Shipping document intelligent auditing method and intelligent agent based on large language model

CN122988914APending Publication Date: 2026-10-27SHANGHAI MARITIME UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611032584.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-13
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0007]本发明的目的在于提供一种基于大语言模型的航运货代单证智能审核方法及智能体,以解决现有技术中人工审核效率低、标准不统一、易出错,以及现有自动化方案缺乏深层语义理解与跨文档关联分析能力的问题

Benefits of technology

(1)两阶段处理的串扰抑制效果:实验数据表明,两阶段处理将多文档信息串扰率从单次大语言模型调用的23.4%降至2.1%,字段提取准确率从71.3%提升至94.7%,有效解决了多文档同时输入大语言模型时的上下文窗口溢出问题和信息混淆问题;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122988914A_ABST
    Figure CN122988914A_ABST
Patent Text Reader

Abstract

The application discloses a shipping freight forwarding document intelligent auditing method and an intelligent agent based on a large language model. The method comprises: in the first stage, each document is independently subjected to structured extraction to eliminate multi-document information crosstalk; in the second stage, all standardized data are summarized to perform cross-document consistency comparison taking a contract as an anchor point, and a risk scoring function is adopted to quantitatively grade the risk of each inconsistent point, and meanwhile, missing field detection is performed to mark key information existing in the contract but not embodied in the document. The application realizes the intelligentization and precision of shipping freight forwarding document auditing, and provides intelligent technical support for single document compliance checking and risk control in the international trade logistics chain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the interdisciplinary field of shipping logistics and artificial intelligence. Specifically, it relates to an intelligent verification method and intelligent agent for shipping and freight forwarding documents based on a two-stage processing of a large language model. It is particularly suitable for automated consistency verification and risk assessment scenarios between freight contracts and various types of transport documents in the international trade logistics chain. Background Technology

[0002] In the international trade and logistics chain, the verification of shipping and freight forwarding documents is a crucial link in ensuring the smooth shipment of goods. As one of the world's largest trading nations, China's import and export trade volume consistently remains at approximately US$6 trillion per year, with over 100,000 freight forwarding companies. A standard import / export freight verification typically involves 5 to 8 documents, including shipping contracts, consignment notes, bills of lading, commercial invoices, packing lists, certificates of origin, and insurance policies. Each document contains an average of 20 to 50 key fields that need to be verified. The document error rate averages 3% to 5% in the industry, meaning that millions of shipments may incur additional costs or delays annually due to document issues.

[0003] Freight forwarding companies need to verify the consistency between the freight contracts submitted by clients and documents such as shipping orders, bills of lading, commercial invoices, and packing lists before loading to ensure compliance and accuracy. However, the traditional manual review model faces many challenges: (1) Obvious efficiency bottleneck: A skilled auditor can handle a maximum of 30 to 40 shipments per day, which is difficult to cope with a large backlog of orders during peak business periods; (2) Audit standards vary from person to person: differences in experience and judgment among different personnel lead to unstable audit results, which may easily miss hidden discrepancies such as changes in transit ports and mismatch of container types; (3) Rising labor costs: The training of qualified auditors is a long process, usually requiring 6 to 12 months of professional training. Large-scale audits require a large amount of manpower, and labor costs account for more than 30% of operating costs. (4) Error risk is difficult to eliminate: human fatigue is prone to oversight. Once critical discrepancies are discovered after shipment, they may lead to bank refusal to pay, customs detention, delay fines, additional costs, or even legal disputes. The loss per shipment can reach thousands to tens of thousands of US dollars. (5) Lack of transparency and traceability in the audit process: It is difficult to grasp the audit progress and quality status in real time, and it is impossible to effectively carry out performance management and risk warning.

[0004] Existing technical solutions mostly employ simple OCR comparison or fixed rule engines, but both have significant limitations: (1) Limitations of OCR comparison schemes: They can only recognize text images but cannot understand semantic connotations. For example, "PREPAID" on a bill of lading and "freight prepaid" in a contract have the same semantic meaning, but OCR cannot recognize this semantic equivalence; another example is that the value of goods "USD500,000.00" on an invoice is different from the form of the contract amount, and OCR can only perform string comparison but cannot perform semantic normalization.

[0005] (2) Limitations of the rule engine: Each new document template requires manual writing of corresponding extraction and comparison rules, and the maintenance cost increases linearly with the number of document types. When document format differences between different countries / regions are involved, the number of rules expands exponentially, and the management of conflicts and priorities between rules becomes extremely complex. Traditional string exact matching methods cannot handle synonyms, such as "PREPAID" and "freight prepaid", nor can they handle format variations, such as "TOORDEROFSHIPPER" and "TOORDEROFTHESHIPPER", resulting in a mapping coverage of only 47.2%.

[0006] (3) Technical limitations of single large language model call: When multiple documents are input into the large language model for comparison at the same time, the following technical problems exist: a) Context window overflow problem: When multiple documents are input at the same time, the total length of the documents often exceeds the context window limit of the large language model. For example, some large language models have a context window length limit (such as the 4096 tokens window of some open source models). When the total length of multiple documents exceeds this limit, the content of the tail document will be truncated, and the field extraction will be incomplete; b) Attention decay problem: In the processing of long documents, the attention mechanism of the large language model has a decay phenomenon, which causes the relationship between distant fields to be ignored, and fields that are far apart cannot establish an effective association; c) Information crosstalk problem: When multiple documents are processed in the same context, the large language model will confuse the information of different documents. For example, it will confuse the consignee of the bill of lading with the consignee of the invoice, which will significantly reduce the extraction accuracy. Experimental data shows that when processing 5 documents in a single large language model call, the field extraction accuracy is only 71.3%, the cross-document comparison recall rate is only 58.6%, and the information crosstalk rate is as high as 23.4%. At the same time, existing solutions generally lack the ability to classify risk levels and detect missing fields, making it difficult to distinguish the urgency of discrepancies and to discover key information mentioned in the contract but omitted in the documents. Summary of the Invention

