A PDF dynamic cutting method, system, device and medium based on corporate finance and taxation

By identifying the image information of the bill PDF file, calculating the pigment threshold and analyzing the pigment distribution position, performing edge positioning and equal cutting, the problem of unevenly arranged bill file cutting errors in the existing technology is solved, and more accurate bill file cutting and storage.

CN118015024BActive Publication Date: 2024-09-20GUANGZHOU RONGZHI CO CREATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410187360.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-19
Publication Date
2024-09-20
Estimated Expiration
2044-02-19

AI Technical Summary

Technical Problem

When existing PDF splitting technology handles unevenly arranged bill files, it is easy to cause cutting errors and blank pages to replace the correct monthly bill files, affecting the accurate accounting of financial and tax data.

Method used

By identifying the image information of the bill PDF file, calculating the bill pigment threshold, analyzing the pigment distribution position, performing edge positioning processing, and cutting the blank pages equally, combining the pigment threshold and edge positioning data for accurate cutting and storage to ensure that the cut bills Image file accuracy and completeness.

Benefits of technology

It improves the cutting accuracy of PDF files, reduces cutting errors and loss errors of valid bills, and ensures accurate archiving and storage of cut bill image files.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118015024B
    Figure CN118015024B
Patent Text Reader

Abstract

The present application relates to a PDF dynamic cutting method, system, device and medium based on corporate finance and taxation, the method comprising identifying the image information of a bill PDF file, calculating the bill pigment threshold of the current form according to the image information recognition result, obtaining the pigment threshold data of each bill image, analyzing the pigment distribution position of the corresponding bill image on the PDF page according to the pigment threshold data, and performing edge positioning processing to obtain the bill edge positioning data on each PDF page, analyzing the blank pages between adjacent bill images according to the bill edge positioning data, and performing equal cutting processing on the blank pages, naming the cut bill images in sequence according to the cutting order of each bill image, and storing the cut bill images arranged in sequence according to the original storage path of the bill PDF file. The present application has the effect of improving the cutting accuracy of PDF files.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of PDF splitting, and in particular to a PDF dynamic cutting method, system, computer equipment and storage medium based on corporate finance and taxation. Background Art

[0002] At present, when conducting financial and tax accounting, it is often necessary to account for all corporate bills for a complete fiscal year. In today's paperless world, corporate bills are often archived in electronic PDF form. Therefore, in the process of automated accounting of financial and tax data, it is often necessary to cut corporate bills in PDF format and extract them independently according to the required months, so as to complete the accounting of different corporate financial and tax needs such as quarterly and annually.

[0003] The existing PDF splitting method often cuts each page of the PDF file at equal intervals after identifying the PDF file. However, when cutting unevenly arranged bill files, it is easy to cut the bill content, thereby affecting the correct calculation of financial and tax data. For bill PDF files with blank pages, it is also easy to cause blank pages to replace the correct monthly bill files, thereby causing errors in bill calculation. Therefore, the cutting method of bill PDF files needs to be optimized. Summary of the invention

[0004] In order to improve the cutting accuracy of PDF files, the present application provides a PDF dynamic cutting method, system, computer equipment and storage medium based on corporate finance and taxation.

[0005] In the first aspect, the above-mentioned invention objective of the present application is achieved through the following technical solutions:

[0006] A PDF dynamic cutting method based on corporate finance and taxation, comprising:

[0007] Identify the image information of the bill PDF file, calculate the bill pigment threshold of the current form according to the image information recognition result, and obtain the pigment threshold data of each bill image;

[0008] According to the pigment threshold data, the pigment distribution position of the corresponding bill image on the PDF page is analyzed, and edge positioning processing is performed to obtain the bill edge positioning data on each PDF page;

[0009] Analyzing the blank pages between adjacent bill images according to the bill edge positioning data, and performing equal cutting processing on the blank pages;

[0010] According to the cutting order of each bill image, the cut bill images are named in sequence, and the cut bill images arranged in sequence are stored according to the original storage path of the bill PDF file.

[0011] By adopting the above technical scheme, when cutting irregularly arranged bill PDF files, targeted target image extraction is performed by identifying the image information in the bill PDF file, and the bill pigment threshold under the current form is calculated, which helps to cut the bill form more accurately according to the bill pigment threshold, and analyze the pigment distribution position of the bill image on the PDF page in combination with the pigment threshold data, and locate the bill edge according to the pigment distribution position, which helps to further improve the bill positioning accuracy in different forms according to the bill edge positioning data, analyze the blank pages between adjacent bill images, and perform equal cutting based on the size of the blank pages to reduce the cutting error of valid bills, and sequentially name the cut bill image files according to the cutting order of the bill images and the original naming of the bills, and store the named bill image files in the original path to reduce the loss error of multiple bill image files after cutting, which helps to accurately archive and store the cut bill image files. The present application improves the cutting accuracy of PDF files through multi-dimensional PDF positioning and cutting steps such as pigment positioning, edge positioning, precise cutting and original path storage of bill PDF files.

