A customs whole-process business object mapping and risk disposal linkage method and system

CN122596877APending Publication Date: 2026-08-18FUJIAN CROSS SERVICE TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611088318.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-22
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0005]针对现有技术的不足,本发明提供了一种报关全流程业务对象映射与风险处置联动方法及系统,解决了现有报关风控系统多源异构数据冲突消解能力弱,且在高并发复杂规则推理时存在的计算资源过载、状态更新不一致以及风险传播边界模糊的问题

Benefits of technology

1、本发明通过将多源异构单证数据的本体构建、业务规则预编译、实时事件匹配推理以及结果回写进行串联整合,构建了业务映射与风险管控的闭环机制。该方法基于本体模式统一数据标准,通过实体状态版本与规则版本协同判定路由路径,并在执行推理输出风险结果后,结合货权归属边界标识控制物理装载单元间的风险状态传播,在多源数据频繁交互的报关场景中提升了风险研判的客观性以及联动处置流程的执行效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122596877A_ABST
    Figure CN122596877A_ABST
Patent Text Reader

Abstract

This application relates to the field of data processing and risk control technology, and discloses a method and system for linking business object mapping and risk handling in the entire customs declaration process. The method includes the following steps: constructing an ontology schema based on multi-source heterogeneous document data, extracting entity attributes and performing conflict resolution calculations; parsing business rules into a syntax tree to generate rule application domain descriptors, rule dependency closures, and pre-compiled query execution plans; matching real-time customs declaration events with application domain descriptors, and determining routing paths based on entity status and rule version; extracting the minimum evaluation subgraph to perform inference and outputting risk event results; controlling risk propagation across physical loading units based on cargo ownership boundary identifiers, writing back the handling results, and triggering asynchronous recalculation. This invention effectively improves the objectivity of risk assessment and the execution efficiency of linked handling in high-concurrency customs declaration scenarios by constructing a business mapping and risk control closed loop.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing and risk control technology, specifically to a method and system for linking business object mapping and risk management throughout the entire customs declaration process. Background Technology

[0002] In the end-to-end customs declaration process, the system typically needs to process heterogeneous document data from different data sources and perform real-time risk assessment based on business rules. Existing customs declaration data processing methods lack effective conflict resolution mechanisms when receiving documents from multiple sources. When different documents describe the same entity attribute differently, existing systems usually directly use the latest received data to overwrite it or directly transfer it to manual verification, failing to combine the correlation between documents and the weight of evidence for quantitative screening, thus limiting the accuracy of the basic risk control data.

[0003] In the risk reasoning and state linkage stages, existing risk control systems typically employ basic condition matching or unrestricted graph traversal for rule verification. Faced with complex business dependencies, this approach is prone to excessive computational resource consumption due to the disordered propagation of related nodes, thus increasing inference latency. When handling high-concurrency customs declaration events, existing systems exhibit a rather coarse management of entity state changes, failing to ensure the accuracy of state updates and precise control of cascading recalculations in concurrent environments. Furthermore, existing risk management logic usually makes independent judgments on a single customs declaration object, failing to combine the physical loading boundaries of the goods and the ownership status to control the propagation scope of risk states, thus failing to meet the business needs for precise risk linkage in complex customs declaration scenarios.

[0004] Therefore, this invention proposes a method and system for linking business object mapping and risk management throughout the entire customs declaration process to address the shortcomings of existing technologies. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides a method and system for linking business object mapping and risk management throughout the entire customs declaration process. This solves the problems of weak multi-source heterogeneous data conflict resolution capabilities in existing customs declaration risk control systems, as well as the problems of computational resource overload, inconsistent state updates, and ambiguous risk propagation boundaries during high-concurrency complex rule reasoning.

[0006] To achieve the above objectives, the present invention provides the following technical solution: a method for linking business object mapping and risk management throughout the entire customs declaration process, comprising the following steps: Receive multi-source heterogeneous document data, construct a customs declaration business ontology model, extract entity attributes and evidence constraint identifiers corresponding to the entity attributes based on the customs declaration business ontology model, and perform value conflict resolution calculations for the multi-source heterogeneous document data to determine the target value of the entity attributes. Receive business rule text, perform syntax tree parsing and ontology type consistency verification, generate rule application domain descriptors, rule dependency closures and pre-compiled query execution plans for business rules that pass the verification, and configure rule version identifiers for business rules that meet the release conditions; Receive real-time customs declaration events, extract event feature sets and match them with the rule application domain descriptor to generate a candidate calculation queue; determine the status routing path based on the entity status version number, the entity status version number corresponding to the risk label and the rule version identifier; Under the real-time computing path, the minimum evaluation subgraph is extracted based on the pre-compiled query execution plan to perform inference, output risk event results and generate risk explanation chains; Obtain the results of the risk events and the risk interpretation chain, generate candidate disposal paths, and control the range of risk status propagation across physical loading units based on the ownership boundary identifier; The processing result is written back to the entity attribute, the entity status version number is updated, and asynchronous recalculation of the affected business rules is triggered.

[0007] Preferably, the step of resolving value conflicts arising from the multi-source heterogeneous document data and determining the target value of the entity attribute specifically includes: Based on the evidence source priority, document association, time validity, field completeness, and manual confirmation status corresponding to the evidence constraint identifier, configure the corresponding weight coefficients respectively; Based on the preset sub-functions and the weight coefficients, calculate the conflict resolution score for each candidate value corresponding to the same entity attribute; The candidate value with the highest and only conflict resolution score is selected as the target value of the entity attribute.

[0008] Preferably, the step of generating a rule application domain descriptor, a rule dependency closure, and a pre-compiled query execution plan for the validated business rules specifically includes: Extract the applicable objects, applicable events, applicable times, and required evidence preconditions from the abstract syntax tree parsed from the business rules to generate the rule application domain descriptor; Based on the graph traversal paths involved in the abstract syntax tree, associated nodes and edges are collected to generate the rule dependency closure; The pre-compiled query execution plan is generated based on the rule-dependent closure, and a maximum traversal depth threshold and a maximum fan-out degree threshold are configured in the pre-compiled query execution plan. The maximum traversal depth threshold is used to limit the level depth of graph traversal, and the maximum fan-out degree threshold is used to limit the number of associated neighbor nodes that a single node can obtain in the query.

[0009] Preferably, the step of extracting the event feature set and matching it with the rule application domain descriptor to generate a candidate computation queue specifically includes: The constraints in the rule's applicable domain descriptor are input into multiple preset hash mapping functions for modulo calculation to generate the applicable domain signature bitmap corresponding to the business rule; The same multiple hash mapping functions are applied to the event feature set to generate an event signature bitmap; If the set positions in the applicable domain signature bitmap corresponding to the business rule are all matched in the event signature bitmap, then the business rule will be included in the initial screening set. The constraints in the initial screening set are matched precisely item by item, and the business rules that pass the precise match are included in the candidate calculation queue.

[0010] Preferably, determining the status routing path based on the entity status version number, the entity status version number corresponding to the risk label, and the rule version identifier specifically includes: Obtain the entity status version number of the target entity, the entity status version number corresponding to the risk label, the rule version identifier recorded by the risk label, the rule version identifier of the business rule involved in the calculation, and the persistent record to be updated; If the entity status version number of the target entity is inconsistent with the entity status version number corresponding to the risk label, or the rule version identifier recorded by the risk label is inconsistent with the rule version identifier of the business rule participating in the calculation, or there is an associated change pending event in the persistent pending update record, then the real-time customs declaration event will be routed to the real-time calculation path.

[0011] Preferably, the step of extracting the minimum evaluation subgraph and performing inference based on the pre-compiled query execution plan specifically includes: After the real-time calculation path is triggered, a graph traversal is performed starting from the customs declaration event node that triggered the business rule, based on the maximum traversal depth threshold and the maximum fan-out degree threshold. When the number of associated neighbor nodes of a traversed node exceeds the maximum fan-out degree threshold, the associated neighbor nodes are filtered according to the rule dependency closure, and the minimum evaluation subgraph participating in the calculation of the business rule is extracted by pagination traversal.

