Invoice identification and inspection method

By receiving and preprocessing files in various formats, prioritizing the parsing of QR codes and using a multimodal model to identify invoice data, generating standardized data and exporting Excel files, the problem of low efficiency, poor accuracy, and resource waste in existing invoice verification methods has been solved, realizing an efficient and automated invoice verification process.

CN123182252APending Publication Date: 2026-11-27CHINA CONSTRUCTION BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611435790.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-16
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing invoice verification methods are inefficient, inaccurate, prone to omissions, and wasteful of computing resources, making it difficult to meet the needs of financial institutions for batch, automated, and efficient business operations.

Method used

By receiving and preprocessing PDF, JPG, and PNG format files, the system prioritizes parsing QR codes to obtain invoice data, eliminates non-invoice pages, uses a multimodal model to identify invoice types and extract fields, generates standardized data, supports automatic verification of multiple invoice types, and exports the results to an Excel file for human-machine collaborative verification.

Benefits of technology

It enables unified access to multi-media invoices, improves recognition efficiency and accuracy, reduces manual verification workload, lowers hardware costs and processing time, and enhances risk identification capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123182252A_ABST
    Figure CN123182252A_ABST
Patent Text Reader

Abstract

An invoice identification and checking method of the present application comprises: receiving a user uploaded PDF, JPG, PNG format file and preprocessing; identifying the preprocessed file, eliminating non-invoice files, and extracting standardized invoice data of the invoice file; storing the standardized invoice data into an identification result table; according to the identification file task identification passed by the front end, screening out the corresponding invoice record from the identification result table, writing into the Excel file according to the preset template, and performing pre-checking at the same time; receiving the Excel file and constructing a verification request message, calling a tax verification interface to realize batch verification of invoice data. The method can realize unified reception and batch processing of multi-media invoice files, and through setting a two-dimensional code priority analysis and a multi-modal model auxiliary judgment non-invoice page elimination mechanism, the identification and verification operation of the non-invoice page contained in the uploaded material can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of invoice recognition technology and relates to an invoice recognition and verification method and system. Background Technology

[0002] In recent years, with the continuous expansion of bank lending, the volume of invoice data processing involved in verifying the authenticity of trade backgrounds has increased dramatically. In the current operating procedures, invoice verification mainly relies on manual methods: business personnel need to browse through invoice images scattered in multiple PDF materials one by one, manually select valid invoice pages, enter the invoice information, and then complete the authenticity verification of each invoice through the tax platform, and manually retain and statistically analyze the verification results.

[0003] However, in actual business transactions, PDF documents often contain non-invoice pages. For example, a 50-page PDF might only contain 30 invoice images, with the remaining pages consisting of contract terms, company qualification documents, or irrelevant attachments. When manually processing these documents, business personnel must painstakingly search for and locate the invoice pages one by one among these irrelevant pages. This process is not only time-consuming but also highly susceptible to visual fatigue, leading to missed invoices or misjudged placement.

[0004] The shortcomings of the aforementioned manual model manifest in the following ways in actual business operations:

[0005] Firstly, the process is cumbersome and inefficient. Taking the verification of 100 invoices as an example, the entire process, from flipping through each page, filtering and locating, manual entry, to verifying each invoice on the tax platform, takes about 40 minutes. When the number of materials reaches hundreds or even thousands, the manual processing time will seriously affect the efficiency of loan approval.

[0006] Secondly, the accuracy of information entry is difficult to guarantee. When manually copying or entering invoice numbers, codes, amounts, and the last 6 digits of the verification code, errors frequently occur due to factors such as differences in invoice fonts, image clarity, and personnel status. This leads to subsequent failures in tax interface calls or inaccurate verification results, requiring repeated verification and re-entry, further lengthening the processing chain.

[0007] Third, the risk of omissions in verification is difficult to avoid. When manually searching for invoices in multi-page documents, it is easy to overlook some invoice pages due to negligence, resulting in incomplete verification of trade background and creating compliance risk exposure.