[0012] In a preferred example, the present application can be further configured as follows: the calculation of the current form of the bill pigment threshold according to the image information recognition result to obtain the pigment threshold data of each bill image specifically includes:

[0013] Obtaining the arrangement order of each pixel and the pixel values ​​of adjacent pixels according to the image information recognition result, and performing color gamut planning on the current form of the bill image according to the arrangement order and the pixel values;

[0014] The color gamut Gaussian value of each color gamut is calculated according to the color gamut planning result, and the highest color gamut Gaussian value is selected as the color threshold of the bill of the current form according to the comparison between the color gamut Gaussian values;

[0015] Obtaining standard frame information of a preset standard bill frame, performing proportional frame comparison between the standard frame information and the bill image in the current form, and obtaining bill frame data of the current bill image;

[0016] The bill color gamut threshold is fitted with the bill frame data, and the pigment threshold data corresponding to the bill frame in the current form is obtained according to the fitting result.

[0017] In a preferred example, the present application may be further configured as follows: the color gamut Gaussian value of each color gamut is calculated according to the color gamut planning result, specifically including:

[0018] The color gamut Gaussian value of each color gamut is calculated by formula (1), where formula (1) is as follows:

[0019] (1)

[0020] Among them, the Indicates the color gamut Gaussian value of the current color gamut, Indicates the position coordinates of the current color gamut, Indicates the standard deviation of the current color space pixel value.

[0021] By adopting the above technical solution and combining it with the image information recognition result, the arrangement order of each pixel and the pixel value of the adjacent pixel are obtained, which helps to divide the color gamut according to the arrangement order of the pixels and the pixel value, and helps to perform partition statistics through the color gamut of the same pixel value after division, and calculates the color gamut Gaussian value of each color gamut in combination with formula (1). The highest color gamut point is selected in combination with the color gamut Gaussian value corresponding to the entire bill image, thereby obtaining the bill pigment threshold, which helps to further determine the edge of the bill through the bill pigment threshold, and uses the standard bill frame as a reference for division, performs proportional frame comparison on all bill images, helps to accurately frame the current bill image, and determines the bill frame in multiple dimensions through the bill color gamut threshold and the fitting result of the bill frame data, thereby improving the analysis accuracy of the bill frame.

[0022] In a preferred example, the present application can be further configured as follows: according to the pigment threshold data, the pigment distribution position of the corresponding bill image on the PDF page is analyzed, and edge positioning processing is performed to obtain the bill edge positioning data on each PDF page, specifically including:

[0023] Binarization is performed on the bill image according to the pigment threshold data, and frame selection is performed on the current bill data according to the binarization processing result to obtain edge frame selection data of the current bill;

[0024] According to the edge selection data, the pixel distribution position of the selected bill corners on the PDF page is analyzed to obtain the edge pixel distribution data corresponding to each bill corner;

[0025] Each corner of the current bill is processed for corner positioning according to the edge pixel distribution data, and the corner positioning result is corrected in combination with a preset standard bill framework to obtain the bill edge positioning data on each PDF page.

[0026] By adopting the above technical solution, the bill image is binarized in combination with the pigment threshold data, and the bill frame is further selected based on the binarization processing result. According to the pigment distribution position of the selected bill corners on the PDF page, the pixel distribution of the bill corners is re-analyzed, and the corner positioning is performed according to the analysis results. The corner positioning results are corrected in combination with the preset standard bill frame, so as to further improve the accuracy of bill corner positioning on the PDF page.

[0027] In a preferred example, the present application can be further configured as follows: analyzing the blank pages between adjacent bill images according to the bill edge positioning data and performing equal cutting processing on the blank pages, specifically including:

[0028] Get the vertical distance between each bill corner and the nearest PDF page edge, and calculate the blank page area between the nearest bill corner and the PDF page;

[0029] According to the blank page area between adjacent PDF pages, the adjacent PDF pages are equally cut;

[0030] Calculating the bill corner coordinate difference between adjacent bill corner coordinates according to the bill edge positioning data, and calculating the bill redundant area between adjacent bill corner coordinate differences;

