A medicine purchasing and selling reconciliation method and system based on identification matching and comparison

CN121860773BActive Publication Date: 2026-10-27RONGDU SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610076330.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-21
Publication Date
2026-10-27
Estimated Expiration
2046-01-21

AI Technical Summary

Technical Problem

这些方法虽能处理简单的单据匹配,但存在明显局限:其一,它们通常只能进行静态的、事后的数据核对,无法在结算执行前,对业务链条中复杂的时序依赖关系和合规性要求进行动态追溯与推演,因而缺乏事前的风险预判能力;其二,这些方法多依赖孤立的、当前时刻的快照数据进行判断,既难以系统性地追溯并整合分散在历史多环节中的完整合规证据,也难以量化评估本次结算对未来业务状态产生的潜在影响,导致决策依据单一、可信度不足

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121860773B_ABST
    Figure CN121860773B_ABST
Patent Text Reader

Abstract

The application discloses a medicine purchasing and selling reconciliation method and system based on identification matching and comparison, and belongs to the technical field of computers. By constructing a time knowledge graph and combining a bidirectional graph reasoning mechanism, historical evidence chains in medicine purchasing and selling business and future business influence can be dynamically integrated, so that comprehensive pre-risk prediction capability is provided before settlement execution. The quantitative settlement credibility score integrates multi-dimensional information, effectively improving the reliability and objectivity of the decision basis. Therefore, the application overcomes the limitations of traditional reconciliation methods in time sequence tracing, risk prediction and decision credibility, realizes the intelligentization and automation of the medicine purchasing and selling reconciliation process, and improves the efficiency and risk control level of the supply chain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method and system for pharmaceutical procurement and sales reconciliation based on identifier matching and comparison. Background Technology

[0002] In the pharmaceutical procurement and sales sector, automated reconciliation is a key element in improving supply chain efficiency and risk control.

[0003] Currently, the industry commonly uses logical comparison based on fixed rules or traditional database association query technology to achieve reconciliation. While these methods can handle simple document matching, they have significant limitations: First, they can usually only perform static, post-event data verification, and cannot dynamically trace and deduce the complex temporal dependencies and compliance requirements in the business chain before settlement is executed, thus lacking the ability to predict risks in advance; Second, these methods mostly rely on isolated, current snapshot data for judgment, making it difficult to systematically trace and integrate complete compliance evidence scattered across multiple historical stages, and also difficult to quantify and assess the potential impact of this settlement on future business status, resulting in a single and unreliable basis for decision-making.

[0004] Therefore, how to build an intelligent reconciliation method that can deeply integrate business time-series logic, support pre-event causal tracing and impact inference, and provide quantitative and reliable decision-making basis has become a technical problem that urgently needs to be solved in the industry. Summary of the Invention

[0005] This application provides a pharmaceutical procurement and sales reconciliation method and system based on identifier matching and comparison, the technical solution of which is as follows: A pharmaceutical procurement and sales reconciliation method based on identifier matching and comparison is provided, the method comprising: In response to settlement trigger events in the pharmaceutical supply chain, an associated set of identifiers is obtained, including logistics, document, and fund transfer identifiers. Based on the set of identifiers, the corresponding entity nodes are located and activated in a pre-constructed temporal knowledge graph. The effective lifespan of the relational edges in the temporal knowledge graph is defined by the effective timestamp and the expiration timestamp, and the effective lifespan of the relational edges constitutes a temporal dependency path. Using the activated entity node as the anchor point, bidirectional graph reasoning is performed in the temporal knowledge graph along the temporal dependency path to generate a historical basis subgraph and a future impact subgraph. The historical basis subgraph is generated by backtracking and is used to verify settlement compliance. The future impact subgraph is generated by extrapolating to the future and is used to describe the scope of the settlement effect. The historical basis subgraph and the future impact subgraph are input into the compliance measurement engine linked with the temporal knowledge graph to obtain a quantitative settlement credibility score. The compliance measurement engine calculates the score by integrating the comparison results of the future impact subgraph and the historical compliance settlement template, as well as the historical evidence features represented by the historical basis subgraph. Based on the settlement credibility score, perform the processing operation corresponding to the settlement credibility score. Attached Figure Description

[0006] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0007] Figure 1 This is a flowchart of a pharmaceutical procurement and sales reconciliation method based on identifier matching and comparison provided in an embodiment of this application; Figure 2 This is a flowchart of another pharmaceutical procurement and sales reconciliation method based on identifier matching and comparison provided in the embodiments of this application; Figure 3 This is a flowchart of another pharmaceutical procurement and sales reconciliation method based on identifier matching and comparison provided in the embodiments of this application; Figure 4 This is a flowchart of another pharmaceutical procurement and sales reconciliation method based on identifier matching and comparison provided in the embodiments of this application; Figure 5 This is a flowchart of another pharmaceutical procurement and sales reconciliation method based on identifier matching and comparison provided in the embodiments of this application; Figure 6 This is a schematic diagram of the structure of a pharmaceutical procurement and sales reconciliation system based on identifier matching and comparison provided in an embodiment of this application. Detailed Implementation

[0008] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0009] In this application, the terms "first," "second," etc., are used to distinguish identical or similar items with essentially the same function. It should be understood that there is no logical or temporal dependency between "first," "second," and "nth," nor are there any restrictions on quantity or execution order.

[0010] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, data stored, data displayed, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0011] Traditional pharmaceutical procurement and sales reconciliation methods generally employ logical comparisons based on fixed rules or traditional database association query techniques. These methods typically only allow for static, post-event data verification, failing to dynamically trace and extrapolate the complex temporal dependencies and compliance requirements within the business chain before settlement execution, thus lacking the ability to predict risks in advance. Furthermore, these methods often rely on isolated, current-moment snapshot data for judgment, making it difficult to systematically trace and integrate complete compliance evidence scattered across multiple historical stages, and also making it difficult to quantify and assess the potential impact of this settlement on future business conditions, resulting in a single and unreliable basis for decision-making.

[0012] In response, this application proposes a pharmaceutical procurement and sales reconciliation method based on identifier matching and comparison, see [link to relevant documentation]. Figure 1 Taking the server as the executing entity as an example, the steps include the following: 101. In response to a settlement trigger event in the pharmaceutical supply chain, obtain the associated set of identifiers, which includes logistics, document, and fund transfer identifiers.

[0013] 102. Based on the set of identifiers, locate and activate the corresponding entity nodes in the pre-constructed temporal knowledge graph. The effective lifespan of the relation edges in the temporal knowledge graph is defined by the effective timestamp and the ineffective timestamp. The effective lifespan of the relation edges constitutes the temporal dependency path.

[0014] 103. Using the activated entity node as the anchor point, perform bidirectional graph reasoning in the temporal knowledge graph along the temporal dependency path to generate a historical basis subgraph and a future impact subgraph. The historical basis subgraph is generated by backtracking and is used to verify settlement compliance. The future impact subgraph is generated by extrapolating to the future and is used to describe the scope of the settlement effect.

[0015] 104. Input the historical basis subgraph and the future impact subgraph into the compliance measurement engine linked with the temporal knowledge graph to obtain a quantitative settlement credibility score. The compliance measurement engine calculates the score by integrating the comparison results of the future impact subgraph and the historical compliance settlement template, as well as the historical evidence features represented by the historical basis subgraph.

[0016] 105. Based on the settlement credibility score, perform the corresponding processing operation.

[0017] For ease of understanding, the following explains some key terms in this embodiment: Settlement trigger events refer to any business activity or status change in the pharmaceutical supply chain that initiates the fund settlement or reconciliation process. Examples include purchase order confirmation, drug warehousing, sales shipment, invoice issuance, and payment request submission.

[0018] An identifier set refers to a unique set of identifiers associated with a specific settlement trigger event, encompassing information from multiple dimensions such as logistics, documents, and fund flows. For example, it may include logistics tracking numbers, purchase order numbers, invoice numbers, and payment transaction numbers, used to accurately track and locate relevant business entities within complex business data.

[0019] Temporal knowledge graphs are graph structures that can represent and manage knowledge that changes over time. In this graph, entity nodes represent business objects, relation edges represent the connections between business objects, and these relation edges are assigned temporal attributes to reflect their validity within a specific time period.

[0020] Entity nodes are the basic building blocks in a temporal knowledge graph, representing specific objects in pharmaceutical procurement and sales, such as suppliers, buyers, drugs, orders, invoices, and payment records. Each entity node has a series of attributes that describe its characteristics and state.

[0021] A relation edge is a logical connection between two entity nodes in a temporal knowledge graph. For example, it could be "an order contains medicine," "an invoice corresponds to an order," or "a payment is associated with an invoice." Relationship edges represent the interactions and dependencies between business entities.

[0022] The effective timestamp refers to the specific point in time when a relationship edge becomes effective. It defines when the business association or state transition represented by the relationship edge takes effect.

[0023] An expiration timestamp refers to the specific point in time when a relational edge ceases to be valid. It defines when the business association or state transition represented by that relational edge becomes invalid.

[0024] A temporal dependency path refers to a time-ordered path in a temporal knowledge graph, consisting of a series of edges connected by effective and ineffective timestamps, reflecting a business process or causal chain. This path reveals the temporal sequence and logical dependencies between business events.

[0025] The historical basis subgraph is a local knowledge graph used to verify settlement compliance, generated by back-reasoning from the settlement trigger event in historical direction. This subgraph contains all historical business facts and evidence that are causally related to the current settlement event.

[0026] A future impact subgraph is a local knowledge graph generated by extrapolating from the settlement trigger event into the future, used to describe the scope of the settlement's aftereffects. This subgraph reveals the potential impact of a current settlement event on future business states or related entities.

[0027] The compliance metrics engine is a computational module specifically designed to assess settlement compliance and credibility. This engine analyzes historical basis subgraphs, future impact subgraphs, and pre-defined compliance templates and rules to output a quantified settlement credibility score.

[0028] Settlement credibility score is a quantitative indicator used to measure the compliance, risk level, and reliability of the decision-making basis for a current settlement event. This score is typically expressed numerically; a higher score indicates higher credibility and lower risk.

[0029] The processing steps refer to the follow-up measures that are executed automatically or semi-automatically based on the settlement credibility score. For example, these could include approving the settlement, blocking the settlement, issuing an early warning, or submitting the settlement for manual review.

[0030] This embodiment provides a pharmaceutical procurement and sales reconciliation method based on identifier matching and comparison. The method responds to settlement trigger events in the pharmaceutical supply chain and obtains a set of associated identifiers. This identifier set may include logistics, document, and fund transfer identifiers. These identifiers can be obtained by manually entering the document numbers related to the settlement trigger event on an interface, or by automatically identifying and extracting these identifiers by scanning barcodes or QR codes on paper documents. Alternatively, a simple event ID can be used to directly query and obtain all identifier information directly associated with the event, without time filtering. The acquisition of these identifiers aims to provide initial clues for subsequently locating relevant business entities in a temporal knowledge graph.

[0031] Based on the obtained set of identifiers, the corresponding entity nodes need to be located and activated in the pre-constructed temporal knowledge graph. The effective lifespan of relation edges in the temporal knowledge graph is defined by their effective and ineffective timestamps; these effective lifespans together constitute the temporal dependency path. The activated entity nodes will serve as the starting point for subsequent graph inference.

[0032] Using activated entity nodes as anchors, bidirectional graph reasoning is performed along temporal dependency paths within the temporal knowledge graph. This reasoning process aims to generate a historical basis subgraph and a future impact subgraph. The historical basis subgraph is generated through backward lookup and is used to verify settlement compliance. The future impact subgraph is generated through forward extrapolation and is used to describe the scope of the settlement's aftereffects.

[0033] The generated historical evidence subgraph and future impact subgraph are input into a compliance measurement engine linked to a temporal knowledge graph to obtain a quantified settlement credibility score. This compliance measurement engine calculates the score by integrating the comparison results of the future impact subgraph and historical compliance settlement templates, as well as the historical evidence features represented by the historical evidence subgraph.

[0034] Based on the obtained settlement credibility score, the corresponding processing operation will be performed.

[0035] This application, by constructing a temporal knowledge graph and combining it with a bidirectional graph reasoning mechanism, can dynamically integrate historical evidence chains and predict future business impacts in pharmaceutical procurement and sales, thereby providing comprehensive pre-settlement risk assessment capabilities. The quantified settlement credibility score integrates multi-dimensional information, effectively improving the reliability and objectivity of decision-making. Thus, this application overcomes the limitations of traditional reconciliation methods in terms of temporal traceability, risk prediction, and decision credibility, achieving intelligent and automated pharmaceutical procurement and sales reconciliation processes, and improving supply chain efficiency and risk control.

[0036] This application further proposes a method for locating and activating corresponding entity nodes in a pre-constructed temporal knowledge graph based on an identifier set. See [link to relevant documentation]. Figure 2 Taking the server as the executing entity as an example, it includes: 201. Based on the type and timestamp of the settlement trigger event, determine the initial time range for entity node search.

[0037] 202. Based on the initial time range, each identifier in the identifier set is parsed to obtain a set of entity keys for querying in the temporal knowledge graph.

[0038] 203. Based on the entity key, perform node retrieval in the temporal knowledge graph to obtain a set of candidate entity nodes.

[0039] 204. Based on the valid state of the time-dependent path, the nodes in the candidate entity node set are filtered, and the nodes on the valid path are determined as the target entity nodes to be activated. The valid state of the time-dependent path refers to the state that is valid at the event timestamp, which is determined by the effective timestamp and the ineffective timestamp of the relation edge.

[0040] 205. Update the status attribute of the target entity node to active, and establish an association index between the target entity node and the settlement trigger event.

[0041] Specifically, based on the type and timestamp of the settlement trigger event, the initial time range for entity node search is determined. This aims to dynamically define a time boundary according to the characteristics of the settlement trigger event, thereby limiting the scope of entity node search in the temporal knowledge graph, thus improving search efficiency and ensuring the timeliness and relevance of retrieval results.

[0042] Based on this initial time range, each identifier in the identifier set is parsed to obtain a set of entity keys for querying in this temporal knowledge graph. The purpose is to transform the original identifier information (such as order number, invoice number, batch number, etc.) attached to the settlement trigger event into structured entity keys that can be recognized and queried by the knowledge graph, and to ensure that these entity keys are valid within the previously determined initial time range.

[0043] Based on the entity key, node retrieval is performed in the temporal knowledge graph to obtain a set of candidate entity nodes. The aim is to use the parsed structured entity key to efficiently find all potentially related entity nodes in the huge temporal knowledge graph.

[0044] Based on the valid state of the time-dependent path, the nodes in the candidate entity node set are filtered, and the nodes on the valid path are identified as the target entity nodes to be activated. The valid state of the time-dependent path refers to the state that is valid at the event timestamp, determined by the effective timestamp and the ineffective timestamp of the relationship edge. The purpose is to further refine the selection of entity nodes in the candidate entity node set whose business relationship and state are real and valid at the time of the settlement trigger event.

