Electronic invoice checking method and device, terminal and storage medium

Through multimodal identification technology and two-layer verification mechanism, the efficiency and accuracy of batch inspection of electronic invoices in the existing technology are solved, efficient and accurate verification of various types of invoices are achieved, and the response capabilities of financial management are improved.

CN119131953APending Publication Date: 2024-12-13JIANGSU HUANXUN INFORMATION TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411210093.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

It is difficult for the existing technology to quickly and accurately verify the authenticity of electronic invoices and layout documents in batches, especially when facing complex and changeable invoice formats and potential forgery methods, single-mode inspection methods are difficult to meet the rapid response requirements of modern financial management.

Method used

Multimodal recognition technology is used to combine preset multiple invoice file templates to conduct double-layer authenticity verification of electronic invoices, ensure the accuracy of identification results through initial and secondary verification, and support multiple types of electronic invoice verification.

Benefits of technology

It realizes efficient and accurate batch inspection of electronic invoices, provides double-layer guaranteed identification results, and supports multiple types of invoice templates, improving the practicality and accuracy of inspections.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119131953A_ABST
    Figure CN119131953A_ABST
Patent Text Reader

Abstract

The invention discloses an electronic invoice checking method and device, a terminal and a storage medium, and the method comprises the steps: obtaining an invoice file of a to-be-checked electronic invoice, carrying out the preprocessing of the invoice file, and obtaining an invoice picture corresponding to the invoice file; carrying out multi-mode identification on the invoice pictures one by one and respectively obtaining an identification result of each invoice picture, wherein the identification result comprises invoice layout information and invoice data information; acquiring actual invoice data of the electronic invoice from the third-party platform according to the invoice data information, and performing primary authenticity verification on the electronic invoice in combination with the actual invoice data; after the primary authenticity verification is passed, carrying out secondary authenticity verification on the electronic invoice according to the invoice layout information and a pre-stored invoice template; and after the secondary authenticity verification is passed, outputting a verification result of the electronic invoice. According to the method, the identification result of the electronic invoice has double-layer guarantee and is more accurate, meanwhile, multiple types of invoice templates are pre-stored, checking of multiple types of electronic invoices can be supported, and the method is more practical.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of electronic invoice verification, and in particular to an electronic invoice verification method, device, terminal and storage medium. Background Art

[0002] With the popularity of e-commerce and digital office, electronic invoices have become an important voucher in daily business transactions. Therefore, how to quickly and batch-verify the authenticity of invoices and their format documents has become an important issue facing enterprises and financial institutions. However, the traditional manual verification method can only verify individual invoices one by one, which is not only inefficient but also prone to errors, and it is difficult to meet the rapid response requirements of modern financial management. In addition, although there are some electronic invoice verification tools on the market, most of them rely on a single recognition mode (such as only through QR code scanning or OCR text recognition), and when batch-checking electronic invoices, they can usually only handle a single type of invoice, which is difficult to deal with complex and changeable invoice formats, and is prone to false detection. In addition, the means of counterfeiting electronic invoices are becoming more and more complicated, and a single-mode verification method has been unable to deal with potential counterfeiting methods.

[0003] Therefore, there is an urgent need for a technical solution that can efficiently and accurately verify the authenticity of electronic invoices and format documents in batches. Summary of the invention

[0004] In order to be able to efficiently and accurately batch check electronic invoices and format files, the present application provides an electronic invoice checking method, device, terminal and storage medium, which realize accurate and detailed checking of electronic invoices and format files through multimodal recognition and preset multiple invoice file templates.

[0005] In the first aspect, the present application provides an electronic invoice verification method, which adopts the following technical solution: Obtaining the invoice file of the electronic invoice to be checked and preprocessing the invoice file to obtain the invoice image corresponding to the invoice file; Performing multimodal recognition on the invoice images one by one and obtaining recognition results for each invoice image respectively, wherein the recognition results include invoice format information and invoice data information; Acquire the actual invoice data of the electronic invoice from a third-party platform based on the invoice data information, and perform a preliminary authenticity verification on the electronic invoice in combination with the actual invoice data; When the initial authenticity verification is passed, the electronic invoice is subjected to a secondary authenticity verification based on the invoice format information and the pre-stored invoice template; When the secondary authenticity verification is passed, the verification result of the electronic invoice is output.