[0008] Fourth, the scarcity of computing resources and the associated costs are becoming increasingly prominent. Introducing deep learning models for automatic invoice image recognition is an inevitable choice for improving the level of intelligence. However, if all PDF pages are indiscriminately fed into the model for recognition (e.g., performing object detection and recognition page by page on a 50-page document), over 90% of the non-invoice pages will result in significant computing resource waste. On the one hand, irrelevant pages consume expensive GPU inference resources, significantly increasing hardware investment and cloud service costs; on the other hand, indiscriminate full-volume recognition greatly extends the processing time of a single task, easily causing task backlog in high-concurrency business scenarios, affecting system response performance, and weakening the efficiency benefits that intelligent transformation should bring.

[0009] In summary, existing invoice verification methods are no longer sufficient to meet the business needs of financial institutions for batch, automated, and efficient verification. Therefore, there is a need for an invoice batch recognition and verification system that can automatically filter out non-invoice pages, support mixed scenarios with multiple invoice types, and has a hierarchical processing strategy, as well as automatic data processing, statistical analysis, and result export functions. Summary of the Invention

[0010] To address the aforementioned technical problems, the purpose of this invention is to provide a method for identifying and verifying invoices.

[0011] This invention provides an invoice recognition and verification method, comprising:

[0012] Step 1: Receive and preprocess PDF, JPG, and PNG files uploaded by users;

[0013] Step 2: Recognize the preprocessed file, prioritize obtaining invoice data through QR code parsing. If the page does not parse out invoice information, switch to the multimodal model, remove non-invoice pages, and perform invoice type identification and field extraction on the invoice pages to generate standardized invoice data.

[0014] Step 3: Store the standardized invoice data in the recognition result table;

[0015] Step 4: Based on the recognition file task identifier transmitted from the front end, filter out the corresponding invoice records from the recognition result table, write them into an Excel file according to the preset template, and perform pre-verification at the same time;

[0016] Step 5: Receive the Excel file and construct a verification request message, then call the tax verification interface to perform batch verification of invoice data.

[0017] The invoice recognition and verification method of the present invention has the following beneficial effects:

[0018] 1. The method of the present invention can realize unified access to invoices of various media such as PDF and images, and is compatible with the situation where the uploaded materials contain non-invoice pages, thereby improving system compatibility.

[0019] 2. The method of the present invention can realize the automatic identification and structured data extraction of invoices of multiple types, thereby improving the identification efficiency and accuracy.

[0020] 3. The method of the present invention can realize automatic batch verification of invoices, which greatly reduces the workload of manual verification.

[0021] 4. The method of the present invention can support the statistics of tax-inclusive amount, red-ink amount and abnormal quantity, reducing manual processing work.

[0022] 5. The method of the present invention can automatically identify the results and export them to Excel. The results are then validated for legality. Cells that fail the validation are highlighted for visual reminders. After manual correction, the results are imported back into the verification system, which is a human-machine collaborative closed-loop mechanism. Attached Figure Description

[0023] Figure 1 This is a flowchart of an invoice recognition and verification method according to the present invention. Detailed Implementation

[0024] This method targets the application scenario of contract invoice processing in bank trade background authenticity verification. The invoice types in this scenario are mainly VAT special invoices, VAT general invoices, and fully digital electronic invoices (digital invoices), and do not involve other types of invoices. The system should be able to effectively control GPU computing power consumption and processing time while ensuring recognition accuracy through a dynamic computing power scheduling mechanism that prioritizes QR codes and uses multimodal model recognition as a backup. This will effectively improve the efficiency of trade background verification, reduce manual review costs, and enhance risk identification and continuous monitoring capabilities.

[0025] like Figure 1 As shown, an invoice recognition and verification method of the present invention includes:

[0026] Step 1: Receive and preprocess PDF, JPG, and PNG files uploaded by users, specifically as follows:

[0027] Step 1.1: Receive PDF files uploaded by users, as well as JPG and PNG files packaged as zip archives.