[0007] The purpose of this invention is to provide an intelligent review method and agent for shipping and freight forwarding documents based on a large language model, to solve the problems of low efficiency, inconsistent standards, and error-proneness in manual review in existing technologies, as well as the lack of deep semantic understanding and cross-document correlation analysis capabilities in existing automation solutions. In particular, this invention aims to address how to simulate the logic of a senior document reviewer, achieving full-process automation of multi-document parallel structured extraction, deep semantic comparison, and accurate risk classification centered on contracts.

[0008] The technical solution of the present invention is as follows: A method for intelligent verification of shipping and freight forwarding documents based on a large language model includes the following steps: S1: Receives document files uploaded by users.

[0009] We accept documents such as freight contracts, shipping orders, bills of lading, commercial invoices, and packing lists, supporting PDF, image, or Word formats.

[0010] S2: Parallel calls to the document parsing service for preprocessing.

[0011] Multiple documents are processed in parallel using multi-threading or asynchronous I / O technology. The original text content is extracted by calling PDF parsing libraries or OCR services, and a queue of tasks to be processed is established.

[0012] S3: Perform the first stage of large model processing.

[0013] Each document is submitted independently to a large language model for structured extraction. The model understands the semantics and layout of the document and outputs structured data in a standardized JSON format.

[0014] The structured data for each document includes key fields such as shipper, consignee, cargo description, quantity, volume, port of loading, port of destination, port of transshipment, and container type, as well as the corresponding field values ​​for these key fields.

[0015] This stage adopts an independent single-document input method, which effectively avoids the problems of context window overflow and information crosstalk.

[0016] The context window overflow problem refers to the issue where the total document length exceeds the context window limit of a large language model when multiple documents are entered simultaneously, resulting in the truncation of the document content at the end. Information crosstalk refers to the problem that when multiple documents are processed in the same context, the large language model confuses information from different documents, leading to a decrease in the accuracy of field extraction.

[0017] S4: Perform the second stage of large model processing.

[0018] Using the structured data of freight contracts as anchors, cross-document semantic comparisons are performed between the structured data of each document to be compared and the contract fields.

[0019] In S4, the agent first establishes association matching between contract fields and the fields of each document to be compared based on a semantic vector-based field mapping method: Step S41, Semantic Vector Mapping: Mapping the names of each key field in the freight contract. and all field names in each document to be compared Calculate the semantic vectors separately and The field names are encoded into high-dimensional semantic vectors using a pre-trained language model; Step S42, Cosine similarity calculation: Calculate the cosine similarity between vectors The mapping candidate with the highest similarity is selected. , Step S43, Confidence threshold screening: Set high threshold The threshold is 0.90; if the similarity is greater than this threshold, it is marked as automatically mapped. A lower threshold is also possible. The similarity is set at 0.75. If the similarity is between the low and high thresholds, it is marked as a weak mapping and requires secondary verification; if the similarity is lower than or equal to the low threshold, it is determined to be a non-mapped field. Step S44: Business ontology reasoning to obtain the final confirmed set of field mappings.

[0020] The shipping and freight forwarding sector itself includes: Equivalence relationships between key fields, such as Consignee being equivalent to Recipient being equivalent to Receiver. Inclusion relationships, for example, the shipping payment method includes FreightPaymentTerms. Business constraints, such as the freight payment method under FOB terms should be Collect; In other words, the "shipping and freight forwarding domain ontology" is a structured business knowledge base that defines equivalence relations, inclusion relations and business constraint rules between fields. It is used in step S44 to verify the business rationality of the semantic vector mapping results: transforming weak mappings into effective mappings, supplementing missing mappings, and discovering discrepancies that violate business rules, thereby significantly improving the accuracy and recall of field mapping.

[0021] Based on the shipping and freight forwarding ontology, the preliminary mapping results are processed as follows: Perform business constraint checks on the automatic mappings to verify whether they comply with business rules. Fields that pass the checks are included in the final confirmed set of field mappings. Weak mappings are verified using equivalence relations, inclusion relations, etc. If they can be confirmed, they are included in the final confirmed field mapping set; otherwise, they are marked as pending manual confirmation. For non-mapped fields, check if there are any field pairs in the ontology that fail vector similarity but are business equivalent. If so, supplement them and include them in the final confirmed field mapping set.

[0022] Step S45, Semantic Normalization Processing: For fields with established mapping relationships, the large language model is called to perform semantic normalization processing on the field values ​​in the contract and the field values ​​in the documents to be compared, respectively, converting semantically equivalent but differently expressed field values ​​into a unified standard form.

[0023] For example, Shanghai and Shanghai are identified as having the same semantic meaning, and PREPAID and prepaid freight are identified as equivalent metaphorical expressions; Step S46: Perform a precise comparison of the normalized field values ​​to identify the key fields where differences exist.

[0024] The following combination Figure 4 Here is a specific calculation example of field mapping and normalization processing in the second stage of step S4: For example, let the key field Fc of the freight contract be "Consignee", and the set of fields extracted from the document to be compared (bill of lading) be {"Consignee","Notify Party","Shipper"}.