[0031] According to the bill redundant area and blank page cutting results, the current bill is adaptively cut to obtain a single bill cutting image of the current bill.

[0032] By adopting the above technical solution, combined with the vertical distance between each bill corner and the nearest PDF page edge, the blank page area between the closest bill corner and the PDF page is calculated, and equal cutting processing is performed between adjacent PDF pages. Combined with the bill edge positioning data, the bill corner coordinate difference between the adjacent bill corner coordinates is calculated, and then the bill redundant area between adjacent bill corners is calculated based on the bill corner coordinate difference, which helps to accurately cut the redundant area of ​​irregularly arranged bills. Combined with the bill redundant area and the blank page cutting results, the current bill is adaptively cut, so as to obtain a single bill cutting image of the current bill, and further improve the edge cutting accuracy of the single bill cutting image.

[0033] In a preferred example, the present application can be further configured as follows:

[0034] Obtain the number of bills in the PDF file that conform to the preset bill framework, and adjust the number of cutting threads of the PDF file according to the number of bills;

[0035] According to the adjusted number of cutting threads, all the bills in the PDF file are cut in parallel synchronously.

[0036] By adopting the above technical solution, combined with the number of bills in the PDF file that conform to the preset bill framework, the number of cutting threads of the PDF file is adjusted, and all bills in the PDF file are cut in parallel according to the adjusted number of cutting threads, thereby improving the cutting efficiency of the PDF file.

[0037] In the second aspect, the above invention objective of the present application is achieved through the following technical solutions:

[0038] A PDF dynamic cutting system based on corporate finance and taxation, including:

[0039] The bill recognition module is used to recognize the image information of the bill PDF file, calculate the bill pigment threshold of the current form according to the image information recognition result, and obtain the pigment threshold data of each bill image;

[0040] A bill positioning module, used to analyze the pigment distribution position of the corresponding bill image on the PDF page according to the pigment threshold data, and perform edge positioning processing to obtain the bill edge positioning data on each PDF page;

[0041] A page cutting module, used for analyzing the blank pages between adjacent bill images according to the bill edge positioning data, and performing equal cutting processing on the blank pages;

[0042] The bill storage module is used to sequentially name the cut bill images according to the cutting order of each bill image, and store the sequentially arranged cut bill images according to the original storage path of the bill PDF file.

[0043] By adopting the above technical scheme, when cutting irregularly arranged bill PDF files, targeted target image extraction is performed by identifying the image information in the bill PDF file, and the bill pigment threshold under the current form is calculated, which helps to cut the bill form more accurately according to the bill pigment threshold, and analyze the pigment distribution position of the bill image on the PDF page in combination with the pigment threshold data, and locate the bill edge according to the pigment distribution position, which helps to further improve the bill positioning accuracy in different forms according to the bill edge positioning data, analyze the blank pages between adjacent bill images, and perform equal cutting based on the size of the blank pages to reduce the cutting error of valid bills, and sequentially name the cut bill image files according to the cutting order of the bill images and the original naming of the bills, and store the named bill image files in the original path to reduce the loss error of multiple bill image files after cutting, which helps to accurately archive and store the cut bill image files. The present application improves the cutting accuracy of PDF files through multi-dimensional PDF positioning and cutting steps such as pigment positioning, edge positioning, precise cutting and original path storage of bill PDF files.

[0044] On the third aspect, the above-mentioned purpose of the present application is achieved through the following technical solutions:

[0045] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above-mentioned PDF dynamic cutting method based on corporate finance and taxation are implemented.

[0046] Fourthly, the above-mentioned purpose of the present application is achieved through the following technical solutions:

[0047] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the above-mentioned PDF dynamic cutting method based on corporate finance and taxation.

[0048] In summary, the present application includes at least one of the following beneficial technical effects:

[0049] 1. When cutting irregularly arranged bill PDF files, the target image is extracted by identifying the image information in the bill PDF file, and the bill pigment threshold under the current form is calculated, which helps to cut the bill form more accurately according to the bill pigment threshold, and analyzes the pigment distribution position of the bill image on the PDF page in combination with the pigment threshold data, and locates the bill edge according to the pigment distribution position, which helps to further improve the bill positioning accuracy under different forms according to the bill edge positioning data, analyzes the blank pages between adjacent bill images, and performs equal cutting based on the size of the blank pages to reduce the cutting error of the effective bill, and sequentially names the cut bill image files according to the cutting order of the bill image and the original naming of the bill, and performs original path storage processing on the named bill image files, which reduces the loss error of multiple bill image files after cutting, and helps to accurately archive and store the cut bill image files. This application improves the cutting accuracy of PDF files through multi-dimensional PDF positioning and cutting steps such as pigment positioning, edge positioning, precise cutting and original path storage of bill PDF files;