[0012] Preferably, the inference is performed by extracting the minimum evaluation subgraph based on the pre-compiled query execution plan, specifically including: In the minimum evaluation subgraph, the sufficiency of evidence for the business rule verification is calculated based on the validity status value and importance weight coefficient of the evidence sources involved in the calculation of the business rule. When the sufficiency of the evidence is greater than or equal to the high confidence threshold and the source of evidence is not missing, a deterministic risk event is determined and output. When the business rule is triggered but the output conditions of the deterministic risk event are not met, the risk event with insufficient evidence is determined to be output. When the business rule is not triggered, it is determined as a miss and no risk event result is output; The risk event outcome includes either the deterministic risk event or the insufficient evidence risk event.

[0013] Preferably, the step of controlling the range of risk status propagation across physical loading units based on the ownership boundary identifier specifically includes: Extract the ownership identifier of adjacent related entities, and use a hash digest algorithm to calculate the hash value of the ownership identifier; Compare the hash value corresponding to the ownership entity identifier of the adjacent associated entities; If the comparison results are inconsistent, it is determined that the adjacent related entities do not belong to the same cargo ownership boundary, and the propagation of the risk status is stopped at the current physical loading unit boundary.

[0014] Preferably, the step of writing the processing execution result back to the entity attribute, updating the entity status version number, and triggering asynchronous recalculation for the affected business rules specifically includes: The entity status version number is verified using a compare-and-swap mechanism within the database transaction. If the comparison is consistent, the entity status version number is incremented and a change pending event is inserted into the persistent pending update record table. The status update event containing the entity identifier of the corresponding entity is pushed to the distributed message queue. The stream processing engine consumes the state update event, accesses the reverse dependency graph to determine the scope of business rules that depend on the entity, and submits the updated entity parameters to the computation execution node to trigger the asynchronous recalculation.

[0015] This invention also provides a system for linking business object mapping and risk management throughout the entire customs declaration process, including: The ontology construction module is used to receive multi-source heterogeneous document data, construct a customs declaration business ontology model, extract entity attributes and evidence constraint identifiers corresponding to the entity attributes based on the customs declaration business ontology model, perform value conflict resolution calculations for the multi-source heterogeneous document data, and determine the target value of the entity attributes. The rule compilation module is used to receive business rule text, perform syntax tree parsing and ontology type consistency verification, generate rule application domain descriptors, rule dependency closures and pre-compiled query execution plans for business rules that pass the verification, and configure rule version identifiers for business rules that meet the release conditions. The online inference module is used to receive real-time customs declaration events, extract event feature sets and match them with the rule application domain descriptors to generate a candidate calculation queue; determine the state routing path based on the entity status version number, the entity status version number corresponding to the risk label and the rule version identifier; under the real-time calculation path, extract the minimum evaluation subgraph based on the pre-compiled query execution plan to perform inference, output the risk event results and generate a risk interpretation chain; The disposal control module is used to obtain the results of the risk event and the risk interpretation chain, generate candidate disposal paths, and control the range of risk status propagation across physical loading units based on the ownership boundary identifier. The status write-back module is used to write back the processing execution result to the entity attribute, update the entity status version number, and trigger asynchronous recalculation for the affected business rules.

[0016] The present invention also provides a computer device, including: a processor and a memory, the memory storing a computer program executable by the processor, the computer program performing the method described above when executed by the processor.

[0017] The present invention also provides a storage medium storing a computer program, which is executed by a processor to perform the method described above.

[0018] This invention provides a method and system for linking business object mapping and risk management throughout the entire customs declaration process. It has the following beneficial effects: 1. This invention establishes a closed-loop mechanism for business mapping and risk management by integrating ontology construction of multi-source heterogeneous document data, pre-compilation of business rules, real-time event matching and reasoning, and result write-back. Based on a unified data standard using ontology schemas, this method collaboratively determines routing paths through entity state versions and rule versions. After outputting risk results through reasoning, it controls the propagation of risk states between physical loading units by combining cargo ownership boundary identifiers. This improves the objectivity of risk assessment and the efficiency of coordinated handling processes in customs declaration scenarios involving frequent interaction of multi-source data.

[0019] 2. To address the value conflict issue arising from multi-source heterogeneous document data, this invention utilizes evidence constraints to identify the priority of the associated evidence source, document relationship, time validity, field completeness, and manual confirmation status, configuring weight coefficients for each to calculate the conflict resolution score for each candidate value of the same entity attribute. This quantitative screening mechanism can automatically filter out the highest-scoring and unique target value from complex conflict data, reducing computational interference caused by underlying data contradictions in the subsequent risk assessment process and improving the accuracy of basic business data input.

[0020] 3. Regarding the execution scheduling of complex business rules, this invention configures maximum traversal depth and maximum fan-out degree thresholds based on dependency closures during the rule pre-compilation stage. When the system performs graph traversal starting from the customs declaration event node in the real-time calculation path, it can filter associated neighbor nodes according to the above threshold conditions, thereby extracting the smallest evaluation subgraph with controlled size to participate in the calculation. This design prevents system resource overload caused by the unrestricted diffusion of associated nodes during graph inference, and controls inference latency while maintaining the integrity of business rule verification.

[0021] 4. To address the issues of state updates and cascading triggers in concurrent environments, this invention employs a comparison and exchange mechanism to verify the entity state version number when writing the execution result back to the entity attributes. It also uses a distributed message queue to deliver state update events to the stream processing engine for consumption. The system utilizes a reverse dependency graph to define the scope of business rules that specifically depend on affected entities and triggers asynchronous recalculation accordingly. This mechanism ensures data update security in high-concurrency scenarios while achieving precise range recalculation driven by local state changes, reducing the computational overhead caused by global system refreshes. Attached Figure Description

[0022] Figure 1 This is a schematic diagram of the system architecture according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the method flow according to an embodiment of the present invention; Figure 3 This is a schematic diagram illustrating the ontology construction and multi-source attribute conflict resolution workflow of an embodiment of the present invention; Figure 4 This is a schematic diagram of the business rule compilation and sandbox pre-release process according to an embodiment of the present invention; Figure 5 This is a schematic diagram of the consistent state routing and three-state reasoning execution process according to an embodiment of the present invention; Figure 6 This is a schematic diagram of the closed-loop process of physical truncation of ownership and status write-back in an embodiment of the present invention. Figure 7 This is a comparison curve of system processing latency under different concurrent request loads according to an embodiment of the present invention; Figure 8 This is a box plot of system memory consumption during the large-scale risk calculation process according to an embodiment of the present invention; Figure 9 This is a bar chart showing the risk identification status distribution of different schemes in the embodiments of the present invention on a real test set.

[0023] Among them, 10 is the ontology construction module; 20 is the rule compilation module; 30 is the online reasoning module; 40 is the disposal control module; and 50 is the state write-back module. Detailed Implementation

[0024] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0025] See attached document Figure 1 This invention provides a system for linking business object mapping and risk management throughout the customs declaration process, comprising: an ontology construction module 10, a rule compilation module 20, an online reasoning module 30, a management control module 40, and a status write-back module 50.

[0026] The ontology construction module 10 is used to receive multi-source heterogeneous document data and construct a customs declaration business ontology model with effective and expiration times. Based on the extracted heterogeneous document fields, the ontology construction module 10 generates ontology object attributes and corresponding evidence constraint identifiers, establishes the association structure between the logical declaration layer and the physical loading layer, and performs value conflict resolution calculations for multi-source data.

[0027] The rule compilation module 20 receives business rule text and performs syntax tree parsing and ontology type consistency verification. For business rules that pass verification, the rule compilation module 20 generates a directed rule graph, rule application domain descriptors, and rule dependency closures. Based on the rule dependency closures, the rule compilation module 20 generates a pre-compiled query execution plan and determines whether the business rule meets the release conditions based on the execution results of historical verification slices. For business rules that meet the release conditions, the rule compilation module 20 configures a unified rule version identifier for the directed rule graph, rule application domain descriptors, rule dependency closures, and pre-compiled query execution plans.

[0028] The online inference module 30 receives real-time customs declaration events, extracts a set of event features, and matches them with the rule application domain descriptors to generate a candidate calculation queue. Based on the entity status version number, the entity status version number recorded in the risk label, the rule version identifier, and the persistent records awaiting updates, the online inference module 30 determines the state routing path for the current customs declaration event. Under the real-time calculation path, the online inference module 30 extracts the minimum evaluation subgraph, performs inference, outputs the corresponding level of risk event results, and generates a risk interpretation chain.