[0006] By adopting the above technical solution, all invoice data information and invoice format information on the electronic invoice are identified through multimodal recognition technology, and the authenticity is verified twice based on the above information in turn, so that the recognition result of the electronic invoice has a double layer of protection and is more accurate. At the same time, the matching method using pre-stored invoice templates can support the inspection of electronic invoices with multiple templates, which is more practical.

[0007] Preferably, the step of obtaining the invoice file of the electronic invoice to be checked and preprocessing the invoice file to obtain the invoice image corresponding to the invoice file specifically includes the following steps: Obtaining all invoice files of the electronic invoices to be checked, wherein the invoice files are uploaded in batches, and preprocessing all the invoice files, wherein the preprocessing includes decompression and format conversion; When the uploaded invoice file is a compressed package, the compressed package is decompressed, and the invoice files obtained after decompression are uniformly converted into the format to obtain the invoice image of the electronic invoice corresponding to each invoice file.

[0008] By adopting the above technical solution, the uploaded invoice files are converted into a unified format, so that all files become a unified image format, which is convenient for subsequent identification and processing.

[0009] Preferably, the multimodal recognition is performed on the invoice images one by one and the recognition results of each invoice image are obtained respectively, wherein the recognition results include invoice format information and invoice data information, and specifically includes the following steps: The converted invoice image is subjected to multimodal recognition, wherein the multimodal recognition includes image recognition and text recognition; the image recognition includes two-dimensional code recognition and ticket pattern recognition, and the coding information of the electronic invoice is obtained through the two-dimensional code recognition, wherein the coding information includes the invoice number and the invoice code; all the layout elements on the electronic invoice and the characteristic information of the layout elements are obtained through the ticket pattern recognition; the text recognition is performed through the OCR technology to extract the text information in the electronic invoice, wherein the text information includes the invoice type; The coding information and the text information are aggregated into invoice data information, and the layout elements and the feature information are aggregated into invoice layout information. By adopting the above-mentioned technical solution, the content of multimodal recognition is described in detail. Through multimodal recognition, all existing information on the electronic invoice can be identified, providing a data basis for subsequent electronic invoice verification.

[0010] Preferably, the actual invoice data of the electronic invoice is obtained from a third-party platform based on the invoice data information, and the initial authenticity verification of the electronic invoice is performed in combination with the actual invoice data, specifically including the following steps: Establishing communication with a third-party platform, constructing a query statement based on the invoice number and the invoice code in the invoice data information and submitting the query statement to the database of the third-party platform, and receiving actual invoice data corresponding to the invoice number and the invoice code returned by the third-party platform; When the actual invoice data is not empty, the actual invoice data is compared with the invoice data information to obtain a comparison result. When the comparison results are consistent, the initial authenticity verification of the electronic invoice is passed, and the invoice data information is true. When the comparison results are inconsistent, the initial authenticity verification fails, and the electronic invoice is determined to be false. When the actual invoice data is empty, the initial authenticity verification fails and the electronic invoice is deemed to be false.

[0011] By adopting the above technical solution, the platform connected to the third party can check the authenticity of the identified invoice data information, which is also the initial authenticity verification of the electronic invoice. When the data cannot be queried, the electronic invoice can be directly judged to be false. When the data can be queried, the consistency of the two is compared to determine the authenticity of the invoice data information of the electronic invoice.

[0012] Preferably, after the initial authenticity verification is passed, a secondary authenticity verification is performed on the electronic invoice based on the invoice format information and the pre-stored invoice template, specifically including the following steps: If the invoice data information is true, a pre-stored invoice template is obtained according to the invoice type, expected invoice format information is extracted from the invoice template, and template matching is performed based on the invoice format information and the expected invoice format information, so as to determine the authenticity of the invoice document, wherein the template matching includes position matching, size matching and spacing matching; The template matching includes taking the layout element as an index, extracting the actual features corresponding to the layout element from the feature information, extracting the expected features corresponding to the layout element from the expected invoice layout information, and calculating the position difference, size difference and spacing difference of each layout element based on the actual features and the expected features.

[0013] By adopting the above technical solution, the authenticity of the identified invoice layout information is verified, that is, the authenticity of the electronic invoice is verified twice. The invoice layout information is matched with the expected invoice layout information extracted from the invoice template, and the difference of various features of each layout element is calculated. Calculating the difference of multiple features separately can make the matching more accurate and improve the matching accuracy.