[0050] 2. Combined with the image information recognition results, the arrangement order of each pixel and the pixel values ​​of adjacent pixels are obtained, which helps to divide the color gamut according to the arrangement order of pixels and pixel values, and helps to perform partition statistics through the color gamut of the same pixel value after division, and combines formula (1) to calculate the color gamut Gaussian value of each color gamut, and combines the color gamut Gaussian value corresponding to the entire bill image to deduce the highest color gamut point, thereby obtaining the bill pigment threshold, which helps to further determine the edge of the bill through the bill pigment threshold, and divides all bill images with the standard bill frame as a reference, and performs proportional frame comparison on all bill images, which helps to accurately frame the current bill image, and determines the bill frame in multiple dimensions through the bill color gamut threshold and the bill frame data fitting results, thereby improving the accuracy of bill frame analysis;

[0051] 3. Binarize the bill image based on the pigment threshold data, further select the bill frame based on the binarization result, and re-analyze the pixel distribution of the bill corners according to the pigment distribution position of the selected bill corners on the PDF page, and perform corner positioning processing based on the analysis results. Correct the corner positioning results based on the preset standard bill frame to further improve the accuracy of bill corner positioning on the PDF page. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 This is a flow chart of an implementation of a PDF dynamic cutting method based on corporate finance and taxation in this embodiment.

[0053] Figure 2 This is a flowchart of the implementation of the PDF dynamic cutting method of this embodiment for calculating the pigment threshold.

[0054] Figure 3 This is a flowchart for implementing step S20 of a PDF dynamic cutting method based on corporate finance and taxation in this embodiment.

[0055] Figure 4 This is a flowchart for implementing step S30 of a PDF dynamic cutting method based on corporate finance and taxation in this embodiment.

[0056] Figure 5 It is an auxiliary schematic diagram of redundant area mapping by the PDF dynamic cutting method of this embodiment.

[0057] Figure 6 This is an interface effect diagram of the PDF dynamic cutting system of this embodiment.

[0058] Figure 7 This is a structural block diagram of a PDF dynamic cutting system based on corporate finance and taxation in this embodiment.

[0059] Figure 8 It is a schematic diagram of the internal structure of a computer device that implements a PDF dynamic cutting method based on corporate finance and taxation. DETAILED DESCRIPTION

[0060] The present application is further described in detail below in conjunction with the accompanying drawings.

[0061] In one embodiment, if Figure 1 As shown, the present application discloses a PDF dynamic cutting method based on corporate finance and taxation, which specifically includes the following steps:

[0062] S10: Identify the image information of the bill PDF file, calculate the bill pigment threshold of the current form according to the image information recognition result, and obtain the pigment threshold data of each bill image.

[0063] Specifically, the user uploads the bill PDF file to be segmented, collects the bill image information on the bill PDF file through PDF scanning, and calculates the bill pigment threshold in the current form based on the bill image information, such as Figure 2 As shown, the specific steps include:

[0064] S101: Obtain the arrangement order of each pixel and the pixel values ​​of adjacent pixels according to the image information recognition result, and perform color gamut planning on the current form of the bill image according to the arrangement order and the pixel values.

[0065] Specifically, combined with the image information recognition results, the arrangement order of each pixel point of each bill and the pixel value size of adjacent pixels are collected, and when the difference between adjacent pigment values ​​exceeds a preset threshold, color gamut demarcation is performed, and pixels within the same pixel value range are divided into the same color gamut to reduce the error impact of irregularly arranged bills.

[0066] S102: Calculate the color gamut Gaussian value of each color gamut according to the color gamut planning result, and select the highest color gamut Gaussian value as the color threshold of the bill of the current form according to the comparison between the color gamut Gaussian values.

[0067] Specifically, the color gamut Gaussian value of each color gamut is calculated by formula (1), where formula (1) is as follows:

[0068] (1)

[0069] in, Indicates the color gamut Gaussian value of the current color gamut, Indicates the position coordinates of the current color gamut, Indicates the standard deviation of the current color space pixel value.

[0070] All color gamut Gaussian values ​​are compared, and the pixel value corresponding to the color gamut with the highest color gamut Gaussian value is selected as the bill pigment threshold in the current form.

[0071] S103: Obtain standard frame information of a preset standard bill frame, perform proportional frame comparison between the standard frame information and the bill image in the current form, and obtain bill frame data of the current bill image.