[0029] The disposal control module 40 is used to obtain the risk interpretation chain and risk event results, and generate corresponding candidate disposal paths. The disposal control module 40 performs precondition verification on the candidate disposal paths and compares the scope of the disposal action with the ownership boundary and regulatory extension conditions. The disposal control module 40 controls the propagation range of risk status across physical loading units based on the ownership boundary identifier.

[0030] The state write-back module 50 is used to obtain the execution result of the action, write the state information back to the attributes of the ontology object in the database transaction, increment the entity state version number, and write it to the persistent record to be updated. The state write-back module 50 updates the auxiliary query structure in the memory layer and triggers asynchronous recalculation based on the state change event. The state write-back module 50 obtains the recalculation result to update the risk label and the entity state version number and rule version identifier recorded by the risk label, and cleans up the corresponding persistent record to be updated.

[0031] See attached document Figure 2 This invention provides a method for linking business object mapping and risk management throughout the entire customs declaration process, comprising the following steps: S100, construct the customs declaration business ontology model, establish evidence constraint mapping for multi-source documents and resolve attribute value conflicts; S200 verifies the business rule structure and generates rule application domain descriptors, rule dependency closures, and pre-compiled query execution plans. S300 receives customs declaration events, performs feature matching, performs consistent routing based on state version determination, and executes risk reasoning within the minimum evaluation subgraph. S400 generates candidate disposal paths and performs precondition verification, controlling risk propagation across physical loading units based on cargo ownership boundaries; S500 writes back the processing results and updates the entity status version number, triggering asynchronous recalculation to complete the risk label rematerialization loop.

[0032] To further clarify the implementation of each technical aspect of the present invention, the following will provide a detailed description of the implementation of each functional module involved above and its internal processing flow.

[0033] See attached document Figure 3This illustrates the ontology construction and multi-source attribute conflict resolution workflow of an embodiment of the present invention. The specific implementation of step S100 in the customs declaration full-process business object mapping and risk handling linkage method is as follows: S110, the ontology construction module 10 receives multi-source heterogeneous document data to construct a customs declaration business ontology model. In this embodiment, to meet the requirements of time-series recording and status tracking during the customs declaration event processing, the customs declaration business ontology model adopts an attribute graph model with time attributes. Specifically, in the above attribute graph model, five entity types are defined: subject, object, event, document, and rule, along with their associated edges.

[0034] Furthermore, the subject types specifically include enterprise nodes, individual nodes, agent nodes, and carrier nodes; the object types include commodity nodes, cargo nodes, packaging unit nodes, pallet nodes, and container nodes; the event types include declaration event nodes, inspection event nodes, control event nodes, release event nodes, and customs clearance event nodes; the document types include customs declaration nodes, invoice nodes, packing list nodes, bill of lading nodes, license nodes, and safety data sheet nodes; and the rule types include HS code rule nodes, regulatory condition rule nodes, license rule nodes, sanctions list rule nodes, and price anomaly rule nodes.

[0035] To support temporal calculations, the system configures a time interval attribute containing the effective time and expiration time for each node and associated edge in the attribute graph model. This attribute is used to characterize the effective lifecycle of the corresponding node or associated edge in business logic. When processing real-time customs declaration events, the effective time and expiration time are compared based on the event's timestamp to filter out expired historical nodes or rule nodes that have not yet taken effect, thereby ensuring the validity of the underlying graph structure participating in subsequent risk reasoning at the current time segment.

[0036] S120 establishes a hierarchical structure based on declaration detail line nodes, pallet nodes, and container nodes to create an association between the logical declaration layer and the physical loading layer. As a preferred implementation, for complex physical flow scenarios such as LCL (Less than Container Load) shipments or multiple containers per order, the declaration detail line node carries logical declaration attributes, including product name, HS code, quantity, weight, price, country of origin, regulatory conditions, and licensing requirements. Pallet nodes and container nodes represent the physical storage location of the goods. By establishing association edges from declaration detail line nodes to pallet nodes, and from pallet nodes to container nodes, a topological mapping from the logical attributes of the customs declaration to the physical storage location of the goods can be achieved.

[0037] S130: Extract fields from the customs declaration and accompanying documents and assign them to entity attributes in the customs declaration business ontology schema, simultaneously generating evidence constraint identifiers associated with the entity attributes. Accompanying documents include invoices, packing lists, bills of lading, licenses, and security data tables. For each entity attribute extracted into the ontology structure, an independent evidence constraint identifier is generated. This identifier records in detail the data source, extraction path, extraction time, and evidence level at the time of entity attribute extraction.

[0038] By identifying the data source and extraction path, the original origin of entity attributes can be pinpointed. Extraction time allows for the creation of a chronological version of the data, while preset evidence levels differentiate the credibility of the data. Specifically, evidence levels are divided into multiple quantitative ranges based on the reliability of the information source. For example, official customs data corresponds to the highest level (e.g., level 5), third-party testing agency certification data corresponds to a higher level (e.g., level 4), and invoices or packing lists provided by the company correspond to medium or lower levels (e.g., levels 1 to 3). When manual review results or on-site inspection results are introduced, the system generates a new evidence constraint identifier and updates the target value of the entity attribute based on this new identifier, while retaining the original evidence constraint identifier as a historical traceability record.

[0039] S140: For situations where multiple data source candidate values ​​exist for the same entity attribute, an attribute conflict graph is constructed, conflict resolution calculations are performed, and the entity attribute status is updated based on the calculation results. In multi-source heterogeneous document environments, evidence conflicts often occur, such as discrepancies between the weight stated on the invoice and the weight stated on the bill of lading. To determine the admissibility of candidate values ​​based on multiple evidentiary dimensions, this embodiment introduces a multi-dimensional dynamic scoring mechanism.

[0040] For different candidate value sets extracted from the same entity attribute, a conflict resolution score is calculated for each candidate value, taking into account pre-defined priorities for evidence sources, document correlation, time validity, field completeness, and manual confirmation status. The formula for calculating the conflict resolution score is as follows: ; In the formula, Indicates the first candidate values Conflict resolution score; Indicates the priority score of the evidence source; Indicates the score for document association; Indicates the time validity score; Indicates the field integrity score; This indicates the score for manual confirmation status. , , , and Let represent the weight coefficients for the corresponding dimensions, with each weight coefficient ranging from [0,1] and satisfying . To ensure the completeness and dimensional consistency of the computational logic, the computational logic of each sub-function is defined as follows: This indicates that the data source has a preset priority score, which directly reads the evidence level defined above and linearly maps it to the [0,1] interval using a maximum-minimum method. In this embodiment, the evidence level ranges from 1 to 5. ,in, , .

[0041] This indicates the score based on the document's relevance. A candidate value is awarded when the document it belongs to is directly related to the current customs declaration event, declaration details line, or physical loading unit. Set to 1; when the document containing the candidate value is indirectly associated with the current customs declaration event through a reference relationship, Take 0.5; when the document containing the candidate value is not related to the current customs declaration event, Take 0.

[0042] This represents the time validity score. The system uses an exponential decay function based on the natural base for calculation: ; In the formula, The system timestamp that triggered the current customs declaration event; The data extraction timestamp for the candidate values; The preset time decay constant, The value ranges from 0.01 to 0.1, with days as the unit of measurement. When Later At that time, the system will The value is set to 0.

[0043] The score represents the field integrity score, which is specifically calculated as the ratio of the number of non-empty subfields in the data structure corresponding to the candidate value to the total number of required subfields. The result also falls within the [0,1] interval.

[0044] This indicates the score for manual confirmation. A candidate value is considered valid only after manual review or on-site verification. Set to 1; when a candidate value has been manually reviewed or confirmed as invalid through on-site inspection, Set to 0; when the candidate value has not yet been manually reviewed or on-site verified, Take 0.5.

[0045] After the scoring is calculated, the highest and unique candidate value for conflict resolution is selected as the target value for that entity attribute. If multiple candidate values ​​have the same score and are all the highest possible, the system cannot determine a unique target value based on the current evidence dimension, and conflict resolution is deemed to have failed. For such entity attributes, the system marks them as pending review. In subsequent risk reasoning processes, any automatic release rules or silent verification logic that rely on this pending review attribute will be restricted from execution and transferred to a manual review or inspection process.