[0025] Step S41: Use the pre-trained language model to encode "Consignee" as a first semantic vector V(Fc), and encode "Consignee", "Notify Party", and "Shipper" as second semantic vectors respectively. , , The semantic vector in this example has a dimension of 768.

[0026] Step S42: Calculate the cosine similarity. =0.95, =0.78, =0.15, the field pair with the highest similarity "Consignee" is selected as the mapping candidate.

[0027] Step S43: High Threshold =0.90, low threshold =0.75; =0.95 greater than Mark "Consignee" as automatically mapped; =0.78 is between and Between them, mark as weak mapping and proceed to step S44 for secondary verification; =0.15 less than It is determined to be a non-mapped field.

[0028] Step S44: Perform business constraint checks and equivalence relation verification based on the shipping and freight forwarding domain ontology.

[0029] In the ontology, "Consignee" is defined as "Consignee" and "Receiver". The automatic mapping of "Consignee" has been verified. For the weak mapping "Consignee – Notify Party", "Notify Party" and "Consignee" belong to different business roles in the ontology and do not constitute an equivalent relationship, so it is marked as pending manual confirmation; The final confirmed field mapping set in this step is {"Consignee"}.

[0030] Step S45: For the field pairs that have been mapped, call the large language model to perform semantic normalization processing on the freight contract field value "GlobalImportCorp" and the bill of lading field value "GLOBAL IMPORT CORP" respectively, and unify them into the standard form "GLOBALIMPORTCORP".

[0031] Step S46: Perform a precise comparison on the two normalized field values. If they are completely consistent, they are determined to be without difference. If the corresponding field value of another document (such as a commercial invoice) is "GLOBALIMPORTSCORP" (with an extra letter S) after the same normalization process, it is inconsistent with the contract field value and is identified as having a substantial semantic difference. It is then added to the field value difference list.

[0032] S5: Risk classification and missing field detection.

[0033] S5.1 Risk Classification: Quantitative risk assessment is performed on the discrepancies identified in S4, using a risk scoring function. , in: The business impact score measures the potential economic loss caused by the discrepancy, with a value ranging from 0 to 100. Typical values ​​include: those that may lead to bank chargeback. A value of 95 may result in customs seizure of the goods. If the value is 90, additional costs exceeding $5,000 may be incurred. A value of 80 may cause shipping delays. A value of 60 might trigger customer complaints. If the value is 45, then B is 15 if it only affects the aesthetics of the document. The deviation score measures the degree of deviation between the actual value and the contract value, with a value ranging from 0 to 100. Deviation of numeric fields It equals the absolute value of the difference between the actual value and the contract value divided by the contract value multiplied by 100; Enumerated fields 100 or 0; Text field It equals one minus the edit similarity multiplied by 100; The propagation score measures the extent of the discrepancy's impact on subsequent document chains, with a value ranging from 0 to 100. , , For weighting coefficients, the recommended value is... It is 0.5. It is 0.3. It is 0.2; Risk level determination rules: If A value greater than or equal to 70 is considered high risk. A score greater than or equal to 40 and less than 70 is considered medium risk. A value less than 40 is considered low risk.

[0034] The edit similarity value is calculated by the Levenshtein edit distance algorithm. The edit similarity value = 1 - Levenshtein edit distance / max(L1, L2), where L1 and L2 are the lengths of the field value strings in the contract and the field value strings in the document to be compared, respectively. S5.2 Missing Field Detection: Based on the structured data of the freight contract extracted in step S3, and combined with the predefined mandatory business fields in the shipping and freight forwarding domain ontology (such as shipper, consignee, port of loading, port of destination, cargo description, quantity, freight terms, etc.), a list of required fields for the freight contract is established; and each document to be compared is checked to see if it contains the required fields.

[0035] For missing fields, prioritize them according to their impact on business operations.

[0036] The present invention also includes active completeness verification, which is a process of identifying key fields that are clearly present in the contract but not mentioned in any document by cross-comparing the list of required fields of the freight contract with the set of extracted fields of all documents. This fills the blind spot of traditional auditing, which only looks at inconsistent field values ​​and does not look at the absence of fields, and increases the detection rate of completeness problems from 67% in traditional auditing to 98%.

[0037] S6: Generate a structured audit report that includes an audit overview, a list of field value differences (each with a corresponding risk level), a list of missing fields, and audit recommendations.

[0038] Preferably, steps S2 and S3 employ a parallel loop processing mechanism: for multiple documents, the document parsing service is called in parallel to extract the original text content of each document. After parsing is completed, the large language model is called in parallel to extract the structured content of the original text content of each document.

[0039] Furthermore, the present invention also provides an intelligent auditing agent for shipping and freight forwarding documents that implements the above method, including a user interface module, a document parsing module, a two-stage large model processing module, a risk analysis module, and a report generation module.

[0040] A user interface module for receiving documents uploaded by users, including freight contracts and at least one of consignment notes, bills of lading, commercial invoices and packing lists; The document parsing module is used to preprocess documents by calling the document parsing service in parallel and extracting the original text content of each document. The two-stage large-scale model processing module includes a first-stage structured processing unit and a second-stage cross-document comparison processing unit. The first-stage structured processing unit independently inputs the original text content of each document into the large-scale language model to generate structured data for each document. The second-stage cross-document comparison processing unit uses the structured data of the freight contract as an anchor point, inputs the structured data of each document and the structured data of the freight contract into the large-scale language model, performs cross-document semantic comparison, and generates a list of field value differences. Each item in the list of field value differences includes the field name, the field value in the contract, the field value in the document, and the type of difference. The risk analysis module is used to classify the risk of each item according to the type of word difference using a quantitative risk scoring function, and to extract the list of required fields of the freight contract, cross-compare it with the fields in the structured data of each document, identify missing fields and mark their priority, and generate a list of missing fields. The report generation module is used to summarize the list of field value differences and their risk levels, the list of missing fields, and review suggestions to generate a structured review report.