[0072] Specifically, according to the standard bill frame size, relevant information of the standard bill frame, including the length-width ratio of the frame and the fixed invoice content, etc., is stored in the PDF cutting system in advance, thereby forming standard frame information, and the standard frame information is compared with the bill image in the current form in proportion, including the length-width ratio of the bill, the fixed content of the bill, etc., and whether the current bill image conforms to the standard frame is determined based on the comparison result, and the bill images that do not conform to the standard frame are eliminated, and only the bill images that conform to the standard frame information are retained.

[0073] S104: Fit the bill color gamut threshold value with the bill frame data, and obtain the color threshold data corresponding to the bill frame in the current form according to the fitting result.

[0074] Specifically, according to the position coordinates of each bill color gamut, the bill color gamut threshold is fitted with the bill frame image, and the pixel value of the bill frame position is obtained according to the fitting result, thereby obtaining the pigment threshold data corresponding to the bill frame.

[0075] S20: Analyze the pigment distribution position of the corresponding bill image on the PDF page according to the pigment threshold data, and perform edge positioning processing to obtain the bill edge positioning data on each PDF page.

[0076] Specifically, Figure 3 As shown, step S20 specifically includes the following steps:

[0077] S201: Binarization processing is performed on the bill image according to the pigment threshold data, and frame selection processing is performed on the current bill data according to the binarization processing result to obtain edge frame selection data of the current bill.

[0078] Specifically, the bill image is binarized according to the pigment threshold data. For example, the binarization demarcation standard is set to 0, which will distinguish the colored bill image from the blank page of the PDF page. However, since there are blank positions inside the bill, it is necessary to combine the binarization processing results, perform frame selection on the current bill again, and distinguish the current bill after the frame selection from the PDF page image outside the frame selection to obtain the edge frame selection data of the current bill.

[0079] S202: Analyze the pixel distribution position of the selected bill corners on the PDF page according to the edge selection data to obtain the edge pixel distribution data corresponding to each bill corner.

[0080] Specifically, combined with the edge selection data, the pigment distribution position of the selected bill corners on the PDF page is analyzed specifically, so as to determine the irregular placement position of the bill on the PDF page according to the pigment distribution position, and combined with the pigment distribution of the four corners of the bill, the distribution position of the bill corners after irregular placement is obtained.

[0081] S203: performing corner positioning processing on each corner of the current bill according to the edge pixel distribution data, and correcting the corner positioning result in combination with a preset standard bill framework to obtain the bill edge positioning data on each PDF page.

[0082] Specifically, each corner of the current bill is positioned according to the edge pixel distribution data. In this embodiment, the lower left corner of the PDF page is used as the origin, and the long and wide sides of the PDF page are used as coordinate axes to establish auxiliary coordinates for positioning the bill corners, thereby obtaining the coordinate values ​​of the four corners of the bill in the auxiliary coordinates, and combining with the standard bill frame, correcting the corner points that exceed or fall below the range of the standard bill frame, and obtaining the corrected corner point coordinates to obtain the bill edge positioning data on each PDF page.

[0083] S30: analyzing the blank pages between adjacent bill images according to the bill edge positioning data, and performing equal cutting processing on the blank pages.

[0084] Specifically, Figure 4 and Figure 5 As shown, step S30 specifically includes the following steps:

[0085] S301: Obtain the vertical distance between each bill corner and the nearest PDF page edge, and calculate the blank page area between the nearest bill corner and the PDF page.

[0086] Specifically, when the bills are placed irregularly on the PDF page, the nearest PDF page edge of each bill corner is analyzed according to the bill image, and the auxiliary vertical distance between each bill corner and the nearest PDF page edge is obtained through image recognition, such as Figure 5 The two auxiliary lines d1 and d2 in the figure are combined with the area formula of the rectangle to calculate the blank page area between the corner of the bill and the edge of the PDF page by multiplying the auxiliary vertical distance by the width of the PDF page.

[0087] S302: performing PDF page equal cutting processing on adjacent PDF pages according to the blank page areas between adjacent PDF pages.

[0088] Specifically, the blank page areas between adjacent PDF pages are combined, and the average values ​​of the adjacent blank page areas are calculated to obtain the blank page dividing line positions between adjacent PDF pages, so that the PDF pages are equally divided according to the blank page dividing line positions.

[0089] S303: Calculate the bill corner coordinate differences between adjacent bill corner coordinates according to the bill edge positioning data, and calculate the bill redundant areas between the adjacent bill corner coordinate differences.