[0046] See attached document Figure 4 This illustrates the business rule compilation and sandbox pre-release process according to an embodiment of the present invention. The specific implementation of step S200 in the customs declaration full-process business object mapping and risk handling linkage method is as follows: S210, the rule compilation module 20 receives business rule text written in a domain-specific language. In this embodiment, the domain-specific language can be a structured query language or a custom scripting format based on JavaScript Object Notation (JSON). The business rule text defines the logical conditions for risk assessment of a specific customs declaration object.

[0047] The rule compilation module 20 parses the received business rule text into an abstract syntax tree. In the topology of this abstract syntax tree, the root node and internal nodes are used to represent logical operators or comparison operators, and the leaf nodes are used to represent ontology object attributes or constant characteristics.

[0048] After parsing, the rule compilation module 20 traverses the abstract syntax tree, verifying whether the object types, attribute types, operator types, and value types contained therein meet the type consistency and operation compatibility requirements defined in the customs declaration business ontology pattern. As a specific implementation detail, the system pre-constructs a mapping table between graph attributes and data types. During the compilation phase, the system checks one by one whether the attributes referenced by the leaf nodes have corresponding definitions in the constructed customs declaration business ontology pattern, and simultaneously determines whether the data types at both ends of the operators support the preset operation logic.

[0049] For example, when the operator is a numeric comparison operator, the system verifies that the values ​​on both sides are numeric data of the same dimension. In this way, the system can identify type anomalies caused by errors in the writing of business rule text during the compilation phase.

[0050] S220, after completing the type consistency verification, the rule compilation module 20 extracts the applicable objects, applicable events, applicable times and required evidence preconditions based on the transformed rule directed graph, and then generates a rule application domain descriptor for online stage pre-filtering.

[0051] In this embodiment, the rule application domain descriptor is a set of features, which is mainly used to narrow the scanning range of the entire rule table during online order review and reasoning. Specifically, the rule compilation module 20 traverses each level of the abstract syntax tree using a depth-first search algorithm to extract the corresponding constraints.

[0052] Among these features, the applicable objects limit the type of ontology node to which the business rule applies; the applicable events define the specific business processes that the rule is allowed to activate; the applicable time specifies the physical date range in which the rule takes effect; and the required evidence preconditions define the basic document data source identifiers that the rule must possess to enter the computation state. By extracting and encapsulating these multi-dimensional constraints into independent descriptor substructures, the system can filter out rules that are irrelevant to the current event after receiving a customs declaration event, thereby reducing the graph traversal overhead when subsequently entering the real-time computation queue.

[0053] S230, as a preferred implementation, the rule compilation module 20 generates a rule dependency closure that defines the full topological boundaries required for the execution of the business rules, and performs a trial run in the historical customs declaration map slice to determine whether it meets the release conditions.

[0054] The rule dependency closure here refers to a closed set obtained by collecting associated nodes and edges using a breadth-first search algorithm, starting from the applicable object node and based on all graph traversal paths involved in the abstract syntax tree. This closure is used to define the range of data that business rules may call when executing graph queries. To ensure that the deployment of new rules will not negatively impact the stability of the production environment, the rule compilation module 20 loads customs declaration graph slices containing real historical data in an independent sandbox environment and conducts simulated operation tests using the aforementioned rule dependency closure as a range constraint.

[0055] The system compares the output of the simulation with preset publishing conditions. These conditions specifically include: the rule structure is valid for execution in the graph query engine and there are no circular dependencies. In this step, the system uses a topology sorting algorithm based on node in-degree to detect rule execution paths. If a cycle exists in the graph that cannot complete the topology sort, a circular dependency is determined to exist.

[0056] Furthermore, the release conditions also require that the compilation process successfully generates rule application domain descriptors and rule dependency closures, and that in the sandbox environment, a risk interpretation chain containing trigger nodes or a clear miss result be formed; when a business rule triggers a risk event in the sandbox environment, the corresponding generated candidate handling path must meet the preconditions required for subsequent control execution. If the simulation results do not meet any of the above conditions, the system will stop the release process of the business rule and generate a corresponding exception tracing log.

[0057] S240, for the verified business rules, the rule compilation module 20 generates a pre-compiled query execution plan based on the above rule dependency closure, and configures a unified rule version identifier for the rule directed graph and the pre-compiled query execution plan.

[0058] In scenarios involving concurrent computation of large-scale graph data, unrestricted open-ended graph node traversal can lead to system memory overflow exceptions. Therefore, the rule compilation module 20 adds a maximum traversal depth threshold and a maximum fan-out degree threshold when generating the pre-compiled query execution plan. Specifically, the maximum traversal depth threshold is used to limit the number of hops in the farthest associated layer from the trigger node. Since the hierarchical relationship from the logical declaration node to the physical loading node is fixed in this embodiment, the maximum traversal depth threshold is set based on the fixed hierarchical depth of the customs declaration business graph, and its preferred range is defined as 3 to 5.

[0059] The maximum fan-out threshold is used to limit the upper limit of the number of associated neighbor nodes that a single node can obtain in a single query batch. This threshold is determined based on the maximum physical line loading capacity of a single pallet or container in an actual shipping scenario, and its preferred range is defined as 500 to 1000.

[0060] During the actual execution of the query, if the actual number of associated neighbor nodes of a certain node exceeds the maximum fan-out degree threshold, the system first filters the neighbor nodes based on the rule dependency closure, the current customs declaration event association identifier, and the time validity period condition; if the number of neighbor nodes after filtering still exceeds the maximum fan-out degree threshold, the system uses batch reading or page traversal to sequentially send the set of neighbor nodes into the memory working area for calculation.

[0061] By introducing the aforementioned traversal depth and fan-out degree constraints, the pre-compiled query execution plan can limit the computational scope of online graph traversal.

[0062] Finally, the rule compilation module 20 uses the SHA-256 algorithm to hash the text content and configuration parameters of the business rule, generating a unique rule version identifier. Specifically, the rule compilation module 20 concatenates the text string of the business rule, the directed graph of the rule, the descriptor of the rule's applicable domain, the rule dependency closure, and the configuration parameters of the pre-compiled query execution plan into the original input string. Then, it uses the SHA-256 algorithm to perform a message digest calculation on the input string, obtaining a fixed hash value of 256 bits as the rule version identifier. This rule version identifier is bound to all the compilation artifacts mentioned above and persistently stored, providing a basis for version consistency verification in subsequent online inference stages.

[0063] See attached document Figure 5This illustrates the consistent state routing and three-state reasoning execution flow of an embodiment of the present invention. This flow clarifies the channel selection and risk assessment logic of the system in concurrent scenarios. The specific implementation of step S300 in the customs declaration full-process business object mapping and risk handling linkage method is as follows: S310, the online inference module 30 extracts features from real-time customs declaration events and performs initial screening of applicable domains. When a real-time customs declaration event is received, the online inference module 30 parses the event payload, extracting the event's time, document identifier, commodity information, company information, HS code, trade method, port, and related document status, forming a structured event feature set. To accelerate the online inference process, the system performs matching operations between the above event feature set and the full set of rule applicable domain descriptors generated in the offline stage. By matching the event feature set with the rule applicable domain descriptors corresponding to each business rule item by item, business rules that meet the matching conditions are filtered out, generating a candidate calculation queue.

[0064] For the matching operation between the aforementioned event feature set and the rule application domain descriptor, the online inference module 30 employs a bitmap mapping technique with fault tolerance. The online inference module 30 pre-configures K independent hash mapping functions (K is preferably an integer between 3 and 7) and generates a corresponding application domain signature bitmap for the rule application domain descriptor of each business rule.

[0065] Both the applicable domain signature bitmap and the event signature bitmap have a length of N bits. The value of N is determined based on the total size of the rule base and the expected misjudgment rate that the system can tolerate. In this embodiment, the preferred value of N is 1024 or 2048.

[0066] The applicable domain signature bitmap is used to record the applicable objects, applicable events, applicable time, applicable regions, applicable trade methods, and required evidentiary conditions of the business rule.

[0067] During the rule loading phase, the system inputs the constraint strings from the rule application domain descriptor of each business rule into the aforementioned K hash mapping functions for calculation. The calculated hash value is then modulo N to obtain the corresponding index position, and the corresponding position in the application domain signature bitmap for that business rule is set to 1. When a real-time customs declaration event is input, the online inference module 30 performs the same hash operation sequence on the extracted event feature set to generate an event signature bitmap.