[0014] Preferably, after respectively calculating the position difference, size difference and spacing difference of each of the layout elements according to the actual feature and the expected feature, the following steps are also included: Setting first weight coefficients for the position difference, the size difference, and the spacing difference of each of the layout elements, respectively, and calculating the layout element difference of each of the layout elements in combination with the first weight coefficients; Setting a second weight coefficient for each of the layout elements, and calculating the comprehensive difference of the invoice document according to the second weight coefficient and the difference of the layout elements; When the comprehensive difference does not exceed the preset difference threshold, the secondary authenticity verification of the electronic invoice passes and the invoice document is authentic; otherwise, the secondary authenticity verification fails.

[0015] By adopting the above technical solution and setting two weight coefficients, it is possible to ensure that the final calculation result of the difference is more comprehensive and stable, reduce the probability of calculation errors, and make the final calculation of the difference more credible.

[0016] Preferably, when the secondary authenticity verification is passed, outputting the verification result of the electronic invoice specifically includes the following steps: When the secondary authenticity verification is passed, the electronic invoice is deemed to be authentic and a verification result is output; When the secondary authenticity verification fails, a verification report is generated and outputted according to the result of the initial authenticity verification, the format element difference and the comprehensive difference.

[0017] By adopting the above technical solution, when the secondary authenticity verification fails, the relevant data of the verification process will be output to generate a report, which is convenient for the staff to quickly know the reason for the failure through the report and improve the processing efficiency.

[0018] In the second aspect, the present application provides an electronic invoice checking device, which adopts the following technical solution: An electronic invoice checking device includes the following modules: An invoice processing module, used to obtain the invoice file of the electronic invoice to be checked and pre-process the invoice file to obtain the invoice image corresponding to the invoice file; An invoice recognition module, used to perform multimodal recognition on the invoice images one by one and obtain recognition results for each invoice image respectively, wherein the recognition results include invoice format information and invoice data information; A primary authenticity verification module, used to obtain the actual invoice data of the electronic invoice from a third-party platform based on the invoice data information, and perform a primary authenticity verification on the electronic invoice in combination with the actual invoice data; A secondary authenticity verification module, used for performing secondary authenticity verification on the electronic invoice according to the invoice format information and a pre-stored invoice template after the initial authenticity verification is passed; The verification result output module is used to output the verification result of the electronic invoice after the secondary authenticity verification is passed.

[0019] By adopting the above-mentioned technical solution, a batch verification system for electronic invoices has been built, which provides the necessary software technical support for the authenticity verification of electronic invoice documents, realizes comprehensive and accurate batch verification of electronic invoices, and provides strong support for batch verification of various types of electronic invoices.

[0020] In a third aspect, the present application provides a smart terminal, which adopts the following technical solution: An intelligent terminal includes a memory and a processor, wherein the memory stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement the electronic invoice verification method as described above.

[0021] In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solution: A computer-readable storage medium, wherein at least one instruction, at least one program, code set or instruction set is stored in the computer-readable storage medium, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the electronic invoice verification method as described above.

[0022] In summary, this application has at least the following beneficial effects: 1. This application integrates multiple verification methods to conduct a comprehensive and detailed inspection of invoices and format files. It can not only verify the authenticity of the data on the electronic invoice, but also compare the differences between the invoice file and the preset standard template, so that the recognition result of the electronic invoice has a double layer of protection and is more accurate. At the same time, multiple types of invoice templates are pre-stored, which can support the inspection of multiple types of electronic invoices, making this method more practical. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 It is a flowchart of the electronic invoice verification method of the embodiment of the present application; Figure 2 is a flow chart of step S3 of the electronic invoice verification method according to an embodiment of the present application; Figure 3 It is a structural schematic diagram of the electronic invoice verification device of an embodiment of the present application. DETAILED DESCRIPTION

[0024] The present application provides an electronic invoice verification method, device, terminal and storage medium. In order to make the purpose, technical solution and advantages of the present application clearer, the implementation method of the present application will be further described in detail below.

[0025] The following is a further detailed description of an embodiment of an electronic invoice verification method of the present application in conjunction with the drawings in the specification.