[0090] Specifically, in combination with the bill edge positioning data, the bill corner coordinate difference between adjacent bill corner coordinates is calculated, wherein the bill corner coordinate difference is the difference between two adjacent corner coordinates, so as to calculate the redundant area on the PDF page excluding the effective area occupied by the bill after excluding the PDF blank page. The bill redundant area in this embodiment is the sum of the coordinate differences of the four corners of the bill, such as Figure 5 The shaded area in the figure is shown.

[0091] S304: According to the bill redundant area and blank page cutting results, the current bill is adaptively cut to obtain a single bill cutting image of the current bill.

[0092] Specifically, according to the bill redundant area and blank page cutting results, the current bill is adaptively cut again to remove the bill redundant area and obtain a single bill cutting image of the current bill.

[0093] S40: naming the cut bill images in sequence according to the cutting order of each bill image, and storing the cut bill images arranged in sequence according to the original storage path of the bill PDF file.

[0094] Specifically, the cut bill images are named sequentially according to the cutting order of the bill images or the arrangement order of the PDF pages. The file name of each bill includes: original file name_page number_semicolon, and combined with the storage path of the original bill PDF file, the cut bills arranged sequentially are returned to the original path for storage. In this embodiment, after the bill cutting is completed, the invoice information is automatically extracted through the artificial intelligence algorithm to generate a bank detailed account.

[0095] The PDF dynamic cutting method based on corporate finance and taxation in this embodiment also includes:

[0096] S50: Obtain the number of bills in the PDF file that conform to a preset bill framework, and adjust the number of cutting threads of the PDF file according to the number of bills.

[0097] Specifically, by scanning the entire PDF file, the number of bills in the PDF file that conform to the preset bill framework is obtained. For example, if there are multiple bills on the same PDF page, or there is one bill on each PDF page, the number of cutting threads of the PDF file is set based on the number of bills. The number of cutting threads in this embodiment is the number of bills - 1.

[0098] S60: According to the adjusted number of cutting threads, all the bills in the PDF file are synchronously cut in parallel.

[0099] Specifically, according to the adjusted number of cutting threads, all the bills in the PDF file are cut synchronously in a multi-threaded parallel manner, thereby reducing the time consumption of batch bill cutting.

[0100] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0101] In one embodiment, a PDF dynamic cutting system based on corporate finance and taxation is provided. The cutting effect of the PDF dynamic cutting system is as follows: Figure 6 As shown, the PDF dynamic cutting system based on enterprise finance and taxation corresponds to the PDF dynamic cutting method based on enterprise finance and taxation in the above embodiment. Figure 7 As shown, the PDF dynamic cutting system based on corporate finance and taxation includes a bill recognition module, a bill positioning module, a page cutting module and a bill storage module. The detailed description of each functional module is as follows:

[0102] The bill recognition module is used to recognize the image information of the bill PDF file, calculate the bill pigment threshold of the current form according to the image information recognition result, and obtain the pigment threshold data of each bill image.

[0103] The bill positioning module is used to analyze the pigment distribution position of the corresponding bill image on the PDF page according to the pigment threshold data, and perform edge positioning processing to obtain the bill edge positioning data on each PDF page.

[0104] The page cutting module is used to analyze the blank pages between adjacent bill images according to the bill edge positioning data and perform equal cutting processing on the blank pages.

[0105] The bill storage module is used to sequentially name the cut bill images according to the cutting order of each bill image, and store the sequentially arranged cut bill images according to the original storage path of the bill PDF file.

[0106] Preferably, the pigment threshold of the bill of the current form is calculated according to the image information recognition result to obtain the pigment threshold data of each bill image, which specifically includes:

[0107] The color gamut planning submodule is used to obtain the arrangement order of each pixel and the pixel values ​​of adjacent pixels according to the image information recognition result, and perform color gamut planning on the current form of the bill image according to the arrangement order and pixel values.

[0108] The threshold selection submodule is used to calculate the color gamut Gaussian value of each color gamut according to the color gamut planning results, and select the highest color gamut Gaussian value as the current form of the bill pigment threshold based on the comparison between the color gamut Gaussian values.

[0109] The frame comparison submodule is used to obtain the standard frame information of the preset standard bill frame, perform proportional frame comparison between the standard frame information and the bill image in the current form, and obtain the bill frame data of the current bill image.

[0110] The data fitting submodule is used to fit the bill color gamut threshold with the bill frame data, and obtain the pigment threshold data corresponding to the bill frame in the current form according to the fitting result.

[0111] Preferably, the color gamut Gaussian value of each color gamut is calculated according to the color gamut planning result, specifically including:

[0112] The color gamut Gaussian value of each color gamut is calculated by formula (1), where formula (1) is as follows:

[0113] (1)

[0114] in, Indicates the color gamut Gaussian value of the current color gamut, Indicates the position coordinates of the current color gamut, Indicates the standard deviation of the current color space pixel value.

[0115] Preferably, the bill positioning module specifically includes:

[0116] The border selection submodule is used to perform binarization processing on the bill image according to the pigment threshold data, and perform border selection processing on the current bill data according to the binarization processing result to obtain the edge border selection data of the current bill.

[0117] The pigment analysis submodule is used to analyze the pigment distribution position of the selected bill corners on the PDF page according to the edge selection data, and obtain the edge pixel distribution data corresponding to each bill corner.

[0118] The edge positioning submodule is used to perform edge positioning processing on each corner of the current bill according to the edge pixel distribution data, and to correct the edge positioning result in combination with the preset standard bill framework to obtain the bill edge positioning data on each PDF page.

[0119] Preferably, the page cutting module specifically includes:

[0120] The blank page calculation submodule is used to obtain the vertical distance between each bill corner and the nearest PDF page edge, and calculate the blank page area between the nearest bill corner and the PDF page.

[0121] The page cutting submodule is used to perform PDF page equal cutting processing on adjacent PDF pages according to the blank page area between adjacent PDF pages.

[0122] The redundancy calculation submodule is used to calculate the bill corner coordinate difference between adjacent bill corner coordinates according to the bill edge positioning data, and calculate the bill redundant area between the adjacent bill corner coordinate differences.

[0123] The bill cutting submodule is used to perform adaptive cutting processing on the current bill according to the bill redundant area and blank page cutting results to obtain a single bill cutting image of the current bill.

[0124] Preferably, the PDF dynamic cutting method based on corporate finance and taxation also includes:

[0125] The thread setting module is used to obtain the number of bills in the PDF file that conform to the preset bill framework and adjust the number of cutting threads of the PDF file according to the number of bills.

[0126] The parallel cutting module is used to synchronously perform parallel cutting processing on all the bills in the PDF file according to the adjusted number of cutting threads.

[0127] The specific definition of the PDF dynamic cutting system based on corporate finance and taxation can be found in the above definition of the PDF dynamic cutting method based on corporate finance and taxation, which will not be repeated here. Each module in the above-mentioned PDF dynamic cutting system based on corporate finance and taxation can be implemented in whole or in part through software, hardware and their combination. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0128] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store intermediate data in the process of PDF dynamic cutting of corporate bills. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a PDF dynamic cutting method based on corporate finance and taxation is implemented.

[0129] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of a PDF dynamic cutting method based on corporate finance and taxation are implemented.

[0130] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0131] Those skilled in the art will clearly understand that for the sake of convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above.

[0132] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A PDF dynamic cutting method based on corporate finance and taxation, characterized in that: include: Identify the image information of the bill PDF file, calculate the bill pigment threshold of the current form according to the image information recognition result, and obtain the pigment threshold data of each bill image; According to the pigment threshold data, the pigment distribution position of the corresponding bill image on the PDF page is analyzed, and edge positioning processing is performed to obtain the bill edge positioning data on each PDF page; Analyzing the blank pages between adjacent bill images according to the bill edge positioning data, and performing equal cutting processing on the blank pages; According to the cutting order of each bill image, the cut bill images are named in sequence, and the cut bill images arranged in sequence are stored according to the original storage path of the bill PDF file; The step of analyzing the blank pages between adjacent bill images according to the bill edge positioning data and performing equal cutting processing on the blank pages specifically includes: Get the vertical distance between each bill corner and the nearest PDF page edge, and calculate the blank page area between the nearest bill corner and the PDF page; According to the blank page area between adjacent PDF pages, the adjacent PDF pages are equally cut; Calculating the bill corner coordinate difference between adjacent bill corner coordinates according to the bill edge positioning data, and calculating the bill redundant area between adjacent bill corner coordinate differences; According to the bill redundant area and blank page cutting results, the current bill is adaptively cut to obtain a single bill cutting image of the current bill; The step of calculating the current form of the bill pigment threshold according to the image information recognition result to obtain the pigment threshold data of each bill image specifically includes: Obtaining the arrangement order of each pixel and the pixel values ​​of adjacent pixels according to the image information recognition result, and performing color gamut planning on the current form of the bill image according to the arrangement order and the pixel values; The color gamut Gaussian value of each color gamut is calculated according to the color gamut planning result, and the highest color gamut Gaussian value is selected as the color threshold of the bill of the current form according to the comparison between the color gamut Gaussian values; Obtaining standard frame information of a preset standard bill frame, performing proportional frame comparison between the standard frame information and the bill image in the current form, and obtaining bill frame data of the current bill image; The bill pigment threshold is fitted with the bill frame data, and the pigment threshold data corresponding to the bill frame in the current form is obtained according to the fitting result.