[0028] Step 1.2: Perform a unified validity check on all uploaded files. Specifically, use the MultipartFile.isEmpty() and getSize() methods to check and intercept empty files and files that exceed the size limit, respectively. If the size limit is exceeded, return the error message "File exceeds size limit" and terminate the file processing.

[0029] Step 1.3: For ZIP format compressed packages that pass the validity check, call the ZipFile method to decompress them. After decompression, iterate through each entry in the compressed package and extract the image files contained therein one by one. If decompression fails, prompt a file error and terminate the file processing.

[0030] Step 1.4: Read the header byte sequence of the file to be processed and match it with preset file type feature values ​​to determine the actual format of the file; wherein, the file type feature values ​​corresponding to PDF files are hexadecimal byte sequences 0x25, 0x50, 0x44, 0x46, 0x2D; the file type feature values ​​corresponding to JPEG files are hexadecimal byte sequences 0xFF, 0xD8, 0xFF; and the file type feature values ​​corresponding to PNG files are hexadecimal byte sequences 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A. The file identification task identifier is a unique identifier obtained by concatenating the current millisecond-level timestamp to the file name.

[0031] Step 1.5: For PDF files, use the PDFBox library to convert each page into an independent image; specifically: load the PDF file, iterate through each page of the file, render each page as an image and output it as a PNG format, thereby splitting a multi-page PDF into multiple independent image files.

[0032] Step 1.6: Perform preprocessing on the image file, including size unification, grayscale conversion, binarization, and rotation correction.

[0033] In practice, the OpenCV image processing library is used to perform various operations. Image scaling is achieved using Thumbnailator to scale the images to a uniform resolution to ensure consistency in subsequent processing; grayscale conversion is performed using Imgproc to convert the color image to grayscale; binarization uses the Otsu algorithm to convert the grayscale image to a black-and-white binary image to enhance the contrast between text and background; rotation correction involves transforming the detected tilt angle and then rotating the image to a horizontal orientation using Imgproc, thereby improving the accuracy of subsequent recognition and QR code recognition.

[0034] Step 1.7: Pass each preprocessed image to the invoice recognition module as a List collection for subsequent recognition processes to process one image at a time.

[0035] Step 2: Recognize the preprocessed files, prioritizing the retrieval of invoice data via QR code parsing. If no invoice information is parsed from the page, proceed to the multimodal model, eliminating non-invoice pages and performing invoice type identification and field extraction on the invoice pages to generate standardized invoice data. Specifically:

[0036] Step 2.1: Use the ZXing library to parse the QR code in each image to obtain the data string of the QR code recognition result.

[0037] Step 2.2: Split the data string according to the unified field naming convention using a delimiter (comma) to organize it into standardized invoice data, including invoice code, invoice number, invoice date, amount, and the last 6 digits of the verification code; and perform legality checks on the number and format of fields.

[0038] Step 2.3: When ZXing fails to parse the invoice information from the page, it transfers the image to the multimodal model-assisted recognition channel for further processing to ensure invoice processing coverage.

[0039] Step 2.4: For images transferred to the multimodal model-assisted recognition channel, the multimodal model first performs a binary classification judgment. By judging whether the page contains specific title keywords such as "VAT special invoice", "VAT general invoice", and "digital invoice", it identifies whether the page is a valid invoice image. If it is not an invoice image, it is removed.

[0040] Step 2.5: For images that are determined to be invoice pages, determine the invoice type based on the title keywords, and then determine the required field combination and extraction rules based on the invoice type; call the corresponding model to perform target detection and text recognition based on the invoice type, and extract the standardized invoice data for that type.

[0041] The field combinations extracted differ depending on the type of invoice. For VAT special invoices, VAT electronic special invoices, and VAT electronic general invoices, the invoice code, invoice number, invoice date, pre-tax amount, and the last 6 digits of the verification code need to be extracted. For fully digital electronic invoices, the invoice number, invoice date, and tax-inclusive amount need to be extracted.