[0026] This application is an electronic invoice verification method, the process is as follows Figure 1 As shown, the following steps are included: S1. Obtain the invoice file of the electronic invoice to be checked and pre-process the invoice file to obtain the invoice image corresponding to the invoice file, which specifically includes the following steps: S11. Obtain invoice files of all electronic invoices to be checked. The invoice files are uploaded in batches. Generally speaking, the invoice files are the layout files of invoices in the conventional sense, which are generally in PDF format or OFD format. The method in this embodiment takes the layout file in PDF format as an example.

[0027] S12. Preprocess all invoice files. Preprocessing includes decompression and format conversion, as well as denoising, cropping, contrast enhancement and other operations to optimize subsequent recognition effects and ensure data consistency and accuracy.

[0028] When the uploaded invoice file is a compressed package, the compressed package is decompressed, and the invoice files obtained after decompression are uniformly converted in format to obtain the invoice image of the electronic invoice corresponding to each invoice file. In this embodiment, the invoice image is in PNG format.

[0029] S2. Perform multimodal recognition on the invoice images one by one and obtain the recognition results of each invoice image respectively. The recognition results include invoice format information and invoice data information. Specifically, the steps include: S21. Perform multimodal recognition on the converted invoice image, where the multimodal recognition includes image recognition and text recognition; the image recognition includes QR code recognition and invoice pattern recognition; S211. The specific process of QR code recognition is: after a series of steps such as image positioning, binarization, decoding and error correction, the QR code in the electronic invoice is decoded in combination with a QR code recognition algorithm (such as the Zxing library) to extract the encoded information therein, which includes the invoice number and invoice code.

[0030] Identifying the QR code can quickly obtain some basic information of the electronic invoice, including the invoice code, invoice number, verification code, etc. These data are crucial for subsequent invoice data information verification.

[0031] S212. Obtain all layout elements and characteristic information of the layout elements on the electronic invoice through face pattern recognition.

[0032] The invoice pattern recognition is to identify specific layout elements in the electronic invoice, such as company logo, invoice frame, etc. through a preset convolutional neural network (CNN). In this embodiment, the layout elements are electronic signatures, invoice frames, company logos, QR codes, etc. The characteristic information of these layout elements is their position, size and spacing.

[0033] Before invoice verification, a large number of electronic invoice images need to be collected as training data, and specific layout elements in these images need to be annotated, that is, the location and category of the layout elements are marked. The annotated training data is used to train the CNN model, which automatically learns the feature representation in the image to identify different categories of layout elements. Finally, the trained CNN model is used to identify the electronic invoice images to be checked. The model outputs the recognized layout element category and location information, such as the location and type of the company logo, the location of the invoice border, etc., for subsequent invoice verification.

[0034] S213. Perform text recognition through OCR technology to extract text information in the electronic invoice, the text information includes invoice type, invoice issue date, invoice amount, etc. It should be noted that since the encoded information in the QR code contains some basic information of the invoice, there will be overlap with the recognized text information.

[0035] S22, the coding information and the text information are aggregated into the invoice data information, and the layout elements and the characteristic information are aggregated into the invoice layout information. In the process of aggregation, the overlapping parts need to be simply screened and deduplicated.

[0036] S3. Obtain the actual invoice data of the electronic invoice from the third-party platform based on the invoice data information, and conduct the initial authenticity verification of the electronic invoice in combination with the actual invoice data. The process is as follows: Figure 2 As shown, the specific steps include: S31. Establish communication with a third-party platform. In this embodiment, the third-party platform is the platform of the State Administration of Taxation.

[0037] S32: construct a query statement based on the invoice number and invoice code in the invoice data information and submit it to the third-party platform, i.e., the database of the State Administration of Taxation, and receive the actual invoice data corresponding to the invoice number and invoice code returned by the third-party platform; S33: Performing initial authenticity verification on the electronic invoice. The initial authenticity verification is to verify the authenticity of the invoice data information identified by the electronic invoice, which specifically includes the following steps: S331. When the actual invoice data is not empty, that is, the relevant invoice can be queried in the State Administration of Taxation based on the identified invoice number and invoice code, it is necessary to compare the queried actual invoice data with the uploaded and identified invoice data information to obtain a comparison result.

[0038] When the comparison results are consistent, the initial authenticity verification of the electronic invoice is passed and the invoice data information is true; when the comparison results are inconsistent, the initial authenticity verification fails and the electronic invoice is deemed to be false.