[0045] The status attribute of the target entity node is updated to active, and an association index between the target entity node and the settlement trigger event is established. The purpose is to clearly mark the verified and valid entity nodes that are directly related to the current settlement trigger event, and to establish a convenient access mechanism so that subsequent graph reasoning and operations can quickly locate and utilize these nodes.

[0046] Through the aforementioned technical solution, this application can intelligently determine the initial time range for entity node searches based on the type and timestamp of the settlement trigger event, avoiding blind searching throughout the entire temporal knowledge graph and improving retrieval efficiency. Simultaneously, by precisely parsing the identifier set, targeted entity keys are generated, ensuring query accuracy. More importantly, by filtering based on the valid state of the temporal dependency path, this application ensures that the activated entity nodes are real and valid when the settlement trigger event occurs, excluding outdated or ineffective business data, thereby guaranteeing the accuracy and reliability of subsequent bidirectional graph reasoning. By updating the state attributes of the target entity nodes and establishing associated indexes, a clear and traceable starting point is provided for subsequent historical basis subgraph generation and future influence subgraph deduction, laying a solid foundation for compliance verification and risk prediction in pharmaceutical procurement and sales reconciliation.

[0047] This application further proposes a method for constructing temporal knowledge graphs, which includes: Historical and real-time data related to logistics, documents, and fund flows are extracted from pharmaceutical procurement and sales operations.

[0048] Based on a predefined unified business model, the extracted historical data and real-time data are mapped to business entities, business documents and settlement vouchers as entity nodes, and the transformation, dependency and binding relationships between entity nodes are mapped to relationship edges.

[0049] Add effective timestamp and expiration timestamp attributes to the relationship edges. The values ​​of the effective timestamp and expiration timestamp attributes are derived from the corresponding time information in the extracted data or derived from the preset business rules.

[0050] Based on all relation edges with added timestamp attributes, a temporal knowledge graph is constructed. The effective and ineffective timestamp attributes of relation edges are used to define temporal dependency paths in the temporal knowledge graph.

[0051] Specifically, this step involves extracting historical and real-time data related to logistics, documentation, and fund flows from pharmaceutical procurement and sales operations. This step aims to provide a comprehensive raw data foundation for building a temporal knowledge graph. Pharmaceutical procurement and sales operations typically contain a large number of business operation records, such as purchase orders, receiving slips, issuing slips, sales invoices, and payment vouchers. This data is a necessary input for building a temporal knowledge graph that reflects the overall business operations. Data extraction can be conducted in various ways, such as obtaining the latest data generated by the business in real time through API interfaces, or periodically extracting historical data in batches through database connections and ETL (Extract, Transform, Load) tools. Its purpose is to break down traditional data silos, aggregate information scattered across different business modules, and provide a unified and complete data source for subsequent knowledge graph construction.

[0052] Building upon this foundation, a predefined unified business model is used to map the extracted historical and real-time data's business entities, documents, and settlement vouchers to entity nodes. The transformations, dependencies, and binding relationships between entity nodes are then mapped to relational edges. The unified business model is an abstract framework defining core concepts and their interrelationships in the pharmaceutical procurement and sales field. For example, it defines "drugs," "suppliers," "purchase orders," and "warehousing" as entity types and specifies relational types such as "purchase," "inclusion," and "occurrence" between them. This step standardizes and structures the heterogeneous raw business data, making it conform to the ontological requirements of a knowledge graph. In practice, a rule engine or machine learning model can be used to match and transform field values ​​in the raw data with predefined entity and relational types. For example, "purchase order number" is mapped to a "purchase order" entity node, and "order status change" is mapped to a "status transition" relational edge. This mapping ensures the consistency and understandability of the data within the knowledge graph, laying a structural foundation for subsequent temporal reasoning.

[0053] Furthermore, an effective timestamp attribute and an expiration timestamp attribute are added to the relationship edge. The values ​​of these attributes are derived from the corresponding time information in the extracted data or deduced according to pre-defined business rules. These attributes are key metadata defining the effective lifecycle of the relationship edge. They enable the knowledge graph to capture the state of business relationships over time, thus supporting temporal reasoning. These timestamps can be obtained in various ways. They can be directly extracted from raw business data, such as order creation time, shipping time, and receipt time. Alternatively, they can be deduced according to pre-defined business rules. For example, if an order is not signed for within 7 days of shipment, it is automatically marked as "abnormal," and the effective time of the "abnormal" relationship can be deduced. By assigning a clear time dimension to the relationship edge, this method can accurately represent the occurrence, duration, and end of business events, solving the problem that traditional knowledge graphs struggle to express temporal dynamics.

[0054] Based on all relation edges with added timestamp attributes, a temporal knowledge graph is constructed. The effective and ineffective timestamp attributes of these relation edges are used to define the temporal dependency path within this knowledge graph. This step is the final integration stage in the construction of the temporal knowledge graph. After all entity nodes and relation edges with timestamp attributes are ready, they are organized into a complete graph structure. The construction process can be implemented using graph databases (such as Neo4j, JanusGraph) or custom graph storage structures. The effective and ineffective timestamp attributes of relation edges are not only attributes of the relation itself, but also the core mechanism for defining temporal dependency paths. This means that during graph traversal and reasoning, only relation edges valid within a specific time range can be considered based on the query time point, thereby forming a temporal dependency path that reflects the business logic within a specific time period. This timestamp-based path definition enables the knowledge graph to support accurate backtracking of historical events and reasonable deduction of future states, providing powerful temporal analysis capabilities for pharmaceutical procurement and sales reconciliation.

[0055] Through the aforementioned construction method, this application can systematically extract and integrate logistics, document, and fund flow information from scattered pharmaceutical procurement and sales business data, and transform it into structured entity nodes and relationship edges based on a unified business model. Crucially, by adding effective and ineffective timestamp attributes to the relationship edges, this method endows the business relationships in the knowledge graph with a clear temporal dimension, enabling the graph to accurately reflect the occurrence, duration, and termination of business events, thus solving the problem of traditional methods lacking dynamic integration of temporal attributes in business data. The temporal knowledge graph constructed based on these timestamped relationship edges can clearly define temporal dependency paths, providing an accurate, complete, and temporally logical data foundation for locating and activating corresponding entity nodes in the temporal knowledge graph when settlement trigger events occur, and for performing bidirectional graph reasoning along the temporal dependency paths using the activated entity nodes as anchors to generate historical basis subgraphs and future impact subgraphs. This improves the reliability of settlement verification and provides solid data support for pre-risk prediction and impact assessment.

[0056] This application further proposes a pharmaceutical procurement and sales reconciliation method based on identifier matching and comparison. This method uses activated entity nodes as anchor points and performs bidirectional graph reasoning along temporal dependency paths in the temporal knowledge graph, generating a historical basis subgraph and a future influence subgraph. (See [link to relevant documentation]). Figure 3 Specifically, it includes: 301. Based on the event timestamp of the settlement trigger event and the business stage defined by the time-series dependency path, determine the time window boundaries for backward look-back and forward projection.

[0057] 302. Starting from the activated entity node, perform forward path traversal and backward path traversal in the temporal knowledge graph along the temporal dependency path, and collect the nodes and relation edges visited during the traversal.

[0058] 303. Based on the nodes and relation edges collected by forward path traversal, construct a historical basis subgraph. The historical basis subgraph is used to represent business facts that are causally related to the current settlement before the time window boundary.

[0059] 304. Based on the nodes and relation edges collected by backward path traversal, construct a future influence subgraph. The future influence subgraph is used to represent the business elements that will undergo state changes after the time window boundary due to the execution of the current settlement.

[0060] Among them, the time window boundaries for backward look-back and forward extrapolation are determined based on the event timestamp of the settlement trigger event and the business stage defined by the time-series dependent path. This aims to set a clear analytical scope for subsequent graph reasoning and ensure the timeliness and relevance of the generated historical basis subgraph and future influence subgraph.

[0061] Starting with the activated entity node, forward and backward path traversals are performed along the temporal dependency path in the temporal knowledge graph, collecting the nodes and relation edges visited during the traversal. This step is fundamental to obtaining business data associated with the settlement trigger event. Specifically, standard graph traversal algorithms, such as Depth-First Search (DFS) or Breadth-First Search (BFS), can be used, modified with time constraints to ensure that only nodes and relation edges within the time window boundaries and conforming to the temporal dependency path are collected during the traversal. Alternatively, specialized graph query languages ​​(such as Cypher or Gremlin) can be used for path queries with time predicates to efficiently extract the required data from the temporal knowledge graph.

[0062] Based on the nodes and relation edges collected by forward path traversal, a historical basis subgraph is constructed. This historical basis subgraph is used to represent business facts that are causally related to the current settlement before the time window boundary. This step structures the collected historical data to form an evidence chain that can be verified for compliance.

[0063] Based on the nodes and relational edges collected through backward path traversal, a future impact subgraph is constructed. This subgraph represents the business elements whose state will change after the execution of the current settlement following the time window boundary. This step aims to predict the potential business impact after settlement execution. Specifically, state predictions can be made on the nodes and relational edges collected during backward path traversal based on predefined business rules or state transition models. For example, this could predict changes in inventory quantity, updates to accounts receivable status, and the triggering of subsequent business processes. Furthermore, multiple future impact subgraphs can be generated by simulating the impact of different settlement outcomes (such as full payment, partial payment, and delayed payment) on future business states to support more comprehensive risk assessment and decision-making.

[0064] The above technical solution determines the time window boundary based on the event timestamp of the settlement trigger event and the business stage defined by the time-series dependency path. This leverages the real-time nature of the event timestamp and the inherent logic of the business stage, avoiding the subjectivity of boundary definition and ensuring that backtracking and deduction only cover the time period directly related to settlement, thereby eliminating irrelevant interference. Starting from the activated entity node and following the time-series dependency path, forward and backward path traversals are performed. This anchors to specific nodes and follows path constraints, collecting visited nodes and relationship edges to ensure that data collection focuses on the causal chain and prevents path deviation or omission of key elements. A historical evidence subgraph is constructed based on the nodes and relationship edges collected by the forward path traversal. This step structures the collected data, representing the causal business facts before the time window boundary, strengthening the integrity of historical evidence. A future impact subgraph is constructed based on the nodes and relationship edges collected by the backward path traversal, transforming the collected data into a predictive model to represent the business elements of state changes after the time window boundary, improving the predictability of impact assessment. Overall, these steps work together to optimize the subgraph generation process through boundary definition and path constraints, thereby providing more accurate and reliable input for subsequent settlement compliance verification and impact assessment.

[0065] This application further proposes a method for determining the time window boundaries for forward backtracking and forward projection based on the event timestamp of the settlement triggering event and the business stage defined by the time-series dependency path. The method includes: obtaining the business stage identifier associated with the settlement triggering event; querying a predefined window rule base based on the business stage identifier to obtain the allowed duration thresholds for forward backtracking and forward projection; using the event timestamp of the settlement triggering event as a reference point; determining the starting boundary of the forward backtracking time window based on the allowed duration thresholds for forward backtracking; and determining the ending boundary of the forward projection time window based on the allowed duration thresholds for forward projection.

[0066] The purpose of obtaining the business stage identifier associated with the settlement trigger event is to identify the specific business process stage in which the current settlement trigger event is located. For example, in pharmaceutical procurement and sales, a settlement trigger event may occur at different stages such as "order confirmation," "shipment," "receipt," "invoicing," or "payment application." This business stage identifier can be directly carried as metadata of the settlement trigger event, or it can be dynamically obtained by querying the status or type of business documents (such as purchase orders, delivery notes, receipt notes, invoices, etc.) associated with the settlement trigger event. By clearly defining the business stage, a basis can be provided for subsequent dynamic adjustment of the time window, avoiding ambiguity in boundaries caused by unclear business stages.

[0067] Based on the business stage identifier, a predefined window rule base is queried to obtain the allowed time thresholds for backward look-back and forward extrapolation. The purpose is to dynamically determine the time range for look-back and extrapolation based on the characteristics of the current business stage. This window rule base can be a configuration table, database, or rule engine, storing the mapping relationship between different business stages and corresponding time thresholds (e.g., in days, hours, or minutes). For example, settlement in the "order confirmation" stage may require a shorter look-back and extrapolation time, while settlement in the "payment application" stage may require a longer look-back time to verify historical purchase records and a longer extrapolation time to assess the impact on future cash flow. This approach ensures that boundary determination is based on predefined rules, enhancing dynamism and adaptability, and preventing errors caused by subjective judgment.

[0068] Using the event timestamp of the settlement trigger event as a reference point is to establish a clear time baseline. This event timestamp typically refers to the precise time when the settlement trigger event occurred or was recorded. For example, when a payment request is submitted, the submission time is recorded. This timestamp serves as the central point for calculating all time windows, ensuring a close correlation between the time window and the event time, and avoiding inaccuracies in the scope of backtracking or extrapolation caused by time baseline deviations.

[0069] Based on the allowed backtracking duration threshold, the starting boundary of the backtracking time window is determined by subtracting the allowed backtracking duration threshold from the event timestamp, thus obtaining the starting point for historical data tracing. For example, if the event timestamp is October 26, 2023, at 10:00:00, and the allowed backtracking duration threshold is 7 days, then the starting boundary is October 19, 2023, at 10:00:00. This limits the backtracking depth, effectively controls the range of historical data, and reduces the risk of omissions or redundancy.

[0070] Based on the allowed duration threshold for forward projection, the termination boundary of the forward projection time window is determined by adding the allowed duration threshold forward from the event timestamp, thus obtaining the endpoint of the future impact assessment. For example, if the event timestamp is October 26, 2023, at 10:00:00, and the allowed duration threshold for forward projection is 3 days, then the termination boundary is October 29, 2023, at 10:00:00. This constrains the breadth of the projection, ensuring the focus and accuracy of the future impact assessment.

[0071] Through the aforementioned technical solution, this application can dynamically and accurately determine the time window boundaries for backward look-back and forward extrapolation based on the specific business stage of the settlement triggering event. This dynamic adjustment mechanism based on business stage avoids data omissions or redundancy problems that may occur with fixed time windows, ensuring that the data included in the construction of the historical basis subgraph and the future impact subgraph is both comprehensive and focused on the actual business context of the current settlement event. By using the event timestamp as a reference point and combining it with a predefined window rule base, this application can provide an accurate and efficient time range for subsequent bidirectional graph reasoning, thereby improving the accuracy of the historical basis subgraph in verifying settlement compliance and the effectiveness of the future impact subgraph in describing the scope of settlement aftereffects, laying a solid foundation for quantifying settlement credibility scoring.

[0072] This application further proposes a method for constructing a historical basis subgraph based on nodes and relational edges collected through forward path traversal. This method includes: applying pre-defined business association rules to perform causal association analysis on the nodes and relational edges collected through forward path traversal to obtain a set of candidate subgraph elements that have a direct causal logic with the settlement trigger event; checking the association time attribute of each entity node in the candidate subgraph element set; checking the effective timestamp and ineffective timestamp attributes of each relational edge in the candidate subgraph element set; determining whether the association time attribute of the entity node and the effective timestamp and ineffective timestamp attributes of the relational edge are within the valid time range defined by the forward backtracking time window boundary based on the forward backtracking time window boundary; identifying entity nodes and relational edges within the valid time range as valid subgraph elements; and performing temporal topological sorting and logical connection on the valid subgraph elements according to the time constraints defined in the temporal dependency path. Based on the sorted and connected valid subgraph elements, a historical basis subgraph with source identifiers and causal type labels is generated. The source identifier is attached to each entity node in the historical basis subgraph, and the causal type label is attached to each relation edge in the historical basis subgraph.