[0068] If all the bit positions in the applicable domain signature bitmap corresponding to a business rule can be matched in the event signature bitmap, then the business rule is included in the initial screening set. Subsequently, the online inference module 30 reads the original constraints of the rule's applicable domain descriptor and performs a precise match on each item for the applicable object, applicable event, applicable time, applicable region, applicable trade method, and required evidence conditions. Business rules that pass the precise match are included in the candidate calculation queue. This mechanism allows the initial screening set to include irrelevant rules caused by hash collisions, which will be excluded in the precise match stage. Business rules that fail the precise match do not enter the candidate calculation queue. The online inference module 30 does not use the hash initial screening result as the basis for the final risk judgment.

[0069] S320, for each business rule in the candidate calculation queue, the online inference module 30 performs consistent routing based on the entity status version and rule version. Since the node status in the customs declaration business graph dynamically changes throughout the entire document flow cycle, to ensure the timeliness and accuracy of the risk inference results, the online inference module 30 comprehensively determines the target entity's current entity status version number, the entity status version number recorded by the risk tag, the rule version identifier, and the persistent records awaiting updates. The aforementioned entity status version number and the entity status version number corresponding to the risk tag are generated by a database sequence, a global version service, or a distributed consistency counting service, and are used to characterize the order in which entity status updates are performed.

[0070] The online inference module 30 uses the following version control logic to determine the current event's flow path. If the entity status version number recorded in the risk label is consistent with the current entity status version number of the target entity, and the rule version identifier recorded in the risk label is consistent with the rule version identifier of the current business rule, and there are no pending change events related to this entity in the persistent update record, then the historical calculation results are determined to be valid. In this case, the system directly proceeds to read the materialized risk label path to save computational resources.

[0071] Conversely, if any of the above version numbers differ, there is a record to be updated, or in an abnormal situation where network latency causes failure to obtain any version number, the online inference module 30 will route the current customs declaration event to the real-time calculation path and submit the calculation task and corresponding parameters to the execution queue of the graph calculation engine.

[0072] S330, after triggering the real-time calculation path, the online inference module 30 dynamically extracts the minimum evaluation subgraph. To control the memory consumption of the graph calculation engine and limit unbounded traversal, the online inference module 30, based on the topological constraints of the pre-compiled query execution plan, extracts the local graph structure participating in the calculation of the current rule, starting from the customs declaration event node that triggers the current business rule.

[0073] In actual implementation, the online inference module 30 employs a breadth-first search algorithm, traversing the graph based on the maximum traversal depth threshold and maximum fan-out degree threshold configured in the pre-compiled query execution plan. When traversing to a node, if the actual number of its associated neighbor nodes exceeds the configured maximum fan-out degree threshold, the online inference module 30 first filters the neighbor nodes based on the rule dependency closure, the current customs declaration event association identifier, and the time validity period condition. If the number of filtered neighbor nodes still exceeds the maximum fan-out degree threshold, the online inference module 30 uses a batch reading or page traversal method to sequentially send the set of neighbor nodes into the memory working area for calculation, to avoid missing rule dependency objects due to directly truncating neighbor nodes.

[0074] The extracted minimum evaluation subgraph retains only the necessary entity attributes and physical loading topology mapping relationships required for the execution of the current business rules, thereby eliminating irrelevant background nodes in the full graph data.

[0075] S340, the online reasoning module 30 performs three-state reasoning based on evidence constraints in the extracted minimum evaluation subgraph and generates a corresponding risk interpretation chain. During the graph structure attribute verification process, for actual working conditions where there are missing or conflicting evidence constraint identifiers from multiple sources, the system expands the output status to three business output statuses: deterministic risk event, insufficient evidence risk event, or no-hit result.

[0076] The online reasoning module 30 uses the sufficiency of evidence calculated according to rules to determine the aforementioned three states. To ensure dimensional consistency and avoid abnormal division operations, the formula for calculating the sufficiency of evidence is as follows: ; In the formula, This indicates the sufficiency of evidence for the current rule validation, with a value range of [0,1]. This represents the total number of evidence sources required to participate in the calculation of the current business rules; Indicates the first One source of evidence; Indicates the first The validity status value of each source of evidence. This is determined when the source of evidence has a corresponding node record in the minimum evaluation subgraph and is not marked as pending review. The value is 1 if it is not 1, otherwise the value is 0. Indicates the first The importance weight coefficient of each evidence source in the business rules has a value range of (0,1]. This parameter is pre-configured by business personnel in the execution plan.

[0077] when At that time, the online reasoning module 30 will assess the sufficiency of the evidence. Set directly to 1 and skip the evidence source weighting calculation; when When the value is greater than 0, the online reasoning module 30 calculates the sufficiency of evidence according to the above formula. .

[0078] The sufficiency of evidence was calculated. Then, the online inference module 30 compares it with a preset high confidence threshold. and low confidence threshold A comparison was performed. Among them, The preferred range is [0.8, 1.0]. The preferred range is [0.4, 0.6]. The aforementioned confidence thresholds can be pre-configured based on historical customs declaration event samples. These samples include the evidence source status, rule triggering results, and final audit results; the final audit result is determined by manual review, on-site inspection, or subsequent handling. The system can perform offline verification of different threshold combinations based on the aforementioned historical customs declaration event samples and select the threshold combination that satisfies the preset audit strategy as the [preset audit strategy]. and .

[0079] The audit strategy conditions include: historical samples classified as certain risk events whose final audit results support the establishment of the risk; historical samples classified as insufficient evidence risk events that can trigger manual review, supplementary documentation, or on-site inspection processes; and historical samples classified as missing results whose final audit results do not fall under the category of samples requiring risk handling.

[0080] In the specific judgment logic, when the business rule logic condition is triggered, If the key sources of evidence are not missing, conflicts are not resolved, or are pending verification, the online reasoning module 30 will determine and output a deterministic risk event.

[0081] When the business rule logic condition is triggered, but the output condition for a deterministic risk event is not met, the online reasoning module 30 determines and outputs a risk event with insufficient evidence.

[0082] When the business rule logic condition is not triggered, the online inference module 30 determines and outputs a miss result.

[0083] Used for internal classification or review priority ranking of risk events with insufficient evidence, and not as a criterion for determining a missed result. When the business rule logic condition is triggered and When this occurs, the system marks the risk event with insufficient evidence as a high priority for review; when the business rule logic condition is triggered and In such cases, the system marks the risk event with insufficient evidence as a normal review priority.

[0084] For risk events with insufficient evidence, the system will temporarily store the status and restrict automatic release instructions until relevant documents are supplemented, manual review is conducted, or on-site inspection results are written, triggering a new round of calculation.

[0085] For both deterministic and insufficiently evidenced risk events in the output, the online reasoning module 30 extracts the nodes, related attributes, and associated evidence constraint identifiers of the triggering rules in the minimum evaluation subgraph, and serializes them into a JSON-based string to form a risk interpretation chain. This risk interpretation chain is output to the downstream handling process along with the risk assessment result, providing a traceability basis for subsequent manual review, on-site inspection, or early warning and control operations.

[0086] See attached document Figure 6 This illustrates the closed-loop process of physical truncation and status write-back for cargo ownership according to an embodiment of the present invention. The process demonstrates the propagation control of risk status between physical loading units, and the eventual consistency write-back process of the underlying data. The specific implementation of step S400 in the customs declaration full-process business object mapping and risk handling linkage method is as follows: S410, the handling control module 40 generates corresponding candidate handling paths based on the risk event types output by the online reasoning module 30, and conducts state simulations in the virtual graph slices.

[0087] Upon receiving a confirmed risk event or a risk event with insufficient evidence, the handling control module 40 queries the preset risk handling strategy mapping table to obtain the corresponding combination of action instructions such as on-site inspection, document locking, or manual review, and forms a candidate handling path.

[0088] The risk handling strategy mapping table records the correspondence between risk event types, risk levels, rule types, target object types, required preconditions, and candidate handling actions. Risk event types include certain risk events and insufficient evidence risk events; rule types include HS coding rules, regulatory condition rules, license rules, sanctions list rules, and price anomaly rules; target object types include declaration detail nodes, pallet nodes, container nodes, and document nodes; required preconditions include whether the target object is locatable, whether the necessary documents exist, and whether there are any regulatory extension conditions; candidate handling actions include on-site inspection, document locking, manual review, supplementary documentation, sorting and unpacking, and release maintenance.