[0039] When the initial authenticity verification is passed, it can be determined that the invoice data information of the electronic invoice is true, but the electronic invoice cannot be directly confirmed to be authentic. When the comparison results are inconsistent, the electronic invoice can be directly confirmed to be false, because the secondary authenticity verification needs to be passed to ensure that the electronic invoice is authentic. Here, the electronic invoice refers to the uploaded file.

[0040] S332. When the actual invoice data is empty, the initial authenticity verification fails and the electronic invoice is deemed to be false.

[0041] If the actual invoice data is empty, it means that the relevant invoice cannot be queried based on the invoice number and code, which means that this electronic invoice does not exist at all and is directly deemed to be false.

[0042] S4. After the initial authenticity verification is passed, the electronic invoice is subjected to a secondary authenticity verification based on the invoice format information and the pre-stored invoice template, which specifically includes the following steps: S41. If the invoice data information is true, obtain a pre-stored invoice template according to the invoice type. In this embodiment, the types of invoice templates include 15 types of invoices, such as special value-added tax invoices, ordinary invoices, rare earth electronic invoices, construction service electronic invoices, and passenger transportation service electronic invoices, which are not listed one by one here.

[0043] S42. Extract expected invoice layout information from the invoice template, and perform template matching based on the invoice layout information and the expected invoice layout information. The above template matching process is to determine the authenticity of the invoice document, which is also the secondary authenticity verification of the electronic invoice.

[0044] In this embodiment, template matching includes position matching, size matching and spacing matching; The template matching process is to use layout elements as indexes, extract actual features corresponding to layout elements from feature information, extract expected features corresponding to layout elements from expected invoice layout information, and calculate the position difference, size difference and spacing difference of each layout element based on the actual features and expected features.

[0045] S421. Specifically, position matching is to obtain the actual coordinates of each layout element from the feature information; obtain the expected coordinates of the corresponding layout element from the expected invoice layout information. These two coordinates can be the upper left corner coordinates or the center point coordinates. In this embodiment, the upper left corner coordinates are used, and the position difference is calculated based on the actual coordinates and the expected coordinates. In this embodiment, the Euclidean distance between these coordinates is calculated to obtain the position difference.

[0046] S422, size matching is to obtain the actual size of each layout element from the feature information, obtain the expected size of the corresponding layout element from the expected invoice layout information, and calculate the size difference between the actual size and the expected size. In this embodiment, the size difference is expressed by calculating the comprehensive average value of the difference between the width size and the height size; S423, spacing matching is to extract the actual spacing between layout elements and between layout elements and invoice borders from the feature information, obtain the corresponding expected spacing between layout elements and between layout elements and invoice borders from the expected invoice layout information, and calculate the spacing difference between the actual spacing and the expected spacing. The above spacing can be calculated by the distance between the edges of the layout elements.

[0047] In a specific embodiment, assuming that for a template of a special VAT invoice, in the expected invoice layout information of the company logo, the coordinates of the upper left corner are (100, 50); the size is 150 pixels in width and 50 pixels in height; the distance between it and the invoice border is 30 pixels, and the distance between it and the upper invoice border is 20 pixels. For the characteristic information of the identified electronic invoice, the coordinates of the upper left corner are (102, 51); the size is 152 pixels in width and 51 pixels in height; the distance between it and the invoice border is 31 pixels, and the distance between it and the upper invoice border is 21 pixels.

[0048] The position difference is expressed by the Euclidean distance d between the two coordinates, that is, The position difference is therefore 2.24 pixels.

[0049] The width difference is The height difference is Therefore, the size difference is obtained by combining the above width difference and height difference:

[0050] The difference in spacing between the left invoice border and the edge of the company logo is |31-30|=1, in pixels; the difference in spacing between the upper invoice border and the edge of the company logo is |21-20|=1, in pixels; therefore, the spacing difference (simplified to the sum) is 1+1=2 pixels.

[0051] S43, setting first weight coefficients for the position difference, size difference, and spacing difference of each layout element, respectively, and calculating the layout element difference of each layout element in combination with the first weight coefficients; In combination with the above embodiment, the first weight coefficients of 0.4, 0.4, and 0.2 are set for the position difference, size difference, and spacing difference, respectively. Then, the difference of the layout elements of the company logo is D1=(2.24*0.4+1.67%*0.4+2 / 10*0.2)=0.94268; The position difference and spacing difference are in pixels, and need to be kept at the same level as other differences. A reasonable approach is to convert all differences to the same level (such as percentage) before calculation. However, this embodiment is simplified and directly uses pixel values ​​for calculation, and appropriately adjusts the weights to accommodate such differences. For this embodiment, the spacing difference is divided by 10 to scale it to a smaller level to make it more balanced with other differences. Of course, this value is not fixed and can be adjusted according to actual conditions.