[0073] Specifically, when applying pre-defined business association rules to perform causal association analysis on the nodes and relation edges collected during forward path traversal to obtain a set of candidate subgraph elements with direct causal logic to the settlement trigger event, the aim is to identify and focus on entities and relationships with direct business causal relationships to the current settlement trigger event, thereby eliminating irrelevant or indirect interference information and ensuring the accuracy of the historical basis subgraph. One implementation is to use a rule engine based on expert knowledge. This engine is pre-configured with a series of business logic rules, such as "purchase orders must precede inbound documents, and inbound documents must precede payment documents," which define the causal dependencies between business entities and documents. During analysis, the traversed nodes and relation edges are matched according to these rules to filter out elements that conform to the causal chain. Another implementation is to use a graph pattern matching algorithm. By defining specific graph patterns, these patterns represent known compliant business processes or causal chains. Substructures matching these graph patterns are searched in the results of forward path traversal to identify candidate subgraph elements with direct causal logic.

[0074] When examining the association time attribute of each entity node in the candidate subgraph element set, and the effective and ineffective timestamp attributes of each relationship edge in the candidate subgraph element set, the aim is to ensure that the selected entity nodes and relationship edges are temporally associated with the settlement trigger event, and that their validity covers the business time period that needs to be traced back. For entity nodes, attributes such as creation time, business occurrence time (e.g., order creation date, product receipt date), or last update time can be checked. These time attributes are typically stored as node metadata in the temporal knowledge graph. For relationship edges, their effective and ineffective timestamp attributes directly define the effective lifespan of the relationship in the time dimension. These attribute values ​​are directly read to determine the temporal validity of the relationship edge.

[0075] When determining whether the association time attribute of an entity node and the effective and ineffective timestamp attributes of a relation edge fall within the valid time range defined by the forward backtracking time window boundary, the aim is to strictly limit the time range of the historical basis subgraph, exclude irrelevant or expired data beyond the backtracking window, and ensure the timeliness and relevance of historical evidence. One implementation method is to compare the association time attribute of an entity node with the start and end boundaries of the forward backtracking time window. For example, if the creation date of an entity node is later than the window's start boundary but earlier than or equal to the event timestamp of the settlement trigger event, it is considered temporally valid. For relation edges, it is determined whether their effective timestamp attribute is within the window and whether their ineffective timestamp attribute is later than the window's start boundary or empty (indicating continued validity). Another implementation method is to utilize the temporal query functions provided by temporal databases or graph databases. These functions allow directly specifying a time range and automatically filter out entities and relationships that are valid or have occurred within that time range. For example, using temporal operators such as `AS OF` or `BETWEEN` for querying.

[0076] When identifying entity nodes and relation edges within the valid time frame as valid subgraph elements, the goal is to explicitly select the minimum set that meets the time constraints and causal relationships, serving as the basis for constructing the historical subgraph. One implementation is to build a new graph structure in memory and add all entity nodes and relation edges that meet the above selection criteria to this new graph. Another implementation is to add a temporary marker (e.g., "is_valid_for_history_subgraph") to the original temporal knowledge graph for eligible entity nodes and relation edges, and subsequent operations are performed only on these marked elements.

[0077] When performing temporal topological sorting and logical connections on valid subgraph elements based on the temporal constraints defined in the temporal dependency path, the goal is to ensure that the elements in the historical subgraph are organized according to the chronological order of actual business operations and logical dependencies, thereby clearly demonstrating the evolution of the business process. One implementation is to use a topological sorting algorithm based on Depth-First Search (DFS) or Breadth-First Search (BFS). During traversal, the effective timestamp attribute of relational edges and the association time attribute of entity nodes are combined to ensure that the time of the parent node (or preceding event) is earlier than that of the child node (or subsequent event), thus constructing a Directed Acyclic Graph (DAG) that reflects temporal dependencies. Another implementation is to utilize event chain analysis. Valid subgraph elements are treated as a series of discrete business events. By analyzing their timestamps and predefined business dependency rules, these events are chained into one or more ordered event chains, which together constitute the temporal topological structure.

[0078] Based on the sorted and connected valid subgraph elements, a historical basis subgraph with source identifiers and causal type tags is generated. The source identifier is appended to each entity node in the historical basis subgraph, and the causal type tag is appended to each relation edge. The purpose is to enhance the traceability and interpretability of the historical basis subgraph, providing richer and more reliable contextual information for subsequent compliance verification. One implementation is to extract the data source (e.g., ERP, WMS, finance, etc.) or data entry personnel information from the original data records for each entity node when generating the historical basis subgraph, and append it as an attribute of the node. Another implementation is to assign a clear causal type tag (e.g., "cause," "trigger," "correct," "depends on," etc.) to each relation edge when constructing it, based on the business association rules applied during the previous causal association analysis, to clearly express the business logic relationship between the two entities or events.

[0079] By employing the aforementioned technical solutions and applying pre-defined business association rules for causal correlation analysis, elements directly related to settlement trigger events can be identified based on the rule base, avoiding indirect or irrelevant influences and thus improving the relevance and specificity of evidence. By checking the association time attributes of entity nodes and the effective and ineffective timestamp attributes of relationship edges, the time attributes of all elements are verified, preventing data interference due to time misalignment. Validity is judged based on the boundaries of the forward-looking time window, and elements are filtered within the time window's limited range, enhancing the accuracy of the time dimension. Entity nodes and relationship edges within the valid time range are identified as valid subgraph elements, refining the subgraph content and eliminating invalid interference. Temporal topology sorting and logical connections are performed based on the time constraints defined in the temporal dependency path, organizing elements in chronological order and reflecting the causal chain, facilitating subsequent compliance verification. A historical basis subgraph with source identifiers and causal type markers is generated, where the source identifier provides data traceability, and the causal type marker clarifies the nature of the relationship, jointly improving the interpretability and credibility of the subgraph. This provides the compliance measurement engine with a solid, accurate, and traceable chain of historical evidence, enhancing the reliability and transparency of settlement compliance verification, thereby effectively supporting the generation of quantitative settlement credibility scores.

[0080] This application further proposes the following steps for generating a historical basis subgraph with accompanying source identifiers and causal type tags: First, based on the sorted and connected valid subgraph elements, create an initial subgraph with a temporal topology. For each entity node in the initial subgraph, extract data source information from the original business data corresponding to the entity node, and generate a source identifier based on the data source information. Second, for each relation edge in the initial subgraph, call a pre-configured causal inference rule base to analyze the business logic relationship between the entity node pairs connected by the relation edge, and determine the causal type tag corresponding to the relation edge. Third, inject the source identifier into the corresponding entity node attribute and inject the causal type tag into the corresponding relation edge attribute. Finally, based on the initial subgraph with injected attributes, output the historical basis subgraph.

[0081] Specifically, creating an initial subgraph with a temporal topology aims to ensure that the constructed subgraph accurately reflects the actual order and logical dependencies of business events, thus providing an ordered and structured foundation for subsequent identification and labeling. For example, a directed acyclic graph (DAG) can be directly constructed using the APIs of graph databases (such as Neo4j and JanusGraph) based on the sorted and connected valid subgraph elements. Nodes represent entities, edges represent relationships, and the direction of the edges is ensured to align with the temporal flow. Alternatively, graph processing libraries in programming languages ​​(such as Python) (such as NetworkX) can be used to convert valid subgraph elements into graph objects and utilize their provided topology sorting algorithms for verification and adjustment to ensure a temporal topology.

[0082] The process of extracting data source information from the original business data corresponding to each entity node in the initial subgraph and generating a source identifier based on this information aims to clarify the data origin of each entity node in the subgraph, thereby enhancing the traceability and credibility of historical evidence and facilitating subsequent auditing and problem localization. For example, during the data extraction phase, metadata such as the original database table name, record ID, and extraction timestamp can be recorded for each business entity data, and this metadata can be attached as a source identifier when generating the entity node. Alternatively, a hash value or unique identifier can be maintained for each entity node. This identifier is generated by combining key fields of the original business data (such as document number and business ID) and can be traced back to the original business and specific record.

[0083] In the process of analyzing the business logic relationships between entity node pairs connected to each relation edge in the initial subgraph by calling a pre-configured causal reasoning rule base and determining the causal type label corresponding to the relation edge, the role of this rule base is to identify and clarify the specific causal type of the relation edge in the subgraph, such as "cause," "include," and "depend on," thereby avoiding ambiguity in business logic and improving the accuracy of compliance verification. For example, the pre-configured causal reasoning rule base can be a rule engine built based on expert knowledge, containing a series of "IF-THEN" rules, such as "If A is a purchase order, B is an inbound order, and the inbound quantity of B is related to the order quantity of A, then the relationship is inbound correspondence." Alternatively, a machine learning model can be used, trained on a large amount of historical business process data, to learn the implicit causal patterns between entity node pairs and predict the causal type of the relation edge.

[0084] Injecting source identifiers into the corresponding entity node attributes and causal type tags into the corresponding relation edge attributes aims to make the generated identifiers and tags inherent properties of the subgraph, integrating them into the subgraph structure for easier subsequent querying, analysis, and verification. For example, in a graph database, these identifiers and tags can be injected directly by updating the attribute fields of nodes and edges. Specifically, a "source_id" attribute can be added to entity nodes, and a "causal_type" attribute can be added to relation edges. Alternatively, if the subgraph exists as an in-memory object, the corresponding attribute fields can be added and values ​​assigned by modifying the data structure of the node and edge objects.

[0085] Based on the initial subgraph with injected attributes, a historical basis subgraph is output, thus forming a complete and information-rich historical basis subgraph, providing comprehensive and reliable input for the subsequent compliance measurement engine. For example, the output can be a serialized graph data format (such as GraphML or JSON) for easy storage and transmission. Alternatively, the subgraph object can be directly passed to the compliance measurement engine's API interface as its input parameter.

[0086] Through the above technical solution, an initial subgraph with a temporal topology is created based on the sorted and connected valid subgraph elements. This ensures that the subgraph structure conforms to the business time sequence, providing a logical framework for subsequent addition of identifiers and tags. For each entity node, data source information is extracted from the original business data, and a source identifier is generated. This directly solves the problem of ambiguous data sources and enhances the credibility of evidence by tracing the original data. For each relation edge, a pre-configured causal reasoning rule base is invoked to analyze the business logic relationship and determine the causal type tag. This clarifies the causal relationship type, avoids logical ambiguity, and ensures the consistency and accuracy of the analysis using the rule base. Source identifiers are injected into entity node attributes, and causal type tags are injected into relation edge attributes. This makes the identifiers and tags inherent attributes of the subgraph, facilitating direct reference in subsequent verification. Based on the initial subgraph with injected attributes, a historical basis subgraph is output, thereby generating a subgraph with complete source and causal tags, providing a more comprehensive and reliable basis for settlement compliance.

[0087] This application further proposes a method for constructing a future influence subgraph based on nodes and relation edges collected through backward path traversal, specifically including: Based on the type of the settlement trigger event and the pre-configured state transition rule set, identify a set of all candidate subgraph elements that may be directly or indirectly caused by the settlement trigger event to change state.

[0088] For each entity node in the candidate subgraph element set, check its current state attribute in the temporal knowledge graph. For each relation edge in the candidate subgraph element set, check its effective timestamp and ineffective timestamp attributes.

[0089] Based on the forward projection time window boundary, determine whether the current state attribute of the entity node meets the change conditions defined by the state transition rule set, and whether the effective timestamp attribute and the ineffective timestamp attribute of the relation edge are within the valid time range defined by the forward projection time window boundary.

[0090] The entity nodes that meet the change conditions and the relationship edges that are within the valid time range are identified as valid subgraph elements.

[0091] Based on the temporal constraints and logical dependencies defined in the temporal dependency path, causal topological sorting and logical connections are performed on the effective subgraph elements.

[0092] Based on the sorted and connected elements of the effective subgraph, a future impact subgraph is generated with an impact range marker and a state change marker. The impact range marker is used to identify the business level affected by the settlement trigger event, and the state change marker is attached to each entity node in the future impact subgraph that meets the change condition to indicate the expected change direction of the entity node.

[0093] Specifically, when identifying the set of candidate subgraph elements that may be directly or indirectly affected by the settlement triggering event, the type of the settlement triggering event refers to a specific event in the pharmaceutical procurement and sales business that triggers settlement, such as the confirmation of purchase orders, completion of receiving slips, sales shipments, return processing, issuance of payment instructions, or confirmation of receipt. Different types of events may have different impacts on business processes and entity states. This pre-configured state transition rule set is a set of predefined logical rules used to describe which entities (such as orders, inventory, cash accounts, contracts, etc.) will have which state attributes change when a specific business event occurs, as well as the conditions and results of the change. These rules can be configured based on business expert experience, historical data analysis, or industry standards. This step aims to comprehensively discover entity nodes and relationship edges related to the current settlement event that may undergo future state changes, ensuring full coverage of future impacts and avoiding omission of key business elements.

[0094] When examining the current state attributes of an entity node in the temporal knowledge graph, the entity node typically contains multiple attributes. Among these, the "state attribute" is key information describing the entity's current business status, such as the "pending payment," "paid," or "completed" status of an order; the "in stock" or "outbound" status of inventory; or the "available balance" or "frozen amount" of a funds account. Examining these current state attributes ensures that subsequent judgments regarding whether change conditions are met are based on the latest and most accurate business situation. When examining the effective and ineffective timestamp attributes of a relationship edge, the relationship edge in the temporal knowledge graph not only represents the association between entities but also defines its effective lifecycle through effective and ineffective timestamps. Examining these timestamp attributes ensures that the considered relationship is valid within the future projection time window, avoiding projections based on ineffective or not-yet-effective relationships, thus guaranteeing the accuracy of future subgraph impacts.

[0095] When determining whether the current state attributes of an entity node meet the change conditions defined by the state transition rule set, the forward projection time window boundary is a preset time range used to limit the time span of concern for the future impact subgraph, such as 3 days, 7 days, or one month after the settlement event. This boundary helps focus on recent and predictable impacts. This judgment is based on a pre-configured state transition rule set, each rule typically containing triggering conditions, such as "when the order status is pending payment and a payment notification is received." This step compares the current state attributes of the entity node with these triggering conditions to determine whether the entity meets the prerequisites for a state change. When determining whether the effective and ineffective timestamp attributes of a relationship edge are within the valid time range defined by the forward projection time window boundary, this judgment ensures that the considered relationship edge is active within the forward projection time window. For example, if a contractual relationship has already expired within the forward projection time window, it should not be included in the consideration of future impacts.