[0089] The handling control module 40 uses the risk event type, the rule type of the hit rule, and the target object type of the risk source object as query keys to obtain candidate handling actions from the risk handling strategy mapping table, and filters the candidate handling actions according to the required preconditions to obtain candidate handling paths.

[0090] To prevent candidate disposal paths from modifying the production environment graph data before verification, the disposal control module 40 constructs virtual graph slices in the memory workspace. Specifically, based on the core node that triggers the current risk event, the system extracts related entity nodes at a preset number of layers (e.g., 1 to 2 layers) and performs a deep copy of the object state on the extracted local graph structure, forming virtual graph slices isolated from the production environment. Subsequently, the system rehearses the action instructions in the candidate disposal paths within these virtual graph slices, recording the expected modification results of the instructions on the entity state nodes to verify the correctness of the system state transition.

[0091] S420, after completing the state rehearsal, the disposal control module 40 performs an executable precondition check on the candidate disposal paths. The system checks whether the candidate disposal paths have the necessary documentation for execution. For example, when a candidate disposal path requires triggering an inspection action, the system verifies whether necessary document nodes such as bill of lading number, container number, and warehouse receipt information exist in the current local graph structure.

[0092] Simultaneously, the disposal control module 40 verifies the positioning accuracy of the disposal action. The system extracts the target graph node to which the disposal action points, and by identifying the object type of the node, determines whether its positioning can be accurate to the declaration detail line node or the specific physical loading unit node.

[0093] In this embodiment, when the target node type belongs to the declaration details line node, pallet node, container node, or other preset manageable node types, the system determines that the processing action meets the positioning accuracy requirements.

[0094] When the target node type does not belong to the preset manageable node types, the system determines that the positioning accuracy of the handling action is insufficient and rejects the candidate handling path. This step is used to restrict the handling action from being applied to objects that cannot be clearly located.

[0095] S430, for candidate disposal paths that pass the precondition verification, the disposal control module 40 performs a comparison and interception of the regulatory extension conditions and scope. In the graph network topology, disposal actions may radiate outward along the topological edges to non-directly risky nodes. Therefore, the disposal control module 40 uses set computation to compare the difference between the scope of the target objects of the candidate disposal path and the coverage of the risk interpretation chain. The relevant set computation formula is as follows: ; In the formula, Represents the set of nodes that have exceeded the boundary; This represents the set of all entity nodes that the candidate disposal path is expected to affect in the virtual graph slice; This represents the set of entity nodes actually covered by the risk explanation chain; The difference operation logic of the set is represented by comparing the globally unique identifiers corresponding to the entity nodes.

[0096] When the calculation result is displayed When the set is empty, the handling control module 40 determines that the scope of the handling action does not exceed the coverage of the risk interpretation chain. If the value is not empty, it indicates that the action taken exceeded the scope of the risk interpretation chain, involving entity nodes not covered by the chain. In this case, the system further queries the pre-defined regulatory extension condition registry.

[0097] If the registry contains regulatory extension conditions, such as requiring full-container inspection for specific high-risk goods, and the current customs declaration event meets these regulatory extension conditions, the system allows the execution of the candidate disposal path. If no regulatory extension conditions are met, the disposal control module 40 blocks the out-of-bounds candidate disposal path and outputs a scope exception blocking log to the system monitoring terminal to terminate the issuance of the current out-of-bounds instruction.

[0098] In cross-border logistics LCL shipping scenarios, when there are goods belonging to multiple cargo owners within the same physical loading unit, the disposal control module 40 performs cargo ownership boundary consistency verification and propagation truncation processing.

[0099] The disposal control module 40 extracts the ownership entity identifier of adjacent related entities and performs a consistency comparison based on the ownership entity identifier or its hash value. As one implementation, the disposal control module 40 uses a hash digest algorithm to process the ownership entity identifier, obtains the corresponding hash value, and compares the hash values ​​of adjacent related entities.

[0100] When the hash values ​​of adjacent related entities are inconsistent, the disposal control module 40 determines that the adjacent related entities do not belong to the same ownership boundary.

[0101] When the hash values ​​of adjacent related entities are consistent, the processing control module 40 further reads the original ownership entity identifier for precise comparison. If the original ownership entity identifiers are consistent, it is determined that the adjacent related entities belong to the same ownership boundary; if the original ownership entity identifiers are inconsistent, it is determined that the adjacent related entities do not belong to the same ownership boundary.

[0102] When the ownership entity identifier is missing or cannot be read, the disposal control module 40 generates a work order to be verified and suspends the propagation judgment process based on the ownership entity identifier.

[0103] Based on the comparison results, if it is confirmed that the ownership of goods of adjacent related entities is not the same entity, the disposal control module 40 controls the risk status to stop propagating at the boundary of the current physical loading unit during graph data traversal. Through this propagation cutoff mechanism, the system restricts the propagation of risk status across different ownership entities to avoid disposal actions being applied to declaration details lines or physical loading units that do not meet the propagation conditions.

[0104] The specific implementation method of step S500 in the method for linking business object mapping and risk management throughout the entire customs declaration process is as follows: S510, the status write-back module 50 initiates a local transaction in the underlying database and writes the final processing result to the attribute field of the corresponding entity's ontology object. To ensure the safety and consistency of data updates in a high-concurrency environment, the status write-back module 50 uses a compare-and-swap mechanism to execute modification instructions. When submitting an update instruction, the status write-back module 50 checks whether the current entity status version number stored in the underlying database is consistent with the initial version number read when the transaction started.

[0105] If the comparison matches, the state write-back module 50 updates the entity state version number to the latest generated global incrementing sequence value. Within the same transaction context, the state write-back module 50 inserts a change pending event for that entity into the persistent record table to be updated. The above transaction operation boundary ensures that the ontology object attribute changes and the pending state markers are completed within the same transaction.

[0106] If the comparison fails, the status write-back module 50 determines that a concurrent conflict has occurred, rolls back the current modification operation, and triggers a retry mechanism. To avoid increased system resource consumption due to unlimited retries under concurrent conditions, this embodiment configures a maximum retry limit for the retry mechanism (preferably set to 3 to 5 times) and uses an exponential backoff algorithm to control the time interval between each retry. When the maximum number of retries is reached and the comparison still fails, the status write-back module 50 terminates the current transaction, marks the handling result as an abnormal state, writes it to the dead letter queue, and hands it over to the timed task scheduler for asynchronous compensation update.

[0107] S520, after the database transaction is successfully committed, the status write-back module 50 obtains the identifiers of the affected entities and synchronously writes them into the auxiliary query structure in the memory layer. The technical purpose of this synchronous write operation is to provide low-latency probing for the online inference module 30 when performing version-based consistent routing. By querying the memory layer to see if there are change pending flags for the entities, the system reduces the read and write overhead caused by frequent queries to the underlying database, thus supporting the low-latency routing judgment of the online inference module 30.

[0108] As a preferred implementation, the auxiliary query structure employs a concurrent safe hash set that supports high-concurrency reads and writes. In this embodiment, the concurrent safe hash set is constructed using a segmented locking mechanism. Specifically, the memory manager pre-divides contiguous memory storage space into multiple independent data segment arrays (e.g., configured as 16 concurrent data segments).

[0109] When an entity identifier needs to be written, the status write-back module 50 calculates a hash value for the entity identifier and locates the specific data segment index by performing a bitwise AND operation on the high-order bits of the hash value. Then, the status write-back module 50 applies a mutex lock only to the target data segment, while the remaining data segments remain open for concurrent reading by other threads.

[0110] After completing the synchronous write, the S530 state write-back module 50 encapsulates the state update event, which includes the entity identifier and comparison data before and after the change, into a standard data stream payload and pushes it to a distributed message queue for asynchronous distribution. The background configured stream processing engine subscribes to and consumes the state update events in this message queue.

[0111] Upon receiving the event payload, the stream processing engine accesses the system's pre-defined reverse dependency graph. This reverse dependency graph uses an inverted index data structure to record the unidirectional dependency mapping relationship between specific entity attributes and upper-level business rules. The specific structure of this inverted index is as follows: the globally unique business code of each basic entity attribute is used as the key, and an array set consisting of rule identifiers of various business rules that depend on that attribute is used as the value.