[0042] Step 2.6: Add an identification source identifier to the standardized invoice data. A mark of 0 represents a QR code, and a mark of 1 represents a multimodal model-assisted identification channel.

[0043] Step 3: Store the standardized invoice data in the recognition result table, specifically as follows:

[0044] The standardized invoice data for each invoice is sent to the data storage module and written into the recognition result table, which facilitates subsequent manual data entry and verification.

[0045] The storage fields in the recognition result table include: record ID, recognition file name, recognition file task identifier, recognition date, invoice code, invoice number, invoice date, amount, last 6 digits of the verification code, and recognition source identifier; if the invoice is from a PDF, the PDF file name is the recognition file name, and if the invoice is from an image, the recognition file name is the image name.

[0046] Step 4: Based on the recognition file task identifier transmitted from the front end, filter out the corresponding invoice records from the recognition result table, write them into an Excel file according to a preset template, and perform pre-verification at the same time, specifically as follows:

[0047] Step 4.1: Based on the recognition file task identifier transmitted from the front end, filter out all invoice records from the recognition result table.

[0048] Step 4.2: Call the EasyExcel library to write the filtered invoice records into an Excel file according to the preset template; the preset template includes the following: invoice code, invoice number, invoice date, amount, last 6 digits of the verification code, and source identification.

[0049] Step 4.3: During the writing process, the legality of the identification fields is verified. The verification rules include: whether the amount is a number, whether the date conforms to the yyyyMMdd format, whether the invoice code is 10 or 12 digits (special invoice / general invoice) or empty, whether the invoice number is 8 digits (special invoice / general invoice) or 20 digits (digital invoice), and whether the verification code is 6 digits (general invoice) or empty (special invoice / digital invoice).

[0050] Step 4.4: For cells that fail the validation, a red background is preset in Excel so that users can intuitively locate the abnormal fields after downloading and opening the file, and perform manual review and supplementation, thereby improving the efficiency of manual review. After downloading the aforementioned Excel file, users can perform the review locally to improve the recognition accuracy.

[0051] In practice, if there are blank spaces or obvious problems with invoice information in the Excel spreadsheet during manual data entry, users can find the correct information in the invoice file and manually enter it into the Excel file.

[0052] Step 5: Receive the Excel file and construct a verification request message. Call the tax verification interface to perform batch verification of invoice data. Specifically:

[0053] Step 5.1: Receive the Excel file, call the EasyExcel library to parse the file content, read the data of each column row by row, and convert it into a standardized invoice data list according to the unified field naming convention based on the invoice type.

[0054] Step 5.2: According to the tax verification interface specification corresponding to the invoice type, encapsulate the invoice code, invoice number, invoice date, amount, and the last 6 digits of the verification code into a verification request message as required by the interface field.

[0055] Step 5.3: Call the tax verification interface, construct an HTTP POST request, and send the verification request message as the request body to the invoice verification platform of the tax system over the network.

[0056] Step 5.4: Receive the response data returned by the tax system, extract the invoice verification results through the JSON parsing library, and obtain all invoice data such as invoice verification status, red-ink cancellation status, invoice information, seller information, buyer information, and tax-inclusive amount.

[0057] Step 5.5: Send the verification results to the data storage module for persistent storage, so that they can be summarized and statistically analyzed later.

[0058] In practice, after the invoice is verified, the complete verification result returned by the tax system is written into the verification result table as the final audit basis.

[0059] The verification result table stores the following fields: verification record ID, verification file name, verification file task identifier, verification date, invoice code, invoice number, invoice date, amount including tax, amount excluding tax, last 6 digits of the verification code, invoice type, identification source, verification status, seller name, buyer name, and remarks field.

[0060] If the invoice originates from a PDF, the PDF file name will be the verification file name; if the invoice originates from an image, the verification file name will be the image name. The verification status is either normal or failed, and the red-inking status is either not voided, full red-inking, or partial red-inking.