[0096] The core of the screening process is to identify the entity nodes that meet the change conditions and their relational edges within the valid time range as valid subgraph elements. This step determines the set of entity nodes and relational edges that truly meet the potential for future state changes and time validity after the aforementioned checks and judgments. These valid subgraph elements constitute the basic building blocks of the subgraph that will influence future changes, ensuring the conciseness and relevance of the subgraph.

[0097] Based on the temporal constraints and logical dependencies defined in the temporal dependency path, causal topological sorting and logical connections are performed on the valid subgraph elements. This temporal dependency path not only defines the sequence of business processes but also includes temporal constraints between entities (e.g., "Event A must occur before Event B") and logical dependencies (e.g., "Shipping can only proceed after payment is completed"). This information is crucial for constructing causal chains. This process aims to arrange and connect the selected valid subgraph elements according to their inherent business causal relationships and temporal order, forming a directed acyclic graph (DAG) structure. For example, a payment event leads to an order status change, an order status change leads to a shipping instruction, and a shipping instruction leads to a decrease in inventory. Topological sorting clearly demonstrates the transmission path and order of future impacts, ensuring the logical rigor of the subgraph.

[0098] Based on the sorted and connected elements of the effective subgraph, a future impact subgraph is generated, complete with impact scope and state change markers. The impact scope marker identifies the business level affected by the settlement-triggered event; for example, a settlement event might affect the "order level," "inventory level," "financial level," or "customer level." This marker helps to quickly understand the breadth of the settlement event's impact on different business areas. The state change marker is attached to each entity node in the future impact subgraph that meets the change conditions, indicating the expected direction of change for that entity node. For example, for an inventory entity, the state change marker might be "inventory decrease." For a funds account entity, it might be "balance increase" or "balance decrease." For an order entity, it might be "state changes to completed." This marker provides a specific prediction of future state changes. The final generated future impact subgraph is a structured and information-rich graph that not only shows the entities and relationships that may be affected in the future but also clearly indicates the scope of the impact and the specific direction of state changes through the attached markers.

[0099] By employing the aforementioned technical solution, candidate subgraph elements are identified based on the type of settlement triggering events and a pre-configured set of state transition rules. This ensures comprehensive coverage of all business elements that directly or indirectly cause state changes, avoiding omissions of potential impact points. Precise checks are performed on the current state attributes of entity nodes and the timestamp attributes of relation edges, combined with judgments based on the boundaries of future projection time windows. This ensures that only elements within the valid time frame and meeting the change conditions are included in the future impact subgraph, thereby improving the accuracy and relevance of the subgraph content. Furthermore, based on the time constraints and logical dependencies defined in the temporal dependency path, causal topological sorting and logical connections are performed on valid subgraph elements. This allows the generated future impact subgraph to clearly reflect the causal transmission chain in business logic, enhancing the logical rigor and reasonability of the subgraph. By generating future impact subgraphs with attached impact range and state change markers, not only are the business levels affected by settlement events clearly identified, but the expected change direction of each affected entity node is also specifically indicated, providing a more quantitative and refined description of the settlement aftereffects. This precise and comprehensive future impact subgraph provides high-quality input for the subsequent compliance measurement engine to score settlement credibility, improving the accuracy and reliability of settlement risk prediction and enabling pharmaceutical procurement and sales reconciliation methods to more effectively support pre-risk warning and decision-making.

[0100] This application further proposes a method for identifying a set of candidate subgraph elements whose state changes may be directly or indirectly caused by settlement-triggered events, specifically including the following steps: Based on the type of the settlement trigger event, at least one applicable target state transition rule is matched within the state transition rule set. The type of the settlement trigger event, such as "purchase order settlement," "sales invoice settlement," or "return settlement," specifies the specific business scenario or event category that leads to the initiation of the settlement process, serving as a key input for identifying relevant business rules and their scope of impact. The state transition rule set is a pre-configured collection of rules that defines how the state of a business entity changes according to specific events and conditions. Each rule typically includes elements such as trigger conditions, attribute values ​​before and after the state change, and can be stored in a database, configuration file, or dedicated rule engine, and can be dynamically updated and maintained according to business needs. Through a matching process, such as based on rule tags, event type associated fields, or semantic analysis based on rule content, rules directly related to the event can be accurately filtered from a large rule set.

[0101] The matched target state transition rule is parsed to obtain the state transition triggering condition, the attribute value before the state change, and the attribute value after the state change as defined by the rule. The state transition triggering condition refers to a specific set of conditions that cause a change in the state of a business entity. These conditions can be the occurrence of a business event, the arrival of a specific time point, a certain value reaching a threshold, or a logical expression combining multiple conditions. The attribute value before and after the state change refers to the specific attribute state of the business entity before and after the state transition, respectively. For example, before an inventory entity experiences an "outbound" event, its "available quantity" attribute might be N, while after the event, its "available quantity" attribute becomes NX. The parsing results provide a clear basis for subsequent entity filtering and state determination.

[0102] From the nodes and relation edges collected during the backward path traversal, entity nodes that satisfy the state transition trigger condition and whose current state attributes match the attribute values ​​before the state change are selected as the first type of candidate elements. The nodes and relation edges collected during the backward path traversal refer to all entity nodes and relation edges visited during the bidirectional graph reasoning process, starting from the activated entity node and extrapolating to the future along the temporal dependency path. By checking whether the current state attributes of these entity nodes match the "attribute values ​​before the state change" defined in the parsed target state transition rule, and whether the entity node satisfies the "state transition trigger condition" of the rule, the business entities directly affected by the settlement event are identified, i.e., the first type of candidate elements.

[0103] Furthermore, from the nodes and relation edges collected during the backward path traversal, entity nodes and relation edges that are directly associated with the first type of candidate element through the temporal dependency path and possess a preset influence transmission attribute are selected as the second type of candidate element. The direct association with the first type of candidate element through a temporal dependency path means that in the temporal knowledge graph, there exists one or more paths connected by relation edges, linking the first type of candidate element to other entity nodes or relation edges, and these connection paths are constructed based on the temporal dependency relationship. The preset influence transmission attribute refers to a predefined attribute on the relation edges or entity nodes in the temporal knowledge graph, used to identify whether the relation or entity has the ability to transmit state changes or influences from one business element to another. Through this selection, the ripple effect of settlement events can be captured, identifying business elements that do not directly meet the state transition triggering conditions but may be indirectly affected due to their direct temporal dependency association with the first type of candidate element and their influence transmission attribute; these are the second type of candidate elements.

[0104] The first type of candidate element is merged with the second type of candidate element to form the candidate subgraph element set. This set contains all entity nodes and relationship edges that may be directly or indirectly affected by the settlement trigger event, and forms the basis for constructing the future impact subgraph.

[0105] The above technical solution ensures the accuracy of rule application by matching applicable target state transition rules based on the type of settlement trigger event. Rule parsing clarifies the triggering conditions and pre- and post-transition attribute values ​​for state transitions, providing a precise basis for subsequent screening. Based on this, a first category of candidate elements that meet the triggering conditions and match the current state is selected, directly capturing the explicit impact of the settlement event. Furthermore, by identifying entity nodes and relationship edges directly associated with the first category of candidate elements and possessing preset impact transmission attributes as the second category of candidate elements, the indirect impact and ripple effect of the settlement event are effectively captured. Merging these two categories of candidate elements forms a more complete and reliable set of candidate subgraph elements, providing a solid foundation for constructing the future impact subgraph. This allows the generated future impact subgraph to more comprehensively represent the potential impact range of the settlement event on future business states, improving the accuracy of settlement credibility scoring and the effectiveness of risk prediction, thereby enhancing the intelligence level and risk control capabilities of the pharmaceutical procurement and sales reconciliation method.

[0106] This application further proposes a method for generating a future impact subgraph with attached influence range markers and state change markers based on the sorted and connected effective subgraph elements. Specifically, the method includes: analyzing the topological structure of the sorted and connected effective subgraph elements; determining the influence range markers based on the topological structure and predefined hierarchical determination rules; traversing each entity node in the sorted and connected effective subgraph elements; matching and determining the state change markers corresponding to each entity node according to the state transition rule set and the type of the settlement trigger event; and associating and binding the influence range markers and the state change markers corresponding to each entity node with the sorted and connected effective subgraph elements to generate the future impact subgraph with all markers.

[0107] The scope of impact flag identifies the business level or scope affected by the settlement-triggered event, quantifying the degree to which the settlement event impacts the business structure or process. This flag can be an enumeration value, such as "department level," "project level," "company level," "supply chain level," or more granular terms like "order level" or "batch level." Alternatively, it can be a numerical value, such as a percentage from 0-100, representing the breadth or depth of the impact, or a level depth value, such as from 0 (direct impact) to N (indirect impact at N levels). The state change flag is appended to each entity node in the future impact subgraph that meets the change conditions, indicating the expected direction or specific state of that entity node. This flag can be a predefined string, such as "completed," "pending," "cancelled," "inventory reduction," "funds increase," etc., directly describing the expected change in state. Alternatively, it can be a numerical value, such as the difference between quantity increases and decreases, or a Boolean value indicating whether a certain attribute will change.

[0108] When analyzing the topology of the effective subgraph elements after sorting and connecting, the analysis reveals the hierarchical relationships, dependencies, and data flows between entity nodes, providing a structural basis for determining the scope of influence. Specifically, depth-first search (DFS) or breadth-first search (BFS) algorithms in graph theory can be used to identify topological properties such as connected components, path lengths, and centrality in the subgraph. Alternatively, query languages ​​of graph databases (such as Cypher and Gremlin) can be used for pattern matching and path analysis to identify specific business process patterns or hierarchical structures. The predefined hierarchical determination rules are pre-configured and used to determine the hierarchy of business elements based on the subgraph's topology, thereby determining the scope of influence. These rules can be defined based on the type, attributes, or position of entity nodes in the graph (e.g., the shortest path length to a core node), for example, "If an entity node is an order and the number of its associated goods exceeds a certain threshold, then its influence hierarchy is bulk transactions." Alternatively, the rule can be a set of logical expressions, such as "If a subgraph contains purchase orders and receiving slips, and they are associated through product entities, then the scope of the impact is the purchase and receiving process."

[0109] When determining the aforementioned influence scope markers, a unified influence scope identifier is assigned to the entire future influence subgraph or its key parts based on the analysis results of the subgraph topology and predefined hierarchical determination rules. Specifically, this can be done by using a decision tree or rule engine, based on the type and number of entity nodes contained in the subgraph and the hierarchical determination rules. Alternatively, certain global topological indicators of the subgraph (such as the number of nodes, the number of edges, and the maximum path depth) can be calculated and mapped to predefined influence scope levels. When matching and determining the state change markers corresponding to each entity node, for each entity node in the future influence subgraph, its state will be accurately predicted based on its type, attributes, and the type of the aforementioned settlement trigger event. Specifically, based on a rule engine, the current attribute combination of the entity node can be matched with the trigger conditions in the aforementioned state transition rule set. Once a match is successful, the changed state defined in the rule is applied as the marker. Alternatively, a machine learning model can be used to predict the state changes of different types of entity nodes under specific settlement trigger events by training on historical data. Through association and binding, the determined influence scope markers and state change markers are attached to the future influence subgraph and its internal entity nodes in a structured manner. Specifically, these markers can be stored as metadata attributes that will affect the subgraph in the future, while state change markers can be stored as attributes of entity nodes. Alternatively, in the graph database, subgraphs or entity nodes can be connected to their corresponding marker values ​​by creating new relational edges (e.g., "has_impact_scope", "has_status_change").

[0110] Through the above technical solution, this application can accurately determine the scope of influence markers by analyzing the topology of the future impact subgraph and combining it with predefined hierarchical judgment rules, thereby clearly defining the degree of impact of settlement events on different business levels and solving the problem of ambiguous scope of influence. Simultaneously, by traversing each entity node in the subgraph and matching it with the type of the settlement triggering event according to the aforementioned state transition rule set, the state change marker corresponding to each entity node can be accurately determined, thereby achieving refined prediction of the future state of business elements. By associating and binding these scope of influence markers and state change markers with the aforementioned effective subgraph elements, a future impact subgraph with all markers is generated. This allows the future impact subgraph to not only describe the scope of the settlement's aftereffects but also to express the potential impact of settlement on future business states in a quantitative and structured manner, providing richer and more accurate input for the subsequent compliance measurement engine and improving the accuracy of settlement credibility scoring and the reliability of risk prediction.

[0111] This application further proposes a method for matching and determining the state change flag corresponding to each entity node based on the state transition rule set and the type of settlement triggering event, specifically including the following steps: Based on the type of settlement trigger event, a subset of applicable state transition rules is selected from the state transition rule set. The type of settlement trigger event specifies the business nature of the current settlement operation, such as "purchase order settlement," "sales invoice settlement," or "return settlement." Its purpose is to provide contextual information for subsequent state transition rule matching, ensuring that only rules relevant to the current business scenario are considered. This can be achieved through identification of specific fields in the event message or classification using predefined event codes from the event source. The state transition rule set is a collection of predefined logical rules used to describe how the state of an entity node should transition from one state to another when a specific business event occurs. Its purpose is to guide the prediction of the future state of business elements. This can be implemented as a rule table stored in a database, containing fields such as rule ID, trigger condition, pre-change state, and post-change state. Alternatively, it can be a rule library configured by business experts based on a rule engine, supporting conditional logic and action definitions. Selecting a subset of applicable state transition rules aims to narrow the matching scope and improve matching efficiency and accuracy by selecting rules directly related to the type of settlement trigger event from the large state transition rule set. This can be achieved by querying rules in the rule set that match the event type field, or by using a pre-established index relationship between event types and rule subsets for fast retrieval.

[0112] For each entity node in the sorted and connected valid subgraph elements, the current attribute combination of the entity node is checked sequentially. The sorted and connected valid subgraph elements refer to the entity nodes and relation edges identified as being affected by the settlement trigger event after temporal topological sorting and logical connection during the generation of the future influence subgraph; their role is to serve as the target objects for determining state change markers. The current attribute combination of an entity node refers to the set of all attributes and their corresponding values ​​that the entity node currently possesses in the temporal knowledge graph. For example, an "inventory product" entity node may contain attributes such as "current quantity," "batch number," "expiration date," and "storage location," which provide the actual state information of the entity node before the settlement trigger event occurs, serving as input for state transition rule matching. This can be achieved by traversing the entity node object to obtain all its stored attribute key-value pairs, or by calling the knowledge graph query interface to obtain all attribute data of a specified entity node. Sequential checking means processing each entity node in each valid subgraph element one by one to ensure that all entity nodes that may undergo state changes are included in the process of determining state change markers. This can be achieved by iterating through the list of entity nodes in the set of valid subgraph elements, or by using a parallel processing mechanism to assign an independent inspection task to each entity node.

