AI-powered intelligent coupon matching method based on knowledge graph
By constructing an AI-powered intelligent coupon matching method based on a two-layer knowledge graph, the problem of separating semantic association retrieval from executable rule constraints in existing technologies is solved. This improves the accuracy and efficiency of coupon matching results and ensures the unity of semantic relevance and rule executability.
Patent Information
- Application Number
- CN202611267937.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-20
- Publication Date
- 2026-11-17
AI Technical Summary
Existing intelligent coupon matching technologies cannot effectively unify semantic association retrieval and executable rule constraints, resulting in a lack of a unified, continuous, and verifiable correspondence between candidate coupons and actual conditions for their validity, leading to inaccurate matching results.
An AI-powered intelligent coupon matching method based on knowledge graphs is constructed. This method organizes users, products, categories, merchants, channels, order contexts, and coupons into a semantic relation layer. Coupon rules are converted into constraint hyperedges carrying comparison operators, scope, preconditions, negation conditions, and execution order, forming a two-layer knowledge graph. This enables the mapping between semantic relations and executable constraints. The method utilizes a query anchor set for reverse expansion and forward propagation of states to prune conflict paths and determine a closed evidence chain.
The system enables coupon candidate retrieval and rule validity determination to be completed in the same subgraph, ensuring that semantic relevance and rule enforceability are consistent, preventing coupons that do not meet the rules from being retained, and enabling the tracing of the evidence chain of the matching results, thereby improving the accuracy and efficiency of the matching results.
Smart Images