[0112] The stream processing engine traverses the above mapping relationships to determine the scope of affected business rules that depend on the currently changed entity, and submits these rules along with the latest entity parameters to the calculation execution node, thereby triggering the asynchronous recalculation of risk labels.

[0113] S540, after the stream processing engine completes asynchronous recalculation, the state write-back module 50 performs risk label rematerialization and state cleanup operations. In this embodiment, the state write-back module 50 associates and stores the newly generated risk label with the updated entity state version number and the currently executed rule version identifier, and persistently writes the associated dataset into the database.

[0114] Once the system confirms that the recalculation result has been successfully written, the status write-back module 50 initiates a status cleanup command. This command is used to delete the corresponding pending event from the persistent record table to be updated in the database, and simultaneously remove the corresponding entity marker from the memory auxiliary query structure.

[0115] In a distributed operating environment, this embodiment is configured with an exception handling mechanism to handle recalculation task interruptions caused by server crashes or network partitions. If the stream processing engine fails to return a confirmation signal of successful recalculation to the status write-back module 50 within a preset time window, the status write-back module 50 will determine that the recalculation has timed out. The preset time window is preferably set within the range of 3s to 5s. This threshold is determined based on the average throughput processing latency of the system's historical message queue, plus the baseline calculation time of the graph computing engine at the 99th percentile.

[0116] When a timeout failure is detected, the status write-back module 50 retains the persistent record to be updated and the entity tag in the memory layer. When a subsequent associated customs declaration event arrives and triggers online inference verification, because the entity tag is still retained, the online inference module 30 restricts the reading of historical risk tags and routes the event to the real-time calculation path. This fault tolerance mechanism reduces the possibility of reading expired risk tags due to asynchronous recalculation anomalies.

[0117] The present invention also provides a computer device, including: a processor and a memory, the memory storing a computer program executable by the processor, the computer program performing the method described above when executed by the processor.

[0118] The present invention also provides a storage medium storing a computer program, which is executed by a processor to perform the method described above.

[0119] The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0120] To further clarify the technical workflow of this invention in actual business, a specific application example is given below in the context of cross-border LCL shipping.

[0121] This embodiment takes the scenario of exporting electronic devices containing lithium battery components in a single container at a certain port as an example, along with ordinary clothing in a consolidated shipment.

[0122] At the initial stage of shipment, shipper A declared the export of a batch of electronic equipment containing lithium battery components, while shipper B declared the export of a batch of ordinary clothing. The two batches of goods were consolidated into the same physical loading unit within the same container at the logistics terminal.

[0123] The ontology construction module 10 receives commercial invoices and packing lists submitted by shipper A and shipper B, as well as bills of lading and terminal tally reports submitted by the carrier. The system extracts the evidence level, extraction time, document correlation, and field integrity of the multi-party data and performs conflict resolution scoring. Regarding the cargo weight attribute of shipper A, since the evidence level corresponding to the bill of lading and terminal tally report submitted by the carrier is high, and the extraction time meets the preset time validity condition, the system determines that the candidate value of 1450kg has the highest score. It is written into the customs declaration business ontology model as the target value of this declaration detail line node, and the evidence constraint identifiers corresponding to the invoices, bills of lading, and terminal tally reports are retained simultaneously.

[0124] When the container triggers a formal declaration event, the online inference module 30 extracts the characteristics of the customs declaration event and inputs multiple preset hash mapping functions to generate an event signature bitmap. Through bitmap mapping comparison, the system initially filters out business rules such as high-risk commodity weight evidence conflict rules that match the current customs declaration event from the rule base.

[0125] Once the online inference module 30 detects that the entity status version number of the declaration detail line node is inconsistent with the entity status version number corresponding to the risk label, or that there are persistent records related to the declaration detail line node awaiting updates, it routes the current customs declaration event to the real-time calculation path. Under the real-time calculation path, the system expands outward to the pallet node associated with shipper A and the current container node based on the maximum traversal depth threshold and maximum fan-out degree threshold configured in the pre-compiled query execution plan, extracting the minimum evaluation subgraph to limit the range of nodes accessed by the current rule calculation.

[0126] Within the minimum evaluation subgraph, since the evidence constraints corresponding to the bill of lading and the terminal tally report are complete and the relevant weight attributes are not marked as pending review, the evidence sufficiency calculated by the online inference module 30 is greater than the preset high confidence threshold, outputting a deterministic risk event and generating a risk explanation chain that includes the source of differences between the invoice, bill of lading and terminal tally report.

[0127] The disposal control module 40 acquires the risk event and risk interpretation chain. During the comparison of regulatory extension conditions and scope, it is found that the ownership entity identifier or its hash value for the goods corresponding to shipper A and the goods corresponding to shipper B within the same container is inconsistent. Based on this, the disposal control module 40 stops the propagation of the risk status to the declaration details line and associated pallets corresponding to shipper B at the current physical loading unit boundary, and generates a locking and inspection disposal path for the declaration details line and associated pallets corresponding to shipper A; the goods corresponding to shipper B are not included in this disposal path due to the risk event of shipper A, and the original processing flow is maintained.

[0128] Finally, the status write-back module 50 initiates a local transaction in the underlying database, uses a compare-and-swap mechanism to write the verification status of the corresponding declaration detail line node and associated pallet node of shipper A into the ontology object attributes, increments the entity status version number and writes it to the persistent record to be updated, and then sends a status change event. The stream processing engine determines the scope of the affected business rules based on the status change event and asynchronously recalculates the relevant risk tags.

[0129] In an optional testing environment, the functionality and performance of the present invention are verified based on customs declaration map slices and customs declaration event flows. Test data includes customs declaration document data, declaration detail line data, physical loading unit data, rule data, and corresponding manual review or inspection results.

[0130] To demonstrate the technical features of this solution, the following comparative solution is provided: Compared to Option 1, which uses a relational database to store documents and performs risk assessment through cross-table queries; Compared with Scheme 2, which uses an attribute graph database to store document associations, the rules do not employ the rules application domain descriptor initial screening, maximum traversal depth threshold, maximum fan-out degree threshold, and minimum evaluation subgraph extraction mechanism during rule execution.

[0131] This embodiment adopts the customs declaration business ontology model, evidence constraint identifier, rule application domain descriptor, minimum evaluation subgraph extraction, and evidence constraint three-state reasoning mechanism described in the aforementioned embodiments.

[0132] Combined with appendix Figure 7 As can be seen, compared with the complex table connection lock contention in Scheme 1 and the unbounded graph traversal diffusion in Scheme 2, the scheme in this embodiment can reduce the number of business rules entering the candidate calculation queue in the online reasoning stage by using the rule application domain descriptor for initial screening and the minimum evaluation subgraph extraction, and limit the range of graph nodes accessed in a single rule calculation, thereby reducing the query latency fluctuations in the concurrent customs declaration event processing process and maintaining a smooth latency distribution.

[0133] Combined with appendix Figure 8It is evident that when processing entity data with densely associated edges, such as complex LCL (Less than Container Load) shipments, the comparative scheme two is prone to generating abnormally high values ​​due to a large number of redundant nodes being loaded into memory. Compared to the comparative scheme two, which does not set traversal boundaries, the scheme in this embodiment constrains the calculation range of online graph traversal through maximum traversal depth threshold, maximum fan-out degree threshold, and pagination traversal mechanism, effectively avoiding the phenomenon of excessive memory consumption in a single request, and making the overall memory consumption distribution more stable.

[0134] Combined with appendix Figure 9 As can be seen, compared to the binary judgment logic of Comparative Scheme 1 and Comparative Scheme 2, which only outputs the risk hit or the risk not hit, this embodiment uses evidence-constrained three-state reasoning to distinguish risk results into certain risk events, insufficient evidence risk events, and non-hit results. For insufficient evidence risk events caused by edge cases, the system can determine the review priority based on the sufficiency of evidence and the confidence threshold. Furthermore, combined with the consistency verification of cargo ownership boundaries and the propagation truncation processing, the system can restrict the propagation of risk status across different cargo ownership entities, thereby reducing the unreasonable impact of disposal actions on other entities in the same container that do not meet the propagation conditions, and effectively ensuring the normal business flow of unrelated risky goods.