[0113] The process involves matching the current attribute combination of an entity node against the triggering conditions of each rule in the state transition rule subset. The triggering condition is a set of logical expressions defined in the state transition rule, used to determine whether the current attribute combination of the entity node satisfies the conditions for a state transition, such as "inventory quantity < 0" or "order status = pending shipment." Its function is to determine whether a state transition rule applies to the current entity node. This can be achieved by parsing the conditional expressions in the rules and comparing them with the attribute values ​​of the entity node, or by using the built-in matching mechanism of the rule engine, taking entity attributes as input and evaluating the triggering conditions. Matching involves comparing the current attribute combination of the entity node with the triggering conditions of each rule in the state transition rule subset to determine if there are any rules that meet the conditions. Its function is to identify the state transition rules applicable to the current entity node. This can be achieved by iteratively traversing each rule in the rule subset and evaluating the triggering conditions of each rule, or by building data structures such as indexes or decision trees to accelerate the matching process.

[0114] When a match is successful, the changed state defined by the matching rule is used as the state change marker for the entity node. The changed state is a pre-defined state in the state transition rule that the entity node should reach when the triggering condition is met. For example, if "Order Status = Pending Shipment" matches successfully, the changed state might be "Shipped." Its purpose is to clearly indicate the expected state change of the entity node after settlement. This can be achieved by directly extracting the pre-defined changed state value from the matched rule definition, or by calculating a new state value based on the current attribute combination according to the calculation logic defined in the rule. The state change marker is a label or attribute attached to the entity node to indicate how its state is expected to change after the settlement trigger event occurs. For example, "Status: From Pending to Completed." Its purpose is to intuitively represent the expected changes in various business elements in the subgraph, providing a basis for subsequent compliance measurements. This can be achieved by directly using the changed state value as the marker, or by combining the pre-change state and the changed state into a single string as the marker.

[0115] When no matching occurs, a default flag is assigned to an entity node to indicate no state change. This default flag is a preset flag assigned to an entity node when its current attribute combination fails to match any state transition rule, indicating that the entity node's state is not expected to change due to the current settlement trigger event; for example, "State: No change". Its purpose is to ensure that each entity node in the future subgraph has a clear indication of state change, avoiding missing information and ensuring the integrity of the subgraph. This can be implemented as a fixed string constant, such as "remain unchanged" or "no impact", or as a specific enumeration value indicating that no state change was detected.

[0116] By employing the aforementioned technical solution and filtering applicable state transition rule subsets based on the type of settlement trigger event, the rules used are ensured to be highly relevant to the current business scenario, avoiding interference from irrelevant rules and improving matching efficiency and accuracy. Each entity node in the sorted and connected effective subgraph elements is sequentially checked for its current attribute combination, comprehensively acquiring real-time state data of the entity nodes, providing a solid foundation for subsequent accurate matching. Matching the current attribute combination of the entity node with the triggering conditions of each rule in the state transition rule subset enables precise identification of potential state changes. When a match is successful, the changed state defined by the successfully matched rule is directly used as the state change marker for the entity node, accurately reflecting the expected changes in business elements and improving the prediction accuracy of the future impact subgraph. Furthermore, when no rule matches, a default marker representing no state change is determined for the entity node, effectively preventing the omission of state markers and ensuring the integrity of the future impact subgraph. This allows the compliance measurement engine to conduct settlement credibility assessment based on a more comprehensive and reliable future impact subgraph, thereby improving the accuracy and credibility of settlement decisions.

[0117] This application further proposes inputting the historical basis subgraph and the future impact subgraph into a compliance measurement engine linked to a temporal knowledge graph to obtain a quantified settlement credibility score. See [link to relevant documentation]. Figure 4 Specifically, it includes: 401. Input the historical basis subgraph and the future impact subgraph into the compliance measurement engine linked with the temporal knowledge graph. The compliance measurement engine performs graph pattern matching between the future impact subgraph and the historical compliance settlement template to obtain the basic structure similarity. It also calculates the difference in the key numerical attributes of the corresponding nodes in the future impact subgraph and the historical compliance settlement template to obtain the basic numerical deviation.

[0118] 402. The compliance measurement engine extracts the completeness indicators of historical paths and the distribution characteristics of historical decision results from the historical evidence subgraph. The completeness indicators of historical paths are used to quantify the completeness of the historical evidence chain supporting this settlement, and the distribution characteristics of historical decision results are used to characterize the statistical regularity of the final risk assessment results of similar historical settlements.

[0119] 403. The basic structural similarity and basic numerical deviation are fused at the first level through the compliance measurement engine to generate a preliminary risk estimate. The preliminary risk estimate is then dynamically corrected and calibrated using the completeness indicators of historical paths and the distribution characteristics of historical decision results.

[0120] 404. The risk estimate after dynamic correction and calibration is fused and normalized with the historical risk performance statistics of similar events to the settlement trigger event recorded in the temporal knowledge graph through the compliance measurement engine to obtain the settlement credibility score.

[0121] The historical basis subgraph and future impact subgraph are input into a compliance measurement engine that is linked to the temporal knowledge graph. This compliance measurement engine is a computational module specifically designed to assess business compliance and risk; it receives and processes structured information from the temporal knowledge graph. Its role is to provide a unified platform for multi-dimensional analysis and quantitative evaluation of complex business data. In practical applications, the compliance measurement engine can be deployed as a standalone microservice, receiving historical basis and future impact subgraph data via an API interface. Alternatively, it can be a built-in component of the temporal knowledge graph, directly accessing the graph data through an internal data bus or shared memory mechanism.

[0122] By using a compliance metrics engine to perform graph pattern matching between the future impact subgraph and the historical compliance settlement template, the basic structure similarity is obtained. This step aims to assess the degree of structural conformity between the future business state (represented by the future impact subgraph) that the current settlement trigger event may cause and the preset, verified compliance business model (historical compliance settlement template).

[0123] The difference between the key numerical attributes of the corresponding nodes in the future impact subgraph and the historical compliance settlement template is calculated to obtain the basic numerical deviation. This step is used to quantify the specific numerical differences between the future impact subgraph and the historical compliance settlement template in key business data.

[0124] The completeness index of historical paths is extracted from the historical evidence subgraph. This index is used to quantify the completeness of the historical evidence chain supporting this settlement. Its purpose is to assess whether the business processes contained in the historical evidence subgraph are complete and whether any key links are missing.

[0125] The historical decision-making results are extracted from the historical basis subgraph, and these characteristics are used to characterize the statistical regularity of the final risk assessment results of similar historical settlements. Its purpose is to provide historical experience as a reference, understanding what risk assessment conclusions were typically reached in similar business scenarios in the past.

[0126] The basic structural similarity and basic numerical deviation are fused at the first level to generate a preliminary risk estimate. This fusion step aims to comprehensively consider the structural compliance and numerical accuracy of future impacts to form a preliminary judgment on the current settlement risks.

[0127] The initial risk estimate is dynamically revised and calibrated using the completeness index of historical paths and the distribution characteristics of historical decision results. This revision step aims to incorporate the quality of historical evidence and historical experience to adjust the initial risk estimate, making it closer to the actual risk level. For example, if the historical path completeness index is low, indicating an incomplete historical evidence chain, the initial risk estimate can be appropriately increased. If the distribution characteristics of historical decision results show that the historical risk of similar settlements is high, the initial risk estimate can also be adjusted upwards. The revision method can employ a revision factor multiplication, where a revision factor is calculated based on the completeness index and distribution characteristics, and then multiplied by the initial risk estimate. Alternatively, a machine learning model can be trained, taking the initial risk estimate, completeness index, and distribution characteristics as input, and outputting the revised risk value.

[0128] The dynamically revised and calibrated risk estimate is then fused and normalized in a second stage with historical risk performance statistics of similar events to the settlement trigger event recorded in the temporal knowledge graph. This results in a settlement credibility score. This fusion step aims to combine the specific risk assessment of this settlement with more macroscopic and comprehensive historical risk data, thereby obtaining a more valuable and standardized final score. Historical risk performance statistics may include the average risk value, risk fluctuation range, and frequency of risk events for similar settlements.

[0129] By employing the aforementioned technical solution, and through graph pattern matching and numerical difference calculation between the future impact subgraph and historical compliance settlement templates, the alignment between future business status and compliance patterns can be captured from both structural and numerical dimensions, providing an objective basis for risk assessment. Extracting completeness indicators of historical paths and distribution characteristics of historical decision results from the historical basis subgraph allows the assessment process to fully consider the completeness of historical evidence and the statistical regularities of historical experience, avoiding the limitations of relying solely on current data. Furthermore, by combining structural similarity and numerical deviation through first-level fusion, a preliminary risk estimate is formed. This estimate is then dynamically corrected and calibrated using the completeness of historical evidence and the distribution of historical decisions, making the risk assessment more refined and personalized. The corrected risk estimate is then fused and normalized with the historical risk performance statistics of similar events through second-level fusion. This not only introduces a wider range of historical data for reference but also ensures the standardization and comparability of the final settlement credibility score. This multi-level integration and dynamic correction mechanism makes the calculation process of settlement credibility score more comprehensive, accurate and reliable, improves the accuracy of risk prediction and the reliability of decision-making basis, thereby effectively supporting the automation and intelligence of pharmaceutical procurement and sales reconciliation and reducing potential business risks.

[0130] This application further proposes a method for extracting the completeness index of historical paths and the distribution characteristics of historical decision results from historical basis subgraphs using a compliance measurement engine. Specifically, this includes: parsing all entity node sequences connected by the time-series dependency path from the historical basis subgraph using the compliance measurement engine, and identifying nodes belonging to predefined key business document types within these entity node sequences. Based on the occurrence of nodes of this predefined key business document type in the entity node sequence, the completeness index of the historical path is calculated. The historical settlement conclusion attributes associated with each entity node are obtained from the historical basis subgraph using the compliance measurement engine. These historical settlement conclusion attributes are then categorized, aggregated, and statistically analyzed to obtain the quantity distribution and proportion of different conclusion types, forming the distribution characteristics of the historical decision results.

[0131] Specifically, when parsing the sequence of entity nodes connected by time-dependent paths, the compliance metric engine can utilize graph traversal algorithms, such as Depth-First Search (DFS) or Breadth-First Search (BFS), to traverse the effective relation edges defined by the time-dependent paths, starting from the activated entity nodes in the historical basis subgraph. During the traversal, the engine collects all visited entity nodes and constructs an ordered sequence of entity nodes according to their chronological order on the time-dependent paths. Alternatively, the compliance metric engine can use path query languages ​​(such as Cypher or Gremlin) to perform pattern matching in the historical basis subgraph to identify entity node sequences that conform to specific time constraints and topological structures. These sequences represent the chronological order of events in the business process, ensuring that the parsed data has a clear temporal logic.

[0132] When identifying nodes in an entity node sequence that belong to a predefined critical business document type, the compliance measurement engine performs type matching for each entity node against a pre-defined list of critical business document types. For example, this list might include "Purchase Order," "Warehouse Receipt," "Invoice," and "Payment Voucher." If an entity node's type attribute matches any type in the list, the node is identified as a node of the critical business document type. Alternatively, a machine learning model can be used to classify the text description or metadata of entity nodes to identify whether they belong to a predefined critical business document type. This model can be trained on historical data, thereby improving the accuracy and robustness of the identification.

[0133] When calculating the completeness metric for historical paths, this compliance metric engine compares the occurrence of identified key business document types' nodes in the entity node sequence with the expected key business process template. For example, an ideal business process could be defined as a sequence of key documents (e.g., "Purchase Order -> Warehouse Receipt -> Invoice -> Payment Voucher"), and then the number of missing key documents in the actual sequence could be counted, or the proportion of actual key documents appearing relative to the expected total number of key documents could be calculated. Another approach is to assign different weights to different key business document types; for example, "Invoice" might have a higher weight than "Warehouse Receipt." Then, based on the key documents appearing in the actual sequence and their weights, a weighted score is calculated and normalized to reflect the completeness of the historical path.

[0134] When retrieving historical settlement conclusion attributes associated with each entity node, the compliance measurement engine extracts these attributes from each entity node in the historical basis subgraph. These attributes are typically stored in the entity node's metadata, such as "settlement status," "risk level," or "compliance judgment result." These attributes reflect the final processing results of the entity's past participation in settlement activities. In some cases, if an entity node in the historical basis subgraph does not directly contain settlement conclusion attributes, the compliance measurement engine can query external settlement history databases or archives using the entity node's unique identifier to obtain the historical settlement conclusions associated with that entity.

[0135] When classifying and aggregating historical settlement conclusion attributes to obtain the quantity distribution and proportion of different conclusion types, thus forming the distribution characteristics of historical decision results, the compliance measurement engine classifies all acquired historical settlement conclusion attributes, such as into categories like "compliant," "non-compliant," "risky," and "pending." Then, it counts the number of each category and calculates its proportion in all historical settlement conclusions. These quantities and proportions together constitute the distribution characteristics of historical decision results. For more detailed analysis, the compliance measurement engine can further aggregate and statistically analyze these classification results over time, such as statistically analyzing the distribution trends of different conclusion types by month or quarter, thereby revealing the dynamic evolution of historical decision-making patterns.

[0136] Through the aforementioned technical solution, the compliance measurement engine parses all entity node sequences connected by time-dependent paths from the historical evidence subgraph, ensuring the temporal logic and business relevance of the extracted information and avoiding interference from irrelevant data. Based on this, nodes belonging to predefined key business document types are identified, allowing the assessment of historical path completeness to focus on core business vouchers crucial to settlement compliance, improving the relevance and accuracy of the assessment. The calculation of historical path completeness indicators based on the occurrence of these key nodes provides a quantitative and objective measurement method, enabling precise measurement of the completeness of the historical evidence chain. Simultaneously, by acquiring the historical settlement conclusion attributes associated with each entity node and classifying and aggregating them statistically, the statistical patterns of risk assessment results for similar historical settlements can be clearly displayed, providing solid historical experience support for subsequent risk prediction. These precisely extracted indicators and features, as key inputs for the compliance measurement engine to calculate settlement credibility scores, can effectively correct and calibrate preliminary risk estimates, making the final settlement credibility score more accurate and reliable, thereby providing more insightful decision-making basis for pharmaceutical procurement and sales reconciliation.

[0137] This application further proposes a first-level fusion of basic structural similarity and basic numerical deviation using a compliance measurement engine to generate a preliminary risk estimate. Specifically, this includes: assigning weights to basic structural similarity and basic numerical deviation using the compliance measurement engine, and setting a risk benchmark threshold for the fusion result. These weights and the risk benchmark threshold are trained based on the correlation between historical compliant settlement templates and historical settlement results. The compliance measurement engine then performs a weighted calculation on the basic structural similarity and basic numerical deviation according to the assigned weights to obtain a weighted fusion result. Finally, the weighted fusion result is compared with the risk benchmark threshold, and the comparison result is mapped to a preliminary risk estimate.

[0138] The weighting of basic structural similarity and basic numerical deviation refers to assigning different importance coefficients to different input indicators to reflect their relative contributions to the comprehensive assessment. This ensures that when multiple indicators are integrated, they can be differentiated according to their impact on the final risk assessment. For example, expert experience can be used, where business experts manually set the weights of each indicator based on their understanding of the risks in pharmaceutical procurement and sales. Alternatively, machine learning methods can be employed, such as regression analysis or decision tree models, using compliance results from historical settlement data as labels and basic structural similarity and basic numerical deviation as features for training. The feature coefficients or importance scores learned by the model can then be used as weights. Simultaneously, setting a risk benchmark threshold for the integration result is a critical value used to determine whether the integration result reaches a specific risk level. Its function is to provide a quantitative standard, enabling the automatic discretization of continuous integration results into different risk levels or decision intervals. For example, risk management personnel can manually set one or more risk benchmark thresholds based on business experience or industry standards. Alternatively, the risk benchmark threshold can be determined using statistical methods by statistically analyzing the distribution of integration results in historical settlement data and combining it with the probability of historical risk events.