Figure CN123118170A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of data processing, information retrieval, and knowledge graph reasoning, specifically to an AI-powered intelligent coupon matching method based on knowledge graphs. Background Technology
[0002] Existing intelligent coupon matching technologies typically use user attributes, product category, order amount, merchant identifier, usage channel, and validity period as matching conditions. Coupon rules are broken down into several fields or tags, and candidate coupons are filtered based on field equivalence judgment, interval comparison, and tag intersection when a user submits an order or browses products. Some systems segment and vectorize the coupon description text, calculate the similarity between the user's current order features and the coupon text features, and then output the results in order of similarity. To reduce the computational load of traversing each rule, the system also establishes an index relationship between product category, merchant, user level, and coupon. It first narrows down the candidate range by category or merchant, and then calls the rule module to verify order amount, usage frequency, limited channel, and time conditions. This approach can handle coupons with simple structures and independent conditions, but after the coupon rules are broken down, the original logical subordination, scope of application, and exception relationships between conditions are easily weakened, and the semantic similarity reflected by vector similarity cannot directly indicate whether the coupon rules are met.
[0003] Another approach similar to the aforementioned technology uses knowledge graphs to organize the relationships between users, products, categories, merchants, orders, and coupons. Information such as product category affiliation, applicable merchant for coupons, user eligibility levels, and order origin channels are represented as entities and relational edges. During matching, starting from a user node or product node, coupon nodes are retrieved along relationships such as applicability, affiliation, and association within the graph. The retrieval results are then passed to an independent rule module for conditional judgment. For rules that apply to a higher-level category but exclude some lower-level categories, and where multiple conditions such as the order originating from a specified channel and meeting user eligibility requirements are met according to the bracket hierarchy, conventional knowledge graphs typically only store semantic relationships between entities. They cannot directly express comparison operators, negation conditions, preconditions, the order of condition execution, or complex constraints where a condition simultaneously associates multiple entities. While the rule module can interpret these conditions separately, the graph retrieval process and the rule validation process use different data structures and processing paths. The path formed during the retrieval phase cannot be directly used as the basis for rule validity, and conflicts arising from rule validation cannot restrict the continued expansion of the graph.
[0004] Therefore, the separation of semantic association retrieval for coupons from executable rule constraint verification results in a lack of a unified, continuous, and verifiable correspondence between the graph path of candidate coupons and their actual validity conditions. The fundamental reason is that ordinary relation edges can only represent associations between entities and cannot fully encompass the logical order between scope, comparison relations, prerequisite dependencies, negation exclusions, and composite conditions within the same graph structure. Furthermore, the independent rule module can only evaluate each retrieved candidate item individually and cannot reverse-correct the retrieval path using range conflicts, negation condition hits, or missing prerequisite conditions discovered during the verification process. Consequently, semantically related coupons that do not meet the rules will still enter the candidate set, and irrelevant relation branches will continue to expand. Simultaneously, the matching results cannot form a closed evidence path from user status, product range, order context to coupon rules, making it difficult to confirm whether a matching result is supported by complete conditions. Summary of the Invention
[0005] The purpose of this invention is to provide an AI-powered intelligent coupon matching method based on knowledge graphs, which can solve the problems mentioned in the background art.
[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows: The AI-powered intelligent coupon matching method based on knowledge graphs includes: acquiring user status data, a set of products to be matched, order context data, and coupon rule data; parsing the coupon rule data into semantic entity relationships and executable constraint relationships; and constructing a two-layer knowledge graph containing a semantic relationship layer and an executable constraint layer. Based on the user status data, the set of products to be matched, and the order context data, a query anchor set is generated, and related coupon nodes and constraint nodes are extracted according to the relationship type to form a candidate subgraph; In the candidate subgraph, constraints are expanded in reverse from the coupon node to the query anchor set, and the state is propagated in forward from the query anchor set to the coupon node; Based on the conditional relationships of two-way propagation, identify range conflicts, negative condition hits, and missing preconditions, and prune the corresponding propagation paths; The closed path in the remaining propagation path that connects user status, product range, order context, and coupon rules with consistent constraints is identified as the evidence chain for the coupon matching result.
[0007] Preferably, constructing the two-layer knowledge graph includes: encoding users, products, categories, merchants, channels, order contexts, and coupons into entity nodes with type identifiers, and encoding attribution, applicability, exclusion, dependency, and inheritance relationships into semantic edges; For each coupon rule, condition clauses are executed, the target object is identified, and the logical connection relationship is parsed. Composite conditions involving at least two entity nodes are encoded as constraint hyperedges, and the comparison operator, scope identifier, set of preconditions, set of negation conditions, and execution order are recorded in the constraint hyperedges. Establish a mapping index between the constraint hyperedge and the corresponding semantic edge, and connect the condition branches in the same coupon rule into a constraint expression subgraph according to the conjunction or disjunction relation.
[0008] Preferably, forming the candidate subgraph includes: determining the set of relationship types that can be extended based on the entity type of each anchor point in the query anchor point set, and generating a relationship extension priority sequence based on the relationship type, anchor point coverage, and constraint density in the path; The semantic edges and the constraint superedges mapped to the semantic edges are accessed layer by layer according to the relationship expansion priority sequence, and the path signature from the query anchor to the coupon node is recorded during the access process. When a new access path does not introduce new query anchor points covering relationships, constraints, or coupon nodes, the expansion of the corresponding relationship branch is terminated. Merge duplicate paths with the same path signature that point to the same coupon node to obtain the minimum association subgraph that covers the constraint relationship between the query anchor and the candidate coupon.
[0009] Preferably, performing the constraint reverse expansion and the state forward propagation includes: generating a sequence of conditions to be satisfied by each coupon node according to the execution order of the constraint superedge, and backtracking along the dependency and inheritance relationships to the query anchor set to form a reverse state containing condition identifiers, scopes and logical branch identifiers; The user status value, product ownership scope, and order context value are extracted from the query anchor set and passed to the coupon node along the applicable relationship and ownership relationship to form a positive status containing fact identifier, valid scope, and source path; The reverse state is paired with the forward state according to the correspondence between the condition identifier and the fact identifier, and the scope intersection, precondition integrity and negative condition hit state are jointly determined within the same logical branch.
[0010] Preferably, encoding the composite condition into the constraint superedge includes: establishing a category-level interval for the product range expression in the coupon rule, generating an inheritance segment and an exclusion segment for the condition containing the superior category, the subordinate category and the exception product, and binding the inheritance segment and the exclusion segment to the same scope identifier; Condition atoms are generated for order thresholds, user qualifications, channel restrictions, and time restrictions respectively. Condition atoms that share the same precondition are aggregated into condition clusters. Based on the bracket hierarchy and logical connection order in the coupon rules, parent-child reference relationships are set for each condition cluster, and the exception conditions are pointed to the inherited segment or condition cluster they cover, forming a constraint expression subgraph containing bracket hierarchy, parent-child reference relationships and exclusion scope identifiers.
[0011] Preferably, generating the relationship expansion priority sequence includes: maintaining a relationship status table consisting of valid path records and conflicting path records for each relationship type, matching the current query anchor set with the historical query anchor set according to the entity type combination and the overlapping relationship of the product range, and extracting the path records in the corresponding relationship status table; Based on the anchor point type covered by the valid path record, the conflict category associated with the conflict path record, and the constraint superedges already included in the current candidate path, an extended sorting value for the relation type is generated. During the access process, newly identified range conflicts, negative condition hits, or missing preconditions are written into the corresponding path signature, and the relationship state table and the expansion order of subsequent unaccessed relationship types are updated with the path signature.
[0012] Preferably, the joint determination of the reverse state and the forward state includes: representing each reverse state as a constraint state tuple composed of a condition identifier, a scope interval, a logical branch identifier, and a set of dependent conditions; and representing each forward state as a fact state tuple composed of a fact identifier, a fact value, a valid range, and a source path. Candidate tuple pairs are generated based on the mapping index between the condition identifier and the fact identifier, and the candidate tuple pairs are grouped according to the logical branch identifier; In each group, the intersection of the scope interval and the effective range, the coverage relationship of the dependency condition set, and the existence state of the facts corresponding to the negation condition are calculated in turn. Tuple pairs that do not form a valid intersection, have incomplete dependency coverage, or have the existence of negation facts are marked as conflicting tuple pairs.
[0013] Preferably, determining the evidence chain includes: taking the coupon node as the root node, connecting the unpruned reverse state, its paired forward state, and the corresponding source path into a directed evidence subgraph according to the execution order of the constraint superedge; Perform a full condition coverage check on the conjunction branches in the directed evidence subgraph, retain at least one complete branch that does not contain conflicting tuple pairs for the disjunctive branches, and expand the superior category conditions to the actual product nodes according to the inheritance relationship. Source paths with the same fact state tuples but serving different condition branches are merged into a shared evidence node, while retaining the tuple identifiers of each branch and the constraint superedge identifiers. A directed closed path is formed by traversing from the root node to all necessary query anchors, thus creating an evidence chain for the corresponding coupon node.
[0014] Preferably, path-level write-back of the conflicting tuple pairs includes: locating each conflicting tuple pair to the constraint superedge and corresponding logical branch in the candidate subgraph based on the source path and condition identifier, and generating a conflict marker containing the conflict category, conflict fact source, scope interval and upstream condition identifier; When the scopes corresponding to the conflict markers have no intersection, delete the corresponding fact state tuple; when the negative fact corresponding to the conflict markers exists, terminate the forward state propagation of the logical branch. When the conflict marker corresponds to an incomplete dependency coverage, mark the subsequent reverse state along the entire branch set; Write back the processed scope interval, fact state tuple, and logical branch state to the corresponding constraint superedge and path signature.
[0015] Preferably, updating the relation status table and the evidence chain includes: extracting query anchor type combinations, relation type sequences, constraint superedge sequences and closed path signatures from each evidence chain, and establishing an index relationship between the closed path signature and the valid path records in the relation status table; Extract the conflict category, first conflict location, and corresponding relationship type sequence from the pruned path to establish a conflict path record; When a new coupon matching request is received, the new query anchor set is compared with the query anchor type combination associated with the closed path signature, and the new user status data, the set of products to be matched and the order context data are compared with the data items of the source path record in the evidence chain. Repropagation is performed only on the constraint superedges and source paths associated with the changed data items, and the order of unexpanded relation types and candidate subgraph boundaries are adjusted based on the newly added conflict path records.
[0016] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. Users, products, categories, merchants, channels, order contexts, and coupons are organized into a semantic relation layer. Coupon rules are converted into constraint hyperedges carrying comparison operators, scope, preconditions, negation conditions, and execution order, forming a two-layer knowledge graph where semantic relations and executable constraints are mutually mapped. During the matching process, query anchors are generated based on user state, the set of products to be matched, and order context. Within the associated subgraph, the constraint backward expansion from the coupon node to the query anchor and the forward propagation of state from the query anchor to the coupon node are performed simultaneously. Then, based on the correspondence between conditions and facts, paths with range conflicts, negative condition hits, and missing preconditions are pruned. Thus, coupon candidate retrieval and rule validity judgment are completed in the same subgraph. Only closed paths connecting user state, product range, order context, and coupon rules with consistent constraints are preserved. Semantic relevance and rule executability have a unified data foundation, avoiding the retention of coupons that do not meet the rules based solely on tags or similarity.
[0017] 2. The two-layer knowledge graph also enables composite coupon rules to retain the original hierarchical relationships according to condition atoms, condition clusters, and logical branches, and expresses the applicability of the superior category, the exclusion of the subordinate category, and the restrictions on exceptional products through inheritance segments, exclusion segments, and scope identifiers. Path signatures are generated during relationship expansion, and duplicate paths can be merged based on coupon nodes and path signatures. Newly identified conflicts are written back to the corresponding constraint hyperedges, logical branches, and relationship state records to adjust the expansion order of subsequent relationship types and narrow the boundaries of candidate subgraphs. The fact source path, condition identifier, constraint hyperedge identifier, and logical branch identifier in the evidence chain are preserved, making each matching result traceable to the corresponding user state, product ownership, and order conditions. When the user state, product set, or order context changes, the relevant propagation path can be recalculated based on the data items and constraint relationships recorded in the evidence chain, without having to repeatedly expand all coupon rules and all graph relationships. Attached Figure Description
[0018] Figure 1 This is a flowchart illustrating the overall process of AI-powered intelligent coupon matching based on knowledge graphs. Figure 2 A graph showing the sorting of extended relation values; Figure 3 The intersection matrix diagram of the scope; Figure 4 A graph showing the change in the amount of new data added along the path; Figure 5 For the coverage change curve; Figure 6 A graph showing the change in the overlap of product ranges; Figure 7 This is a graph showing the change in the completeness of evidence. Detailed Implementation
[0019] In one embodiment, please refer to Figure 1 This paper presents an intelligent coupon matching method based on knowledge graphs. The method includes acquiring user state data, a set of products to be matched, order context data, and coupon rule data. The coupon rule data is parsed into semantic entity relationships and executable constraint relationships. A two-layer knowledge graph containing a semantic relationship layer and an executable constraint layer is constructed. A query anchor set is generated based on the user state data, the set of products to be matched, and the order context data. Related coupon nodes and constraint nodes are extracted according to relationship type to form a candidate subgraph. In the candidate subgraph, constraints are executed in reverse from the coupon nodes to the query anchor set, and the execution state is propagated in forward from the query anchor set to the coupon nodes. Based on the condition correspondence of the two-way propagation, range conflicts, negative condition hits, and missing preconditions are identified. Corresponding propagation paths are pruned. The closed paths connecting user state, product range, order context, and coupon rules with consistent constraints in the remaining propagation paths are determined as the evidence chain for the coupon matching result.
[0020] Specifically, user status data consists of user identifier-associated level status, qualification status, historical usage status, available usage times status, and region status. The set of products to be matched consists of product identifier, product category path, merchant identifier, product quantity, and the range of products participating in pricing. Order context data consists of order amount, settlement channel, order time, delivery area, and the combination relationship of products within the order. Coupon rule data maintains the correspondence between rule text, structured fields, rule version, scope of application, and exclusion scope. All data is converted into graph data records with unified entity identifier, data source identifier, and effective scope identifier before entering the two-layer knowledge graph to avoid the same object forming isolated nodes in different data sources.
[0021] The semantic relation layer is used to store the factual relationships between users, products, categories, merchants, channels, order contexts, and coupons that can be traversed by the graph. The executable constraint layer is used to store the conditional relationships transformed from coupon rules. The two layers do not use independent storage logic, but establish a bidirectional mapping through rule identifiers, condition identifiers, entity identifiers, and scope identifiers, so that any applicable relation in the semantic relation layer can be located to the source of the condition in the constraint layer, and any condition in the constraint layer can also be traced back to the fact nodes and relation edges in the semantic relation layer.
[0022] In this embodiment, the coupon rule parsing process first performs sentence segmentation on the rule text, and then identifies the target, comparison object, comparison method, logical connector, negation word, exception word, and condition order in each sentence. The target is used to determine the user, product, category, merchant, channel, order, or time of the condition constraint; the comparison object is used to determine the amount, frequency, level, range, or status; the logical connector is used to determine the conjunction or disjunction relationship between the conditions; the negation word is used to generate exclusion conditions; the exception word is used to attach the exclusion conditions to the corresponding applicable scope; and the condition order is used to form the execution order when the constraint is reverse-expanded.
[0023] The parsed conditions are not directly saved as isolated fields, but are formed into a constraint expression structure according to the semantic dependencies in the original rules. For example, if the rule includes a user level of 3 and an order amount of 300, and the product belongs to the clothing category but excludes footwear, the user level condition, order amount condition, and clothing category range condition are placed in the same conjunctive branch. The footwear exclusion condition points to the clothing category range condition through a scope reference, and the coupon node stores the entry identifier of the conjunctive branch, thereby preserving the subordinate and exclusion relationships between conditions in the compound rule.
[0024] The query anchor set consists of fact nodes that can be directly determined in this matching request. It includes at least the current user node, order node, and actual product node within the order. Category nodes, merchant nodes, and channel nodes can be added according to the rule coverage. When generating query anchors, coupon nodes that are yet to be reasoned are not added to the anchor set. Instead, known fact nodes are used as the starting point for graph expansion. The anchor record stores entity type, entity identifier, fact value, effective range, and source path for subsequent relationship expansion and state propagation.
[0025] To determine the order of relation expansion, relation expansion values are calculated for candidate relation types. The relation expansion values are expressed by the following formula: ; in, Representing relation type Extended value, Representing relation type The number of unconnected query anchors that can be covered. Indicates the relation type The ratio of the number of constraint hyperedges to the number of path edges in the reached path. This indicates the number of conflicting paths corresponding to the current anchor type combination in the relation status table. , and These are the non-negative weights for the coverage term, constraint density term, and conflict term, respectively. These three are only used for sorting within the same relation type set and do not change the rules' own conditions for validity. For example, if a clothing category relation can connect two unconnected product anchors with a constraint density of 0.6 and one historical conflict record, then when taking... , , In the case of obtaining an extended value of 3.6, when the extended value is higher than that of a relation type that only connects one anchor point and has a low constraint density, the clothing category relation is accessed first.
[0026] Please refer to Figure 2 , Figure 2 The horizontal axis represents the types of relationships accessed and the sampling rounds during the expansion of the candidate subgraph, covering relationships such as attribution, applicability, exclusion, dependency, inheritance, channel, and amount; the vertical axis represents the relationship expansion value, which is used to measure the expansion priority of the current relationship type when connecting user, product, order context, and coupon nodes. Figure 2 The solid black line with dots represents the main sequence of relational extended values. The long dashed line represents the mean reference line, the dotted line represents the high-level reference line, and the thin dotted line represents the low-level reference line. Each line type is used to distinguish between the main sequence and the reference threshold and does not participate in the redefinition of the formula itself.
[0027] from Figure 2 As can be seen, the attribution relationship shows a relatively high peak across multiple sampling rounds, indicating that when product nodes are connected to the coupon's applicable scope along the category attribution path, they can cover more unconnected query anchors, making them suitable as a priority access direction for candidate subgraph expansion. The applicable and dependency relationships are lower than the attribution relationship in some sampling rounds due to the number of conflicting paths, indicating that under the same coupon rule, conflicting paths recorded in the relationship status table will lower the ranking value of the corresponding relationship type. However, this decrease only affects the access order and does not change whether the rule conditions themselves are true.
[0028] Figure 2 The low ranking of relationships such as amount and channel in some rounds indicates that these relationships typically depend on the completion of the preceding product range or user fact state before entering the closed evidence chain. The overall trend shows that the relationship expansion value can uniformly map the semantic relationships, constraint hyperedges, and historical conflict states in the two-layer knowledge graph to the candidate path access order, enabling the system to prioritize the expansion of relationship types more likely to form a complete evidence chain, while delaying the processing of high-conflict, low-coverage paths. This provides a stable relationship ranking basis for subsequent forward propagation, reverse expansion, and incremental recalculation.
[0029] Relationship expansion starts from the query anchor set and visits semantic edges layer by layer, while simultaneously reading the constraint hyperedges mapped to the semantic edges. After each visit, the set of covered anchors, the set of reached coupon nodes, and the set of read constraints are updated. If a new path does not add query anchor covering relationships, does not introduce new constraints, and does not reach a new coupon node, the new path is marked as a stalled path and the corresponding relationship branch is terminated to prevent irrelevant entity relationships from continuing to expand within the candidate subgraph.
[0030] In a preferred embodiment, each access path generates a path signature. The path signature is encoded in sequence according to the starting anchor type, relation type sequence, constraint superedge sequence, termination coupon identifier, and logical branch identifier. When there are multiple identical path signatures for the same coupon node, only one path structure is retained and anchors from different sources are registered as shared sources. When different path signatures reach the same coupon node, they are retained separately to prevent the loss of evidence source when the same coupon is established by different rule branches.
[0031] After the candidate subgraph is formed, the constraint superedge associated with each coupon node is read and expanded in the direction of the query anchor point according to the execution order. Each state generated by the reverse expansion contains at least the condition identifier, scope range, logical branch identifier, dependent condition set and upstream constraint identifier. For example, when the amount condition requires the order amount to reach 300, the reverse state records the order amount condition identifier, order scope, conjunctive branch, applicable category conditions and coupon rule entry.
[0032] The forward propagation of state begins with the factual state in the query anchor set. The product node propagates the product range to the category node along the attribution relationship, the user node propagates the level or qualification fact along the qualification relationship, and the order node propagates the amount, channel, and time fact along the context relationship. Each forward state stores the fact identifier, fact value, valid range, source path, and fact version. When it propagates to the constraint superedge, it does not immediately determine that the coupon is valid, but waits to be paired with the reverse state with the same condition object and the corresponding condition identifier.
[0033] To quantify whether a correspondence can be established between scopes, a scope intersection metric is used: ; in, Indicates the reverse state With positive state The scope intersection quantity, This represents a set of entities subject to certain conditions. This represents the set of entity ranges covered by the fact state. The cardinality of the set represents the number of entity identifiers within the range. It is 0 when two ranges have no intersection and 1 when two ranges are completely identical. For example, if the coupon applies to 4 products under the clothing category and there are 2 corresponding products in the current order, the intersection cardinality is 2, the union cardinality is 4, and the scope intersection is 0.5. Subsequently, only the fact pairing of the 2 products in the intersection is retained. If the footwear exclusion range hits 1 of the products, a range conflict is generated on the pairing path corresponding to the product.
[0034] Please refer to Figure 3 , Figure 3 The horizontal axis represents the set of fact states generated from orders, products, channels, and user status, while the vertical axis represents the set of constraint states formed after rule parsing. The numbers in the matrix cells represent the degree of intersection between the scopes of the two sets, ranging from 0 to 1. The grayscale levels on the right indicate the degree of intersection; the darker the color, the higher the overlap between the fact set and the constraint set, while the lighter the color, the fewer or no objects they affect.
[0035] from Figure 3 As can be seen, when the values at the corresponding positions of the channel scope and channel facts, and the user scope and user facts reach 1, it indicates that these conditions belong to single fact object matching, and the fact state and constraint state are completely consistent, allowing direct entry into the subsequent evidence chain judgment. The non-zero intersection value between the clothing scope and the top garment fact, and the order pricing fact, indicates that some items in the current order are retained within the coupon's applicable range. When the constraint states such as footwear exclusion and home furnishing exclusion have non-zero intersection with the corresponding fact set, it means that the matched product path needs to be pruned or marked as conflicting, rather than negating the entire coupon.
[0036] This matrix illustrates the key process of joint scope determination: the system does not roughly determine whether the shopping cart as a whole is usable or unusable, but rather maps the products, categories, exclusion ranges, and amounts to a computable set of scopes, and then determines the retention path, pruning path, and scope conflicts based on intersection and union relationships. The overall trend shows that the scope intersection can accurately describe fine-grained rule behaviors such as retaining apparel products, excluding footwear products, and not including home furnishing products, providing direct scope calculation basis for conditional fact pairing, conflict write-back, and the generation of closed evidence chains.
[0037] When pairing two states, candidate state pairs are first filtered based on the condition object type and condition identifier mapping. Then, they are grouped according to the logical branch identifier. Within the same group, the states of scope intersection, dependency condition coverage, and existence of negative facts are judged. State pairs with no scope intersection are marked as scope conflict. If there is a condition in the dependency condition set that is not covered by the positive fact, it is marked as missing precondition. If the fact corresponding to the negative condition exists in the intersection range, it is marked as negative condition hit.
[0038] In this embodiment, path pruning does not involve directly deleting the entire coupon node. Instead, it locates the conflicting logical branch and scope segment, and only deletes the propagation path affected by the conflict. For example, if the same coupon rule contains two disjunctive branches, one for clothing items and one for home furnishing items, and the footwear item in the order triggers the exclusion condition of the clothing branch, only the path corresponding to the clothing branch is pruned. If the home furnishing branch still has complete factual support, then the matching calculation of the home furnishing branch is retained.
[0039] The determination of the closed path is based on the coupon node as the root. The reverse state, the paired forward state, and the source path are connected according to the execution order of the constraint superedge. The conjunctive branch requires that all necessary conditions in the branch have unconflicted fact states. The disjunctive branch requires that there is at least one complete and unconflicted condition path. The dependent condition requires that its upstream condition path and the current condition path are in the same fact version and compatible scope. After satisfying the above structure, a closed evidence chain from the coupon node to all necessary query anchors is formed.
[0040] In this embodiment, the evidence chain is not a textual description of the matching results, but a directed subgraph composed of coupon nodes, constraint superedges, condition state nodes, fact state nodes, semantic relationship edges, and query anchors. The evidence chain stores the source rules of each condition, the source data of each fact, the pairing relationship between conditions and facts, and conflict pruning records, so that when subsequent state changes occur, the affected propagation path can be located according to the evidence chain.
[0041] In another embodiment, the semantic relationship layer of the two-layer knowledge graph encodes users, products, categories, merchants, channels, order contexts, and coupons as entity nodes with type identifiers, and encodes attribution, applicability, exclusion, dependency, and inheritance relationships as semantic edges. Entity nodes use global entity identifiers to distinguish object types and object instances. Semantic edges store start-point identifiers, end-point identifiers, relationship types, data sources, and valid ranges. The same product node can be connected to its direct category and parent category at the same time, but the hierarchical direction is retained in the inheritance relationship to limit the scope propagation direction.
[0042] The executable constraint layer encodes composite conditions involving at least two entity nodes as constraint hyperedges. Each constraint hyperedge stores at least a comparison operator, a scope identifier, a set of preconditions, a set of negation conditions, and an execution order. The comparison operators include equal to, not equal to, greater than, reach, belong to, contain, and exclude. The scope identifier points to the set of goods, users, or order contexts that the condition actually constrains. The set of preconditions is used to establish condition dependencies. The set of negation conditions is used to attach exclusion facts. The execution order is used to maintain the original judgment order of the rule.
[0043] Conditional clause parsing employs a combination of term type recognition and rule templates. Term type recognition identifies entity names, numerical objects, range objects, logical connectors, and negation expressions. Rule templates convert the recognition results into condition atoms. If the text contains an omitted subject, the target object is inherited from the previous condition of the same rule clause. If expressions such as "except," "not included," or "limited" exist, a negation condition is generated and its scope is limited to the nearest inheritable range condition, preventing the negation condition from being incorrectly extended to the entire coupon rule.
[0044] The constraint expression subgraph is established according to the bracket hierarchy and logical connection relationship. The conjunction relation corresponds to the subconditions that must be true together under the same parent node, and the disjunction relation corresponds to the subconditions that can be true either under the same parent node. When there is a sequential dependency between conditions, they are connected by dependency edges. The dependent condition is the predecessor node and the dependent condition is the successor node. The constraint hyperedge and semantic edge are mapped to each other through the condition object and entity type, so that the rule parsing result can be directly bound to the graph facts.
[0045] To prevent old constraints from still participating in matching after rule text changes, each constraint hyperedge stores the rule version identifier and effective range. When the rule version is updated, a new constraint hyperedge is generated and the effective range of the old hyperedge is terminated. The semantic entity nodes remain unchanged, and only the mapping index and condition structure in the constraint layer are updated. When the candidate subgraph is read, the constraint hyperedge in the corresponding effective range is selected according to the order context time.
[0046] In another embodiment, when forming a candidate subgraph, the set of allowed relationship types for expansion is determined based on the entity type of each anchor in the query anchor. For example, product anchors are allowed to expand along attribution, merchant, and applicable relationships; user anchors are allowed to expand along qualification, level, and usage status relationships; and order anchors are allowed to expand along channel, time, and amount condition mappings. However, expansion directly from product anchors along user qualification relationships is not allowed, thus maintaining consistency between relationship access and entity type.
[0047] During the relationship expansion process, the path signature from the query anchor point to the coupon node is recorded. The path signature does not use a random digest, but instead connects the entity type sequence, relationship type sequence, constraint identifier sequence and logical branch sequence in an ordered manner. This allows paths of the same type to be compared and ensures that different rule branches remain distinguishable even if they pass through the same entity node. The path signature is also associated with the set of covered anchor points and the set of conflict markers, which are used for subsequent merging of duplicate paths and updating of the relationship status table.
[0048] To determine whether a candidate subgraph has reached the minimum association range, the path increment is calculated: ; in, Representing a path The new increment, This indicates the number of newly added query anchors in the path. This indicates the number of newly added constraint superedges in the path. This indicates the number of newly added coupon nodes in the path; all three terms are non-negative integers. Time termination path For example, if a path does not connect to a new product anchor point, does not read new rule conditions, and still points to a visited coupon node, all three conditions are 0, and the path will not be extended. This will happen when a new exclusion constraint superedge is introduced into the path. Even without adding new coupon nodes, it continues to expand to complete constraint verification.
[0049] Please refer to Figure 4 , Figure 4 The horizontal axis represents the access level of the candidate path and its path signature number, while the vertical axis represents the increase in path size, reflecting whether new query anchors, constraint superedges, or coupon nodes are introduced during the current path expansion process. The black dotted solid line represents the main sequence of path size increases at different access levels. The reference line is used to help observe the average level, high range, and low range of the increase in size, and there are clear distinctions between the different line types.
[0050] from Figure 4 As can be seen, the incremental value of the path exhibits discrete fluctuations across different access levels. Some access levels reach higher values, indicating that these paths simultaneously introduce new product anchors, constraint superedges, or coupon nodes, making them valuable for further expansion. Other access levels have incremental values close to or equal to 0, indicating that the path does not bring new facts, rule conditions, or coupon candidates. Continuing to expand would result in duplicate visits, and the corresponding relationship branches should be stopped.
[0051] Figure 4 This reflects the boundary control logic of candidate subgraph expansion. For ordinary repeated paths, the system terminates access when the incremental addition is 0 to avoid unbounded expansion of knowledge graph relationships. For paths with introduced exclusion constraints, range constraints, or key preconditions, even if no new coupon nodes are generated yet, they will continue to be retained due to the added constraint overedge, used for conflict localization and evidence closure. The overall trend shows that the incremental addition of paths is an important indicator for controlling the size of candidate subgraphs, reducing invalid retrieval costs, and the scope of incremental recalculation, enabling the coupon matching process to maintain a balance between graph path integrity and computational efficiency.
[0052] When merging duplicate paths, the path signature and the termination coupon identifier are used as the union key. Paths with the same union key are merged into a single graph structure. Different starting anchors, different fact sources, and different propagation versions are registered in the shared source set. After merging, the mapping between each source and condition state is still retained, avoiding the inability to distinguish which order product or user state supports a certain condition due to graph structure compression.
[0053] In another embodiment, the constraint reverse expansion is performed by reading the sequence of conditions to be satisfied from the coupon node, and the condition with the earlier execution position first generates the reverse state. When there is a preceding dependency, the subsequent conditions remain in a waiting state. The subsequent conditions are released after the preceding condition is covered by a positive fact. Different condition sequences in the disjunctive branch are expanded separately, and the condition sequences in the conjunctive branch share the same branch identifier but maintain independent condition identifiers.
[0054] The forward propagation of status selects the propagation relationship based on the fact type. When the product fact is propagated along the attribution and inheritance relationship, it carries the actual product identifier, so that the superior category fact can still be traced back to the specific product in the order. The user level fact is only propagated along the qualification relationship of the corresponding user node. The order amount fact is only propagated within the scope of the current order. The channel and time facts are propagated with the order context but are not reused across orders, preventing facts from being linked between incompatible object scopes.
[0055] After the reverse state is paired with the forward state, a conditional fact pair is formed. The conditional fact pair stores a constraint state tuple and a fact state tuple. The constraint state tuple consists of a condition identifier, a scope interval, a logical branch identifier, and a set of dependent conditions. The fact state tuple consists of a fact identifier, a fact value, a valid range, and a source path. All fields in the conditional fact pair are mapped using a unified identifier, and the correspondence is not determined by natural language similarity.
[0056] For comparable facts such as amount, frequency, and level, the comparison result is calculated according to the comparison operator in the constraint superedge. For example, when the condition operator is "met" and the condition value is 300, the order amount fact value is greater than or equal to 300 and is recorded as satisfied, and less than 300 and is recorded as conflict. When the condition operator is "not equal", conflicts are only generated on the path where the fact value and the condition value are the same. When the condition operator is "belongs", the judgment is based on whether the entity identifier is within the scope interval, and different types of comparison results are not mixed into the same judgment field.
[0057] In a preferred embodiment, dependency condition coverage is expressed as follows: ; in, Indicates condition Dependency coverage Indicates condition The number of dependencies This indicates whether the j-th dependency condition has a non-conflicting fact path; it is set to 1 if it exists and 0 if it does not. When dependency coverage is defined as 1, for example, if a coupon condition depends on two preconditions: user level and specified channel, and the user level has a fact path but the specified channel does not exist, then... If the corresponding condition remains in a state of missing prerequisites, it will not enter a closed chain of evidence.
[0058] Please refer to Figure 5 , Figure 5 The horizontal axis represents different condition clusters and their sampling periods, including combinations of conditions such as grade-based, channel-based, amount-based, range-based, time-based, and frequency-based conditions. The vertical axis represents dependency coverage, ranging from 0 to 1, used to describe whether the prerequisite facts for a certain condition have been met before it enters the closed chain of evidence. The black dotted solid line represents the main sequence of dependency coverage, while other reference lines are used to assist in identifying full coverage, partial coverage, and low coverage intervals.
[0059] from Figure 5 As can be seen, the dependency coverage of some level, amount, and channel conditions reaches 1, indicating that the corresponding prerequisite fact paths all exist and there are no conflicts. Such conditions can be included in the calculation of subsequent logical branches. Some range, time, or frequency-related conditions are at a low to medium level, indicating that at least one dependent fact is missing or the corresponding path has been pruned due to conflict. Therefore, these conditions will not be included in the closed evidence chain for the time being, but will be retained as prerequisite missing conditions, waiting for the facts to be updated or the rule version to change before recalculation.
[0060] Figure 5 This section explains the execution order of multi-condition dependencies in coupon rules. The system doesn't simply evaluate each text condition one by one; instead, it first breaks down the condition into a set of executable pre-dependencies, then checks if each dependency has a conflict-free fact path. Subsequent amount, scope, or user eligibility conditions only have computational meaning when dependency coverage reaches its maximum; when coverage is insufficient, even if other local conditions are met, a complete chain of evidence will not be formed. The overall trend indicates that dependency coverage prevents missing facts from being misjudged as rule failures and provides traceable status indicators for issues such as missing pre-conditions, channel mismatches, and insufficient user eligibility.
[0061] The negation condition judgment is bounded by the fact type and scope to which the negation condition points. If the negation condition excludes footwear, only the intersection of the current applicable product scope and the footwear scope is checked. The entire coupon is not directly negated because there are footwear products in the order that are not included in the coupon pricing. If the exclusion scope hits some of the products that are included in the pricing, only the hit part is deleted from the candidate product scope and the set of products on which the relevant amount condition depends is recalculated.
[0062] In another embodiment, when encoding composite conditions, a category-level interval is established for the expression of the product range. The category-level interval is represented by the starting category node, the inheritable depth, and the set of stopping inheritance nodes. The superior category condition is expanded downwards along the inheritance relationship to the inheritable depth. When the stopping inheritance node is encountered, the corresponding branch is terminated. Exception products are bound to the same scope identifier through the exclusion segment, so that the applicable scope and the exclusion scope are calculated in the same condition structure.
[0063] Order threshold, user qualification, channel restriction, and time restriction are generated as condition atoms. Each condition atom contains a condition object, comparison operator, condition value, scope, and source clause. Condition atoms that share the same precondition are aggregated into a condition cluster. For example, when the channel condition and the amount condition in "Member Level 3 uses a specified channel and the order amount reaches 300" both depend on the user level condition, they are placed in the same condition cluster and reference the user level precondition node.
[0064] The bracket hierarchy is determined by explicit brackets, connector priorities, and semantic pauses in the rule text. Explicit brackets take precedence over connector priorities. Conjunctions within the same level take precedence over disjunctions. Exception conditions do not create independent root branches but instead point to the nearest applicable node or condition cluster. Parent-child reference relationships are stored in the constraint expression subgraph, enabling reverse expansion to restore the original rule's condition combination structure.
[0065] When a coupon rule does not use explicit parentheses but contains consecutive "and" or "but not including" connective expressions, the parsing process builds a temporary expression tree according to the logical type of the connective words. Then, the tree structure is checked for consistency between the condition object and the scope. If the object of the exception condition is inconsistent with the nearest scope condition, the search continues upwards for a scope node with the same object type. If no such node is found, the rule is marked as pending verification and no matching result is formed directly.
[0066] In another embodiment, a relation state table is maintained for each relation type. The relation state table includes valid path records and conflict path records. Valid path records store query anchor type combinations, product range characteristics, relation type sequences, constraint superedge sequences, and closed path signatures. Conflict path records store conflict categories, first conflict locations, relation type sequences, scope characteristics, and corresponding logical branches.
[0067] When a new matching request is received, the current query anchor set is matched with the historical query anchor set according to the combination of entity type and the overlap of product range. Historical records with the same entity type combination and overlapping product range are selected as candidate relationship records. If the user type combination is the same but the product range does not overlap at all, the corresponding product path is not reused, and only the relationship status record related to user qualification and order channel is retained.
[0068] The overlap in the product range is expressed by the following formula: ; in, Indicates the current product range With historical product range The overlap is calculated by taking the smaller of the two range bases in the denominator. The value is 1 when the smaller range is completely contained within the larger range, and 0 when there is no intersection. For example, if the current order contains 3 clothing items and the historical records contain 2 clothing items that are both included in the current order, the overlap is 1. The historical relationship type sequence can be used as an extended sorting basis, but the historical fact value is not directly used as the current fact.
[0069] Please refer to Figure 6 , Figure 6 The horizontal axis represents the combination of the current product range with different historical product range records in the relationship status table, and the vertical axis represents the overlap of product ranges, with values ranging from 0 to 1. The black dotted solid line represents the degree of overlap between each historical record and the current product range. The reference line is used to distinguish between high similarity, medium similarity, and low similarity records, helping to determine which historical relationship type sequences can be used for the current candidate path expansion sorting.
[0070] from Figure 6 As can be seen, some historical records have an overlap of 1 or close to 1, indicating that the product set corresponding to that historical record is completely covered by the product range of the current order, or that there is a highly consistent category range relationship between the two. The sequence of related relationship types can be used as a reference for the current graph path access order. Some historical records have an overlap close to 0, indicating that their product range differs significantly from the current order range. These can only be retained as audit records and should not directly affect the current matching result.
[0071] Figure 6 This reflects the reference role of the relationship state table in incremental recalculation. The product range overlap does not directly copy historical fact values to the current order, nor does it replace the re-verification of current user, channel, amount, and product facts; it is only used to determine which historical closed paths or conflicting paths have a high similarity to the current product range, improving the stability of candidate subgraph expansion ranking. Overall trends indicate that this indicator can quickly identify reusable relationship access experiences when rule versions change, items are added or removed from the shopping cart, or the product category range is adjusted, while avoiding irrelevant historical records interfering with the current coupon matching judgment.
[0072] The relationship expansion ranking value is calculated by the anchor point coverage of the effective path, constraint density, product range overlap, and conflict records. The ranking value only determines the order of access and does not replace the actual judgment of range conflict, preconditions, and negative conditions. When a new conflict is found during the access process, the conflict type, occurrence location, and path signature are written into the relationship status table, and the ranking of unvisited relationship types is adjusted so that conflicting relationships associated with the same anchor point combination and similar scopes are accessed later.
[0073] In a preferred embodiment, the relation status table is stored in isolation according to the rule version. When the rule version changes, the valid path record of the old version is only used to determine the potentially related relation types and is not used to reuse the constraint superedge sequence. The new version establishes a new valid path record after completing at least one closed evidence chain generation, so as to prevent the condition order or exclusion range in the old rule from being directly carried into the new rule.
[0074] In another embodiment, the joint decision process converts each reverse state into a constraint state tuple and each forward state into a fact state tuple. Candidate tuple pairs are generated based on the mapping index between the condition identifier and the fact identifier. The candidate tuple pairs are first grouped by logical branch and then divided by scope identifier to avoid the cross-combination of facts from different branches or different product ranges of the same coupon.
[0075] In each group, the scope intersection, dependency coverage, and negation fact existence status are calculated sequentially. If the scope intersection is empty, the candidate tuple pair is marked as a scope conflict. If the dependency coverage is less than 1, it is marked as a missing precondition. If the negation fact exists in the scope intersection, it is marked as a negation condition hit. Tuple pairs that do not exhibit the above status and whose comparison operators are valid are registered as usable tuple pairs.
[0076] When multiple fact state tuples exist for the same condition, candidate tuple pairs are retained according to the fact source path. For example, if two items in an order belong to the clothing category, the two item facts are paired with the clothing range condition. If one of the items belongs to the excluded footwear category, only the corresponding item tuple pair is marked as a negative condition hit, and the other item tuple pair can still participate in the subsequent aggregation of amount and item range.
[0077] In another embodiment, when determining the evidence chain, the coupon node is used as the root node. The reverse state that has not been pruned, the paired forward state and the corresponding source path are connected into a directed evidence subgraph according to the execution order of the constraint superedge. The connecting edge records the condition identifier, fact identifier, logical branch identifier and scope identifier. When the same fact state serves different condition branches, multiple condition references can be established, but the fact node itself is only retained once.
[0078] The completeness of evidence is expressed by the following formula: ; in, Representing logical branches Completeness of evidence This indicates the number of conditions that must be satisfied within a branch. This represents the number of necessary conditions for connecting non-conflicting factual states; for conjunctive branches, it only applies to... When the condition is retained, for the disjunctive structure, the completeness of evidence for each sub-branch is calculated separately and at least one sub-branch with a value of 1 is retained. For example, when the conjunctive branch contains three conditions: grade, amount, and channel, and only grade and amount have a factual path, the completeness of evidence is 2 / 3, and the branch does not form a closed chain of evidence.
[0079] Please refer to Figure 7 , Figure 7 The horizontal axis represents different logical branches or matching tracking numbers, and the vertical axis represents the completeness of evidence, ranging from 0 to 1. It is used to describe whether all the conditions that must be met within a logical branch have been connected to a state of unconflicting facts. The black solid line with dots represents the main sequence of completeness of evidence, and the reference line is used to help observe the differences between closed branches, partially closed branches, and branches with low completeness.
[0080] from Figure 7 As can be seen, branches with an evidence completeness of 1 indicate that all necessary conditions, such as user level, channel, product range, and amount, have been established without conflicting factual paths. Such branches can form a closed chain of evidence and proceed to the final coupon availability assessment. Branches with an evidence completeness of less than 1 indicate that at least one necessary condition is not covered by valid facts. Possible reasons include no overlap in product ranges, the exclusion condition being met, missing preconditions, or insufficient amount aggregation results. Therefore, such branches will be pruned or remain in an open state.
[0081] Figure 7 The final evidence convergence process for coupon matching results is demonstrated. For conjunctive structures, the system requires all necessary conditions to be met, and only retains coupons when the evidence completeness reaches 1. For disjunctive structures, the system calculates the completeness of each sub-branch separately and retains at least one complete sub-branch. The overall trend shows that evidence completeness can unify the results of bidirectional propagation, range joint determination, and conflict write-back into an interpretable closed-path index, enabling the final output of usable coupons to not only have monetary results but also trace back to specific factual sources, conditional states, pruning reasons, and logical branches.
[0082] The category inheritance conditions are expanded to the actual product node in the evidence subgraph. The superior category node is retained as an intermediate semantic node, and the actual product node is connected to the category conditions as a necessary query anchor point. If there is an exclusion section, the inheritance path corresponding to the excluded product terminates at the exclusion node and does not enter the closed path. The non-excluded products continue to be connected to their monetary contribution and product range facts.
[0083] Source paths with the same fact state tuples but serving different conditional branches are merged into shared evidence nodes. During merging, all conditional branch identifiers and constraint superedge identifiers are saved. When a certain logical branch fails, only the corresponding condition reference is deleted, and the shared fact nodes that are still referenced by other branches are not deleted, thus avoiding the expansion of the evidence subgraph caused by duplicate fact structures.
[0084] The evidence chain generation adopts a directed traversal from the coupon root node to the query anchor point. During the traversal, it checks whether each required condition has a reachable fact node, whether the dependent condition is located before the current condition and has a compatible scope, whether the conjunctive branch is fully covered and whether the disjunctive branch has at least one complete one. After all checks are passed, the corresponding directed closed path is saved as the evidence chain associated with the matching result.
[0085] In another embodiment, when performing path-level writeback on conflict tuple pairs, the conflict is located to the constraint superedge and logical branch in the candidate subgraph based on the source path in the fact state tuple and the condition identifier in the constraint state tuple. The conflict marker includes at least the conflict category, conflict fact source, scope interval, upstream condition identifier, and first conflict relationship edge.
[0086] When the conflict category is no intersection of scopes, delete the pairing relationship between the corresponding fact state tuple and the current constraint state tuple, but retain the fact state tuple for use by other conditions. When the conflict category is the denial of fact existence, terminate the forward state propagation of the corresponding logical branch in the hit scope. When the conflict category is incomplete dependency coverage, mark the subsequent reverse state as a waiting or missing state along the dependency condition set, and stop it from entering the evidence subgraph.
[0087] After conflict resolution, the scope interval, fact state tuple, and logical branch state are written back to the corresponding constraint superedge and path signature. The set of conflict markers in the path signature is updated accordingly. When the same conflict path is accessed again, expansion can be stopped directly after reaching the first conflict position. However, when the rule version, product range, or fact version changes, the joint decision is re-executed. The corresponding relationship type is not permanently masked.
[0088] In another embodiment, when updating the relation state table and evidence chain, the query anchor type combination, relation type sequence, constraint superedge sequence and closed path signature are extracted from each evidence chain, and an index relationship between the closed path signature and the valid path record in the relation state table is established. The conflict category, first conflict position and corresponding relation type sequence are extracted from the pruned path and a conflict path record is established.
[0089] When a new coupon matching request is received, the new query anchor set is compared with the query anchor type combination associated with the closed path signature. The new user status data, the set of products to be matched, and the order context data are then compared with the data items in the evidence chain source path. The data items include fact values, scope, source identifiers, and version identifiers. Only the data items that have changed are marked as change sources.
[0090] The source of change propagates to the coupon node along the fact reference edge and condition dependency edge in the evidence chain. The constraint superedge, logical branch and source path that are propagated to form the recalculation subgraph. Evidence nodes outside the recalculation subgraph and with the same version are retained. Inside the recalculation subgraph, the old condition fact pairing is deleted and forward propagation, reverse expansion and joint judgment are re-executed to avoid repeated expansion of all coupon nodes and all relation paths.
[0091] In a preferred embodiment, if only one product is added to the order, the newly added product node and its category path are added to the query anchor set. The system expands from the related relationships of the newly added product and checks whether the amount condition and product range condition in the original evidence chain refer to the order product aggregation result. Only the constraint superedges that refer to the aggregation result are entered into the recalculation subgraph. If the user level, channel and time facts have not changed, the original fact state node continues to be reused.
[0092] If a user's level changes, the change propagates from the user node along the qualification relationship to the constraint hyperedges that depend on the user's level. The product ownership path and order conditions that do not depend on the user's level remain unchanged. If the rule version changes, the difference between the old and new constraint hyperedges is located based on the rule identifier. New conditions are expanded in reverse, deleted conditions are deactivated, and changes in scope trigger the recalculation of the relevant product paths.
[0093] The relationship status table is updated synchronously after each recalculation. New closed evidence chains are added to form new valid path records, and new conflicts are added to form new conflict path records. Records that have become invalid due to rule version retain the version termination mark. Subsequent sorting only reads records that are the same as the current rule version or are allowed to be used as relationship references, and does not directly incorporate the factual status of terminated versions into the current matching result.
[0094] In this embodiment, the two-layer knowledge graph, candidate subgraph, bidirectional propagation, conflict write-back, evidence chain, and incremental recalculation share unified entity identifiers, condition identifiers, scope identifiers, logical branch identifiers, and version identifiers. Data generated in any processing stage can be directly referenced by subsequent stages without the need for re-mapping text between graph retrieval results and rule verification results. The entire matching process is completed with traceable graph paths and constraint states.
[0095] In one specific application, the coupon rules stipulate that the user level must be 3 or higher, the order must come from a designated channel, the participating products must be clothing (excluding footwear), and the participating amount must be 300. After the rules are parsed, user level conditions, channel conditions, clothing range conditions, footwear exclusion conditions, and amount conditions are generated. The user level conditions and channel conditions form a set of prerequisite conditions, the clothing range conditions and footwear exclusion conditions share a scope identifier, and the amount condition references the set of products participating in the pricing after exclusion.
[0096] When an order contains one top, one pair of shoes, and one home furnishing item, the product node propagates along the category relationship to the apparel, footwear, and home furnishing nodes respectively. The top enters the apparel scope, the shoes enter both the apparel inheritance scope and the footwear exclusion scope, and the home furnishing item does not enter the apparel scope. The scope joint judgment deletes the conditional fact pair corresponding to the shoes and retains the pair corresponding to the top. The amount condition only summarizes the pricing amount of the top within the current coupon scope.
[0097] User level facts and channel facts are paired with their corresponding reverse states. If the user level reaches 3 and the channel matches, the precondition coverage is 1. When the amount fact reaches 300, the clothing range, level, channel and amount conditions constitute a complete evidence path of conjunction branch. Footwear exclusion facts are attached to the pruned path as conflict records and do not enter the closed evidence chain. Home furnishing products do not participate in coupon judgment because their scopes do not overlap.
[0098] When an order removes tops but retains shoes and home goods, the source of change only involves the top product node and its monetary contribution path. The recalculated subgraph includes clothing scope conditions, footwear exclusion conditions, and monetary conditions. User level and channel fact nodes are retained. After recalculation, there are no actual products within the applicable scope of clothing that have not been excluded. The evidence completeness cannot reach 1, and the corresponding closed evidence chain is removed.
[0099] When the rule is modified to allow footwear but exclude home furnishings, a new version of the range constraint hyperedge and exclusion constraint hyperedge is generated, and the old version of the constraint hyperedge is terminated. The new version of the candidate subgraph can still refer to the historical relationship status table to determine the access order of product ownership and coupon applicability, but the range joint determination is executed according to the new version scope. Footwear products can form fact pairings, and home furnishing products can form exclusion conflicts.
[0100] Through the above data structure and processing, the coupon matching result is jointly limited by semantic facts, executable constraints, bidirectional states and closed evidence paths in the two-layer knowledge graph. Range conflicts, negative condition hits and missing preconditions generated during the matching process are all located to specific conditions, fact sources and logical branches. Candidate graph expansion, rule verification and subsequent recalculation are continuously executed within the same graph identification system.
Claims
1. A knowledge graph-based AI-powered intelligent coupon matching method, characterized in that, include: Acquire user status data, a set of products to be matched, order context data, and coupon rule data. Parse the coupon rule data into semantic entity relationships and executable constraint relationships, and construct a two-layer knowledge graph containing a semantic relationship layer and an executable constraint layer. Based on the user status data, the set of products to be matched, and the order context data, a query anchor set is generated, and related coupon nodes and constraint nodes are extracted according to the relationship type to form a candidate subgraph; In the candidate subgraph, constraints are expanded in reverse from the coupon node to the query anchor set, and the state is propagated in forward from the query anchor set to the coupon node; Based on the conditional relationships of two-way propagation, identify range conflicts, negative condition hits, and missing preconditions, and prune the corresponding propagation paths; The closed path in the remaining propagation path that connects user status, product range, order context, and coupon rules with consistent constraints is identified as the evidence chain for the coupon matching result.
2. The AI-powered intelligent coupon matching method based on knowledge graphs according to claim 1, characterized in that, Constructing the two-layer knowledge graph includes: encoding users, products, categories, merchants, channels, order contexts, and coupons as entity nodes with type identifiers, and encoding attribution, applicability, exclusion, dependency, and inheritance relationships as semantic edges; For each coupon rule, condition clauses are executed, the target object is identified, and the logical connection relationship is parsed. Composite conditions involving at least two entity nodes are encoded as constraint hyperedges, and the comparison operator, scope identifier, set of preconditions, set of negation conditions, and execution order are recorded in the constraint hyperedges. Establish a mapping index between the constraint hyperedge and the corresponding semantic edge, and connect the condition branches in the same coupon rule into a constraint expression subgraph according to the conjunction or disjunction relation.
3. The AI-powered intelligent coupon matching method based on knowledge graphs according to claim 1, characterized in that, Forming the candidate subgraph includes: determining the set of allowed relationship types to be expanded based on the entity type of each anchor point in the query anchor set, and generating a relationship expansion priority sequence based on the relationship type, anchor coverage, and constraint density in the path; The semantic edges and the constraint superedges mapped to the semantic edges are accessed layer by layer according to the relationship expansion priority sequence, and the path signature from the query anchor to the coupon node is recorded during the access process. When a new access path does not introduce new query anchor points covering relationships, constraints, or coupon nodes, the expansion of the corresponding relationship branch is terminated. Merge duplicate paths with the same path signature that point to the same coupon node to obtain the minimum association subgraph that covers the constraint relationship between the query anchor and the candidate coupon.
4. The AI-powered intelligent coupon matching method based on knowledge graphs according to claim 1, characterized in that, The execution of the constraint reverse expansion and the state forward propagation includes: generating a sequence of conditions to be satisfied by each coupon node according to the execution order of the constraint superedge, and backtracking along the dependency and inheritance relationships to the query anchor set to form a reverse state containing condition identifiers, scopes and logical branch identifiers; The user status value, product ownership scope, and order context value are extracted from the query anchor set and passed to the coupon node along the applicable relationship and ownership relationship to form a positive status containing fact identifier, valid scope, and source path; The reverse state is paired with the forward state according to the correspondence between the condition identifier and the fact identifier, and the scope intersection, precondition integrity and negative condition hit state are jointly determined within the same logical branch.
5. The AI-powered intelligent coupon matching method based on knowledge graphs according to claim 2, characterized in that, Encoding the composite condition as the constraint superedge includes: establishing a category-level interval for the product range expression in the coupon rule, generating an inheritance segment and an exclusion segment for the condition containing the superior category, the inferior category and the exception product, and binding the inheritance segment and the exclusion segment to the same scope identifier; Condition atoms are generated for order thresholds, user qualifications, channel restrictions, and time restrictions respectively. Condition atoms that share the same precondition are aggregated into condition clusters. Based on the bracket hierarchy and logical connection order in the coupon rules, parent-child reference relationships are set for each condition cluster, and the exception conditions are pointed to the inherited segment or condition cluster they cover, forming a constraint expression subgraph containing bracket hierarchy, parent-child reference relationships and exclusion scope identifiers.
6. The AI-powered intelligent coupon matching method based on knowledge graphs according to claim 3, characterized in that, Generating the relationship expansion priority sequence includes: maintaining a relationship status table consisting of valid path records and conflicting path records for each relationship type; matching the current query anchor set with the historical query anchor set according to the entity type combination and the overlap of product range; and extracting the path records from the corresponding relationship status table. Based on the anchor point type covered by the valid path record, the conflict category associated with the conflict path record, and the constraint superedges already included in the current candidate path, an extended sorting value for the relation type is generated. During the access process, newly identified range conflicts, negative condition hits, or missing preconditions are written into the corresponding path signature, and the relationship state table and the expansion order of subsequent unaccessed relationship types are updated with the path signature.
7. The AI-powered intelligent coupon matching method based on knowledge graphs according to claim 4, characterized in that, The joint determination of the reverse state and the forward state includes: representing each reverse state as a constraint state tuple consisting of a condition identifier, a scope interval, a logical branch identifier, and a set of dependent conditions; and representing each forward state as a fact state tuple consisting of a fact identifier, a fact value, a valid range, and a source path. Candidate tuple pairs are generated based on the mapping index between the condition identifier and the fact identifier, and the candidate tuple pairs are grouped according to the logical branch identifier; In each group, the intersection of the scope interval and the effective range, the coverage relationship of the dependency condition set, and the existence state of the facts corresponding to the negation condition are calculated in turn. Tuple pairs that do not form a valid intersection, have incomplete dependency coverage, or have the existence of negation facts are marked as conflicting tuple pairs.
8. The AI-powered intelligent coupon matching method based on knowledge graphs according to claim 7, characterized in that, Determining the evidence chain includes: taking the coupon node as the root node, connecting the unpruned reverse state, its paired forward state, and the corresponding source path into a directed evidence subgraph according to the execution order of the constraint hyperedge; Perform a full condition coverage check on the conjunction branches in the directed evidence subgraph, retain at least one complete branch that does not contain conflicting tuple pairs for the disjunctive branches, and expand the superior category conditions to the actual product nodes according to the inheritance relationship. Source paths with the same fact state tuples but serving different condition branches are merged into a shared evidence node, while retaining the tuple identifiers of each branch and the constraint superedge identifiers. A directed closed path is formed by traversing from the root node to all necessary query anchors, thus creating an evidence chain for the corresponding coupon node.
9. The AI-powered intelligent coupon matching method based on knowledge graphs according to claim 8, characterized in that, The path-level write-back of the conflict tuple pairs includes: based on the source path and condition identifier, locating each conflict tuple pair to the constraint superedge and corresponding logical branch in the candidate subgraph, and generating a conflict marker containing the conflict category, conflict fact source, scope interval and upstream condition identifier; When the scopes corresponding to the conflict markers have no intersection, delete the corresponding fact state tuple; when the negative fact corresponding to the conflict markers exists, terminate the forward state propagation of the logical branch. When the conflict marker corresponds to an incomplete dependency coverage, mark the subsequent reverse state along the entire branch set; Write back the processed scope interval, fact state tuple, and logical branch state to the corresponding constraint superedge and path signature.
10. The AI-powered intelligent coupon matching method based on knowledge graphs according to claim 1, characterized in that, Updating the relation status table and the evidence chain includes: extracting query anchor type combinations, relation type sequences, constraint hyperedge sequences and closed path signatures from each evidence chain, and establishing an index relationship between the closed path signature and the valid path records in the relation status table; Extract the conflict category, first conflict location, and corresponding relationship type sequence from the pruned path to establish a conflict path record; When a new coupon matching request is received, the new query anchor set is compared with the query anchor type combination associated with the closed path signature, and the new user status data, the set of products to be matched and the order context data are compared with the data items of the source path record in the evidence chain. Repropagation is performed only on the constraint superedges and source paths associated with the changed data items, and the order of unexpanded relation types and candidate subgraph boundaries are adjusted based on the newly added conflict path records.