[0061] In practice, the verification results can also be exported and statistically analyzed. The specific operation process is as follows:

[0062] (1) Read normal invoice records: When the verification file task identifier is received from the front end, all invoice data is filtered out from the data storage module according to the verification file task identifier.

[0063] (2) Grouped statistical amounts:

[0064] Statistical Method 1: Using the seller's name as the grouping condition, extract invoices with a normal verification status and a positive tax-inclusive amount, and sum the tax-inclusive amounts to help compare the actual loan amount with the tax-inclusive amount of the invoices with normal verification status.

[0065] Method 2: Based on the time period transmitted from the front end, sum the invoices in the database that are in a normal status and have a positive tax amount within that time period.

[0066] (3) Export results: Use the EasyExcel library to write the verification details and summary statistics into an Excel file and export it to the account manager who uploaded it.

[0067] The above description is only a preferred embodiment of the present invention and is not intended to limit the ideas of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. An invoice recognition check method, characterized by, include: Step 1: Receive and preprocess PDF, JPG, and PNG files uploaded by users; Step 2: Recognize the preprocessed file, prioritize obtaining invoice data through QR code parsing. If the page does not parse out invoice information, switch to the multimodal model, remove non-invoice pages, and perform invoice type identification and field extraction on the invoice pages to generate standardized invoice data. Step 3: Store the standardized invoice data in the recognition result table; Step 4: Based on the recognition file task identifier transmitted from the front end, filter out the corresponding invoice records from the recognition result table, write them into an Excel file according to the preset template, and perform pre-verification at the same time; Step 5: Receive the Excel file and construct a verification request message, then call the tax verification interface to perform batch verification of invoice data.

2. The invoice identification and verification method according to claim 1, characterized in that, Step 1 specifically involves: Step 1.1: Receive PDF files uploaded by users, as well as JPG and PNG files packaged as zip archives; Step 1.2: Perform a unified validity check on all uploaded files. Specifically, use the MultipartFile.isEmpty() and getSize() methods to check and intercept empty files and files that exceed the size limit, respectively. If the size limit is exceeded, return the "File exceeds size limit" error message and terminate the file processing. Step 1.3: For ZIP format compressed packages that pass the validity check, call the ZipFile method to decompress them. After decompression, iterate through each entry in the compressed package and extract the image files contained therein one by one. If decompression fails, prompt a file error and terminate the file processing. Step 1.4: Read the header byte sequence of the file to be processed and match it with preset file type feature values ​​to determine the actual format of the file; wherein, the file type feature values ​​corresponding to PDF files are hexadecimal byte sequences 0x25, 0x50, 0x44, 0x46, 0x2D; the file type feature values ​​corresponding to JPEG files are hexadecimal byte sequences 0xFF, 0xD8; and the file type feature values ​​corresponding to PNG files are hexadecimal byte sequences 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A; the file identification task identifier is a unique identifier obtained by concatenating the current millisecond-level timestamp to the file name. Step 1.5: For PDF files, use the PDFBox library to convert each page into an independent image; specifically: load the PDF file, iterate through each page of the file, render each page as an image and output it as a PNG format, thereby splitting a multi-page PDF into multiple independent image files; Step 1.6: Perform preprocessing on the image file, including size unification, grayscale conversion, binarization, and rotation correction; Step 1.7: Pass each preprocessed image to the invoice recognition module as a List collection for subsequent recognition processes to process one image at a time.