[0139] Furthermore, the weights and risk benchmark thresholds are trained based on the correlation between the historical compliant settlement templates and the historical settlement results. This technical feature clarifies the acquisition method of the weights and risk benchmark thresholds, namely, through learning and training on historical data. Its purpose is to ensure that the assigned weights and set thresholds are objective, accurate, and adaptable, reflecting the risk patterns in actual business scenarios, avoiding subjective assumptions, and thus improving the reliability of preliminary risk estimates. Specifically, a large number of historical compliant settlement templates and corresponding historical settlement results can be collected. Then, using supervised learning algorithms, the basic structural similarity and basic numerical deviation are used as input features, and the historical settlement results are used as labels to train the model. During training, the model automatically learns and optimizes the weights, and the risk benchmark threshold can be determined based on the model's output probability or classification boundary. Alternatively, reinforcement learning methods can be used, with the weights and thresholds serving as the agent's action space. By simulating the historical settlement process and adjusting the weights and thresholds based on the final settlement results, the model can better identify risks.

[0140] Based on this, the compliance measurement engine performs a weighted calculation on the basic structural similarity and basic numerical deviation according to the assigned weights, resulting in a weighted fusion result. Weighted calculation is a common fusion method; it multiplies each indicator by its corresponding weight and then sums the results to obtain a comprehensive value, thus integrating information from different dimensions into a single metric while considering the differences in importance among the indicators. For example, the most direct method is linear weighted summation: Weighted Fusion Result = (Weight - Similarity × Basic Structural Similarity) + (Weight - Deviation × Basic Numerical Deviation). Alternatively, non-linear weighted fusion can be used, for example, by transforming the weighted sum using the Sigmoid or Tanh function to ensure the result falls within a specific range. The weighted fusion result is compared with a risk benchmark threshold, and the comparison result is mapped to a preliminary risk estimate. Comparison and mapping are the processes that transform continuous weighted fusion results into discrete, business-meaning preliminary risk estimates. Their purpose is to convert technical calculation results into risk levels or states that are easily understood and decided upon by business personnel. For example, a simple interval judgment can be used: if the weighted fusion result is higher than threshold 1, the preliminary risk estimate is "low risk". If the weighted fusion result is lower than or equal to threshold 2, it is "high risk". Alternatively, a probability mapping can be used to map the weighted fusion result to the probability of risk occurrence through a pre-trained probability model, i.e., the preliminary risk estimate.

[0141] Through the aforementioned technical solution and deep learning of historical data, the compliance measurement engine can objectively and accurately assign weights to basic structural similarity and basic numerical deviation, ensuring that the relative importance of different risk indicators in the assessment is reasonably reflected. Simultaneously, the risk benchmark thresholds trained on historical data provide a scientific and quantitative judgment standard for the weighted fusion results, enabling the preliminary risk estimate to more accurately reflect the potential risk level of the current settlement. This data-driven weight and threshold determination mechanism improves the accuracy and reliability of the preliminary risk estimate, providing a more solid foundation for subsequent risk correction and calibration, thereby effectively enhancing the risk prediction capability and decision-making credibility of the entire pharmaceutical procurement and sales reconciliation method.

[0142] This application further proposes a method for dynamically correcting and calibrating preliminary risk estimates using completeness indicators of historical paths and distribution characteristics of historical decision results. Specifically, this includes: using a compliance measurement engine based on predefined mapping rules or statistical models to convert historical path completeness indicators into path completeness coefficients and historical decision result distribution characteristics into historical success coefficients; using the compliance measurement engine to determine historical correction coefficients based on the path completeness coefficients and historical success coefficients; and using the compliance measurement engine to process the preliminary risk estimate using the historical correction coefficients to obtain a dynamically corrected and calibrated risk estimate.

[0143] Specifically, this compliance measurement engine is a core component of the pharmaceutical procurement and sales reconciliation method. It is responsible for quantitatively assessing settlement compliance, integrating multiple analysis modules to process graph data, perform comparisons, calculate indicators, and fuse them. In this embodiment, the engine is responsible for converting the completeness indicators of historical paths and the distribution characteristics of historical decision results into coefficients, and using these coefficients to dynamically correct and calibrate the preliminary risk estimate. This compliance measurement engine can be a rule-based and algorithm-based software module, pre-defined with mathematical models and logical processes for indicator conversion, coefficient calculation, and risk value correction. Alternatively, it can be an integrated machine learning model, for example, using regression models or neural networks to learn the complex relationship between indicators and risk correction in historical data, thereby achieving more intelligent conversion and correction.

[0144] This predefined mapping rule or statistical model is a mathematical or logical tool used to transform raw historical data characteristics (such as completeness indicators and distribution characteristics) into standardized, computable coefficients. It aims to ensure that historical information of different dimensions and scales can be uniformly incorporated into the risk correction framework. The mapping rule can be expressed as a simple lookup table, for example, mapping a range of completeness indicators to a specific path completeness coefficient value. Alternatively, it can be a set of conditional statements that directly output coefficients based on specific conditions of the indicators. The statistical model can include linear regression models, logistic regression models, decision tree models, or more complex machine learning models. These models are trained on historical data to learn how to transform input indicators (such as historical path completeness indicators and distribution characteristics of historical decision results) into output coefficients (such as path completeness coefficients and historical success coefficients).

[0145] The completeness metric of this historical path is a quantitative measure of the completeness of the historical evidence chain supporting this settlement. It reflects whether all key business links and documents from the business initiation point to the settlement trigger point are complete and logically coherent. It is used to assess the reliability and sufficiency of historical evidence; the more complete the evidence chain, the higher the compliance of the settlement it supports. This metric can be obtained by calculating the coverage of key nodes (such as purchase orders, warehouse receipts, invoices, and payment vouchers) in the historical basis subgraph. For example, a list of key documents can be preset, and the ratio of the number of key documents appearing in the subgraph to the total number in the list can be calculated. Alternatively, it can be obtained by assessing the connectivity or depth of the historical basis subgraph. For example, an ideal business process path can be defined, and then the matching degree or deviation between the actual subgraph and the ideal path can be calculated.

[0146] The path completeness coefficient is a standardized value obtained by transforming historical path completeness indices through predefined mapping rules or statistical models. It typically ranges from 0 to 1 and is used directly in subsequent correction calculations. Its purpose is to transform the original completeness index into a unified, operational factor for mathematical operations with the initial risk estimate. For example, if the completeness index is a percentage from 0 to 100, the path completeness coefficient can be directly calculated by dividing that percentage by 100. Alternatively, a non-linear function (such as the sigmoid function) can be used to map the completeness index to the 0-1 range to reflect its non-linear impact on risk correction.

[0147] The distribution characteristics of historical decision results describe the statistical regularity of the final risk assessment results of similar historical settlements. It reflects the distribution of success rates, failure rates, or different risk levels in past settlements under similar business scenarios, aiming to provide historical experience as a reference to help determine whether the risk level of the current settlement conforms to historical norms. These distribution characteristics can be expressed as the quantity or proportion distribution of different settlement conclusions (such as "compliant," "partially compliant," and "non-compliant"). For example, in the past 100 similar settlements, 80% were compliant and 20% were non-compliant. Alternatively, it can be statistical measures such as the mean, median, and standard deviation of historical settlement risk scores, or their probability density function.

[0148] The historical success coefficient is a standardized value, typically between 0 and 1, obtained by transforming the distribution characteristics of historical decision outcomes through predefined mapping rules or statistical models. It is used directly in subsequent correction calculations, aiming to transform complex historical decision distribution information into a concise and operable factor that reflects the corrective effect of historical experience on current risks. For example, it could be the proportion of historical compliant settlements, directly used as the success coefficient. Alternatively, a weighted average or expert analysis can be used to synthesize the distribution characteristics of different risk levels into a single success coefficient; for example, a high compliance rate corresponds to a high success coefficient, and a high risk rate corresponds to a low success coefficient.

[0149] The historical correction coefficient is an adjustment factor determined by comprehensively considering the path completeness coefficient and the historical success coefficient. It is used to make multiplicative or additive adjustments to the initial risk estimate, aiming to integrate the completeness of historical evidence and the statistical regularity of historical decisions to form a comprehensive correction factor to improve the accuracy of risk prediction. This coefficient can be the product of the path completeness coefficient and the historical success coefficient, or their weighted average. Alternatively, it can be calculated using a pre-trained machine learning model that takes the path completeness coefficient and the historical success coefficient as input and outputs the historical correction coefficient.

[0150] This dynamic correction and calibration refers to the process of adjusting the initial risk estimate based on historical correction coefficients to more accurately reflect the actual risk of the current settlement. The aim is to improve the accuracy and reliability of risk estimates, enabling them to dynamically adapt to different historical evidence and decision-making contexts. This correction process can be a simple multiplicative correction, for example, corrected risk estimate = initial risk estimate × historical correction coefficient (if the historical correction coefficient is designed as an adjustment ratio). Alternatively, it can be a more complex functional relationship, for example, corrected risk estimate = f(initial risk estimate, historical correction coefficient), where f is a predefined mathematical function or model.

[0151] Through the aforementioned technical solutions, the compliance measurement engine, based on predefined mapping rules or statistical models, transforms the completeness indicators of historical paths into path completeness coefficients. This allows the completeness of the historical evidence chain to be quantified and used in the correction process, avoiding the incompatibility caused by directly using the original indicators. Simultaneously, the distribution characteristics of historical decision results are transformed into historical success coefficients, enabling the operationalization of the statistical regularities of historical decisions and their use for calibration, ensuring the effective integration of decision distribution characteristics. The compliance measurement engine determines historical correction coefficients based on the path completeness coefficients and historical success coefficients. This integrates the influence of historical evidence completeness and decision distribution, generating a dynamic adjustment factor that reflects the synergistic effect of both in correcting risk estimates. By applying the historical correction coefficients to the preliminary risk estimate through the compliance measurement engine, a dynamically corrected and calibrated risk estimate is obtained. This directly adjusts the preliminary value to reflect historical factors, solving the problem of the preliminary risk value being isolated from historical evidence. This improves the accuracy and reliability of risk estimates, making settlement credibility scoring more accurate, and thus providing a more solid and convincing basis for subsequent handling operations.

[0152] This application further proposes a pharmaceutical procurement and sales reconciliation method based on identifier matching and comparison. In this method, a compliance measurement engine performs a second-level fusion and normalization with historical risk performance statistics of similar events to the settlement trigger event recorded in a temporal knowledge graph, resulting in a settlement credibility score. Specifically, this process includes: querying historical risk performance statistics of similar events to the settlement trigger event from the temporal knowledge graph using the compliance measurement engine; determining fusion weights based on the central tendency and dispersion of the historical risk performance statistics using the compliance measurement engine; and performing a weighted fusion calculation between the dynamically corrected and calibrated risk estimate and the historical risk performance statistics to obtain a fused risk value; and mapping the fused risk value to a pre-defined scoring scale based on business rules using the compliance measurement engine to obtain the settlement credibility score.

[0153] The compliance measurement engine queries the temporal knowledge graph for historical risk performance statistics of events similar to the settlement trigger event. This aims to obtain risk data with similar business attributes and historical background to the current settlement event being assessed. This can be achieved in several ways. For example, the compliance measurement engine can perform multi-dimensional queries in the temporal knowledge graph based on dimensions such as the type of settlement trigger event (e.g., procurement settlement, sales settlement, return settlement), the involved business entities (e.g., suppliers, buyers), transaction amount range, and product category, retrieving all historical settlement events that meet these conditions and have occurred and been processed. Another approach is for the compliance measurement engine to utilize a predefined event similarity model. By calculating the feature vector distance or semantic similarity between the current settlement trigger event and historical events, it can filter out the most relevant set of historical events and extract their risk performance statistics. These statistics can include the average risk score of historical settlements, the frequency of risk events, and the distribution ratio of different risk levels.

[0154] The compliance metrics engine determines the fusion weights based on the central tendency and dispersion of historical risk performance statistics to reasonably allocate the importance of historical data and current estimated values ​​during the fusion process. Central tendency can refer to the mean, median, or mode of historical risk performance, reflecting the typical level of historical risk. Dispersion can refer to the standard deviation, variance, or interquartile range of historical risk performance, reflecting the volatility and uncertainty of historical risk. For example, when the dispersion of historical risk performance is small, indicating that the risk performance of similar events is relatively stable and predictable, the compliance metrics engine can assign a higher fusion weight to the historical risk performance statistics to enhance the stability of the score. Conversely, if the dispersion is large, indicating strong historical risk volatility, the weight of historical data can be appropriately reduced, or a more complex adaptive weight adjustment mechanism can be introduced to avoid historical outliers having an excessive impact on the current assessment.

[0155] The key step in combining the pre-corrected risk assessment result with historical risk performance statistics is to calculate the fused risk value by weighting and integrating the dynamically revised and calibrated risk estimate with historical experience. This is typically achieved through a weighted average, for example, fused risk value = W1 × dynamically revised and calibrated risk estimate + W2 × historical risk performance statistics, where W1 and W2 are the fusion weights determined based on the aforementioned central tendency and dispersion, and W1 + W2 = 1. Alternatively, more complex fusion algorithms, such as Bayesian fusion and fuzzy logic fusion, can be used to better handle uncertainty and the integration of multi-source information.

[0156] The compliance measurement engine maps convergence risk values ​​to settlement credibility scores using pre-defined scoring scales based on business rules. This transforms internally calculated convergence risk values ​​into a final score easily understood and manipulated by business personnel. The scoring scale can be linear (e.g., 0-100 points), graded (e.g., high risk, medium risk, low risk), or use a specific risk index. For example, the compliance measurement engine can pre-define a series of thresholds, dividing convergence risk values ​​into different intervals, each corresponding to a settlement credibility score level. Alternatively, a mapping function can be used to convert continuous convergence risk values ​​into credibility scores within a specific range. These business rules and scoring scales are typically developed collaboratively by business experts based on industry standards, corporate risk appetite, and historical experience to ensure the practicality and guidance of the scoring results.

[0157] Through the aforementioned technical solution, this application deeply integrates the pre-corrected and calibrated risk estimate with historical risk performance statistics of similar events recorded in a temporal knowledge graph, resolving potential biases in the preliminary risk assessment. By querying historical risk performance statistics, rich historical background and experience support are provided for the current settlement assessment, ensuring that the settlement credibility score is no longer an isolated, static judgment, but a dynamic assessment incorporating long-term trends and historical patterns. The fusion weights are dynamically determined based on the central tendency and dispersion of historical data, ensuring the reasonable participation of historical experience in the assessment and avoiding assessment distortion caused by historical data volatility or uncertainty, thereby improving the reliability and robustness of the settlement credibility score. By mapping the fused risk value to a preset scoring scale, the assessment results become more business-interpretable and operable, providing a more comprehensive and accurate decision-making basis for subsequent handling operations.