[0041] Preferably, the second-stage cross-document comparison processing unit of the two-stage large model processing module establishes field associations between contracts and documents using a field mapping method based on semantic vector similarity calculation and shipping and freight forwarding domain ontology reasoning.

[0042] Preferably, the risk analysis module uses a quantitative risk scoring function to classify discrepancies, and simultaneously performs proactive completeness checks to detect missing fields in the documents.

[0043] The beneficial effects of this invention are as follows: (1) Crosstalk suppression effect of two-stage processing: Experimental data show that two-stage processing reduces the crosstalk rate of multi-document information from 23.4% in a single large language model call to 2.1%, and increases the field extraction accuracy from 71.3% to 94.7%, effectively solving the context window overflow problem and information confusion problem when multiple documents are input into the large language model at the same time; (2) Robustness of semantic vector mapping: Compared to traditional regular expression matching or exact string comparison, the semantic vector mapping method can establish correct mappings for documents with different templates, languages, and expressions, achieving a mapping accuracy of 93.5%, while the mapping accuracy of exact string matching is only 47.2%. (3) Accuracy of quantitative risk scoring: Compared with subjective human judgment, the quantitative risk scoring function improves the consistency of the priority ranking of discrepancies from 62% to 89%, and increases the first detection rate of high-risk discrepancies from 78% to 96%; (4) Completeness of missing field detection: Proactive completeness verification increases the detection rate of document integrity issues from 67% in traditional auditing to 98%, effectively filling the blind spot of only looking at inconsistencies and not looking at non-existent fields; (5) Scalability of parallel processing: The cyclic parallel processing mechanism makes the document preprocessing time not increase linearly with the number of documents. The processing time for 5 documents is T, and the processing time for 10 documents is about 1.3T instead of 2T. (6) End-to-end audit process technical closed loop: From document parsing, structured extraction, cross-document comparison, risk classification to report generation, a complete technical closed loop is formed, and each link has quantifiable technical indicators. Attached Figure Description

[0044] Figure 1 This is a complete workflow diagram of the intelligent agent from receiving documents to generating an audit report in an embodiment of the present invention; Figure 2 This is a four-layer technical architecture diagram of the intelligent agent in an embodiment of the present invention (access layer, processing layer, analysis layer, output layer). Figure 3 This is a flowchart of the two-stage processing in this embodiment of the invention, consisting of the first stage of single-document structured extraction and the second stage of cross-document comparison. Figure 4 This is a schematic diagram of a field mapping comparison model based on semantic vectors and domain ontology in an embodiment of the present invention; Figure 5 This is a logic diagram of the discrepancy risk classification based on the risk scoring function in an embodiment of the present invention; Figure 6This is a flowchart of the missing field detection and active completeness verification in an embodiment of the present invention; Figure 7 This is a schematic diagram illustrating the mechanism of multi-document cyclic parallel processing in an embodiment of the present invention; Figure 8 This is a content structure diagram of the structured audit report generated in an embodiment of the present invention. Detailed Implementation

[0045] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments.

[0046] Example 1 This embodiment describes in detail the overall workflow and technical architecture of the intelligent auditing agent for shipping and freight forwarding documents.

[0047] like Figure 1 and Figure 2 As shown, the intelligent agent adopts a four-layer architecture design, including an access layer, a processing layer, an analysis layer, and an output layer.

[0048] At the access layer, users upload documents to be reviewed via a web interface or API. The intelligent agent supports uploading files in PDF, image (scanned) and Word formats.

[0049] After the file is uploaded, it enters the document parsing service for preprocessing, and calls the PDF parsing library (such as Pdfplumber) or OCR service (such as Tesseract) to extract the original text content.

[0050] The parsing results (original text content) are stored in a cache queue and distributed to subsequent processing modules via message queues (such as RabbitMQ or Kafka) to achieve high-concurrency processing capabilities.

[0051] At the processing layer, a two-stage large model processing mechanism is adopted.

[0052] like Figure 3 As shown, the first stage involves retrieving files to be processed in a loop, calling the document parsing service and the large language model interface in parallel, and having the large language model independently extract the structure from each document.

[0053] The intelligent agent employs prompt word engineering technology, using carefully designed prompt word templates to guide the model to output standardized JSON structured data, including 20 to 30 key fields such as shipper information, consignee information, cargo description, quantity, volume, port of loading, port of destination, transshipment port, container type, and freight terms.

[0054] The first phase adopts an independent single-document input method, with each document calling the large language model separately, thus avoiding the problems of context window overflow and information interference.

[0055] When multiple documents are input into a large language model simultaneously, the total document length often exceeds the model's context window limit (e.g., 4096 tokens), resulting in truncation of the document content at the end and incomplete field extraction. Furthermore, when multiple documents are processed in the same context, the model is prone to confusing information from different documents, such as conflating the consignee of a bill of lading with the consignee of an invoice. This invention reduces the crosstalk rate from 23.4% to 2.1% and improves the field extraction accuracy from 71.3% to 94.7% through a two-stage processing approach.

