Invoice item name and tax classification verification method and related device
Through image acquisition and large-scale model technology, the problem of insufficient matching between invoice project names and tax classification in the existing technology is solved, and the accuracy and efficiency of invoice verification is improved, and the accuracy and efficiency of invoice verification is reduced. Tax risks.
Patent Information
- Application Number
- CN202411081679.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-12-06
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing invoice verification methods are insufficient in the matching verification of project names and tax classifications, resulting in an increase in the possibility of tax risks and financial misoperation.
Image acquisition processing, image segmentation, text recognition and large-model technology combined with tax classification knowledge base methods are used to identify the project names in the invoices and make tax classification predictions and verify them. If there is inconsistency, a warning will be issued.
It greatly improves the accuracy and efficiency of invoice verification, ensures compliance of financial and tax operations, and reduces related risks.
Smart Images

Figure CN119091456A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a method and a related device for verifying invoice item names and tax classifications. Background Art
[0002] In the financial management and tax processing process of modern enterprises, ensuring the accuracy of invoices is crucial. However, most current invoice verification methods focus on verifying basic information, and the matching verification of item names and tax classifications is insufficient, which may increase tax risks and the possibility of financial misoperation. Summary of the invention
[0003] The purpose of the present invention is to overcome the shortcomings of the prior art. The present invention provides a method and related device for verifying invoice item names and tax classifications, which can greatly improve the accuracy and efficiency of invoice verification, ensure the compliance of financial and tax operations, and reduce related risks.
[0004] In order to solve the above technical problems, an embodiment of the present invention provides a method for verifying invoice item names and tax classifications, the method comprising:
[0005] Obtaining an invoice to be identified, and performing image acquisition processing on the invoice to be identified to obtain invoice image data;
[0006] Performing positioning processing on the target area in the invoice image data based on image segmentation to obtain the target positioning area in the invoice image data;
[0007] Recognize the text in the target positioning area to obtain detailed information of the items in the target positioning area;
[0008] Based on the big model technology combined with the knowledge base of the mapping relationship between tax classification and project name, the project name in the project detail information is analyzed and processed, and the corresponding tax classification prediction processing is performed according to the analysis result to obtain the predicted tax classification;
[0009] The predicted tax classification is used to verify the tax classification in the item detail information, and when the verification result is inconsistent, an invoice item error or tax classification mismatch warning is executed.
[0010] Optionally, the performing image acquisition processing on the invoice to be identified to obtain invoice image data includes:
[0011] The image acquisition device on the smart terminal is called by a preset APP to perform image acquisition and processing on the invoice to be identified at a preset angle and a preset distance to obtain invoice image data.
[0012] Optionally, the performing positioning processing on the target area in the invoice image data based on image segmentation to obtain the target positioning area in the invoice image data includes:
[0013] grayscale the invoice image data to obtain grayscale invoice image data;
[0014] Using at least two edge detection algorithms in sequence to perform region segmentation processing on the grayscale invoice image data to obtain at least two region segmentation contour images corresponding to the invoice image data;
[0015] Performing image contour fusion processing on the regional segmentation contour images corresponding to at least two invoice image data to form a plurality of fused segmentation contour images corresponding to the invoice image data;
[0016] The target area is positioned based on a plurality of fused segmented contour images corresponding to the invoice image data to obtain a target positioning area in the invoice image data.
[0017] Optionally, the performing positioning processing on the target area based on the multiple fused segmented contour images corresponding to the invoice image data to obtain the target positioning area in the invoice image data includes:
[0018] Calculate the area corresponding to each of the multiple fused segmented contour images corresponding to the invoice image data and the aspect ratio corresponding to each of the fused segmented contour images;
[0019] Calculating the ratio of the area of each fused segmented contour image to the total area corresponding to the invoice image data, and obtaining the area ratio value corresponding to each fused segmented contour image;
[0020] The target area is positioned based on the area ratio value and the aspect ratio corresponding to each fused segmentation contour image to obtain the target positioning area in the invoice image data.
[0021] Optionally, the step of performing recognition processing on the text in the target positioning area to obtain detailed information of items in the target positioning area includes:
[0022] The text in the target positioning area is recognized based on an optical character recognition algorithm to obtain item detail information in the target positioning area.
[0023] Optionally, the knowledge base based on the large model technology combined with the mapping relationship between tax classification and project name analyzes and processes the project name in the project details information, and performs corresponding tax classification prediction processing according to the analysis result to obtain the predicted tax classification, including:
[0024] Obtaining the project name in the project details information, and vectorizing the project name to form project name vector data;
[0025] Based on the preset similarity query condition, the project name vector data is used to perform similarity query processing in the vector table corresponding to the knowledge base to obtain the returned paragraph ID that meets the similarity;
[0026] Perform query processing in a paragraph query table based on the paragraph ID to obtain the paragraph text corresponding to the paragraph ID;
[0027] Fill the paragraph text and the tax classification in the item details into the prompt word template to generate corresponding prompt words;
[0028] The prompt word is input as an input parameter into the large model corresponding to the large model technology to perform corresponding tax classification prediction processing to obtain the predicted tax classification.
[0029] Optionally, the using the predicted tax classification and the tax classification in the item detail information to perform verification processing, and when the verification result is inconsistent, executing an invoice item error or tax classification mismatch warning, includes:
[0030] Verify the predicted tax classification with the tax classification in the project detail information by comparing them to obtain a verification result;
[0031] Determine whether the verification results are consistent, and if so, indicate that the verification is successful;
[0032] If the verification result is inconsistent, an invoice item error or tax classification mismatch warning is executed.
[0033] In addition, an embodiment of the present invention further provides an invoice item name and tax classification verification device, the device comprising:
[0034] Image acquisition module: used to obtain the invoice to be identified, and perform image acquisition processing on the invoice to be identified to obtain invoice image data;
[0035] Region positioning module: used for positioning the target region in the invoice image data based on image segmentation to obtain the target positioning region in the invoice image data;
[0036] Information recognition module: used to recognize the text in the target positioning area and obtain the item details in the target positioning area;
[0037] Analysis and prediction module: used to analyze and process the project names in the project details based on the big model technology combined with the knowledge base of the mapping relationship between tax classification and project name, and perform corresponding tax classification prediction processing according to the analysis results to obtain predicted tax classification;
[0038] Verification processing module: used to perform verification processing using the predicted tax classification and the tax classification in the item detail information, and when the verification result is inconsistent, execute an invoice item error or tax classification mismatch warning.
[0039] In addition, an embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the invoice item name and tax classification verification method as described in any one of the above items is implemented.
[0040] In addition, an embodiment of the present invention further provides an intelligent terminal, the intelligent terminal comprising:
[0041] one or more processors;
[0042] Memory;
[0043] One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to: execute the invoice item name and tax classification verification method according to any one of the above.
[0044] In an embodiment of the present invention, an invoice to be identified is obtained and image acquisition processing is performed to obtain invoice image data; a target area in the invoice image data is positioned to obtain a target positioning area in the invoice image data; text in the target positioning area is recognized to obtain item detail information in the target positioning area; the item name in the item detail information is analyzed and processed, and corresponding tax classification prediction processing is performed to obtain a predicted tax classification; the predicted tax classification is verified with the tax classification in the item detail information, and when the verification result is inconsistent, an invoice item error or tax classification mismatch warning is executed; the accuracy and efficiency of invoice verification can be greatly improved, the compliance of financial and tax operations can be ensured, and related risks can be reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0046] Figure 1 It is a flowchart of a method for verifying invoice item names and tax classifications in an embodiment of the present invention;
[0047] Figure 2 It is a schematic diagram of the structure of the invoice item name and tax classification verification device in an embodiment of the present invention;
[0048] Figure 3 It is a schematic diagram of the structure of the intelligent terminal in the embodiment of the present invention. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0050] For example, see Figure 1 , Figure 1 It is a flowchart of the invoice item name and tax classification verification method in an embodiment of the present invention.
[0051] like Figure 1 As shown, a method for verifying invoice item names and tax classifications includes:
[0052] S11: obtaining an invoice to be identified, and performing image acquisition processing on the invoice to be identified to obtain invoice image data;
[0053] In the specific implementation process of the present invention, the image acquisition and processing of the invoice to be identified to obtain invoice image data includes: calling the image acquisition device on the smart terminal through a preset APP to perform image acquisition and processing on the invoice to be identified at a preset angle and a preset distance to obtain invoice image data.
[0054] Specifically, a corresponding APP is installed on the smart terminal, and the APP is opened on the smart terminal. The image acquisition device carried by the smart terminal is called through the APP, and then image acquisition is performed at a preset angle and a preset distance, that is, image acquisition and processing are performed on the invoice to be identified, so that the invoice image data can be obtained.
[0055] S12: performing positioning processing on the target area in the invoice image data based on image segmentation to obtain the target positioning area in the invoice image data;
[0056] In the specific implementation process of the present invention, the target area in the invoice image data is positioned based on image segmentation to obtain the target positioning area in the invoice image data, including: graying the invoice image data to obtain grayed invoice image data; sequentially using at least two edge detection algorithms to perform region segmentation on the grayed invoice image data to obtain at least two region segmentation contour images corresponding to the invoice image data; performing image contour fusion processing on the region segmentation contour images corresponding to the at least two invoice image data to form multiple fused segmentation contour images corresponding to the invoice image data; positioning the target area based on the multiple fused segmentation contour images corresponding to the invoice image data to obtain the target positioning area in the invoice image data.
[0057] Furthermore, the target area is positioned based on multiple fused segmented contour images corresponding to the invoice image data to obtain the target positioning area in the invoice image data, including: calculating the area corresponding to each of the multiple fused segmented contour images corresponding to the invoice image data and the aspect ratio of each fused segmented contour image; calculating the ratio of the area of each fused segmented contour image to the total area corresponding to the invoice image data to obtain the area ratio value corresponding to each fused segmented contour image; positioning the target area based on the area ratio value and the aspect ratio corresponding to each fused segmented contour image to obtain the target positioning area in the invoice image data.
[0058] Specifically, it is necessary to locate and segment the relevant areas of the invoice image data, so as to ensure the subsequent processing speed; therefore, it is necessary to grayscale the invoice image data first. In the present technical solution, the grayscale histogram method can be selected for grayscale to obtain the grayscale invoice image data; then at least two edge detection algorithms are used in turn to perform regional segmentation processing on the grayscale invoice image data to obtain at least two regional segmentation contour images corresponding to the invoice image data; then the regional segmentation contour images corresponding to the at least two invoice image data are subjected to image contour fusion processing to form multiple fused segmentation contour images corresponding to the invoice image data; finally, the target area can be located and segmented according to the multiple fused segmentation contour images corresponding to the invoice image data to obtain the target location area in the invoice image data.
[0059] In the present technical solution, at least two edge detection algorithms may be the Sobel edge detection algorithm and the Canny edge detection algorithm. These two edge detection algorithms have high detection recognition in edge detection and can effectively identify the border lines in the invoice image. Therefore, the Sobel edge detection algorithm is first used to perform edge detection processing on the grayscale invoice image data to obtain the first edge detection contour information corresponding to the grayscale invoice image data. Then, the Canny edge detection algorithm is used to perform edge detection processing on the grayscale invoice image data to obtain the second edge detection contour information corresponding to the grayscale invoice image data.
[0060] After obtaining the first edge detection contour information and the second edge detection contour information, in order to solve some unclear edge contour detection problems that may exist due to a single edge contour detection algorithm, the fusion processing of the first edge detection contour information and the second edge detection contour information is performed. In the present technical solution, firstly, an N*N matrix is constructed respectively using the first edge detection contour information and the second edge detection contour information, that is, corresponding to the first contour matrix and the second contour matrix, and then the first contour matrix and the second contour matrix are weightedly fused according to a preset weighted fusion ratio to form a corresponding weighted fusion matrix, and then the weighted fusion matrix is converted back into an image form to obtain multiple fused segmented contour images corresponding to the invoice image data. In the present technical solution, multiple fused segmented contour images refer to multiple fused segmented contour images formed by segmenting the invoice image data into multiple regions according to the extracted contours.
[0061] When performing positioning processing, it is first necessary to calculate the area corresponding to each of the multiple fused segmented contour images corresponding to the invoice image data. This area is generally only the pixel area. At the same time, the aspect ratio corresponding to each fused segmented contour image is also calculated. The aspect ratio here is the ratio of the pixel length to the pixel width corresponding to each fused segmented contour image; then it is also necessary to calculate the total area corresponding to the invoice image data, and the total area here is the total pixel area corresponding to the invoice image data; then calculate the ratio of the area of each fused segmented contour image to the total area corresponding to the invoice image data, and obtain the area ratio value corresponding to each fused segmented contour image; then determine the corresponding target area according to the aspect ratio corresponding to each fused segmented contour image and the area ratio value corresponding to each fused segmented contour image, so as to realize the positioning processing of the target area and obtain the target positioning area in the invoice image data; wherein the target positioning area is the area where the tax classification and project name are located in the invoice image data.
[0062] S13: Recognize the text in the target positioning area to obtain detailed information of the items in the target positioning area;
[0063] In the specific implementation process of the present invention, the recognition and processing of the text in the target positioning area to obtain the item detail information in the target positioning area includes: recognizing and processing the text in the target positioning area based on an optical character recognition algorithm to obtain the item detail information in the target positioning area.
[0064] Specifically, since the text extraction operation is performed on the image, it is necessary to use an optical character recognition algorithm to identify and process the text in the target positioning area, so as to obtain the corresponding extracted text information, and finally screen the corresponding text information to form the project details in the target positioning area; for example, the information existing in the target positioning area includes the details corresponding to the "goods or taxable services, service name", such as "*catering services*meal expenses", in which case "catering services" is the tax classification, and "meal expenses" is the project name. The tax classification and project name are extracted by segmenting the character string. The character string between the first * and the second * is the tax classification, and the character string after the second * is the project name.
[0065] S14: Analyze and process the project name in the project details information based on the big model technology combined with the knowledge base of the mapping relationship between tax classification and project name, and perform corresponding tax classification prediction processing according to the analysis result to obtain the predicted tax classification;
[0066] In the specific implementation process of the present invention, the knowledge base based on the big model technology combined with the mapping relationship between tax classification and project name analyzes and processes the project name in the project details information, and performs corresponding tax classification prediction processing according to the analysis results to obtain predicted tax classification, including: obtaining the project name in the project details information, and vectorizing the project name to form project name vector data; performing similarity query processing in the vector table corresponding to the knowledge base based on the preset similarity query conditions to obtain a returned paragraph ID that meets the similarity; performing query processing in the paragraph query table based on the paragraph ID to obtain the paragraph text corresponding to the paragraph ID; filling the paragraph text and the tax classification in the project details information into the prompt word template to generate a corresponding prompt word; inputting the prompt word as an input parameter into the big model corresponding to the big model technology to perform corresponding tax classification prediction processing to obtain a predicted tax classification.
[0067] Specifically, it is first necessary to obtain the project name in the project details information, and vectorize the project name to form project name vector data; then, according to the preset similarity query conditions, the project name vector data is used to perform similarity query processing in the vector table corresponding to the knowledge base, and the returned paragraph ID that meets the similarity is obtained; then, according to the paragraph ID, query processing is performed in the paragraph query table to obtain the paragraph text corresponding to the paragraph ID; the paragraph text and the tax classification in the project details information are filled in the prompt word template to generate the corresponding prompt word; then the prompt word is input as an input parameter into the big model corresponding to the big model technology to perform the corresponding tax classification prediction processing to obtain the predicted tax classification.
[0068] That is, the construction of a knowledge base of the mapping relationship between tax classification and project name, including a general tax classification catalog and known tax classification knowledge; the general tax classification catalog is obtained from relevant units and updated regularly; part of the known tax classification knowledge is built-in by the system, and part can be added by users; for the added knowledge documents, the system will first extract the knowledge text content and perform intelligent segmentation, save the knowledge documents in the document table, and save the paragraphs in the paragraph table; vectorize the paragraph content and save it in the vector table; the purpose of vectorizing the paragraph content is to realize vector retrieval of the content.
[0069] The process of using the big model to theoretically determine the tax classification is as follows: vectorize the project name in the project details information to obtain vector data; then query the vector table and the vector data under the knowledge base; query the vector table through the vector data and similarity conditions, and return the paragraph id that meets the conditions; query the paragraph table through the paragraph id, and finally return the hit paragraph text; fill the paragraph text and tax classification into the prompt word template and splice them into prompt words; the prompt word template is as follows: Tax classification contains: {taxclassification}, and it is known: {data}, please answer which tax classification the current input content belongs to; pass the spliced prompt words as parameters into the big model and return the prediction result; in this way, the predicted tax classification can be obtained.
[0070] S15: The predicted tax classification is used to verify the tax classification in the item detail information, and when the verification result is inconsistent, an invoice item error or tax classification mismatch warning is executed.
[0071] In the specific implementation process of the present invention, the predicted tax classification is verified with the tax classification in the item detail information, and when the verification result is inconsistent, an invoice item error or tax classification mismatch warning is executed, including: verifying the predicted tax classification with the tax classification in the item detail information in a comparative manner to obtain a verification result; judging whether the verification result is consistent, and if so, prompting that the verification is passed; if the verification result is inconsistent, executing an invoice item error or tax classification mismatch warning.
[0072] Specifically, first, the predicted tax classification and the tax classification in the item detail information are verified by comparison to obtain the verification result; then, it is determined whether there is any consistency in the verification result. If the verification result is consistent, it is prompted that the verification is passed, that is, there is no abnormality between the item name and the tax classification of the invoice; if the verification result is inconsistent, an invoice item error or tax classification mismatch warning is executed, which means that there is a related abnormality between the item name and the tax classification of the invoice.
[0073] In an embodiment of the present invention, an invoice to be identified is obtained and image acquisition processing is performed to obtain invoice image data; a target area in the invoice image data is positioned to obtain a target positioning area in the invoice image data; text in the target positioning area is recognized to obtain item detail information in the target positioning area; the item name in the item detail information is analyzed and processed, and corresponding tax classification prediction processing is performed to obtain a predicted tax classification; the predicted tax classification is verified with the tax classification in the item detail information, and when the verification result is inconsistent, an invoice item error or tax classification mismatch warning is executed; the accuracy and efficiency of invoice verification can be greatly improved, the compliance of financial and tax operations can be ensured, and related risks can be reduced.
[0074] For example 2, please refer to Figure 2 , Figure 2 It is a schematic diagram of the structure of the invoice item name and tax classification verification device in an embodiment of the present invention.
[0075] like Figure 2 As shown, a device for verifying invoice item names and tax classifications includes:
[0076] Image acquisition module 21: used to obtain the invoice to be identified, and perform image acquisition processing on the invoice to be identified to obtain invoice image data;
[0077] In the specific implementation process of the present invention, the image acquisition and processing of the invoice to be identified to obtain invoice image data includes: calling the image acquisition device on the smart terminal through a preset APP to perform image acquisition and processing on the invoice to be identified at a preset angle and a preset distance to obtain invoice image data.
[0078] Specifically, a corresponding APP is installed on the smart terminal, and the APP is opened on the smart terminal. The image acquisition device carried by the smart terminal is called through the APP, and then image acquisition is performed at a preset angle and a preset distance, that is, image acquisition and processing are performed on the invoice to be identified, so that the invoice image data can be obtained.
[0079] Region positioning module 22: used for positioning the target region in the invoice image data based on image segmentation to obtain the target positioning region in the invoice image data;
[0080] In the specific implementation process of the present invention, the target area in the invoice image data is positioned based on image segmentation to obtain the target positioning area in the invoice image data, including: graying the invoice image data to obtain grayed invoice image data; sequentially using at least two edge detection algorithms to perform region segmentation on the grayed invoice image data to obtain at least two region segmentation contour images corresponding to the invoice image data; performing image contour fusion processing on the region segmentation contour images corresponding to the at least two invoice image data to form multiple fused segmentation contour images corresponding to the invoice image data; positioning the target area based on the multiple fused segmentation contour images corresponding to the invoice image data to obtain the target positioning area in the invoice image data.
[0081] Furthermore, the target area is positioned based on multiple fused segmented contour images corresponding to the invoice image data to obtain the target positioning area in the invoice image data, including: calculating the area corresponding to each of the multiple fused segmented contour images corresponding to the invoice image data and the aspect ratio of each fused segmented contour image; calculating the ratio of the area of each fused segmented contour image to the total area corresponding to the invoice image data to obtain the area ratio value corresponding to each fused segmented contour image; positioning the target area based on the area ratio value and the aspect ratio corresponding to each fused segmented contour image to obtain the target positioning area in the invoice image data.
[0082] Specifically, it is necessary to locate and segment the relevant areas of the invoice image data, so as to ensure the subsequent processing speed; therefore, it is necessary to grayscale the invoice image data first. In the present technical solution, the grayscale histogram method can be selected for grayscale to obtain the grayscale invoice image data; then at least two edge detection algorithms are used in turn to perform regional segmentation processing on the grayscale invoice image data to obtain at least two regional segmentation contour images corresponding to the invoice image data; then the regional segmentation contour images corresponding to the at least two invoice image data are subjected to image contour fusion processing to form multiple fused segmentation contour images corresponding to the invoice image data; finally, the target area can be located and segmented according to the multiple fused segmentation contour images corresponding to the invoice image data to obtain the target location area in the invoice image data.
[0083] In the present technical solution, at least two edge detection algorithms may be the Sobel edge detection algorithm and the Canny edge detection algorithm. These two edge detection algorithms have high detection recognition in edge detection and can effectively identify the border lines in the invoice image. Therefore, the Sobel edge detection algorithm is first used to perform edge detection processing on the grayscale invoice image data to obtain the first edge detection contour information corresponding to the grayscale invoice image data. Then, the Canny edge detection algorithm is used to perform edge detection processing on the grayscale invoice image data to obtain the second edge detection contour information corresponding to the grayscale invoice image data.
[0084] After obtaining the first edge detection contour information and the second edge detection contour information, in order to solve some unclear edge contour detection problems that may exist due to a single edge contour detection algorithm, the fusion processing of the first edge detection contour information and the second edge detection contour information is performed. In the present technical solution, firstly, an N*N matrix is constructed respectively using the first edge detection contour information and the second edge detection contour information, that is, corresponding to the first contour matrix and the second contour matrix, and then the first contour matrix and the second contour matrix are weightedly fused according to a preset weighted fusion ratio to form a corresponding weighted fusion matrix, and then the weighted fusion matrix is converted back into an image form to obtain multiple fused segmented contour images corresponding to the invoice image data. In the present technical solution, multiple fused segmented contour images refer to multiple fused segmented contour images formed by segmenting the invoice image data into multiple regions according to the extracted contours.
[0085] When performing positioning processing, it is first necessary to calculate the area corresponding to each of the multiple fused segmented contour images corresponding to the invoice image data. This area is generally only the pixel area. At the same time, the aspect ratio corresponding to each fused segmented contour image is also calculated. The aspect ratio here is the ratio of the pixel length to the pixel width corresponding to each fused segmented contour image; then it is also necessary to calculate the total area corresponding to the invoice image data, and the total area here is the total pixel area corresponding to the invoice image data; then calculate the ratio of the area of each fused segmented contour image to the total area corresponding to the invoice image data, and obtain the area ratio value corresponding to each fused segmented contour image; then determine the corresponding target area according to the aspect ratio corresponding to each fused segmented contour image and the area ratio value corresponding to each fused segmented contour image, so as to realize the positioning processing of the target area and obtain the target positioning area in the invoice image data; wherein the target positioning area is the area where the tax classification and project name are located in the invoice image data.
[0086] Information recognition module 23: used to recognize the text in the target positioning area and obtain the item detailed information in the target positioning area;
[0087] In the specific implementation process of the present invention, the recognition and processing of the text in the target positioning area to obtain the item detail information in the target positioning area includes: recognizing and processing the text in the target positioning area based on an optical character recognition algorithm to obtain the item detail information in the target positioning area.
[0088] Specifically, since the text extraction operation is performed on the image, it is necessary to use an optical character recognition algorithm to identify and process the text in the target positioning area, so as to obtain the corresponding extracted text information, and finally screen the corresponding text information to form the project details in the target positioning area; for example, the information existing in the target positioning area includes the details corresponding to the "goods or taxable services, service name", such as "*catering services*meal expenses", in which case "catering services" is the tax classification, and "meal expenses" is the project name. The tax classification and project name are extracted by segmenting the character string. The character string between the first * and the second * is the tax classification, and the character string after the second * is the project name.
[0089] Analysis and prediction module 24: used to analyze and process the project name in the project details information based on the big model technology combined with the knowledge base of the mapping relationship between tax classification and project name, and perform corresponding tax classification prediction processing according to the analysis result to obtain the predicted tax classification;
[0090] In the specific implementation process of the present invention, the knowledge base based on the big model technology combined with the mapping relationship between tax classification and project name analyzes and processes the project name in the project details information, and performs corresponding tax classification prediction processing according to the analysis results to obtain predicted tax classification, including: obtaining the project name in the project details information, and vectorizing the project name to form project name vector data; performing similarity query processing in the vector table corresponding to the knowledge base based on the preset similarity query conditions to obtain a returned paragraph ID that meets the similarity; performing query processing in the paragraph query table based on the paragraph ID to obtain the paragraph text corresponding to the paragraph ID; filling the paragraph text and the tax classification in the project details information into the prompt word template to generate a corresponding prompt word; inputting the prompt word as an input parameter into the big model corresponding to the big model technology to perform corresponding tax classification prediction processing to obtain a predicted tax classification.
[0091] Specifically, it is first necessary to obtain the project name in the project details information, and vectorize the project name to form project name vector data; then, according to the preset similarity query conditions, the project name vector data is used to perform similarity query processing in the vector table corresponding to the knowledge base, and the returned paragraph ID that meets the similarity is obtained; then, according to the paragraph ID, query processing is performed in the paragraph query table to obtain the paragraph text corresponding to the paragraph ID; the paragraph text and the tax classification in the project details information are filled in the prompt word template to generate the corresponding prompt word; then the prompt word is input as an input parameter into the big model corresponding to the big model technology to perform the corresponding tax classification prediction processing to obtain the predicted tax classification.
[0092] That is, the construction of a knowledge base of the mapping relationship between tax classification and project name, including a general tax classification catalog and known tax classification knowledge; the general tax classification catalog is obtained from relevant units and updated regularly; part of the known tax classification knowledge is built-in by the system, and part can be added by users; for the added knowledge documents, the system will first extract the knowledge text content and perform intelligent segmentation, save the knowledge documents in the document table, and save the paragraphs in the paragraph table; vectorize the paragraph content and save it in the vector table; the purpose of vectorizing the paragraph content is to realize vector retrieval of the content.
[0093] The process of using the big model to theoretically determine the tax classification is as follows: vectorize the project name in the project details information to obtain vector data; then query the vector table and the vector data under the knowledge base; query the vector table through the vector data and similarity conditions, and return the paragraph id that meets the conditions; query the paragraph table through the paragraph id, and finally return the hit paragraph text; fill the paragraph text and tax classification into the prompt word template and splice them into prompt words; the prompt word template is as follows: Tax classification contains: {taxclassification}, and it is known: {data}, please answer which tax classification the current input content belongs to; pass the spliced prompt words as parameters into the big model and return the prediction result; in this way, the predicted tax classification can be obtained.
[0094] Verification processing module 25: used to perform verification processing using the predicted tax classification and the tax classification in the item detail information, and when the verification result is inconsistent, execute an invoice item error or tax classification mismatch warning.
[0095] In the specific implementation process of the present invention, the predicted tax classification is verified with the tax classification in the item detail information, and when the verification result is inconsistent, an invoice item error or tax classification mismatch warning is executed, including: verifying the predicted tax classification with the tax classification in the item detail information in a comparative manner to obtain a verification result; judging whether the verification result is consistent, and if so, prompting that the verification is passed; if the verification result is inconsistent, executing an invoice item error or tax classification mismatch warning.
[0096] Specifically, first, the predicted tax classification and the tax classification in the item detail information are verified by comparison to obtain the verification result; then, it is determined whether there is any consistency in the verification result. If the verification result is consistent, it is prompted that the verification is passed, that is, there is no abnormality between the item name and the tax classification of the invoice; if the verification result is inconsistent, an invoice item error or tax classification mismatch warning is executed, which means that there is a related abnormality between the item name and the tax classification of the invoice.
[0097] In an embodiment of the present invention, an invoice to be identified is obtained and image acquisition processing is performed to obtain invoice image data; a target area in the invoice image data is positioned to obtain a target positioning area in the invoice image data; text in the target positioning area is recognized to obtain item detail information in the target positioning area; the item name in the item detail information is analyzed and processed, and corresponding tax classification prediction processing is performed to obtain a predicted tax classification; the predicted tax classification is verified with the tax classification in the item detail information, and when the verification result is inconsistent, an invoice item error or tax classification mismatch warning is executed; the accuracy and efficiency of invoice verification can be greatly improved, the compliance of financial and tax operations can be ensured, and related risks can be reduced.
[0098] An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the invoice item name and tax classification verification method of any one of the above embodiments is implemented. The computer-readable storage medium includes, but is not limited to, any type of disk (including floppy disk, hard disk, optical disk, CD-ROM, and magneto-optical disk), ROM (Read-Only Memory), RAM (Random Access Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory, magnetic card or optical card. That is, the storage device includes any medium that can store or transmit information in a readable form by a device (for example, a computer, a mobile phone), which can be a read-only memory, a disk or an optical disk, etc.
[0099] An embodiment of the present invention further provides a computer application program that runs on a computer and is used to execute the invoice item name and tax classification verification method of any one of the above embodiments.
[0100] also, Figure 3 It is a schematic diagram of the structure of the intelligent terminal in the embodiment of the present invention.
[0101] The embodiment of the present invention also provides an intelligent terminal, such as Figure 3 The intelligent terminal includes a processor 302, a memory 303, an input unit 304, a display unit 305 and other devices. Those skilled in the art will understand that Figure 3The illustrated intelligent terminal structure device does not constitute a limitation on all devices, and may include more or fewer components than shown, or combine certain components. The memory 303 can be used to store the application 301 and each functional module, and the processor 302 runs the application 301 stored in the memory 303, thereby executing various functional applications and data processing of the device. The memory can be an internal memory or an external memory, or include both internal and external memories. The internal memory may include a read-only memory (ROM), a programmable ROM (PROM), an electrically programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), a flash memory, or a random access memory. The external memory may include a hard disk, a floppy disk, a ZIP disk, a U disk, a magnetic tape, etc. The memory disclosed in the present invention includes but is not limited to these types of memories. The memory disclosed in the present invention is only used as an example and not as a limitation.
[0102] The input unit 304 is used to receive the input of the signal and the keyword input by the user. The input unit 304 may include a touch panel and other input devices. The touch panel can collect the touch operation of the user on or near it, and drive the corresponding connection device according to a pre-set program; other input devices may include but are not limited to one or more of a physical keyboard, a function key (such as a play control key, a switch key, etc.), a trackball, a mouse, a joystick, etc. The display unit 305 can be used to display the information input by the user or the information provided to the user and various menus of the terminal device. The display unit 305 can be in the form of a liquid crystal display, an organic light emitting diode, etc. The processor 302 is the control center of the terminal device, which uses various interfaces and lines to connect various parts of the entire device, and executes various functions and processes data by running or executing software programs and / or modules stored in the memory 303, and calling data stored in the memory.
[0103] As an embodiment, the intelligent terminal includes: one or more processors 302, a memory 303, and one or more applications 301, wherein the one or more applications 301 are stored in the memory 303 and are configured to be executed by the one or more processors 302, and the one or more applications 301 are configured to execute the invoice item name and tax classification verification method in any one of the above embodiments.
[0104] In an embodiment of the present invention, an invoice to be identified is obtained and image acquisition processing is performed to obtain invoice image data; a target area in the invoice image data is positioned to obtain a target positioning area in the invoice image data; text in the target positioning area is recognized to obtain item detail information in the target positioning area; the item name in the item detail information is analyzed and processed, and corresponding tax classification prediction processing is performed to obtain a predicted tax classification; the predicted tax classification is verified with the tax classification in the item detail information, and when the verification result is inconsistent, an invoice item error or tax classification mismatch warning is executed; the accuracy and efficiency of invoice verification can be greatly improved, the compliance of financial and tax operations can be ensured, and related risks can be reduced.
[0105] In addition, the above is a detailed introduction to an invoice item name and tax classification verification method and related devices provided by an embodiment of the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for a person skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A method for verifying invoice item names and tax classifications, characterized in that: The method comprises: Obtaining an invoice to be identified, and performing image acquisition processing on the invoice to be identified to obtain invoice image data; Performing positioning processing on the target area in the invoice image data based on image segmentation to obtain the target positioning area in the invoice image data; Recognize the text in the target positioning area to obtain detailed information of the items in the target positioning area; Based on the big model technology combined with the knowledge base of the mapping relationship between tax classification and project name, the project name in the project detail information is analyzed and processed, and the corresponding tax classification prediction processing is performed according to the analysis result to obtain the predicted tax classification; The predicted tax classification is used to verify the tax classification in the item detail information, and when the verification result is inconsistent, an invoice item error or tax classification mismatch warning is executed.
2. The invoice item name and tax classification verification method according to claim 1 is characterized in that: The step of performing image acquisition processing on the invoice to be identified to obtain invoice image data includes: The image acquisition device on the smart terminal is called by a preset APP to perform image acquisition and processing on the invoice to be identified at a preset angle and a preset distance to obtain invoice image data.
3. The invoice item name and tax classification verification method according to claim 1 is characterized in that: The method of performing positioning processing on the target area in the invoice image data based on image segmentation to obtain the target positioning area in the invoice image data includes: grayscale the invoice image data to obtain grayscale invoice image data; Using at least two edge detection algorithms in sequence to perform region segmentation processing on the grayscale invoice image data to obtain at least two region segmentation contour images corresponding to the invoice image data; Performing image contour fusion processing on the regional segmentation contour images corresponding to at least two invoice image data to form a plurality of fused segmentation contour images corresponding to the invoice image data; The target area is positioned based on a plurality of fused segmented contour images corresponding to the invoice image data to obtain a target positioning area in the invoice image data.
4. The invoice item name and tax classification verification method according to claim 3 is characterized in that: The method of performing positioning processing on the target area based on the multiple fused segmented contour images corresponding to the invoice image data to obtain the target positioning area in the invoice image data includes: Calculate the area corresponding to each of the multiple fused segmented contour images corresponding to the invoice image data and the aspect ratio corresponding to each of the fused segmented contour images; Calculating the ratio of the area of each fused segmented contour image to the total area corresponding to the invoice image data, and obtaining the area ratio value corresponding to each fused segmented contour image; The target area is positioned based on the area ratio value and the aspect ratio corresponding to each fused segmentation contour image to obtain the target positioning area in the invoice image data.
5. The invoice item name and tax classification verification method according to claim 1 is characterized in that: The step of performing recognition processing on the text in the target positioning area to obtain detailed information of items in the target positioning area includes: The text in the target positioning area is recognized based on an optical character recognition algorithm to obtain item detail information in the target positioning area.
6. The invoice item name and tax classification verification method according to claim 1 is characterized in that: The large model technology combined with the knowledge base of the mapping relationship between tax classification and project name analyzes and processes the project name in the project details information, and performs corresponding tax classification prediction processing according to the analysis result to obtain the predicted tax classification, including: Obtaining the project name in the project details information, and vectorizing the project name to form project name vector data; Based on the preset similarity query condition, the project name vector data is used to perform similarity query processing in the vector table corresponding to the knowledge base to obtain the returned paragraph ID that meets the similarity; Perform query processing in a paragraph query table based on the paragraph ID to obtain the paragraph text corresponding to the paragraph ID; Fill the paragraph text and the tax classification in the item details into the prompt word template to generate corresponding prompt words; The prompt word is input as an input parameter into the large model corresponding to the large model technology to perform corresponding tax classification prediction processing to obtain the predicted tax classification.
7. The invoice item name and tax classification verification method according to claim 1 is characterized in that: The method of verifying the predicted tax classification with the tax classification in the item detail information and issuing an invoice item error or tax classification mismatch warning when the verification result is inconsistent includes: Verify the predicted tax classification with the tax classification in the project detail information by comparing them to obtain a verification result; Determine whether the verification results are consistent, and if so, indicate that the verification is successful; If the verification result is inconsistent, an invoice item error or tax classification mismatch warning is executed.
8. An invoice item name and tax classification verification device, characterized in that: The device comprises: Image acquisition module: used to obtain the invoice to be identified, and perform image acquisition processing on the invoice to be identified to obtain invoice image data; Region positioning module: used for positioning the target region in the invoice image data based on image segmentation to obtain the target positioning region in the invoice image data; Information recognition module: used to recognize the text in the target positioning area and obtain the item details in the target positioning area; Analysis and prediction module: used to analyze and process the project names in the project details based on the big model technology combined with the knowledge base of the mapping relationship between tax classification and project name, and perform corresponding tax classification prediction processing according to the analysis results to obtain predicted tax classification; Verification processing module: used to perform verification processing using the predicted tax classification and the tax classification in the item detail information, and when the verification result is inconsistent, execute an invoice item error or tax classification mismatch warning.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the invoice item name and tax classification verification method as described in any one of claims 1-7 is implemented.
10. An intelligent terminal, characterized in that: The intelligent terminal comprises: one or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to: execute the invoice item name and tax classification verification method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Invoice image classification method and device, equipment and storage medium
CN113342977A
Invoice verification method and device, equipment and storage medium
CN115761738A
Systems and methods for tax data capture and use
US20140241631A1
Cited By
Automatic tax monitoring and early warning method and system
CN120013695A