[0158] This application further proposes a method for performing processing operations corresponding to the settlement credibility score, see [link to relevant documentation]. Figure 5 Specifically, it includes: 501. Compare the settlement credibility score with the preset settlement execution threshold.

[0159] 502. If the settlement credibility score is higher than the settlement execution threshold, a settlement execution instruction will be generated.

[0160] 503. Based on the settlement execution instruction, trigger the fund settlement operation corresponding to the settlement trigger event, generate a settlement evidence package, and submit the settlement evidence package to the blockchain network for storage. The settlement evidence package includes the historical basis subgraph, the future impact subgraph, and the settlement credibility score.

[0161] 504. If the settlement credibility score is lower than or equal to the settlement execution threshold, a settlement blocking instruction will be generated.

[0162] 505. Based on the settlement blocking instruction, terminate the process corresponding to the settlement triggering event, generate and output a risk warning report, which includes an abnormal settlement credibility score and key risk node identifiers related to the settlement credibility score.

[0163] The settlement credibility score is a quantitative indicator assessing the compliance and risk level of settlements. Its value typically ranges from 0 to 100, or is represented as a probability value from 0 to 1. A higher value indicates better compliance and lower risk. The settlement execution threshold is a pre-set critical value used to determine whether a settlement can be automatically executed. This threshold can be set as a fixed value, such as 80 points, based on historical data analysis and expert experience. Alternatively, it can be dynamically adjusted according to different business types and risk levels; for example, a threshold of 90 points could be set for high-risk businesses, while 75 points could be set for routine businesses. Comparing the settlement credibility score with the settlement execution threshold is the first step in automated decision-making; a simple numerical comparison can determine whether the current settlement meets the execution conditions.

[0164] When the settlement credibility score exceeds the settlement execution threshold, a settlement execution instruction will be generated. This instruction is an internal signal or message carrying authorization information allowing the current settlement to continue. The instruction can be a structured data packet containing key information such as the settlement ID, amount, and participating parties, used to drive subsequent fund settlement operations. Based on this settlement execution instruction, the fund settlement operation corresponding to the settlement trigger event will be triggered. This fund settlement operation refers to the actual fund transfer, accounting record update, and other financial processing procedures. The triggering method can be by calling the enterprise financial management or bank's API interface, passing the key information in the settlement instruction to these external entities to complete the fund transfer. Alternatively, a batch of settlement files to be processed can be generated, which the finance department can periodically scan and execute the settlement tasks within.

[0165] After the fund settlement operation is completed, a settlement evidence package is generated. This settlement evidence package is a data set containing all key information of this settlement decision, designed to provide complete audit trails and decision-making basis. The settlement evidence package includes a historical basis subgraph, a future impact subgraph, and a settlement credibility score. The historical basis subgraph provides historical traceability evidence of the settlement decision, proving the compliance basis of the settlement. The future impact subgraph reveals the potential impact of this settlement on future business status, helping to assess the comprehensiveness of the decision. The settlement credibility score directly reflects the risk assessment results of this settlement. Submitting the settlement evidence package to the blockchain network for notarization leverages the immutable and decentralized characteristics of blockchain technology to ensure the authenticity, integrity, and long-term validity of the settlement evidence. Specifically, this can be achieved by writing the hash value of the settlement evidence package as transaction data into the blockchain, leaving an indelible record on the chain. Alternatively, the settlement evidence package itself can be encrypted and stored in off-chain distributed storage, with its storage address and access credentials recorded on the blockchain to ensure traceability.

[0166] Conversely, if the settlement credibility score is lower than or equal to the settlement execution threshold, a settlement blocking instruction will be generated. This instruction is an internal signal or message that instructs the immediate cessation of the current settlement process to prevent potential risks. This instruction can be a process control signal with an abort flag, used to notify relevant business modules to stop further processing. Based on this settlement blocking instruction, the process corresponding to the settlement trigger event will be aborted. The process can be aborted by updating the process status to "aborted" or "pending manual review," thereby preventing the automated process from continuing. Alternatively, an interrupt signal can be sent to the process engine to terminate the current process instance. Simultaneously, a risk warning report will be generated and output. This risk warning report is a detailed document designed to provide relevant personnel (such as risk control departments and business managers) with details of the risks associated with this settlement. The risk warning report includes the abnormal settlement credibility score and identifiers of key risk nodes related to that score. Anomaly settlement credibility scores directly indicate the degree of risk quantification, while key risk node identifiers accurately locate the specific entity nodes in the knowledge graph that cause the risk, such as an abnormal purchase order number, logistics batch number, or fund transfer record, thereby assisting manual investigation and intervention.

[0167] Through the aforementioned technical solutions, this application enables automated and intelligent processing of pharmaceutical procurement and sales settlements. When the settlement credibility score is high, settlement execution instructions are automatically generated and fund settlement operations are triggered, improving settlement efficiency. Simultaneously, by generating a settlement evidence package containing historical basis subgraphs, future impact subgraphs, and settlement credibility scores, and submitting it to a blockchain network for evidence storage, the transparency, traceability, and immutability of the settlement decision-making process are ensured, greatly enhancing audit capabilities and the credibility of decisions. When the settlement credibility score is low, settlement blocking instructions are generated promptly, effectively halting risky settlement processes and avoiding potential financial losses and compliance risks. Furthermore, the generated risk warning report not only provides abnormal settlement credibility scores but also accurately identifies key risk-related nodes, enabling rapid and accurate identification of the root cause of problems through manual intervention, thereby optimizing risk control strategies and improving the overall robustness of business operations. This two-way, quantitatively assessed processing mechanism solves the problems of settlement execution security and traceability, and improves the risk blocking and reporting capabilities for low-scoring settlements, providing more reliable and efficient automated decision support for pharmaceutical procurement and sales reconciliation.

[0168] This application further proposes that the method also includes: archiving the final settlement conclusion, settlement evidence package, or risk warning report determined after the execution of the disposal operation to a case knowledge base associated with the temporal knowledge graph. From the case knowledge base, for cases with successful settlement conclusions, extract the stable compliant business patterns that appear in the future impact subgraph of the case. For cases with failed settlement conclusions or those involving risks, extract the risky business patterns representing conflicts or anomalies from the future impact subgraph of the case. Use the extracted compliant business patterns as positive samples to enrich the historical compliant settlement template or generate new auxiliary verification templates. Use the extracted risky business patterns as negative samples to enhance the risk triggering conditions in the state transition rule set. In subsequent settlement triggering events, when calculating the settlement credibility score, the compliance measurement engine synchronously calls the newly generated auxiliary verification template and the enhanced risk triggering conditions to participate in the graph pattern matching and dynamic correction calibration process.

[0169] Specifically, after executing the disposal operation, a final settlement conclusion is generated, which can be settlement success, settlement failure, or requiring manual intervention. Simultaneously, a settlement evidence package is generated, containing a historical basis subgraph, a future impact subgraph, and a settlement credibility score. This information collectively constitutes a complete record of this settlement. If the settlement credibility score is lower than or equal to the settlement execution threshold, a risk warning report is also generated, containing the abnormal settlement credibility score and the identifier of key risk nodes related to that score. These final settlement conclusions, settlement evidence packages, or risk warning reports are archived in a case knowledge base associated with the temporal knowledge graph. This case knowledge base can be a structured database, such as a relational database or graph database, used to store and manage historical settlement case data, or it can be a distributed file logically linked to the temporal knowledge graph through metadata indexing. The archiving operation ensures that detailed information for each settlement is systematically saved, providing a data foundation for subsequent learning and analysis.

[0170] The system analyzes archived cases from the case knowledge base. For cases with successful settlements, it extracts consistently occurring compliant business patterns from their corresponding future impact subgraphs. These compliant business patterns refer to graph structures or node attribute combinations that repeatedly appear in multiple successful settlements and conform to business specifications, such as specific fund flow paths, document approval sequences, or inventory status changes. The extraction process can be implemented using graph pattern mining algorithms, such as frequent subgraph mining, graph neural network analysis, or rule-based pattern recognition, to identify statistically significant compliant patterns. For cases with failed settlements or those involving risk, it extracts risky business patterns representing conflicts or anomalies from their corresponding future impact subgraphs. These risky business patterns refer to graph structures or node attribute combinations that deviate from normal business processes in abnormal settlements, such as abnormal fund retention, missing documents, or negative inventory values. The extraction process can also employ graph pattern mining, anomaly detection algorithms, or expert rule matching to identify risk-related patterns.

[0171] The extracted compliant business patterns are used as positive samples to optimize the historical compliant settlement template or generate new auxiliary verification templates. This historical compliant settlement template serves as the foundation for graph pattern matching with future impact subgraphs. Integrating new compliant patterns into existing templates enriches their coverage and accuracy; for example, by adding new node types, relationship edges, or attribute constraints, or by combining existing templates to generate more complex verification logic. Simultaneously, the extracted risky business patterns are used as negative samples to enhance the risk triggering conditions in the state transition rule set. This state transition rule set defines the conditions for entity nodes to transition between different business states. Transforming risk patterns into specific triggering conditions allows for earlier and more accurate identification of potential risks; for example, by adding new rules to detect specific abnormal graph structures or adjusting the thresholds of existing rules to improve sensitivity.

[0172] In subsequent settlement-triggered events, the compliance metrics engine, when calculating settlement credibility scores, simultaneously invokes the newly generated auxiliary verification template and enhanced risk trigger conditions to participate in the graph pattern matching and dynamic correction calibration process. This means that when calculating infrastructure similarity, in addition to using the original historical compliance settlement template, the newly generated auxiliary verification template will also be considered for a more comprehensive comparison. Simultaneously, when dynamically correcting and calibrating the initial risk estimate, the enhanced risk trigger conditions will serve as additional judgment criteria, allowing for more refined adjustments to the risk estimate. This synchronous invocation mechanism ensures that knowledge learned from historical cases can be applied to new settlement assessments in real time.

[0173] Through the aforementioned technical solution, this application establishes a closed-loop self-learning and knowledge update mechanism. It can archive the actual results and detailed processes of each settlement as case knowledge, and automatically extract compliance and risk business patterns from them. These patterns are used to continuously optimize historical compliance settlement templates and state transition rule sets, enabling the compliance measurement engine to utilize more comprehensive and accurate knowledge for graph pattern matching and dynamic correction calibration in subsequent settlement credibility score calculations. This solves the problem of lacking an automatic learning and knowledge base update mechanism for historical cases, improving the accuracy and continuous improvement capabilities of settlement credibility assessment. By continuously learning and adapting from actual business, it can dynamically adapt to business changes, more accurately identify potential risks, and thus improve the overall risk prediction accuracy and decision-making quality.

[0174] The following example will provide a more detailed explanation of the above technical solution: In pharmaceutical procurement and sales, suppose User A, as a pharmaceutical distributor, needs to settle a monthly purchase of a batch of influenza vaccines with Supplier B. When User A's financial system generates a "Monthly Settlement Request for Influenza Vaccine Batch 2023-09-01", a settlement trigger event is triggered in the pharmaceutical supply chain.

[0175] In response to this settlement trigger event, retrieve the associated set of identifiers. This set of identifiers may include the purchase order number (e.g., PO-202308-005), delivery note number (e.g., DN-202308-010), receiving note number (e.g., WR-202308-015), and the expected payment transaction identifier corresponding to this settlement. These identifiers are crucial for subsequently locating relevant business entities in the temporal knowledge graph.

[0176] Based on the acquired set of identifiers, the system locates and activates corresponding entity nodes in a pre-constructed temporal knowledge graph. Specifically, the system determines the initial time range for entity node search based on the type of the settlement trigger event (e.g., "monthly settlement") and the event timestamp (e.g., September 30, 2023, 10:00:00). Within this time range, the system parses each identifier in the identifier set to obtain a set of entity keys, such as "Purchase Order PO-202308-005" and "Delivery Order DN-202308-010". The system uses these entity keys to perform node retrieval in the temporal knowledge graph, obtaining a set of candidate entity nodes. Subsequently, based on the valid state of the temporal dependency path (i.e., the effective and ineffective timestamps of the relation edges are valid at the event timestamp), the candidate entity nodes are filtered, and nodes on the valid path are identified as target entity nodes to be activated. For example, if Purchase Order PO-202308-005 has expired when the settlement event occurs, it will not be activated. Finally, the system updates the state attributes of these target entity nodes to active and establishes an association index between them and the current settlement trigger event. Unlike traditional database queries that can only retrieve current static data, this solution uses a temporal knowledge graph to ensure that the activated entity nodes and their relationships are real and valid when the settlement event occurs, avoiding misjudgments caused by data timeliness issues.

[0177] Using these activated entity nodes as anchor points, bidirectional graph reasoning is performed in the temporal knowledge graph along the temporal dependency path to generate a historical basis subgraph and a future influence subgraph.

[0178] When generating the historical basis subgraph, the system first determines the forward backtracking time window boundary (e.g., 90 days back) based on the event timestamp of the settlement trigger event and the business stage defined by the temporal dependency path (e.g., the "procurement settlement" stage). Starting from the activated entity node (e.g., purchase order PO-202308-005), the system performs a forward path traversal in the temporal knowledge graph along the temporal dependency path. For example, it traces back from the purchase order to its corresponding purchase application, supplier qualification review record, contract signing record, and then to the delivery note, warehouse receipt note, quality inspection report, etc. During the traversal, the system collects the accessed nodes and relationship edges. Then, the system applies pre-defined business association rules to perform causal association analysis on these collected nodes and relationship edges, filtering out candidate subgraph elements that have a direct causal logic with this settlement. For example, the quality inspection report of another batch of drugs unrelated to this influenza vaccine procurement will be excluded. The system further checks the association time attributes of these elements and the effective / ineffective timestamps of the relationship edges to determine whether they are within the valid time range defined by the forward backtracking time window boundary. For example, if a quality inspection report was generated before the 90-day retrospective period, it will not be included in the historical evidence. Ultimately, entity nodes and relationship edges within the valid time frame are identified as valid subgraph elements. Based on the time constraints defined in the time-series dependency paths, a time-series topological sorting and logical connection are performed to generate a historical evidence subgraph with source identifiers (e.g., "ERP system," "WMS system") and causal type markers (e.g., "preconditions," "constituent elements"). This historical evidence subgraph is used to represent business facts causally related to the current settlement before the time window boundary, thereby verifying the settlement's compliance. Unlike related technologies that can only perform static, post-hoc data verification, this solution can systematically trace and integrate a complete chain of compliance evidence scattered across multiple historical stages, providing comprehensive historical support for settlement compliance.