[0056] The second stage involves summarizing the structured data of all documents and then using the structured data of freight contracts as anchors to perform cross-document semantic comparison using a large language model.

[0057] like Figure 4 As shown, the model first establishes the association and matching between contract fields and document fields of each document to be compared based on a semantic vector-based field mapping method: (1) Calculate semantic vectors for the key field name Fc in the contract and the document field name Fd respectively. and ; (2) Calculate cosine similarity equal Dot product Divide by The modulus multiplied by The model; (3) If similarity Greater than the high threshold (0.90), automatic mapping is established; if the similarity is between the low threshold... (0.75) and Between them, those marked as weak mappings require secondary verification; if the similarity is less than or equal to... It is determined to be a non-mapped field; (4) Construct the shipping and freight forwarding domain ontology, define the equivalence relations, inclusion relations and business constraint relations between fields, and perform association reasoning based on the business ontology; (5) Normalize field values ​​that are semantically equivalent but have different forms of expression; (6) Perform a precise comparison to identify fields that differ.

[0058] Experimental data show that the semantic vector mapping accuracy of the present invention reaches 93.5%, which is significantly better than the 47.2% accuracy of string exact matching.

[0059] At the analysis layer, the risk grading module performs a quantitative risk assessment on the identified discrepancies.

[0060] like Figure 5 As shown, a risk scoring function is used. To provide accurate scores.

[0061] The missing field detection module establishes a list of required fields for the contract, checks whether each document contains all required fields, and fills in the detection blind spots through proactive completeness checks, increasing the detection rate of completeness issues to 98%.

[0062] At the output layer, the report generation module summarizes all analysis results and generates a structured audit report that includes an audit overview, a list of field value differences, a list of missing fields, and audit recommendations.

[0063] The report supports output in multiple formats including JSON, PDF, and HTML, and can be displayed to users via API or web interface.

[0064] Example 2 This embodiment is a specific application example (the scenario of exporting hamburgers from Shanghai).

[0065] This embodiment uses a freight shipment from Shanghai to Hamburg, Germany as an example to demonstrate in detail the practical application effect of intelligent agents.

[0066] Business Background: A freight forwarding company received a client's request to ship 200 boxes of electronic products from Shanghai Port to Hamburg Port, with a value of USD 500,000.

[0067] The client provided five documents: a freight contract, booking confirmation, draft bill of lading, commercial invoice, and packing list, requiring the documents to be reviewed before shipment.

[0068] The first stage of processing involves the agent receiving five document files in parallel, extracting the text content by calling the document parsing service, and then submitting them to the large language model for structured extraction.

[0069] The structured results of each document are as follows: Freight contract record: The shipper is "ABC Electronics Co., Ltd."; The consignee is "XYZTradingGmbH"; The goods are named "Electronic Components"; The quantity is 200 boxes, and the value is USD 500,000; Port of departure: Shanghai; Port of destination: Hamburg. The transit port is Rotterdam; The cabinet type is 40HQ; The shipping terms are "FreightPrepaid".

[0070] Second-stage processing: Cross-document comparison was performed using the contract as the anchor point, revealing the following discrepancies: The bill of lading shows "Singapore" as the port of transit, while the contract stipulates "Rotterdam," which is a substantial discrepancy. The bill of lading lists the container type as "20GP" while the contract specifies "40HQ," indicating a mismatch. The freight terms on the commercial invoice are worded "PREPAID," which is semantically consistent with "FreightPrepaid" in the contract. The agent correctly identified the differences as consistent rather than dissimilar.

[0071] Risk grading and missing data detection: The agent uses a quantitative risk scoring function to perform grading calculations.

[0072] Taking discrepancies in transit ports as an example, the impact on business... The deviation is 90. For 100 (completely different locations), the spread The value is 40 (as shown in multiple documents), substituting it in... =0.5×90+0.3×100+0.2×40, Calculation result The score was 83, which was determined to be high risk.

[0073] The intelligent agent marks changes to transit ports as high-risk and mismatches in container types as medium-risk.

[0074] At the same time, a missing gross weight field was detected in the packing list, and it was marked as medium priority.

[0075] The entire processing time is approximately 2 minutes and 30 seconds, significantly faster than the 15 to 30 minutes required for manual review.

[0076] To further demonstrate the specific operation process of the intelligent agent in steps S1 to S6 of this embodiment, the following is a combination of... Figure 4 , Figures 6-8 Explained step by step: S1. Receiving Documents: The agent receives the above 5 documents through the web interface, including the freight contract (contract.pdf), booking order (booking.pdf), draft bill of lading (bl_draft.pdf), commercial invoice (invoice.pdf), and packing list. All documents are in PDF format, and the total file size is approximately 3.2MB.

[0077] S2. Parallel parsing: The agent uses a multi-threaded asynchronous IO mechanism to call the document parsing service in parallel. It calls Pdfplumber to extract text from 5 documents. For the bill of lading draft containing scanned pages, it automatically switches to the Tesseract OCR service for image recognition. The total time for extracting the text of the 5 documents is about 8 seconds.

[0078] S3. First-stage structured extraction: The agent independently submits the original texts of the five documents to the large language model for structured extraction, avoiding crosstalk between multiple documents. See the aforementioned "Freight Contract Records" for details of the structured extraction results.

[0079] S4. Second stage cross-document comparison: The agent uses the contract as the anchor point and performs field mapping and normalization comparison according to steps S41 to S46.