[0052] S44, setting a second weight coefficient for each layout element, and calculating the comprehensive difference of the invoice document based on the second weight coefficient and the difference of the layout element; the calculation method of the comprehensive difference is the same as the calculation method of the above-mentioned layout element difference, which will not be repeated here.

[0053] When the comprehensive difference does not exceed the preset difference threshold, the secondary authenticity verification of the electronic invoice passes and the invoice document is authentic; otherwise, the secondary authenticity verification fails.

[0054] The difference threshold can be adjusted accordingly. For example, if the invoice template has a slight change, there is no need to replace the invoice template. The difference threshold can be appropriately increased according to the actual situation. In this embodiment, the difference threshold is 1.2 pixels.

[0055] S5. After the secondary authenticity verification is passed, the verification result of the electronic invoice is output, which specifically includes the following steps: When the secondary authenticity verification is passed, the electronic invoice is deemed to be authentic and the verification result is output; When the secondary authenticity verification fails, a verification report is generated and output based on the results of the initial authenticity verification, the difference in layout elements, and the comprehensive difference.

[0056] If the first authenticity verification fails, the verification report does not need to include the content of the layout element difference and the comprehensive difference. When the second authenticity verification fails, the generated verification report can help the staff quickly know the reasons for the failure, facilitate the staff to conduct manual review, and improve the inspection efficiency.

[0057] Based on the same inventive concept as above, the present application also discloses an electronic invoice checking device, the structure of which is as follows: Figure 3 As shown, the device includes the following modules: The invoice processing module is used to obtain the invoice file of the electronic invoice to be checked and pre-process the invoice file to obtain the invoice image corresponding to the invoice file; The invoice recognition module is used to perform multimodal recognition on invoice images one by one and obtain the recognition results of each invoice image respectively. The recognition results include invoice format information and invoice data information; The initial authenticity verification module is used to obtain the actual invoice data of the electronic invoice from the third-party platform based on the invoice data information, and perform initial authenticity verification on the electronic invoice in combination with the actual invoice data; The secondary authenticity verification module is used to conduct a secondary authenticity verification of the electronic invoice based on the invoice format information and the pre-stored invoice template after the initial authenticity verification is passed; The verification result output module is used to output the verification result of the electronic invoice after the secondary authenticity verification is passed.

[0058] In a specific implementation scheme, the invoice processing module includes the following units: The first invoice processing unit is used to obtain the invoice files of all the electronic invoices to be checked. The invoice files are uploaded in batches and all the invoice files are pre-processed, including decompression and format conversion. The second invoice processing unit is used to decompress the compressed package when the uploaded invoice file is a compressed package, and uniformly convert the format of the invoice files obtained after decompression to obtain the invoice image of the electronic invoice corresponding to each invoice file.

[0059] In a specific implementation scheme, the invoice identification module includes the following units: A first invoice recognition unit, used for performing multimodal recognition on the converted invoice image, wherein the multimodal recognition includes image recognition and text recognition; Image recognition includes QR code recognition and invoice pattern recognition. The coded information of the electronic invoice is obtained through QR code recognition, including the invoice number and invoice code. All layout elements and characteristic information of the layout elements on the electronic invoice are obtained through invoice pattern recognition. Text recognition is performed through OCR technology to extract text information from the electronic invoice, including the invoice type. The second invoice recognition unit is used to aggregate the coding information and the text information into invoice data information, and aggregate the layout elements and the feature information into invoice layout information.

[0060] In a specific implementation scheme, the initial authenticity verification module includes the following units: The actual invoice data acquisition unit is used to establish communication with the third-party platform, construct a query statement based on the invoice number and invoice code in the invoice data information and submit it to the database of the third-party platform, and receive the actual invoice data corresponding to the invoice number and invoice code returned by the third-party platform; The initial authenticity verification unit is used to compare the actual invoice data with the invoice data information to obtain a comparison result when the actual invoice data is not empty. When the comparison results are consistent, the initial authenticity verification of the electronic invoice is passed and the invoice data information is true. When the comparison results are inconsistent, the initial authenticity verification fails and the electronic invoice is determined to be false. The initial authenticity verification unit is used to fail the initial authenticity verification when the actual invoice data is empty, and the electronic invoice is determined to be false.

