Attachment identification and archiving method, apparatus, and medium
Patent Information
- Application Number
- CN202610827687.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-09
- Publication Date
- 2026-10-13
AI Technical Summary
[0003]因此,上述现有技术存在以下缺陷:第一,数据孤岛问题突出,订单数据与报销附件之间缺乏业务逻辑关联;第二,缺少场景化的合规校验引擎,无法自动判断附件类型、数量是否齐全及逻辑是否一致;第三,识别后的附件仍以原始杂乱格式存在,缺乏从识别到标准化归档的闭环处理流程
[0009]通过将附件信息与商旅订单数据转换为特征向量进行动态关联匹配,突破了传统模板匹配与孤立OCR识别的技术局限,提高了附件匹配准确率与效率。将原始附件统一转换为标准版式PDF并自动生成结构化归档目录,显著缩短归档准备时间与检索时间。
Smart Images

Figure CN122903913A_ABST
Abstract
Description
Technical Field
[0001] This document relates to the field of attachment recognition technology, and in particular to a method, device and medium for attachment recognition and archiving. Background Technology
[0002] Currently, the processing of receipts in corporate travel reimbursement processes mainly relies on two types of technical solutions. The first type is electronic invoice processing systems based on template matching or identification codes. For example, patent application CN114049643A discloses a QR code-based traceability method for electronic financial records management. This method links business data with reimbursement documents by adding QR codes to attachments. However, it relies on preset identifiers and lacks the ability to dynamically connect with heterogeneous platforms such as Ctrip Business Travel and Alibaba Business Travel, making it unable to process regular receipts without pre-set identifiers. The second type is receipt information extraction solutions based on OCR recognition. For example, patent CN117830015B discloses a voucher archiving processing system and method. This system obtains voucher information by scanning and compares it with a historical voucher set for verification. The OCR module of this type of solution only performs isolated recognition on a single receipt and lacks the ability to understand the contextual relationships between multiple receipts and attachments involved in a single reimbursement transaction.
[0003] Therefore, the existing technologies mentioned above have the following drawbacks: First, the problem of data silos is prominent, and there is a lack of business logic connection between order data and reimbursement attachments; Second, there is a lack of scenario-based compliance verification engines, which cannot automatically determine whether the attachment type and quantity are complete and whether the logic is consistent; Third, the identified attachments still exist in the original messy format, and there is a lack of a closed-loop processing flow from identification to standardized archiving.
[0004] Therefore, there is an urgent need for a fully automated processing method that can break down data barriers between business travel platforms and reimbursement systems, achieve intelligent association and matching of attachments and orders, and possess scenario-based compliance verification and standardized archiving capabilities. Summary of the Invention
[0005] This invention provides a method, device, and medium for attachment identification and archiving, aiming to solve the above-mentioned problems.
[0006] According to an embodiment of the present invention, an attachment identification and archiving method is provided, comprising: S1. Retrieve structured order data from the business travel platform based on expense reimbursement information; S2. After classifying the attachment packages uploaded by users, extract key fields; S3. By converting attachment information and order data into feature vectors and calculating similarity, the association and matching of attachments and order data are achieved; S4. Perform completeness and logical verification on the associated and matched attachments using a preset rule base, and obtain the verification results; S5. Standardize and convert the verified attachments, generate a print package, and archive them in a structured manner using the expense report number as the index.
[0007] According to an embodiment of the present invention, an electronic device is provided, characterized in that it comprises: Processor; and, A memory is configured to store computer-executable instructions that, when executed, cause the processor to perform the steps of the attachment identification and archiving method described above.
[0008] According to an embodiment of the present invention, a storage medium is provided, characterized in that it is used to store computer-executable instructions, which, when executed, implement the steps of the attachment identification and archiving method described above.
[0009] By converting attachment information and business travel order data into feature vectors for dynamic association and matching, the technical limitations of traditional template matching and isolated OCR recognition are overcome, improving the accuracy and efficiency of attachment matching. Original attachments are uniformly converted into standard PDF format and a structured archive catalog is automatically generated, significantly reducing archiving preparation and retrieval time.
[0010] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in one or more embodiments of this specification or in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 This is a flowchart of the attachment identification and archiving method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0013] To enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the technical solutions in one or more embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of this document.
[0014] Method Implementation Examples According to embodiments of the present invention, a method for identifying and archiving attachments is provided. Figure 1 This is a flowchart of the attachment identification and archiving method according to an embodiment of the present invention, such as... Figure 1 As shown, the attachment identification and archiving method according to an embodiment of the present invention specifically includes: S1. Retrieve structured order data from the business travel platform based on expense reimbursement information; S1 specifically includes: Based on the employee ID and travel time range in the expense report, the system retrieves structured order data from the business travel platform. This structured order data includes: a unique trip ID, a list of expenses, the amount, the merchant name, and the time information. Specifically, it establishes connections with multiple business travel platform APIs through a pre-configured OAuth 2.0 security protocol. When an employee initiates an expense report, the system automatically retrieves the corresponding structured order data from the business travel platform based on the employee ID and travel time range.
[0015] S2. After classifying the attachment packages uploaded by users, extract key fields; S2 specifically includes: First, the attachments are classified in a coarse-grained manner using an image classification model. Specifically, a ResNet50-based convolutional neural network is used as the backbone network to classify the attachments. The classification categories include air tickets, hotel bills, VAT invoices, taxi receipts, and approval forms.
[0016] For invoice attachments, a hybrid OCR model combining CRNN and Transformer is used for layout analysis and text recognition, extracting key fields including invoice number, amount, invoice date, and seller name. For non-invoice attachments such as approval forms, text information such as approver, date, and comments is extracted. In the hybrid OCR model, CRNN is responsible for extracting temporal feature sequences from the image, while the Transformer module globally encodes the feature sequences and outputs the text recognition results. This model improves recognition accuracy compared to a single CRNN model when invoice layouts vary. The classification results are used both to call the corresponding text extraction template during OCR recognition and to compare with the required attachment types in the rule base during step S4 verification.
[0017] S3. By converting attachment information and order data into feature vectors and calculating similarity, the association and matching of attachments and order data are achieved; S3 specifically includes: The attachment information and business travel expenses are converted into high-dimensional feature vectors. Cosine similarity and edit distance of key fields are calculated, and a dynamic threshold is set to achieve intelligent binding between attachments and expenses, establishing a three-level association relationship between itinerary ID, expenses, and attachments. The high-dimensional feature vectors are constructed by normalizing the amounts, dates, and merchant names of the attachments, converting them to timestamps, and embedding them into text, then concatenating them to form a multi-dimensional vector. The dynamic threshold is adaptively adjusted based on the confidence level of the attachment type. When the attachment classification confidence level is higher than the first threshold, a lower similarity matching threshold is used; when the classification confidence level is lower than the second threshold, a higher similarity matching threshold is used, and a manual review prompt is triggered. For example, an invoice from a hotel in Beijing is matched with the hotel accommodation fee item in a business travel order, establishing a three-level association relationship between itinerary ID, expenses, and attachments.
[0018] S4. Perform completeness and logical verification on the associated and matched attachments using a preset rule base, and obtain the verification results; S4 specifically includes: Build a configurable reimbursement rule knowledge base and store mandatory attachment configuration rules according to business travel scenarios; business travel scenarios include at least three categories: domestic business travel, international business travel, and business entertainment.
[0019] The system automatically calls the corresponding rule template based on the travel type filled in on the expense report; Iterate through the set of associated attachments and execute the preset validation logic for each item. A forward chain reasoning mechanism is adopted to map each rule to a Boolean expression, and the truth value determination of all rules is completed through parallel computation; If all rules pass, a validation pass signal is output. If any rule fails, the specific missing or abnormal attachment type is identified, a precise warning text is generated and pushed to the user, and a re-validation is automatically triggered after the user supplements the missing or abnormal attachment. For example, if the validation fails, a warning is sent to the user: "Missing hotel accommodation invoice detected. Please upload it."
[0020] The preset verification logic includes: The set of attachment types required by the rule base is compared with the set of types of already associated attachments to determine whether there are any missing types. Extract the start and end timestamps of the trip and the time fields in each attachment, construct a timeline model, use interval algebra algorithm to verify whether the time points of each attachment are included in the trip time interval, and check whether the time sequence of multiple tickets in the same trip is consistent with the business logic. The merchant name and the travel destination address are converted into latitude and longitude coordinates by calling the geocoding interface, and the spherical distance between the two is calculated. If the distance exceeds the preset threshold, it is judged as a consumption in a different location and an alert is triggered. The system accumulates the total amount of attachments of the same type according to the expense type and dynamically compares it with the expense standard upper limit in the rule base for this travel scenario. It supports two modes: single-item over-limit warning and cumulative over-limit interception. The single-item over-limit warning mode is applicable to scenarios where the amount of a single invoice cannot exceed a specific upper limit, while the cumulative over-limit interception mode is applicable to scenarios where the total amount of multiple invoices of the same expense type cannot exceed a specific upper limit. The system automatically selects the corresponding verification logic according to the expense control mode configured in the rule base.
[0021] If any layer of verification fails, the process terminates and the corresponding warning message is output.
[0022] S5. Standardize and convert the verified attachments, generate a print package, and archive them in a structured manner using the expense report number as the index.
[0023] S5 specifically includes: The PDF rendering engine is invoked to create a blank document object. The list of verified attachments is then traversed, and the image data of each attachment is drawn page by page into the document object. Specifically, for verified invoice-type attachments, the PDF generation engine is invoked to convert the original images or non-standard PDFs into A4-sized, fixed-format standard PDFs that conform to the requirements of the financial supervision seal. During the conversion process, the PDF generation engine automatically detects the financial supervision seal area in the original image. If it is missing, the corresponding type of supervision seal image is extracted from the standard seal template library, and after calculating the scaling ratio, it is embedded in a preset position on the PDF page.
[0024] During the traversal, based on the attachment type tags output in step S2, bookmarks are inserted into the document object, and the bookmark name is taken from the attachment type tag value; After the traversal is complete, the table generation interface is called to create a table of contents page at the beginning of the document, recording the name of each bookmark and its starting page number, and serializing the document object into a PDF file; then, all compliant attachments for this reimbursement are aggregated to generate a print package file containing a table of contents page, arranged in order of type, which can be printed in batches with one click.
[0025] Using the expense report number as the key, all generated PDF files under the same expense report are associated and stored in the archive directory. Specifically, a unique expense report number is generated for each completed expense report process. Based on this number, the following subdirectories and files are automatically created and organized: the Business Travel Order Data directory stores the original order data retrieved from the platform; the Original Attachments directory stores the original files uploaded by users and renamed according to the type_serial number format; the Standardized Archive Files directory stores the generated standard-format PDFs; and the Approval Process Records directory stores all approval comments and operation logs along the approval chain. Finally, the structured data package is automatically uploaded to the enterprise's designated cloud storage or document management system to complete the archiving.
[0026] The method further includes: When verification fails, the system records the reason for the failure and marks the specific type of the missing attachment. After the user uploads the missing attachment, the system will automatically jump back to step S2 to re-execute the identification and verification process until the verification passes or is terminated by manual intervention.
[0027] The following example illustrates the complete execution process of the above method.
[0028] Employee A initiated an expense report after completing a business trip from Beijing to Shanghai, with the trip dates from May 1st to May 3rd, 2025. The system executed step S1, retrieving structured order data from the Ctrip Business Travel platform via OAuth 2.0 protocol based on Employee A's employee ID and the travel time range. The resulting trip ID was TRIP20250501001, and the expenses included 800 RMB for accommodation at Shanghai XX Hotel and 1200 RMB for round-trip airfare. The merchant name was Shanghai XX Hotel, the check-in date was May 1st, and the departure time was 9:00 AM on May 1st.
[0029] Employee A uploaded an attachment package containing three images: a VAT invoice from Shanghai XX Hotel, a flight itinerary, and a screenshot of a business trip approval form. In step S2, an image classification model based on ResNet50 identifies the three images as a hotel bill, a flight ticket, and an approval form, respectively. Subsequently, a hybrid OCR model combining CRNN and Transformer extracts the following information from the hotel invoice: invoice number 12345678, amount 800 yuan, invoice date May 2, 2025, and seller name Shanghai XX Hotel; from the flight itinerary, the amount 1200 yuan and invoice date April 20, 2025; and from the approval form, the approver Li Si, approval date April 25, 2025, and approval opinion "Approved for business trip."
[0030] In step S3, the system converts the amount of 800 yuan, merchant name Shanghai XX Hotel, and invoice date May 2, 2025 from the hotel invoice into a high-dimensional feature vector. This vector is then used to calculate the cosine similarity with the hotel accommodation fee of 800 yuan, merchant name Shanghai XX Hotel, and check-in date May 1, retrieved in S1. The similarity is 0.96, exceeding the dynamic threshold of 0.85, thus indicating a successful match. A three-level association is established between the itinerary ID TRIP20250501001, the consumption item (hotel accommodation fee), and the attached hotel invoice. Similarly, the flight itinerary matches the round-trip ticket successfully, while the approval form is archived separately and not involved in the amount matching.
[0031] The expense report form is filled in as a domestic business trip. Step S4 calls the domestic business trip rule template for verification. Type verification: Required attachments, flight itinerary and hotel accommodation invoice, are all linked, passing; Time verification: Hotel invoice date May 2nd falls within the travel period of May 1st to May 3rd, passing; Location verification: Hotel location is Shanghai, consistent with the travel destination, passing; Amount verification: Hotel accommodation fee of 800 yuan is within the limit, passing. All four verifications pass, and a verification pass signal is output. If employee A has not uploaded a hotel invoice, the type verification layer will terminate the process and send a warning: Missing hotel accommodation invoice detected, please upload it.
[0032] After successful verification, step S5 generates the expense report number REIM20250501001 for this expense report. A PDF generation engine is used to convert the hotel invoice and flight itinerary images into standard A4 PDFs, merging them in the order of flight and hotel bookings. A table of contents is automatically generated at the beginning of the file, specifying the expense report number REIM20250501001, the claimant (Employee A), the travel dates (May 1st to May 3rd), the flight itinerary (page 2), and the hotel invoice (page 3). A folder is created with the expense report number as the root directory, containing four subdirectories: business travel order data, original expense report attachments, standardized archive files, and approval process records. This compressed file is then uploaded to the company cloud drive, with the storage location set to the expense report.
[0033] By converting attachment information and business travel order data into feature vectors for dynamic association and matching, the technical limitations of traditional template matching and isolated OCR recognition are overcome, improving the accuracy and efficiency of attachment matching. Original attachments are uniformly converted into standard PDF format and a structured archive catalog is automatically generated, significantly reducing archiving preparation and retrieval time.
[0034] Device Example 1 According to an embodiment of the present invention, an electronic device is provided. Figure 2 This is a schematic diagram of an electronic device according to an embodiment of the present invention. Figure 2 As shown, the electronic device of this invention includes: Processor 22; and, A memory 20 is configured to store computer-executable instructions, which, when executed, cause the processor 22 to perform the steps as described in the above method embodiments.
[0035] Device Example 2 According to an embodiment of the present invention, a storage medium is provided, characterized in that it is used to store computer-executable instructions, which, when executed, implement the steps of the method embodiments described above.
[0036] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for identifying and archiving attachments, characterized in that, include: S1. Retrieve structured order data from the business travel platform based on expense reimbursement information; S2. After classifying the attachment packages uploaded by users, extract key fields; S3. By converting attachment information and order data into feature vectors and calculating similarity, the association and matching of attachments and order data are achieved; S4. Perform completeness and logical verification on the associated and matched attachments using a preset rule base, and obtain the verification results; S5. Standardize and convert the verified attachments, generate a print package, and archive them in a structured manner using the expense report number as the index.
2. The method according to claim 1, characterized in that, S1 specifically includes: Based on the employee ID and travel time range in the expense report, structured order data is retrieved from the business travel platform. The structured order data includes: unique travel ID, list of consumption items, amount, merchant name, and time information.
3. The method according to claim 1, characterized in that, S2 specifically includes: First, the attachments are classified in a coarse-grained manner using an image classification model; For invoice attachments, a hybrid OCR model combining CRNN and Transformer is used for layout analysis and text recognition to extract key fields including invoice number, amount, invoice date, and seller name.
4. The method according to claim 1, characterized in that, S3 specifically includes: The attachment information and business travel consumption items are converted into high-dimensional feature vectors respectively. The cosine similarity and edit distance of key fields are calculated. Dynamic thresholds are set to realize the intelligent binding of attachments and consumption items, and a three-level association relationship of trip ID, consumption items and attachments is established.
5. The method according to claim 1, characterized in that, S4 specifically includes: Build a configurable reimbursement rule knowledge base and store mandatory attachment configuration rules according to business travel scenarios; The system automatically calls the corresponding rule template based on the travel type filled in on the expense report; Iterate through the set of associated attachments and execute the preset validation logic for each item. A forward chain reasoning mechanism is adopted to map each rule to a Boolean expression, and the truth value determination of all rules is completed through parallel computation; If all rules pass, a verification pass signal is output. If any rule fails, the specific missing or abnormal attachment type is located, a precise warning text is generated and pushed to the user's end, and a re-verification is automatically triggered after the user supplements the missing or abnormal attachment.
6. The method according to claim 5, characterized in that, The preset verification logic includes: The set of attachment types required by the rule base is compared with the set of types of already associated attachments to determine whether there are any missing types. Extract the start and end timestamps of the trip and the time fields in each attachment, construct a timeline model, use interval algebra algorithm to verify whether the time points of each attachment are included in the trip time interval, and check whether the time sequence of multiple tickets in the same trip is consistent with the business logic. The merchant name and the travel destination address are converted into latitude and longitude coordinates by calling the geocoding interface, and the spherical distance between the two is calculated. If the distance exceeds the preset threshold, it is judged as a consumption in a different location and an alert is triggered. The total amount of attachments of the same type is accumulated according to the expense type, and dynamically compared with the expense standard upper limit in the rule base for this travel scenario. It supports two modes: single over-limit warning and cumulative over-limit interception. If any layer of verification fails, the process terminates and the corresponding warning message is output.
7. The method according to claim 1, characterized in that, S5 specifically includes: Call the PDF rendering engine to create a blank document object, iterate through the list of verified attachments, and draw the image data of each attachment page by page into the document object; During the traversal, based on the attachment type tags output in step S2, bookmarks are inserted into the document object, and the bookmark name is taken from the attachment type tag value; After traversal is complete, the table generation interface is called to create a table of contents page in the document header, recording the name of each bookmark and its starting page number, and serializing the document object into a PDF file; Using the expense report number as the key, all generated PDF files under the same expense report are associated and stored in the archive directory.
8. The method according to claim 1, characterized in that, The method further includes: When verification fails, the system records the reason for the failure and marks the specific type of the missing attachment. After the user uploads the missing attachment, the system will automatically jump back to step S2 to re-execute the identification and verification process until the verification passes or is terminated by manual intervention.
9. An electronic device, characterized in that, include: processor; as well as, A memory configured to store computer-executable instructions, which, when executed, cause the processor to implement the steps of the attachment identification and archiving method as described in any one of claims 1 to 8.
10. A storage medium, characterized in that, Used to store computer-executable instructions, which, when executed, implement the steps of the attachment identification and archiving method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
A voucher filing processing system and method
CN117830015B