[0080] For example, for the "Consignee" field pair, S41 encodes the two field names into 768-dimensional semantic vectors, and S42 calculates the cosine similarity. =0.95, S43 similarity is greater than the high threshold. = 0.90 Automatic mapping is established, S44 The ontology verification is passed, S45 The field value "XYZTradingGmbH" is normalized respectively, and S46 The accurate comparison and identification are consistent. For example, the values ​​of the two fields "FreightPrepaid" and "PREPAID" are normalized to the same standard form "PREPAID" by S45, and S46 identifies them as consistent rather than different (for other discrepancies, please refer to the discrepancy list in the previous paragraph).

[0081] S5.1 Risk Classification: The agent uses a risk scoring function for each discrepancy. (Recommendation weight) =0.5、 =0.3、 =0.2) to perform quantitative scoring; For detailed calculations of discrepancies at transit ports, please refer to the previous section. Cabinet type mismatch: Business impact =60 (corresponding to "may cause transportation delays" in the invention content value table), deviation degree =100 (completely inconsistent enumeration types), propagation =30 (only affects one bill of lading document), substitute =0.5×60+0.3×100+0.2×30=66, which is judged as medium risk.

[0082] S5.2 Missing Field Detection: Based on the structured data of freight contracts extracted by S3, the agent combines the predefined mandatory business fields in the shipping and freight forwarding domain ontology to establish a list of necessary contract fields (including more than 10 items such as shipper, consignee, port of loading, port of destination, cargo description, quantity, gross weight, and freight terms). By performing a cross-comparison between the list of necessary fields and the extracted field sets of 5 documents, the missing "gross weight" field in the packing list is detected and marked as medium priority according to its impact on business (affecting container loading and arrangement).

[0083] S6. Generate Audit Report: The agent summarizes the list of field value differences output by S4, the risk level output by S5.1, the list of missing fields output by S5.2, and the corresponding audit suggestions to generate a structured audit report.

[0084] The report structure includes: Review Overview (5 documents, 3 discrepancies, 1 missing field); Checklist (Transit port change: high risk; Container type mismatch: medium risk); Missing Fields List (Packing List – Gross Weight – Medium Priority); Review Recommendations (It is recommended to contact the shipping company to verify the transshipment port change; it is recommended to confirm the container type with the customer; it is recommended to supplement the packing list gross weight data).

[0085] The report supports output in JSON, PDF, and HTML formats.

[0086] Example 3 This embodiment designs three sets of comparative experiments to verify the superiority of the method of the present invention compared with the prior art.

[0087] The experiment used the same 20 freight transaction data, each containing 5 documents (freight contract, consignment note, bill of lading, commercial invoice, packing list), and senior document reviewers pre-marked all discrepancies and missing fields as the standard answer.

[0088] Experimental group A adopted a single large language model invocation method: inputting 5 documents into a large model at the same time to complete extraction and comparison in one step; Experimental group B uses a rule engine approach: it pre-sets field mapping rules and performs comparisons based on exact string matching. Experimental group C adopted the two-stage treatment method of this invention: The first stage involves independent structured extraction, and the second stage involves cross-document semantic comparison, combining semantic vector mapping and quantitative risk scoring.

[0089] The experimental statistical indicators include: field extraction accuracy (the proportion of extracted fields that match the standard answer), cross-document comparison recall (the ability to find real discrepancies), cross-document comparison precision (the proportion of real discrepancies among the discrepancies found), information crosstalk rate (the proportion of cross-document information confusion), missing field detection rate (the proportion of missing fields in the standard answer detected), and average review time.

[0090] The results of the comparative experiment are shown in the table below: Table 1: Comparative Experimental Results of the Three Methods

[0091] Analysis of experimental results: (1) Field extraction accuracy: This invention achieves 94.7%, which is significantly better than the 71.3% of a single large language model call and the 88.6% of the rule engine. This is due to the fact that the independent structured extraction in the first stage avoids the problems of context window overflow and information interference; (2) In terms of recall: the present invention achieved 91.2%, which is much higher than the 58.6% of a single large language model call and the 72.1% of the rule engine. This shows that the semantic vector mapping method can find more real discrepancies, while the string exact matching method misses a large number of discrepancies because it cannot handle synonyms; (3) In terms of accuracy: the present invention achieves 93.8%, which is better than the 64.2% of a single large language model call and similar to the 89.3% of the rule engine. This shows that the present invention maintains a high accuracy while improving recall, avoiding too many false positives; (4) Regarding the information crosstalk rate: the present invention has a rate of only 2.1%, which is far lower than the 23.4% of a single large language model call. Although the crosstalk rate of the rule engine is 0, this is because it uses completely independent field matching and lacks cross-document semantic understanding capabilities; (5) Regarding the missing field detection rate: This invention achieves 98.0%, which is far higher than the 31.5% of a single large language model call and the 67.0% of the rule engine. This is due to the proactive completeness verification mechanism, which effectively fills the detection blind spot of only looking at inconsistencies and not looking at non-existent fields; (6) Review time: The average review time of this invention is 3.1 minutes, which is slightly longer than the 0.5 minutes of the rule engine, but much faster than the 15 to 30 minutes of manual review, and has a fundamental advantage in key accuracy indicators. Compared with the 2.8 minutes of a single large language model call, the time added by this invention is mainly used for the second stage of accurate semantic comparison and quantitative risk scoring, but it brings significant benefits of a 32.6 percentage point increase in recall rate and a 66.5 percentage point increase in missing detection rate.