[0061] In a specific implementation scheme, the secondary authenticity verification module includes the following units: The invoice template matching unit is used to obtain a pre-stored invoice template according to the invoice type if the invoice data information is true, extract the expected invoice layout information from the invoice template, and perform template matching based on the invoice layout information and the expected invoice layout information, so as to determine the authenticity of the invoice document. The template matching includes position matching, size matching and spacing matching; the template matching includes taking the layout element as an index, extracting the actual features corresponding to the layout element from the feature information, extracting the expected features corresponding to the layout element from the expected invoice layout information, and calculating the position difference, size difference and spacing difference of each layout element based on the actual features and the expected features.

[0062] The secondary authenticity verification unit is used to set a first weight coefficient for the position difference, size difference and spacing difference of each layout element, and calculate the layout element difference of each layout element in combination with the first weight coefficient; set a second weight coefficient for each layout element, and calculate the comprehensive difference of the invoice file based on the second weight coefficient and the layout element difference; when the comprehensive difference does not exceed the preset difference threshold, the secondary authenticity verification of the electronic invoice passes and the invoice file is authentic, otherwise the secondary authenticity verification fails.

[0063] In a specific implementation scheme, the verification result output module includes the following units: The first verification result output unit is used to determine that the electronic invoice is authentic and output the verification result after the secondary authenticity verification is passed; The second verification result output unit is used to generate and output a verification report based on the result of the initial authenticity verification, the difference of the layout elements and the comprehensive difference when the secondary authenticity verification fails.

[0064] From the above functional introduction, it can be seen that an electronic invoice verification device in this application has built a batch verification system for electronic invoices. By introducing two different dimensions of authenticity verification, it has achieved comprehensive and accurate batch electronic invoice verification, and promoted the sustained, rapid and healthy development of the economy and society.

[0065] Based on the same inventive concept mentioned above, an embodiment of the present application also discloses a computer-readable storage medium, which stores at least one instruction, at least one program, code set or instruction set. The at least one instruction, at least one program, code set or instruction set can be loaded and executed by a processor to implement the electronic invoice verification method provided in the above method embodiment.

[0066] Also based on the same inventive concept mentioned above, an embodiment of the present application also discloses a computer-readable storage medium, in which at least one instruction, at least one program, code set or instruction set is stored. The at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the electronic invoice verification method as described above.

[0067] Those skilled in the art will appreciate that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in the computer-readable storage medium, which may include, for example, various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0068] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. An electronic invoice verification method, characterized in that: The steps include: Obtaining the invoice file of the electronic invoice to be checked and preprocessing the invoice file to obtain the invoice image corresponding to the invoice file; Performing multimodal recognition on the invoice images one by one and obtaining recognition results for each invoice image respectively, wherein the recognition results include invoice format information and invoice data information; Acquire the actual invoice data of the electronic invoice from a third-party platform based on the invoice data information, and perform a preliminary authenticity verification on the electronic invoice in combination with the actual invoice data; When the initial authenticity verification is passed, the electronic invoice is subjected to a secondary authenticity verification based on the invoice format information and the pre-stored invoice template; When the secondary authenticity verification is passed, the verification result of the electronic invoice is output.

2. The electronic invoice verification method according to claim 1, characterized in that: The obtaining of the invoice file of the electronic invoice to be checked and preprocessing the invoice file to obtain the invoice image corresponding to the invoice file specifically includes the following steps: Obtaining all invoice files of the electronic invoices to be checked, wherein the invoice files are uploaded in batches, and preprocessing all the invoice files, wherein the preprocessing includes decompression and format conversion; When the uploaded invoice file is a compressed package, the compressed package is decompressed, and the invoice files obtained after decompression are uniformly converted into the format to obtain the invoice image of the electronic invoice corresponding to each invoice file.

3. The electronic invoice checking method according to claim 1, characterized in that: The multimodal recognition is performed on the invoice images one by one and the recognition results of each invoice image are obtained respectively, wherein the recognition results include invoice format information and invoice data information, and specifically includes the following steps: Performing multimodal recognition on the converted invoice image, wherein the multimodal recognition includes image recognition and text recognition; The image recognition includes two-dimensional code recognition and ticket pattern recognition. The coding information of the electronic invoice is obtained through the two-dimensional code recognition. The coding information includes the invoice number and the invoice code. The all layout elements on the electronic invoice and the characteristic information of the layout elements are obtained through the ticket pattern recognition. Performing text recognition by OCR technology to extract text information in the electronic invoice, wherein the text information includes the invoice type; The coding information and the text information are aggregated into invoice data information, and the layout elements and the feature information are aggregated into invoice layout information.

