Invoice reconciliation method and device based on image segmentation and storage medium
The image segmentation technology extracts the reconciliation areas and information from the invoice images, solving the problem of low reconciliation efficiency of enterprises, realizing automated processing and real-time reconciliation, and reducing manual intervention.
Patent Information
- Application Number
- CN202411375628.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-14
AI Technical Summary
Enterprises are inefficient in conducting invoice reconciliation, and manual processing results in a long time, especially when processing diversified and inconsistent formats, increasing complexity.
Using an image segmentation method, by obtaining invoice images, extracting the area to be reconciled, performing area segmentation and information extraction, calculating consistency with preset bills, marking doubtful invoices, and verifying misjudgments through transaction records, reducing manual processing.
It realizes automation of the reconciliation process, improves efficiency and response speed, reduces the workload of manually processing abnormal invoices, and can process large amounts of invoice data in real time or near real time.
Smart Images

Figure CN119313490A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image segmentation, and in particular to an invoice reconciliation method, device and storage medium based on image segmentation. Background Art
[0002] Invoice reconciliation is a common method for corporate reconciliation. However, there are many problems with corporate annual invoices, such as duplication, invalidated invoices, misplaced invoices, etc. If the company's reconciliation is directly based on existing invoices, it is likely to cause account confusion. The invoice reconciliation process mainly relies on manual processing, which will lead to inefficiency. Among them, manual identification of invoices, verification of information, recording of exceptions and other steps are time-consuming.
[0003] At the same time, invoice data may come from different channels and formats. If there is no standardized data processing process and tools, it will increase the complexity and time consumption of processing. Therefore, it is necessary to improve the efficiency of invoice reconciliation conducted by enterprises. Summary of the invention
[0004] The present invention provides an invoice reconciliation method, device and storage medium based on image segmentation, the main purpose of which is to solve the problem of low efficiency in invoice reconciliation.
[0005] To achieve the above object, the present invention provides an invoice reconciliation method based on image segmentation, comprising:
[0006] Acquire an invoice image of a target invoice, and extract a to-be-reconciled area in the invoice image;
[0007] Performing regional segmentation on the invoice image according to the area to be reconciled to obtain a regional image corresponding to the area to be reconciled;
[0008] Extracting the to-be-reconciled information in the regional image, and calculating the consistency between the to-be-reconciled information and a preset corporate bill;
[0009] When the to-be-reconciled information is inconsistent with the preset corporate invoice, the target invoice is marked as a questionable invoice;
[0010] The transaction record corresponding to the questionable invoice is obtained, and the questionable invoice is misjudged and verified according to the transaction record. When the abnormal invoice is misjudged, the abnormal mark of the target invoice is cancelled.
[0011] Optionally, extracting the area to be reconciled in the invoice image includes:
[0012] Filtering and denoising the invoice image, and performing edge detection on the filtered and denoised invoice image;
[0013] The target area of the invoice image is screened according to the edge detection result of the edge detection to obtain the area to be reconciled in the invoice image.
[0014] Optionally, performing edge detection on the filtered and denoised invoice image includes:
[0015] Converting the filtered and denoised invoice image into a grayscale image, and extracting edge pixels in the grayscale image;
[0016] The edge pixels are spliced into edge lines, and the edge detection result of the filtered and denoised invoice image is determined according to the edge lines.
[0017] Optionally, the performing target area screening on the invoice image according to the edge detection result of the edge detection to obtain the to-be-reconciled area in the invoice image includes:
[0018] Determining edge features in the invoice image according to the edge detection result of the edge detection;
[0019] The invoice image is filtered step by step according to the edge features, the preset area conditions, the preset shape conditions and the preset position conditions to obtain the area to be reconciled in the invoice image.
[0020] Optionally, filtering the invoice image step by step according to the edge features and preset filtering conditions to obtain the to-be-reconciled area in the invoice image includes:
[0021] Performing area filtering on the invoice image according to the edge area in the edge feature and the area condition;
[0022] Performing shape filtering on the invoice image after area filtering according to the edge shape in the edge feature and the shape condition;
[0023] The invoice image after shape filtering is subjected to position filtering according to the edge position in the edge feature and the position condition, so as to obtain the area to be reconciled in the invoice image.
[0024] Optionally, segmenting the invoice image according to the area to be reconciled to obtain a regional image corresponding to the area to be reconciled includes:
[0025] Performing regional positioning on the to-be-reconciled area in the invoice image, and performing image cropping on the invoice image after the regional positioning to obtain a cropped image of the invoice image;
[0026] The cropped image corresponding to the area to be reconciled is selected as the area image.
[0027] Optionally, extracting the to-be-reconciled information in the regional image includes:
[0028] Performing optical character recognition on the area image to obtain text characters in the area image;
[0029] The to-be-reconciled information in the area image is generated according to the text characters.
[0030] Optionally, generating the to-be-reconciled information in the regional image according to the text characters includes:
[0031] Performing character pattern matching on the text characters, extracting reconciliation information from the text characters after the character pattern matching, and obtaining primary reconciliation information;
[0032] The primary reconciliation information is format-checked one by one, and the primary reconciliation information that passes the format check is determined to be the to-be-reconciled information in the regional image.
[0033] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:
[0034] at least one processor; and,
[0035] a memory communicatively connected to the at least one processor; wherein,
[0036] The memory stores a computer program that can be executed by the at least one processor. The computer program is executed by the at least one processor so that the at least one processor can perform the above-mentioned invoice reconciliation method based on image segmentation.
[0037] In order to solve the above problem, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is executed by a processor in an electronic device to implement the above-mentioned invoice reconciliation method based on image segmentation.
[0038] The embodiment of the present invention utilizes image segmentation technology to extract the area to be reconciled from the invoice image, and segments and extracts information from the area, thereby realizing automated processing of the reconciliation process. By accurately segmenting and extracting information from the area to be reconciled, high-quality information to be reconciled can be obtained, and invoices inconsistent with preset corporate bills can be marked as questionable invoices, that is, potential abnormal invoices. By further verifying the transaction records of the questionable invoices, misjudged abnormal invoices can be effectively screened out, reducing the workload of manual processing of abnormal invoices. The image segmentation method can quickly process a large amount of invoice image data, and perform reconciliation and anomaly detection in a timely manner, which enables the reconciliation process to be carried out on a real-time or near real-time basis, thereby improving the efficiency and response speed of the reconciliation. Therefore, the invoice reconciliation method, device and storage medium based on image segmentation proposed in the present invention can solve the problem of low efficiency in invoice reconciliation. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 A schematic diagram of a process of an invoice reconciliation method based on image segmentation provided by an embodiment of the present invention;
[0040] Figure 2 A schematic diagram of the structure of an electronic device for implementing the invoice reconciliation method based on image segmentation provided by an embodiment of the present invention.
[0041] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0042] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0043] The embodiment of the present application provides an invoice reconciliation method based on image segmentation. The execution subject of the invoice reconciliation method based on image segmentation includes but is not limited to at least one of the electronic devices such as a server, a terminal, etc. that can be configured to execute the method provided in the embodiment of the present application. In other words, the invoice reconciliation method based on image segmentation can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms.
[0044] Reference Figure 1FIG. 1 is a flow chart of an invoice reconciliation method based on image segmentation provided by an embodiment of the present invention. In this embodiment, the invoice reconciliation method based on image segmentation includes:
[0045] S1. Obtain an invoice image of a target invoice, and extract a to-be-reconciled area in the invoice image.
[0046] In an embodiment of the present invention, it is assumed that a manufacturing company regularly purchases raw materials from suppliers and receives corresponding invoices. They hope to digitize these paper invoices through image acquisition to improve the efficiency of reconciliation.
[0047] In detail, the target invoice can be different types of invoices, such as special value-added tax invoices, ordinary invoices and professional invoices. Among them, special value-added tax invoices are mainly used as vouchers for the sale of goods or provision of taxable services between general value-added tax taxpayers. Ordinary invoices are mainly used by business tax taxpayers and small-scale value-added tax taxpayers, and can also be used by general value-added tax taxpayers when special invoices cannot be issued. Professional invoices are special types of invoices used in certain special industries or fields, such as deposit, loan, remittance and transfer vouchers of state-owned financial and insurance enterprises; stamps and mailing lists of state-owned postal and telecommunications enterprises, etc. Various types of invoices have different forms of expression.
[0048] Furthermore, a template library can be established for common invoice types, each template containing the structural characteristics, key word positions, etc. of this type of invoice, and the area to be reconciled in the invoice image is extracted based on the templates in the template library, thereby performing regional segmentation of the invoice image.
[0049] Alternatively, for each invoice type, its layout pattern is analyzed and corresponding segmentation rules are defined, such as the position of the text area, the distribution of table lines, etc., to extract the area to be reconciled in the invoice image, and then perform regional segmentation of the invoice image.
[0050] In an embodiment of the present invention, the invoice image of the target invoice can be obtained by assuming that the company has received a paper invoice from a supplier. In order to digitize it for subsequent reconciliation processing, the employee uses a mobile phone or scanner provided by the company to take a photo or scan the invoice. After taking or scanning, the image may contain noise or distortion, so preprocessing is required. The image clarity can be ensured by adjusting the brightness and contrast of the image or performing some basic image repair.
[0051] Furthermore, the processed images are saved in the company's computers or cloud storage for subsequent image processing steps, through which the company can quickly and easily convert paper invoices into electronic images, laying the foundation for the subsequent reconciliation process.
[0052] In the embodiment of the present invention, extracting the area to be reconciled in the invoice image includes:
[0053] Filtering and denoising the invoice image, and performing edge detection on the filtered and denoised invoice image;
[0054] The target area of the invoice image is screened according to the edge detection result of the edge detection to obtain the area to be reconciled in the invoice image.
[0055] In detail, the collected invoice images are filtered and denoised. This step aims to remove noise and unnecessary details in the image so that subsequent processing is more accurate. For example, a Gaussian filter can be used to smooth the image to remove some small pixel changes and make the image clearer.
[0056] Furthermore, after filtering and denoising, edge detection is performed on the processed invoice image, wherein the edge detection is a commonly used image processing technology for detecting boundaries and contours in an image, which can help determine the boundaries of each item in the invoice and provide a basis for subsequent area screening.
[0057] In detail, based on the results of edge detection, the invoice image is screened for target areas, which means that the various boundaries and contours in the image are identified, and based on pre-defined rules and conditions, it is determined which areas contain the information to be reconciled, such as important information such as invoice number, date and amount. These determined areas are the areas to be reconciled, which contain the information to be reconciled and can be used for subsequent information extraction and processing.
[0058] In summary, through these steps, important information areas to be reconciled can be automatically extracted from the invoice image, providing an accurate data basis for the subsequent reconciliation process.
[0059] In detail, the edge detection of the filtered and denoised invoice image includes:
[0060] Converting the filtered and denoised invoice image into a grayscale image, and extracting edge pixels in the grayscale image;
[0061] The edge pixels are spliced into edge lines, and the edge detection result of the filtered and denoised invoice image is determined according to the edge lines.
[0062] In detail, the filtered and denoised invoice image is converted into a grayscale image. This step is because when performing edge detection, usually only the brightness change of the pixel needs to be considered without considering the color information. Therefore, converting the image into grayscale can simplify the processing process.
[0063] In detail, the edge pixels are usually pixels with large brightness changes in the image. The edge pixels are marked as white and other pixels are marked as black according to the brightness changes of the pixels, thereby extracting the edge pixels in the grayscale image.
[0064] In detail, the extracted edge pixels are spliced into continuous edge lines. This step will connect the discrete edge pixels to form edge lines. These lines will correspond to the boundaries and contours in the image. Finally, the edge detection result of the filtered and denoised invoice image is determined based on the spliced edge lines. This means that the edge lines will be compared with the original image to determine which parts are the boundaries and contours in the image, thereby obtaining the edge detection result.
[0065] In summary, through this process, the boundaries and contours in the invoice image can be accurately detected, providing a reliable basis for subsequent area screening. These edge information will help identify the location of each item in the invoice for the next step of processing and analysis.
[0066] In detail, the target area screening of the invoice image according to the edge detection result of the edge detection to obtain the area to be reconciled in the invoice image includes:
[0067] Determining edge features in the invoice image according to the edge detection result of the edge detection;
[0068] The invoice image is filtered step by step according to the edge features, the preset area conditions, the preset shape conditions and the preset position conditions to obtain the area to be reconciled in the invoice image.
[0069] In detail, the target area screening of the invoice image is performed based on the result of edge detection, mainly to determine the area to be reconciled in the invoice, that is, the part containing valuable information, such as product name, quantity, price, etc.
[0070] Specifically, the result of edge detection usually produces a series of edge features, which can describe the boundaries and contours in the image. For example, straight lines, curves, corner points, etc. can all be regarded as edge features.
[0071] In detail, when performing target area screening, the image is filtered step by step according to preset conditions to determine the area to be reconciled, and these conditions usually include area, shape, and location.
[0072] Furthermore, according to the characteristics of the invoice, some shape conditions may be preset, such as a rectangle or a strip, to ensure that the selected area is consistent with the shape of the invoice item.
[0073] In detail, some location conditions may also be set according to the layout and structure of the invoice, such as within a specific area of the invoice or adjacent to other specific elements.
[0074] Specifically, suppose there is an invoice image. After edge detection, a series of edge features are obtained, including some straight lines and curves. It is hoped that the area to be reconciled, that is, the area where the product list is located, can be filtered out.
[0075] Furthermore, first, according to the preset area conditions, those edge features with too small or too large areas are filtered out, and only features with moderate areas are retained; then, according to the preset shape conditions, edge features that conform to the shape of a rectangle or a long strip are screened out, because the product list is usually rectangular or long strip; finally, according to the preset location conditions, these features can be confined to a specific area of the invoice and adjacent to other specific elements (such as the invoice header or footer).
[0076] In detail, through these step-by-step filtering steps, the area to be reconciled in the invoice image can be obtained, which contains valuable information such as the product list, providing a basis for subsequent reconciliation and processing.
[0077] In detail, filtering the invoice image step by step according to the edge features and the preset filtering conditions to obtain the to-be-reconciled area in the invoice image includes:
[0078] Performing area filtering on the invoice image according to the edge area in the edge feature and the area condition;
[0079] Performing shape filtering on the invoice image after area filtering according to the edge shape in the edge feature and the shape condition;
[0080] The invoice image after shape filtering is subjected to position filtering according to the edge position in the edge feature and the position condition, so as to obtain the area to be reconciled in the invoice image.
[0081] In detail, in the area filtering step, those edge features that are too small or too large are excluded according to the preset area conditions. This step is to be able to remove noise and insignificant edges in the image, thereby simplifying the subsequent processing steps. Through area filtering, it is ensured that the retained edge features are more likely to be related to the invoice, which helps to improve the efficiency and accuracy of the subsequent steps.
[0082] Specifically, in the shape filtering step, edge features that meet the requirements are screened out according to the preset shape conditions. This step is to further narrow the scope of candidate areas and exclude those features whose shapes do not meet expectations. Through shape filtering, the area in the invoice that may contain the information to be reconciled can be more accurately located, improving the accuracy of subsequent processing steps.
[0083] In detail, in the position filtering step, the edge features after shape filtering are further filtered according to the preset position conditions. This step is to ensure that the selected area is located in a specific position of the invoice, such as in the area where the product list is located, and adjacent to other important elements. Through position filtering, the area to be reconciled in the invoice can be further accurately located, which improves the accuracy of the final result.
[0084] In summary, the best filtering order should be area filtering first, then shape filtering, and finally position filtering. This is because area filtering can exclude most of the noise and irrelevant features, shape filtering can further narrow the scope of candidate areas, and position filtering can ensure that the selected area is located in the correct position in the invoice. This order can maximize processing efficiency and accuracy of results.
[0085] S2. Segment the invoice image according to the area to be reconciled to obtain a regional image corresponding to the area to be reconciled.
[0086] In the embodiment of the present invention, the step of segmenting the invoice image according to the area to be reconciled to obtain the area image corresponding to the area to be reconciled includes:
[0087] Performing regional positioning on the to-be-reconciled area in the invoice image, and performing image cropping on the invoice image after the regional positioning to obtain a cropped image of the invoice image;
[0088] The cropped image corresponding to the area to be reconciled is selected as the area image.
[0089] In detail, the contour detection technology can be used to locate the area to be reconciled in the invoice image. Once the area to be reconciled is successfully located, a rectangular frame or polygonal area can be obtained to indicate the position of the area to be reconciled in the original invoice image.
[0090] Further, the original invoice image is cropped using the positioning result of the area to be reconciled. This means that only the image pixels in the area to be reconciled are retained and other areas are deleted. This can be achieved by masking the rectangular box or polygon where the area to be reconciled is located with the original image to extract the pixels in the area to be reconciled.
[0091] Specifically, the image corresponding to the area to be reconciled is selected from the cropped image as the final area image. This means that only the portion containing the information to be reconciled is retained, and the other portions are discarded. Typically, the image corresponding to the area to be reconciled will contain important information such as invoice number, date, amount, etc.
[0092] In general, through regional positioning and image cropping, separate regional images can be obtained, which contain the information to be reconciled. Then, by selecting the image corresponding to the area to be reconciled as the final regional image, these images can be further processed to extract important information for subsequent reconciliation work.
[0093] S3. Extract the information to be reconciled in the regional image, and calculate the consistency between the information to be reconciled and a preset corporate bill.
[0094] In the embodiment of the present invention, extracting the to-be-reconciled information in the regional image includes:
[0095] Performing optical character recognition on the area image to obtain text characters in the area image;
[0096] The to-be-reconciled information in the area image is generated according to the text characters.
[0097] In detail, optical character recognition (OCR) technology is used to process the regional image, the text characters in the image are converted into computer-recognizable text data, and character pattern matching is performed on the text characters output by OCR to identify the invoice number, date and amount waiting for reconciliation information, wherein character pattern matching can be implemented using regular expressions or string matching algorithms of specific patterns.
[0098] In detail, the step of generating the to-be-reconciled information in the regional image according to the text characters includes:
[0099] Performing character pattern matching on the text characters, extracting reconciliation information from the text characters after the character pattern matching, and obtaining primary reconciliation information;
[0100] The primary reconciliation information is format-checked one by one, and the primary reconciliation information that passes the format check is determined to be the to-be-reconciled information in the regional image.
[0101] Furthermore, primary reconciliation information is extracted based on the matched character pattern, including key information such as invoice number, date and amount.
[0102] Furthermore, the format of the primary reconciliation information is checked to ensure that the date format is correct, the amount is in digital format, whether the product name exists in the list, etc. This can be achieved through programming, such as using date format check function and amount format check function.
[0103] In detail, the primary reconciliation information is compared with the preset corporate bills to calculate consistency, for example: comparing whether information such as invoice number, date and amount matches the corresponding information in the preset bills, and performing consistency assessment based on the matching results.
[0104] In summary, by extracting the information to be reconciled through optical character recognition technology, performing character pattern matching and format verification on it, and finally comparing it with the preset corporate bills, the extraction and consistency calculation of the information to be reconciled can be achieved.
[0105] In an embodiment of the present invention, calculating the consistency of the information to be reconciled with the preset corporate bill refers to comparing the degree of matching between the information to be reconciled extracted from the regional image and the corresponding information in the preset corporate bill, wherein the purpose of the consistency calculation is to determine whether the information to be reconciled is consistent with the preset corporate bill, thereby determining whether there is a reconciliation difference.
[0106] In detail, the information to be reconciled extracted from the area image is matched with the corresponding information in the corporate bill, for example, the invoice number extracted from the area image is compared with the invoice number in the corporate bill, the extracted date is compared with the date in the bill, and the extracted amount is compared with the amount in the bill.
[0107] Furthermore, based on the results of information matching, the consistency of the information to be reconciled and the information in the corporate bill is evaluated. If all the information matches, the information to be reconciled is consistent with the corporate bill; if there is any information mismatch, further analysis of the possible reasons is required.
[0108] For example, suppose the invoice number extracted from the reconciliation information is "INV123456", the date is "2024-04-15", and the amount is "$500.00". The corresponding invoice number in the corporate bill is "INV123456", the date is "2024-04-15", and the amount is "$520.00". In this case, the invoice number and date match, but the amount does not match. It can be determined that the reconciliation information is inconsistent with the preset corporate bill.
[0109] Furthermore, the mismatch in amounts needs to be further investigated to find out the possible reasons for the discrepancy, such as additional fees or discounts that were not taken into account.
[0110] S4. When the to-be-reconciled information is inconsistent with the preset corporate invoice, the target invoice is marked as a questionable invoice.
[0111] In an embodiment of the present invention, when the information to be reconciled is inconsistent with the preset corporate invoice, marking the target invoice as a questionable invoice means that if key fields such as the invoice number, date or amount do not match the information to be reconciled and the corporate invoice, the invoice can be marked as a questionable invoice.
[0112] In addition to the above situations, there may be other inconsistencies, such as some invoices in the corporate bill are missing from the pending reconciliation information, or the pending reconciliation information contains invoices that are not in the corporate bill, etc. These situations can also mark the target invoice as a questionable invoice.
[0113] S5. Acquire the transaction record corresponding to the questionable invoice, perform misjudgment verification on the questionable invoice according to the transaction record, and cancel the abnormal mark of the target invoice when the abnormal invoice is misjudged.
[0114] In an embodiment of the present invention, after a questionable invoice is identified, a transaction record related to the questionable invoice is obtained from a corporate account or financial system, and the transaction record should include payment information, order information or other transaction details associated with the questionable invoice.
[0115] Furthermore, the acquired transaction records are analyzed and compared with the information in the questionable invoice. If the transaction records match the information shown in the questionable invoice, that is, there is a corresponding payment or transaction record that supports the legitimacy of the questionable invoice, the questionable invoice is considered a misjudgment and the abnormal mark is cancelled.
[0116] Further, suppose there is a questionable invoice in the reconciliation information, the invoice number is "INV789012", the amount is "$700.00", but the corresponding record is not found in the corporate bill, and the relevant transaction records are obtained from the financial system. It is found that there is a payment of "$700.00" in the transaction record, which matches the amount of the questionable invoice, and the payment purpose description is "INV789012", which is consistent with the invoice number of the questionable invoice. After verification, it is determined that the questionable invoice is legal and matches the actual transaction record of the corporate bill. Therefore, the abnormal mark of the questionable invoice will be cancelled, and it will be confirmed as a valid invoice, which is consistent with the corporate bill.
[0117] The embodiment of the present invention utilizes image segmentation technology to extract the area to be reconciled from the invoice image, and segments and extracts information from the area, thereby realizing automated processing of the reconciliation process. By accurately segmenting and extracting information from the area to be reconciled, high-quality information to be reconciled can be obtained, and invoices inconsistent with preset corporate bills can be marked as questionable invoices, that is, potential abnormal invoices. By further verifying the transaction records of the questionable invoices, misjudged abnormal invoices can be effectively screened out, reducing the workload of manual processing of abnormal invoices. The image segmentation method can quickly process a large amount of invoice image data, and perform reconciliation and anomaly detection in a timely manner, which enables the reconciliation process to be carried out on a real-time or near real-time basis, thereby improving the efficiency and response speed of the reconciliation. Therefore, the invoice reconciliation method based on image segmentation proposed in the present invention can solve the problem of low efficiency in invoice reconciliation.
[0118] like Figure 2 FIG. 1 is a schematic diagram of the structure of an electronic device for implementing an invoice reconciliation method based on image segmentation provided by an embodiment of the present invention.
[0119] The electronic device 1 may include a processor 10, a memory 11, a communication bus 12, and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as an invoice reconciliation program based on image segmentation.
[0120] In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 10 is the control core (ControlUnit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules stored in the memory 11 (for example, executing an invoice reconciliation program based on image segmentation, etc.), and calls data stored in the memory 11 to execute various functions of the electronic device and process data.
[0121] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 11 may also be an external storage device of an electronic device, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Further, the memory 11 may also include both an internal storage unit of the electronic device and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device, such as the code of an invoice reconciliation program based on image segmentation, but also be used to temporarily store data that has been output or is to be output.
[0122] The communication bus 12 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.
[0123] The communication interface 13 is used for communication between the above-mentioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface may also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.
[0124] The figure only shows an electronic device with components. Those skilled in the art will understand that the structure shown in the figure does not constitute a limitation on the electronic device, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0125] For example, although not shown, the electronic device may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0126] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.
[0127] The invoice reconciliation program based on image segmentation stored in the memory 11 of the electronic device 1 is a combination of multiple instructions, and when running in the processor 10, it can achieve:
[0128] Acquire an invoice image of a target invoice, and extract a to-be-reconciled area in the invoice image;
[0129] Performing regional segmentation on the invoice image according to the area to be reconciled to obtain a regional image corresponding to the area to be reconciled;
[0130] Extracting the to-be-reconciled information in the regional image, and calculating the consistency between the to-be-reconciled information and a preset corporate bill;
[0131] When the to-be-reconciled information is inconsistent with the preset corporate invoice, the target invoice is marked as a questionable invoice;
[0132] The transaction record corresponding to the questionable invoice is obtained, and the questionable invoice is misjudged and verified according to the transaction record. When the abnormal invoice is misjudged, the abnormal mark of the target invoice is cancelled.
[0133] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to the description of the relevant steps in the corresponding embodiment of the accompanying drawings, which will not be repeated here.
[0134] Furthermore, if the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).
[0135] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program can implement:
[0136] Acquire an invoice image of a target invoice, and extract a to-be-reconciled area in the invoice image;
[0137] Performing regional segmentation on the invoice image according to the area to be reconciled to obtain a regional image corresponding to the area to be reconciled;
[0138] Extracting the to-be-reconciled information in the regional image, and calculating the consistency between the to-be-reconciled information and a preset corporate bill;
[0139] When the to-be-reconciled information is inconsistent with the preset corporate invoice, the target invoice is marked as a questionable invoice;
[0140] The transaction record corresponding to the questionable invoice is obtained, and the questionable invoice is misjudged and verified according to the transaction record. When the abnormal invoice is misjudged, the abnormal mark of the target invoice is cancelled.
[0141] In several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways.
[0142] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0143] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0144] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0145] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0146] The embodiment of the present application can acquire and process relevant data based on image segmentation technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0147] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. An invoice reconciliation method based on image segmentation, characterized in that: The method comprises: Acquire an invoice image of a target invoice, and extract a to-be-reconciled area in the invoice image; Segment the invoice image according to the area to be reconciled to obtain a regional image corresponding to the area to be reconciled; Extracting the to-be-reconciled information in the regional image, and calculating the consistency between the to-be-reconciled information and a preset corporate bill; When the to-be-reconciled information is inconsistent with the preset corporate invoice, the target invoice is marked as a questionable invoice; The transaction record corresponding to the questionable invoice is obtained, and the questionable invoice is misjudged and verified according to the transaction record. When the abnormal invoice is misjudged, the abnormal mark of the target invoice is cancelled.
2. The invoice reconciliation method based on image segmentation as claimed in claim 1, characterized in that: The extracting the area to be reconciled in the invoice image includes: Filtering and denoising the invoice image, and performing edge detection on the filtered and denoised invoice image; The target area of the invoice image is screened according to the edge detection result of the edge detection to obtain the area to be reconciled in the invoice image.
3. The invoice reconciliation method based on image segmentation as claimed in claim 2, characterized in that: The performing edge detection on the filtered and denoised invoice image comprises: Converting the filtered and denoised invoice image into a grayscale image, and extracting edge pixels in the grayscale image; The edge pixels are spliced into edge lines, and the edge detection result of the filtered and denoised invoice image is determined according to the edge lines.
4. The invoice reconciliation method based on image segmentation as claimed in claim 2, characterized in that: The step of screening the target area of the invoice image according to the edge detection result of the edge detection to obtain the area to be reconciled in the invoice image includes: Determining edge features in the invoice image according to the edge detection result of the edge detection; The invoice image is filtered step by step according to the edge features, the preset area conditions, the preset shape conditions and the preset position conditions to obtain the area to be reconciled in the invoice image.
5. The invoice reconciliation method based on image segmentation as claimed in claim 4, characterized in that: The step of filtering the invoice image step by step according to the edge features and the preset filtering conditions to obtain the area to be reconciled in the invoice image includes: Performing area filtering on the invoice image according to the edge area in the edge feature and the area condition; Performing shape filtering on the invoice image after area filtering according to the edge shape in the edge feature and the shape condition; The invoice image after shape filtering is subjected to position filtering according to the edge position in the edge feature and the position condition, so as to obtain the area to be reconciled in the invoice image.
6. The invoice reconciliation method based on image segmentation as claimed in claim 1, characterized in that: The performing of region segmentation on the invoice image according to the area to be reconciled to obtain a region image corresponding to the area to be reconciled includes: Performing regional positioning on the to-be-reconciled area in the invoice image, and performing image cropping on the invoice image after the regional positioning to obtain a cropped image of the invoice image; The cropped image corresponding to the area to be reconciled is selected as the area image.
7. The invoice reconciliation method based on image segmentation as claimed in claim 1, characterized in that: The extracting the to-be-reconciled information in the regional image includes: Performing optical character recognition on the area image to obtain text characters in the area image; The to-be-reconciled information in the area image is generated according to the text characters.
8. The invoice reconciliation method based on image segmentation as claimed in claim 7, characterized in that: The step of generating the to-be-reconciled information in the regional image according to the text characters includes: Performing character pattern matching on the text characters, extracting reconciliation information from the text characters after the character pattern matching, and obtaining primary reconciliation information; The primary reconciliation information is format-checked one by one, and the primary reconciliation information that passes the format check is determined to be the to-be-reconciled information in the regional image.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the invoice reconciliation method based on image segmentation as described in any one of claims 1 to 8.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the invoice reconciliation method based on image segmentation as described in any one of claims 1 to 8 is implemented.
Citation Information
Cited By
Invoice processing method and device and related equipment
CN120913218A