2. The PDF dynamic cutting method based on corporate finance and taxation according to claim 1 is characterized in that: The color gamut Gaussian value of each color gamut is calculated according to the color gamut planning result, specifically including: The color gamut Gaussian value of each color gamut is calculated by formula (1), where formula (1) is as follows: (1) Among them, the Indicates the color gamut Gaussian value of the current color gamut, Indicates the position coordinates of the current color gamut, Indicates the standard deviation of the current color space pixel value.

3. The PDF dynamic cutting method based on corporate finance and taxation according to claim 1 is characterized in that: The pigment distribution position of the corresponding bill image on the PDF page is analyzed according to the pigment threshold data, and edge positioning processing is performed to obtain the bill edge positioning data on each PDF page, specifically including: Binarization is performed on the bill image according to the pigment threshold data, and frame selection is performed on the current bill data according to the binarization processing result to obtain edge frame selection data of the current bill; According to the edge selection data, the pixel distribution position of the selected bill corners on the PDF page is analyzed to obtain the edge pixel distribution data corresponding to each bill corner; Each corner of the current bill is processed for corner positioning according to the edge pixel distribution data, and the corner positioning result is corrected in combination with a preset standard bill framework to obtain the bill edge positioning data on each PDF page.

4. The PDF dynamic cutting method based on corporate finance and taxation according to claim 1 is characterized in that: Also includes: Obtain the number of bills in the PDF file that conform to the preset bill framework, and adjust the number of cutting threads of the PDF file according to the number of bills; According to the adjusted number of cutting threads, all the bills in the PDF file are cut in parallel synchronously.

5. A PDF dynamic cutting system based on corporate finance and taxation, characterized in that: include: The bill recognition module is used to recognize the image information of the bill PDF file, calculate the bill pigment threshold of the current form according to the image information recognition result, and obtain the pigment threshold data of each bill image; A bill positioning module, used to analyze the pigment distribution position of the corresponding bill image on the PDF page according to the pigment threshold data, and perform edge positioning processing to obtain the bill edge positioning data on each PDF page; A page cutting module, used for analyzing the blank pages between adjacent bill images according to the bill edge positioning data, and performing equal cutting processing on the blank pages; The bill storage module is used to sequentially name the cut bill images according to the cutting order of each bill image, and store the sequentially arranged cut bill images according to the original storage path of the bill PDF file; Wherein, the page cutting module specifically includes: A blank page calculation submodule is used to obtain the vertical distance between each bill corner and the nearest PDF page edge, and calculate the blank page area between the nearest bill corner and the PDF page; The page cutting submodule is used to perform PDF page equal cutting processing on adjacent PDF pages according to the blank page area between adjacent PDF pages; A redundancy calculation submodule, used for calculating the bill corner coordinate difference between adjacent bill corner coordinates according to the bill edge positioning data, and calculating the bill redundant area between the adjacent bill corner coordinate differences; The bill cutting submodule is used to perform adaptive cutting processing on the current bill according to the bill redundant area and blank page cutting results to obtain a single bill cutting image of the current bill; The step of calculating the current form of the bill pigment threshold according to the image information recognition result to obtain the pigment threshold data of each bill image specifically includes: A color gamut planning submodule is used to obtain the arrangement order of each pixel and the pixel values ​​of adjacent pixels according to the image information recognition result, and perform color gamut planning on the current form of the bill image according to the arrangement order and the pixel values; The threshold selection submodule is used to calculate the color gamut Gaussian value of each color gamut according to the color gamut planning result, and select the highest color gamut Gaussian value as the color threshold of the bill of the current form according to the comparison between the color gamut Gaussian values; The frame comparison submodule is used to obtain the standard frame information of the preset standard bill frame, perform proportional frame comparison between the standard frame information and the bill image in the current form, and obtain the bill frame data of the current bill image; The data fitting submodule is used to fit the bill pigment threshold value with the bill frame data, and obtain the pigment threshold data corresponding to the bill frame in the current form according to the fitting result.

6. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the PDF dynamic cutting method based on corporate finance and taxation as described in any one of claims 1 to 4 are implemented.

7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the PDF dynamic cutting method based on corporate finance and taxation as claimed in any one of claims 1 to 4 are implemented.