3. The invoice identification and verification method according to claim 1, characterized in that, Step 2 specifically involves: Step 2.1: Use the ZXing library to parse the QR code in each image to obtain the data string of the QR code recognition result; Step 2.2: Split the data string according to the unified field naming convention using delimiters, and organize it into standardized invoice data, including invoice code, invoice number, invoice date, amount, and the last 6 digits of the verification code; and perform legality checks on the number and format of fields. Step 2.3: When ZXing fails to parse the invoice information from the page, it transfers the image to the multimodal model-assisted recognition channel for further processing to ensure invoice processing coverage. Step 2.4: For images transferred to the multimodal model-assisted recognition channel, the multimodal model first performs a binary classification judgment. By judging whether the page contains specific title keywords such as "VAT special invoice", "VAT general invoice", and "digital invoice", it identifies whether the page is a valid invoice image. If it is not an invoice image, it is removed. Step 2.5: For images identified as invoice pages, determine the invoice type based on title keywords, then determine the required field combinations and extraction rules based on the invoice type; call the corresponding model to perform target detection and text recognition based on the invoice type, and extract standardized invoice data for that type; Step 2.6: Add an identification source identifier to the standardized invoice data. A mark of 0 represents a QR code, and a mark of 1 represents a multimodal model-assisted identification channel.

4. The invoice identification and verification method according to claim 1, characterized in that, Step 3 specifically involves: The standardized invoice data for each invoice is sent to the data storage module and written into the recognition result table, which facilitates subsequent manual data entry and verification. The storage fields in the recognition result table include: record ID, recognition file name, recognition file task identifier, recognition date, invoice code, invoice number, invoice date, amount, last 6 digits of the verification code, and recognition source identifier; if the invoice is from a PDF, the PDF file name is the recognition file name, and if the invoice is from an image, the recognition file name is the image name.

5. The invoice identification and verification method according to claim 1, characterized in that, Step 4 specifically involves: Step 4.1: Based on the recognition file task identifier transmitted from the front end, filter out all invoice records from the recognition result table; Step 4.2: Use the EasyExcel library to write the filtered invoice records into an Excel file according to the preset template; The preset template includes the following: invoice code, invoice number, invoice date, amount, last 6 digits of the verification code, and source identification; Step 4.3: During the writing process, the recognition fields are validated for legality. The validation rules include: whether the amount is a number, whether the date conforms to the yyyyMMdd format, whether the invoice code is 10 or 12 digits or empty, whether the invoice number is 8 or 20 digits, and whether the verification code is 6 digits or empty. Step 4.4: For cells that fail the validation, a red background is preset in Excel so that users can intuitively locate the abnormal fields after downloading and opening the file, and perform manual review and supplementation, thereby improving the efficiency of manual review. After downloading the aforementioned Excel file, users can perform the review locally to improve the recognition accuracy.

6. The invoice identification and verification method according to claim 1, characterized in that, Step 5 specifically involves: Step 5.1: Receive the Excel file, call the EasyExcel library to parse the file content, read the data of each column row by row, and convert it into a standardized invoice data list according to the unified field naming convention based on the invoice type; Step 5.2: According to the tax verification interface specification corresponding to the invoice type, encapsulate the invoice code, invoice number, invoice date, amount, and the last 6 digits of the verification code into a verification request message according to the interface field requirements; Step 5.3: Call the tax verification interface, construct an HTTP POST request, and send the verification request message as the request body to the invoice verification platform of the tax system over the network; Step 5.4: Receive the response data returned by the tax system, extract the invoice verification results through the JSON parsing library, and obtain all invoice data, including invoice verification status, red-ink cancellation status, invoice information, seller information, buyer information, and tax-inclusive amount. Step 5.5: Send the verification results to the data storage module for persistent storage, so that they can be summarized and statistically analyzed later.

7. The invoice identification and verification method according to claim 6, characterized in that, Step 5.5 specifically involves: After the invoice is verified, the complete verification result returned by the tax system is written into the verification result table as the final audit basis. The stored fields include: verification record ID, verification file name, verification file task identifier, verification date, invoice code, invoice number, invoice date, amount including tax, amount excluding tax, last 6 digits of the verification code, invoice type, identification source, verification status, seller name, buyer name, and remarks field; If the invoice originates from a PDF, the PDF file name will be the verification file name; if the invoice originates from an image, the verification file name will be the image name. The verification status is either normal or failed, and the red-inking status is either not voided, full red-inking, or partial red-inking.