[0179] When generating the future impact subgraph, the system also determines the time window boundary for future projection (e.g., projection for 30 days) based on the event timestamp and business stage of the settlement trigger event. Starting with the activated entity node, the system performs a backward path traversal in the temporal knowledge graph along the temporal dependency path. For example, starting from the payment behavior of this settlement, it projects the potential impact on supplier B's accounts payable status, user A's inventory costs, future procurement plans, supplier credit ratings, etc. The system identifies all candidate subgraph elements that may be directly or indirectly affected by the current settlement, based on the type of the settlement trigger event and the pre-configured state transition rule set, of the nodes and relationship edges collected during the traversal. For example, it identifies that the status of the "Accounts Payable" entity node will change from "Pending Payment" to "Paid". The system further examines the current state attributes of these entity nodes and the effective / ineffective timestamps of the relationship edges to determine whether they meet the change conditions defined in the state transition rule set and are within the valid time range defined by the future projection time window boundary. Finally, entity nodes that meet the change conditions and their relational edges within the valid time range are identified as valid subgraph elements. Based on the time constraints and logical dependencies defined in the temporal dependency paths, causal topological sorting and logical connections are performed to generate a future impact subgraph with accompanying impact scope markers (e.g., "financial level," "inventory level") and state change markers (e.g., "state: pending payment -> paid"). This future impact subgraph characterizes business elements whose state will change after the current settlement is executed, following the time window boundary, thus describing the scope of the settlement's aftereffects. Unlike related technologies that lack the ability to predict risks in advance, this solution can quantitatively assess the potential impact of this settlement on future business states, providing a forward-looking decision-making basis.

[0180] The generated historical basis subgraph and future impact subgraph are input into a compliance measurement engine linked to a temporal knowledge graph to obtain a quantified settlement credibility score. The compliance measurement engine first performs graph pattern matching between the future impact subgraph and historical compliant settlement templates to obtain basic structural similarity. It then calculates the differences in key numerical attributes of corresponding nodes in the future impact subgraph and historical compliant settlement templates to obtain basic numerical deviation. For example, it compares the differences in business process structure and key amounts between the future impact subgraph of this settlement and the standard influenza vaccine settlement template. Simultaneously, the compliance measurement engine extracts completeness indicators of historical paths (e.g., whether the key document chain of this settlement is complete, such as whether purchase orders, delivery notes, warehouse receipts, and quality inspection reports are all present and linked) and distribution characteristics of historical decision results from the historical basis subgraph (e.g., what percentage of similar influenza vaccine settlements in the past were compliant, and what percentage were at risk). Next, the compliance measurement engine performs a first-level fusion of basic structural similarity and basic numerical deviation to generate a preliminary risk estimate, and dynamically corrects and calibrates the preliminary risk estimate using the completeness indicators of historical paths and the distribution characteristics of historical decision results. For example, if the completeness of the historical path is low, the initial risk estimate will be increased. Finally, the compliance measurement engine will perform a second-level fusion and normalization with the historical risk performance statistics of similar events (i.e., "monthly settlement of influenza vaccines") recorded in the temporal knowledge graph, to obtain the final settlement credibility score (e.g., 0-100 points). Compared with existing methods that rely heavily on isolated, current-moment snapshot data for judgment, resulting in a single basis for decision-making and insufficient credibility, this solution provides a quantitative, multi-dimensional, and highly credible settlement credibility score by integrating historical evidence, future impact predictions, and historical statistical data.

[0181] Based on the settlement credibility score, the system executes the corresponding action. The system compares the settlement credibility score with a preset settlement execution threshold (e.g., 80 points).

[0182] If the settlement credibility score is higher than the settlement execution threshold (e.g., a score of 92), the system generates a settlement execution instruction. Based on this instruction, the system triggers the fund settlement operation corresponding to the settlement trigger event, such as initiating a payment to supplier B. Simultaneously, the system generates a settlement evidence package, which includes a historical basis subgraph, a future impact subgraph, and the settlement credibility score. This settlement evidence package is then submitted to the blockchain network for notarization, ensuring the transparency and immutability of the settlement process.

[0183] If the settlement credibility score is lower than or equal to the settlement execution threshold (e.g., a score of 65 might be due to a lack of key quality inspection reports in the historical basis subgraph, or an anomaly in the inventory cost accounting predicted in the future impact subgraph), the system generates a settlement blocking instruction. Based on this instruction, the process corresponding to the current settlement trigger event is suspended, such as suspending payment to supplier B. Simultaneously, the system generates and outputs a risk warning report, which includes the abnormal settlement credibility score and the identification of key risk nodes related to that score (e.g., "Missing Quality Inspection Report WR-202308-015").

[0184] Furthermore, the final settlement conclusions, settlement evidence packages, or risk warning reports determined after the execution of disposal operations will be archived in a case knowledge base associated with the temporal knowledge graph. From the case knowledge base, for cases with successful settlement conclusions, the system extracts the stable compliant business patterns that appear in the future impact subgraph; for cases with failed settlement conclusions or those involving risks, it extracts the risky business patterns representing conflicts or anomalies in the future impact subgraph. These extracted compliant business patterns serve as positive samples to enrich historical compliant settlement templates or generate new auxiliary verification templates; the extracted risky business patterns serve as negative samples to enhance the risk triggering conditions in the state transition rule set. In subsequent settlement triggering events, when calculating the settlement credibility score, the compliance measurement engine synchronously calls these newly generated auxiliary verification templates and enhanced risk triggering conditions to participate in the graph pattern matching and dynamic correction calibration process, thereby enabling continuous learning and optimization of the system and further improving the accuracy and intelligence level of reconciliation.

[0185] All of the above-mentioned optional technical solutions can be combined in any way to form the optional embodiments of this application, and will not be described in detail here.

[0186] Figure 6 This is a schematic diagram of the structure of a pharmaceutical procurement and sales reconciliation system based on identifier matching and comparison provided in an embodiment of this application. See also... Figure 6 The system 600 includes one or more processors 601 and one or more memories 602. The one or more memories store at least one computer program, which is loaded and executed by the one or more processors to implement the above-mentioned pharmaceutical procurement and sales reconciliation method based on identifier matching and comparison. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0187] The above are merely optional embodiments of this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A pharmaceutical procurement and sales reconciliation method based on identifier matching and comparison, characterized in that, The method includes: In response to settlement trigger events in the pharmaceutical supply chain, an associated set of identifiers is obtained, including logistics, document, and fund transfer identifiers. Based on the set of identifiers, the corresponding entity nodes are located and activated in a pre-constructed temporal knowledge graph. The effective lifespan of the relational edges in the temporal knowledge graph is defined by the effective timestamp and the expiration timestamp, and the effective lifespan of the relational edges constitutes a temporal dependency path. Based on the event timestamp of the settlement triggering event and the business stage defined by the temporal dependency path, the time window boundaries for forward backtracking and forward extrapolation are determined. Starting from the activated entity node, forward path traversal and backward path traversal are performed respectively along the temporal dependency path in the temporal knowledge graph, collecting the nodes and relation edges visited during the traversal. Based on the nodes and relation edges collected by the forward path traversal, a historical basis subgraph is constructed. The historical basis subgraph is used to represent business facts that are causally related to the current settlement before the time window boundary. The historical basis subgraph is generated by forward backtracking and is used to verify settlement compliance. Based on the nodes and relation edges collected by the backward path traversal, a future impact subgraph is constructed. The future impact subgraph is used to represent business elements that will undergo state changes due to the execution of the current settlement after the time window boundary. The future impact subgraph is generated by forward extrapolation and is used to describe the scope of settlement aftereffects. The historical basis subgraph and the future impact subgraph are input into the compliance measurement engine linked with the temporal knowledge graph to obtain a quantitative settlement credibility score. The compliance measurement engine calculates the score by integrating the comparison results of the future impact subgraph and the historical compliance settlement template, as well as the historical evidence features represented by the historical basis subgraph. Based on the settlement credibility score, perform the processing operation corresponding to the settlement credibility score.

2. The method according to claim 1, characterized in that, The step of locating and activating the corresponding entity node in the pre-constructed temporal knowledge graph based on the identifier set includes: Based on the type and timestamp of the settlement trigger event, determine the initial time range for entity node search; Based on the initial time range, each identifier in the identifier set is parsed to obtain a set of entity keys for querying in the temporal knowledge graph; Based on the entity key, a node retrieval is performed in the temporal knowledge graph to obtain a set of candidate entity nodes; Based on the effective state of the time-dependent path, the nodes in the candidate entity node set are filtered, and the nodes on the effective path are determined as the target entity nodes to be activated. The effective state of the time-dependent path refers to the state that is within the validity period of the event timestamp, which is determined by the effective timestamp and the ineffective timestamp of the relation edge. Update the status attribute of the target entity node to active, and establish an association index between the target entity node and the settlement trigger event.

3. The method according to claim 1, characterized in that, The determination of the time window boundaries for forward backtracking and forward extrapolation, based on the event timestamp of the settlement trigger event and the business stage defined by the time-series dependency path, includes: Obtain the business stage identifier associated with the settlement trigger event; Based on the business stage identifier, a predefined window rule base is queried to obtain the allowed duration threshold for forward backtracking and the allowed duration threshold for forward extrapolation. The timestamp of the settlement trigger event is used as a reference point; Based on the allowed duration threshold for forward backtracking, the starting boundary of the forward backtracking time window is determined; Based on the allowed duration threshold for forward extrapolation, the termination boundary of the forward extrapolation time window is determined.

4. The method according to claim 1, characterized in that, The construction of the historical basis subgraph based on the nodes and relation edges collected by the forward path traversal includes: The nodes and relation edges collected by the forward path traversal are subjected to causal association analysis using preset business association rules to obtain a set of candidate subgraph elements that have a direct causal logic with the settlement trigger event. For each entity node in the candidate subgraph element set, check the association time attribute of the entity node; for each relation edge in the candidate subgraph element set, check the effective timestamp attribute and the ineffective timestamp attribute of the relation edge. Based on the starting boundary of the forward backtracking time window, determine whether the associated time attribute of the entity node, the effective timestamp attribute and the ineffective timestamp attribute of the relation edge are within the effective time range defined by the starting boundary of the forward backtracking time window. Entity nodes and relation edges located within the effective time range are identified as valid subgraph elements; Based on the time constraints defined in the time-dependent path, the effective subgraph elements are subjected to time-order topological sorting and logical connection. Based on the sorted and connected valid subgraph elements, a historical basis subgraph with source identifiers and causal type tags is generated. The source identifier is attached to each entity node in the historical basis subgraph, and the causal type tag is attached to each relation edge in the historical basis subgraph.

5. The method according to claim 1, characterized in that, The construction of the future influence subgraph based on the nodes and relationship edges collected by the backward path traversal includes: For the nodes and relation edges collected by the backward path traversal, based on the type of the settlement trigger event and the pre-configured state transition rule set, identify a set of all candidate subgraph elements that may be directly or indirectly caused by the settlement trigger event to change their state. For each entity node in the candidate subgraph element set, check the current state attribute of the entity node in the temporal knowledge graph; for each relation edge in the candidate subgraph element set, check the effective timestamp attribute and the ineffective timestamp attribute of the relation edge. Based on the termination boundary of the forward projection time window, determine whether the current state attribute of the entity node satisfies the change conditions defined by the state transition rule set, and whether the effective timestamp attribute and ineffective timestamp attribute of the relation edge are within the valid time range defined by the termination boundary of the forward projection time window. The entity nodes that meet the change conditions and the relationship edges that are located within the valid time range are determined as valid subgraph elements; Based on the temporal constraints and logical dependencies defined in the temporal dependency path, the effective subgraph elements are subjected to causal topological sorting and logical connection. Based on the sorted and connected valid subgraph elements, a future impact subgraph is generated with an impact range marker and a state change marker. The impact range marker is used to identify the business level affected by the settlement trigger event, and the state change marker is attached to each entity node in the future impact subgraph that meets the change conditions to indicate the expected change direction of the entity node.

6. The method according to claim 1, characterized in that, The historical basis subgraph and the future influence subgraph are input into a compliance measurement engine linked to the temporal knowledge graph to obtain a quantified settlement credibility score, including: The historical basis subgraph and the future impact subgraph are input into the compliance measurement engine linked with the temporal knowledge graph. The compliance measurement engine performs graph pattern matching between the future impact subgraph and the historical compliance settlement template to obtain the basic structure similarity. The engine also calculates the difference in key numerical attributes of corresponding nodes in the future impact subgraph and the historical compliance settlement template to obtain the basic numerical deviation. The compliance measurement engine extracts the completeness index of historical paths and the distribution characteristics of historical decision results from the historical basis subgraph. The completeness index of historical paths is used to quantify the completeness of the historical evidence chain supporting this settlement, and the distribution characteristics of historical decision results are used to characterize the statistical regularity of the final risk assessment results of similar historical settlements. The compliance measurement engine performs a first-level fusion of the basic structure similarity and the basic numerical deviation to generate a preliminary risk estimate. The preliminary risk estimate is then dynamically corrected and calibrated using the completeness index of the historical path and the distribution characteristics of the historical decision results. The compliance measurement engine performs a second-level fusion and normalization of the dynamically corrected and calibrated risk estimate with the historical risk performance statistics of similar events to the settlement trigger event recorded in the temporal knowledge graph, to obtain the settlement credibility score.

7. The method according to claim 6, characterized in that, The extraction of completeness indicators of historical paths and distribution characteristics of historical decision results from the historical basis subgraph through the compliance measurement engine includes: The compliance measurement engine parses all entity node sequences connected by the time-series dependency paths from the historical basis subgraph and identifies nodes in the entity node sequences that belong to the predefined key business document type. Based on the occurrence of nodes of the predefined key business document type in the entity node sequence, the completeness index of the historical path is calculated. The compliance measurement engine obtains the historical settlement conclusion attributes associated with each entity node from the historical basis subgraph; The attributes of the historical settlement conclusions are classified, aggregated, and statistically analyzed to obtain the quantity distribution and proportion of different conclusion types, thus forming the distribution characteristics of the historical decision results.

8. The method according to claim 1, characterized in that, The step of performing processing operations corresponding to the settlement credibility score based on the settlement credibility score includes: The settlement credibility score is compared with a preset settlement execution threshold; If the settlement credibility score is higher than the settlement execution threshold, a settlement execution instruction is generated; based on the settlement execution instruction, the fund settlement operation corresponding to the settlement trigger event is triggered, a settlement evidence package is generated, and the settlement evidence package is submitted to the blockchain network for storage. The settlement evidence package includes the historical basis subgraph, the future impact subgraph, and the settlement credibility score. If the settlement credibility score is lower than or equal to the settlement execution threshold, a settlement blocking instruction is generated; based on the settlement blocking instruction, the process corresponding to the settlement triggering event is terminated, and a risk warning report is generated and output. The risk warning report includes an abnormal settlement credibility score and key risk node identifiers related to the settlement credibility score.

9. A pharmaceutical procurement and sales reconciliation system based on identifier matching and comparison, characterized in that, The system includes one or more processors and one or more memories, wherein at least one computer program is stored in the one or more memories, and the computer program is loaded and executed by the one or more processors to implement the pharmaceutical procurement and sales reconciliation method based on identifier matching and comparison as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Supplier settlement risk management and control method and system based on AI big data

    CN121052637A

  • Obtaining information to provide to users

    US9471606B1