4. The electronic invoice checking method according to claim 1, characterized in that: The actual invoice data of the electronic invoice is obtained from the third-party platform based on the invoice data information, and the initial authenticity verification of the electronic invoice is performed in combination with the actual invoice data, specifically including the following steps: Establishing communication with a third-party platform, constructing a query statement based on the invoice number and the invoice code in the invoice data information and submitting the query statement to the database of the third-party platform, and receiving actual invoice data corresponding to the invoice number and the invoice code returned by the third-party platform; When the actual invoice data is not empty, the actual invoice data is compared with the invoice data information to obtain a comparison result. When the comparison results are consistent, the initial authenticity verification of the electronic invoice is passed, and the invoice data information is true. When the comparison results are inconsistent, the initial authenticity verification fails, and the electronic invoice is determined to be false. When the actual invoice data is empty, the initial authenticity verification fails and the electronic invoice is deemed to be false.

5. The electronic invoice checking method according to claim 3, characterized in that: After the initial authenticity verification is passed, the electronic invoice is subjected to a secondary authenticity verification based on the invoice format information and the pre-stored invoice template, specifically including the following steps: If the invoice data information is true, a pre-stored invoice template is obtained according to the invoice type, expected invoice format information is extracted from the invoice template, and template matching is performed based on the invoice format information and the expected invoice format information, so as to determine the authenticity of the invoice document, wherein the template matching includes position matching, size matching and spacing matching; The template matching includes taking the layout element as an index, extracting the actual features corresponding to the layout element from the feature information, extracting the expected features corresponding to the layout element from the expected invoice layout information, and calculating the position difference, size difference and spacing difference of each layout element based on the actual features and the expected features.

6. The electronic invoice checking method according to claim 5, characterized in that: After respectively calculating the position difference, size difference and spacing difference of each of the layout elements according to the actual features and the expected features, the following steps are also included: Setting first weight coefficients for the position difference, the size difference, and the spacing difference of each of the layout elements, respectively, and calculating the layout element difference of each of the layout elements in combination with the first weight coefficients; Setting a second weight coefficient for each of the layout elements, and calculating the comprehensive difference of the invoice document according to the second weight coefficient and the difference of the layout elements; When the comprehensive difference does not exceed the preset difference threshold, the secondary authenticity verification of the electronic invoice passes and the invoice document is authentic; otherwise, the secondary authenticity verification fails.

7. The electronic invoice checking method according to claim 6, characterized in that: When the secondary authenticity verification is passed, the verification result of the electronic invoice is output, which specifically includes the following steps: When the secondary authenticity verification is passed, the electronic invoice is deemed to be authentic and a verification result is output; When the secondary authenticity verification fails, a verification report is generated and outputted according to the result of the initial authenticity verification, the format element difference and the comprehensive difference.

8. An electronic invoice checking device, characterized in that: Includes the following modules: An invoice processing module, used to obtain the invoice file of the electronic invoice to be checked and pre-process the invoice file to obtain the invoice image corresponding to the invoice file; An invoice recognition module, used to perform multimodal recognition on the invoice images one by one and obtain recognition results for each invoice image respectively, wherein the recognition results include invoice format information and invoice data information; A primary authenticity verification module, used to obtain the actual invoice data of the electronic invoice from a third-party platform based on the invoice data information, and perform a primary authenticity verification on the electronic invoice in combination with the actual invoice data; A secondary authenticity verification module, used for performing secondary authenticity verification on the electronic invoice according to the invoice format information and a pre-stored invoice template after the initial authenticity verification is passed; The verification result output module is used to output the verification result of the electronic invoice after the secondary authenticity verification is passed.

9. An intelligent terminal, characterized in that: It includes a memory and a processor, wherein the memory stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement the electronic invoice verification method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The readable storage medium stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement the electronic invoice verification method as described in any one of claims 1 to 7.

Citation Information

Cited By

  • Digital ticket information tampering identification method, system and equipment

    CN120853202A