[0135] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for linking business object mapping and risk management throughout the entire customs declaration process, characterized in that, Includes the following steps: Receive multi-source heterogeneous document data, construct a customs declaration business ontology model, extract entity attributes and evidence constraint identifiers corresponding to the entity attributes based on the customs declaration business ontology model, and perform value conflict resolution calculations for the multi-source heterogeneous document data to determine the target value of the entity attributes. Receive business rule text, perform syntax tree parsing and ontology type consistency verification, generate rule application domain descriptors, rule dependency closures and pre-compiled query execution plans for business rules that pass the verification, and configure rule version identifiers for business rules that meet the release conditions; Receive real-time customs declaration events, extract event feature sets and match them with the rule application domain descriptor to generate a candidate calculation queue; determine the status routing path based on the entity status version number, the entity status version number corresponding to the risk label and the rule version identifier; Under the real-time computing path, the minimum evaluation subgraph is extracted based on the pre-compiled query execution plan to perform inference, output risk event results and generate risk explanation chains; Obtain the results of the risk events and the risk interpretation chain, generate candidate disposal paths, and control the range of risk status propagation across physical loading units based on the ownership boundary identifier; The processing result is written back to the entity attribute, the entity status version number is updated, and asynchronous recalculation of the affected business rules is triggered.

2. The method for linking business object mapping and risk management throughout the entire customs declaration process according to claim 1, characterized in that, The step of resolving value conflicts arising from the multi-source heterogeneous document data and determining the target value of the entity attribute specifically includes: Based on the evidence source priority, document association, time validity, field completeness, and manual confirmation status corresponding to the evidence constraint identifier, configure the corresponding weight coefficients respectively; Based on the preset sub-functions and the weight coefficients, calculate the conflict resolution score for each candidate value corresponding to the same entity attribute; The candidate value with the highest and only conflict resolution score is selected as the target value of the entity attribute.

3. The method for linking business object mapping and risk management throughout the entire customs declaration process according to claim 1, characterized in that, The process of generating rule application domain descriptors, rule dependency closures, and pre-compiled query execution plans for validated business rules specifically includes: Extract the applicable objects, applicable events, applicable times, and required evidence preconditions from the abstract syntax tree parsed from the business rules to generate the rule application domain descriptor; Based on the graph traversal paths involved in the abstract syntax tree, associated nodes and edges are collected to generate the rule dependency closure; The pre-compiled query execution plan is generated based on the rule-dependent closure, and a maximum traversal depth threshold and a maximum fan-out degree threshold are configured in the pre-compiled query execution plan. The maximum traversal depth threshold is used to limit the level depth of graph traversal, and the maximum fan-out degree threshold is used to limit the number of associated neighbor nodes that a single node can obtain in the query.

4. The method for linking business object mapping and risk management throughout the entire customs declaration process according to claim 1, characterized in that, The step of extracting the event feature set and matching it with the rule application domain descriptor to generate a candidate computation queue specifically includes: The constraints in the rule's applicable domain descriptor are input into multiple preset hash mapping functions for modulo calculation to generate the applicable domain signature bitmap corresponding to the business rule; The same multiple hash mapping functions are applied to the event feature set to generate an event signature bitmap; If the set positions in the applicable domain signature bitmap corresponding to the business rule are all matched in the event signature bitmap, then the business rule will be included in the initial screening set. The constraints in the initial screening set are matched precisely item by item, and the business rules that pass the precise match are included in the candidate calculation queue.

5. The method for linking business object mapping and risk management throughout the entire customs declaration process according to claim 1, characterized in that, The determination of the status routing path based on the entity status version number, the entity status version number corresponding to the risk label, and the rule version identifier specifically includes: Obtain the entity status version number of the target entity, the entity status version number corresponding to the risk label, the rule version identifier recorded by the risk label, the rule version identifier of the business rule involved in the calculation, and the persistent record to be updated; If the entity status version number of the target entity is inconsistent with the entity status version number corresponding to the risk label, or the rule version identifier recorded by the risk label is inconsistent with the rule version identifier of the business rule participating in the calculation, or there is an associated change pending event in the persistent pending update record, then the real-time customs declaration event will be routed to the real-time calculation path.

6. The method for linking business object mapping and risk management throughout the entire customs declaration process according to claim 3, characterized in that, The step of extracting the minimum evaluation subgraph based on the pre-compiled query execution plan and performing inference specifically includes: After the real-time calculation path is triggered, a graph traversal is performed starting from the customs declaration event node that triggered the business rule, based on the maximum traversal depth threshold and the maximum fan-out degree threshold. When the number of associated neighbor nodes of a traversed node exceeds the maximum fan-out degree threshold, the associated neighbor nodes are filtered according to the rule dependency closure, and the minimum evaluation subgraph participating in the calculation of the business rule is extracted by pagination traversal.

7. The method for linking business object mapping and risk management throughout the entire customs declaration process according to claim 1, characterized in that, Based on the pre-compiled query execution plan, inference is performed by extracting the minimum evaluation subgraph, specifically including: In the minimum evaluation subgraph, the sufficiency of evidence for the business rule verification is calculated based on the validity status value and importance weight coefficient of the evidence sources involved in the calculation of the business rule. When the sufficiency of the evidence is greater than or equal to the high confidence threshold and the source of evidence is not missing, a deterministic risk event is determined and output. When the business rule is triggered but the output conditions of the deterministic risk event are not met, the risk event with insufficient evidence is determined to be output. When the business rule is not triggered, it is determined as a miss and no risk event result is output; The risk event outcome includes either the deterministic risk event or the insufficient evidence risk event.

8. The method for linking business object mapping and risk management throughout the entire customs declaration process according to claim 1, characterized in that, The control of the risk status propagation range across physical loading units based on the ownership boundary marker specifically includes: Extract the ownership identifier of adjacent related entities, and use a hash digest algorithm to calculate the hash value of the ownership identifier; Compare the hash value corresponding to the ownership entity identifier of the adjacent associated entities; If the comparison results are inconsistent, it is determined that the adjacent related entities do not belong to the same cargo ownership boundary, and the propagation of the risk status is stopped at the current physical loading unit boundary.

9. The method for linking business object mapping and risk management throughout the entire customs declaration process according to claim 1, characterized in that, The step of writing the processing execution result back to the entity attribute, updating the entity status version number, and triggering asynchronous recalculation for the affected business rules specifically includes: The entity status version number is verified using a compare-and-swap mechanism within the database transaction. If the comparison is consistent, the entity status version number is incremented and a change pending event is inserted into the persistent pending update record table. The status update event containing the entity identifier of the corresponding entity is pushed to the distributed message queue. The stream processing engine consumes the state update event, accesses the reverse dependency graph to determine the scope of business rules that depend on the entity, and submits the updated entity parameters to the computation execution node to trigger the asynchronous recalculation.

10. A system for linking business object mapping and risk management throughout the entire customs declaration process, applied to the method described in any one of claims 1-9, characterized in that, include: The ontology construction module is used to receive multi-source heterogeneous document data, construct a customs declaration business ontology model, extract entity attributes and evidence constraint identifiers corresponding to the entity attributes based on the customs declaration business ontology model, perform value conflict resolution calculations for the multi-source heterogeneous document data, and determine the target value of the entity attributes. The rule compilation module is used to receive business rule text, perform syntax tree parsing and ontology type consistency verification, generate rule application domain descriptors, rule dependency closures and pre-compiled query execution plans for business rules that pass the verification, and configure rule version identifiers for business rules that meet the release conditions. The online inference module is used to receive real-time customs declaration events, extract event feature sets and match them with the rule application domain descriptors to generate a candidate calculation queue; and determine the status routing path based on the entity status version number, the entity status version number corresponding to the risk label and the rule version identifier. Under the real-time computing path, the minimum evaluation subgraph is extracted based on the pre-compiled query execution plan to perform inference, output risk event results and generate risk explanation chains; The disposal control module is used to obtain the results of the risk event and the risk interpretation chain, generate candidate disposal paths, and control the range of risk status propagation across physical loading units based on the ownership boundary identifier. The status write-back module is used to write back the processing execution result to the entity attribute, update the entity status version number, and trigger asynchronous recalculation for the affected business rules.