[0092] Example 4 This embodiment uses a simplified scenario involving two documents, a bill of lading and a commercial invoice, to demonstrate in detail the specific working process of the two-stage processing and risk classification mechanism.

[0093] Scenario setting: The freight contract stipulates that the value of the goods is USD100,000, the consignee is "GlobalImportCorp", the port of loading is "Ningbo", the port of destination is "LosAngeles", and the freight payment method is "Collect" (cash on delivery).

[0094] First stage of structured extraction: Bill of lading structured result: Shipper:ABCExportLtd.;Consignee:"GlobalImportCorp";Description:"MachineryParts";Quantity:50crates;Freight:"Collect";PortofLoading:"Ningbo";PortofDischarge:"LosAngeles"; Structured results of commercial invoices: Seller: ABCExportLtd.; Buyer: "GlobalImportsCorp" (Note: there is a spelling difference in the name; it is missing an "a"); Goods: "Machinery Parts"; Invoice Value: USD 100,000.00; Quantity: 50 crates; Incoterms: DDP; Second stage cross-document comparison: The intelligent agent performs semantic vector mapping and comparison using contracts as anchors: Recipient field: Contract "GlobalImportCorp" → Bill of Lading "GlobalImportCorp" → Cosine similarity 0.98 → Automatic mapping established → Consistent; Contract "GlobalImportCorp" → Invoice "GlobalImportsCorp" → Cosine similarity 0.87 → Between the thresholds → The large language model is used to determine that it is "a slight spelling variant of the same entity" and it is marked as a low-risk discrepancy. Value field: Contract USD100,000 → Invoice USD100,000.00 → Values ​​match, format differences, deviation calculation A value of 0 indicates low risk; Freight terms fields: Contract "Collect" → Bill of Lading "Collect" → Consistent; Contract "Collect" → Invoice "DDP" → Substantial difference exists, DDP (Delivered Duty Paid) and Collect (Freight Collect) are different trade terms.

[0095] Quantitative risk grading calculation: Freight terms not in compliance: Business impact B(f) is 80 (may lead to disputes over payment settlement), deviation rate The propagation degree is 100 (completely inconsistent with enumeration types). The value is 50 (affecting subsequent settlement processes). Substitute... =0.5×80+0.3×100+0.2×50, Calculation result The value was 81, which was determined to be a high-risk discrepancy. Consignee spelling differences: Business impact The deviation is 15 (only slight difference). The propagation value is 5 (the edit distance is very small), and the propagation range is... The value is 10 (affecting only one document). Substitute... =0.5×15+0.3×5+0.2×10, Calculation result The value is 11.5, which is considered a low-risk discrepancy. Differences in value formats: Business impact The deviation is 15. The propagation degree is 0 (the values ​​are exactly the same). The value is 5. Substitute it into... =0.5×15+0.3×0+0.2×5, Calculation result The score was 8.5, which was determined to be a low-risk discrepancy.

[0096] Missing field detection: The intelligent agent checks the coverage of required fields in each document: Insurance Amount field: Not clearly specified in the contract → Missing bill of lading → Missing due to low priority; HS code field: Not provided in contract → Bill of lading missing → Low priority missing; Gross weight field: Contract not provided → Invoice missing → Medium priority missing (packing requires reference data).

[0097] Review suggestions: 1. High priority.

[0098] Confirm shipping terms: Please contact customer service to confirm whether the actual shipping payment method is Collect or DDP. If it is DDP, relevant agreement documents need to be provided. 2. Medium priority.

[0099] Additional Gross Weight Information: Please provide the gross weight data so that we can arrange packing and shipment. 3. Low priority.

[0100] Verify the consignee's name: It is recommended to confirm the correct spelling of the consignee's company name with the customer to avoid customs clearance delays.

[0101] The above are merely preferred embodiments of the present invention and do not constitute any limitation on the present invention. Any equivalent substitutions or modifications made by those skilled in the art to the technical solutions and content disclosed in the present invention without departing from the scope of the present invention shall be deemed to have remained within the protection scope of the present invention.

Claims

1. A method for intelligent verification of shipping and freight forwarding documents based on a large language model, characterized in that, Including the following steps: Step S1: Receive the documents uploaded by the user; the documents include a freight contract, and at least one of a shipping order, bill of lading, commercial invoice, and packing list; wherein the freight contract, shipping order, bill of lading, commercial invoice, and packing list are all documents. Step S2: Parallel call to document parsing service: preprocess the document in parallel to extract the original text content; Step S3: Large model structure extraction: The original text content of each document is independently input into the large language model, which then performs structured extraction on each document to generate structured data for each document. The structured data includes key field names and key field values; Step S4: Cross-document semantic comparison: Using the structured data of the freight contract as the anchor, the structured data of each document and the structured data of the freight contract are input into the large language model. The large language model performs cross-document semantic comparison to identify semantic differences of the same key field name between the freight contract and the document to be compared, and generates a list of field value differences; each item in the list of field value differences is called a discrepancy. Step S5, Risk Classification and Missing Field Detection: For each discrepancy, a quantitative risk scoring function is used to classify the risk. At the same time, based on the structured data of the freight contract generated in step S3, a list of necessary fields is extracted. Each document to be compared is checked to see if the structured data contains the fields in the list of necessary fields. For missing fields, priority is marked according to their impact on the business, and a list of missing fields is generated. Step S6: Generate an audit report: Summarize the list of field value differences and their risk levels, the list of missing fields, and audit recommendations to generate a structured audit report.

2. The intelligent verification method for shipping and freight forwarding documents based on a large language model according to claim 1, characterized in that, Steps S3 and S4 may share the same large language model or use different large language models; the large language model is a pre-trained large-scale language model.

3. The intelligent verification method for shipping and freight forwarding documents based on a large language model according to claim 1, characterized in that, Step S3 uses a standalone single-document input method.

4. The intelligent verification method for shipping and freight forwarding documents based on a large language model according to claim 1, characterized in that, Step S4 specifically includes: Step S41, Semantic Vector Mapping: Map each key field name in the freight contract to a first semantic vector, and at the same time map all field names in the documents to be compared to a second semantic vector; The key fields refer to the field names in the structured data of each document; Step S42: Similarity calculation based on field semantic vectors: Calculate the cosine similarity between the first semantic vector and the second semantic vector, and take the field pair with the highest similarity as the mapping candidate; Step S43: Confidence threshold filtering to obtain preliminary mapping results; If the similarity is greater than the high threshold, it is marked as automatically mapped; If the similarity is between the low threshold and the high threshold, it is marked as a weak mapping; If the similarity is less than or equal to the low threshold, it is marked as a non-mapped field; The automatic mapping, weak mapping, and non-mapping fields together constitute the preliminary mapping result. Step S44: Business ontology reasoning, obtaining the final confirmed set of field mappings: Based on the shipping and freight forwarding ontology, the preliminary mapping results are processed as follows: Perform business constraint checks on the automatic mappings to verify whether they comply with business rules. Fields that pass the checks are included in the final confirmed set of field mappings. Weak mappings are verified using equivalence relations, inclusion relations, etc. If they can be confirmed, they are included in the final confirmed field mapping set; otherwise, they are marked as pending manual confirmation. For non-mapped fields, check if there are any field pairs in the ontology that fail the vector similarity test but are business equivalent. If so, supplement them and include them in the final confirmed field mapping set. Step S45: For the field mapping output in step S4, call the large language model to perform semantic normalization processing on the field values ​​in the freight contract and the field values ​​in the documents to be compared, and convert the semantically equivalent but different expression forms into a unified standard form. Step S46: Compare the normalized contract field values ​​with the document field values, identify fields with substantial semantic differences, and generate a list of field value differences.

5. The intelligent verification method for shipping and freight forwarding documents based on a large language model according to claim 1, characterized in that, The risk grading in step S5 is based on a quantitative scoring mechanism for business risk transmission, specifically including: Risk scoring function: ; in, Score the business impact. Scoring the deviation. Scoring based on dissemination, , , These are the weighting coefficients; Deviation quantification rules: For numeric fields ; For enumeration type fields =100 or 0; For text fields ; Risk level determination rules: If 70 is considered high risk. It is classified as medium risk. It was determined to be low risk.

6. The intelligent verification method for shipping and freight forwarding documents based on a large language model according to claim 1, characterized in that, Step S5, which involves detecting missing contract fields in each document to be compared, specifically includes: Based on the structured data of freight contracts extracted in step S3, and combined with the predefined mandatory business fields in the shipping and freight forwarding domain ontology, a list of required fields for freight contracts is established. Check each document to be compared to see if it contains the required fields; For missing fields, they are marked as high priority, medium priority, or low priority based on their impact on business operations.

7. The intelligent verification method for shipping and freight forwarding documents based on a large language model according to claim 1, characterized in that, Steps S2 and S3 employ a parallel loop processing mechanism: for multiple documents, the document parsing service is called in parallel to extract the original text content of each document. After parsing is completed, the large language model is called in parallel to extract the structured content of the original text content of each document.

8. A smart agent for intelligent review of shipping and freight forwarding documents, used to implement the intelligent review method for shipping and freight forwarding documents based on a large language model as described in any one of claims 1 to 7, characterized in that, include: A user interface module for receiving documents uploaded by users, including freight contracts and at least one of consignment notes, bills of lading, commercial invoices and packing lists; The document parsing module is used to preprocess documents by calling the document parsing service in parallel and extracting the original text content of each document. The two-stage large model processing module includes a first-stage structured processing unit and a second-stage cross-document comparison processing unit; The first-stage structured processing unit is used to independently input the original text content of each document into the large language model to generate structured data for each document. The second-stage cross-document comparison processing unit is used to input the structured data of each document and the structured data of the freight contract into the large language model, using the structured data of the freight contract as the anchor point, to perform cross-document semantic comparison and generate a list of field value differences; each item in the list of field value differences includes the field name, the field value in the contract, the field value in the document, and the type of difference. The risk analysis module is used to classify the risk of each item according to the type of word difference using a quantitative risk scoring function, and to extract the list of required fields of the freight contract, cross-compare it with the fields in the structured data of each document, identify missing fields and mark their priority, and generate a list of missing fields. The report generation module is used to summarize the list of field value differences and their risk levels, the list of missing fields, and review suggestions to generate a structured review report.

9. The intelligent auditing system for shipping and freight forwarding documents according to claim 7, characterized in that, The second-stage cross-document comparison processing unit of the two-stage large model processing module establishes field associations between contracts and documents using a field mapping method based on semantic vector similarity calculation and shipping and freight forwarding domain ontology reasoning.

10. The intelligent auditing agent for shipping and freight forwarding documents according to claim 7, characterized in that, The risk analysis module uses a quantitative risk scoring function to classify discrepancies, and simultaneously performs proactive completeness checks to detect missing fields in documents.

Citation Information

Patent Citations

  • An articulated rail car or similar article

    USD100000S

  • Automobile body

    USD500000S