CN107861931B - Template file processing method and device, computer equipment and storage medium - Google Patents

Template file processing method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN107861931B
CN107861931B CN201711062347.9A CN201711062347A CN107861931B CN 107861931 B CN107861931 B CN 107861931B CN 201711062347 A CN201711062347 A CN 201711062347A CN 107861931 B CN107861931 B CN 107861931B
Authority
CN
China
Prior art keywords
template
extraction
extraction frame
frame
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711062347.9A
Other languages
Chinese (zh)
Other versions
CN107861931A (en
Inventor
许文江
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Kingdee Software China Co Ltd
Original Assignee
Kingdee Software China Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Kingdee Software China Co Ltd filed Critical Kingdee Software China Co Ltd
Priority to CN201711062347.9A priority Critical patent/CN107861931B/en
Publication of CN107861931A publication Critical patent/CN107861931A/en
Application granted granted Critical
Publication of CN107861931B publication Critical patent/CN107861931B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates

Abstract

The invention relates to a template file processing method, a template file processing device, computer equipment and a storage medium, wherein the method comprises the following steps: acquiring a first template and a second template corresponding to a scanned file, and monitoring the operation of the first template; receiving an extracting frame adding instruction, and adding a corresponding extracting frame in the first template according to the adding instruction; acquiring the position coordinates of the extraction frame; calculating the size change proportion of the first template relative to the second template; when the coordinate and the size change proportion are monitored, adding a corresponding extraction frame in the second template according to the coordinate and the size change proportion; and extracting the information in the scanned file by using the second template after the extraction frame is added. By adopting the method, the position accuracy of the extraction frame on the template file can be improved, so that the extraction information of the template file is more accurate.

Description

Template file processing method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a template file processing method and apparatus, a computer device, and a storage medium.
Background
In daily life, people often adopt template files to process a batch of files of the same type. For example, a set of files of the same type are subjected to information extraction of the same part by using template files which are made in advance. In the process of creating a template file, the template file may be enlarged or reduced to fit the screen, and then the template file may be created by adding an extraction frame.
The extraction frame is manually added to the template file, and in a traditional mode, when the added extraction position coordinate is obtained, a locator is generally needed to be used for positioning the extraction frame, and then the extraction position coordinate is calculated by using the coordinate of the locator and the position relation between the extraction frame and the locator. Because the size of the template file may be changed, the position of the extraction box needs to be obtained through multiple calculations, which may result in the position of the extraction box being inaccurate. How to improve the accuracy of the position of the extraction frame on the template file, so that the accuracy of the information extraction of the template file becomes a technical problem to be solved at present.
Disclosure of Invention
Therefore, it is necessary to provide a template file processing method, an apparatus, a computer device, and a readable storage medium, which can improve the accuracy of the position of the extraction frame on the template file, so that the extraction information of the template file is more accurate.
A template file processing method, the method comprising:
acquiring a first template and a second template corresponding to a scanned file, and monitoring the operation of the first template;
receiving an extracting frame adding instruction, and adding a corresponding extracting frame in the first template according to the adding instruction;
acquiring the position coordinates of the extraction frame;
calculating the size change proportion of the first template relative to the second template;
when the coordinate and the size change proportion are monitored, adding a corresponding extraction frame in the second template according to the coordinate and the size change proportion;
and extracting the information in the scanned file by using the second template after the extraction frame is added.
In one embodiment, the step of drawing the corresponding extraction frame in the second template according to the coordinate and the size change ratio includes:
acquiring the size of the first module and the size of the second module;
mapping the position coordinates of the extraction frame, the size of the first template and the corresponding change proportion to the second template;
and adding a corresponding extraction frame in the second template by using the coordinates, the change proportion and the size of the second template.
In one embodiment, the second template has a corresponding type, and the step of extracting information in the scanned file by using the second template after adding the extraction frame comprises:
loading a plurality of scanning files to be extracted, wherein the types of the scanning files are the same as those of the second template;
covering the second template added with the extraction frame on the scanned file to be extracted, and extracting corresponding information from the scanned file to be extracted through the extraction frame.
In one embodiment, the method further comprises:
copying the second template to which the extraction frames are added to obtain a plurality of second templates to which the extraction frames are added;
calling a plurality of threads, and covering a plurality of second templates added with the extraction frames on a plurality of scanning files to be extracted through the plurality of threads;
and extracting corresponding information in the scanned file to be extracted through the extraction frame.
In one embodiment, the method further comprises:
receiving a naming instruction corresponding to the extraction frame, and adding a corresponding extraction frame identifier to the extraction frame according to the naming instruction;
and acquiring the extraction frame identifications, and extracting corresponding information in the scanned file by using a second template added with the extraction frame according to one or more extraction frame identifications.
A template file processing apparatus, the apparatus comprising:
the monitoring module is used for acquiring a first template and a second template corresponding to a scanned file and monitoring the operation of the first template;
the adding module is used for receiving an extracting frame adding instruction and adding a corresponding extracting frame in the first template according to the adding instruction; when the coordinate and the size change proportion are monitored, adding a corresponding extraction frame in the second template according to the coordinate and the size change proportion;
the calculation module is used for acquiring the position coordinates of the extraction frame; calculating the size change proportion of the first template relative to the second template;
and the extraction module is used for extracting the information in the scanned file by using the second template added with the extraction frame.
In one embodiment, the apparatus further comprises:
the loading module is used for loading a plurality of scanning files to be extracted, which have the same type as the second template;
and the extraction module is further used for covering the second template added with the extraction frame on the scanned file to be extracted, and extracting corresponding information from the scanned file to be extracted through the extraction frame.
In one embodiment, the apparatus further comprises:
the naming module is used for receiving a naming instruction corresponding to the extraction frame and adding a corresponding extraction frame identifier to the extraction frame according to the naming instruction;
and the extraction module is further used for acquiring the extraction frame identifications, and extracting corresponding information in the scanned file by using the second template added with the extraction frame according to one or more extraction frame identifications.
A computer device comprising a memory and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the template file processing method provided in the above embodiments of the invention when executing the program.
A computer-readable storage medium on which a computer program is stored, which when executed by a processor, implements the steps of the template file processing method provided in the above-described embodiments of the present invention.
According to the template file processing method, the template file processing device, the computer equipment and the readable storage medium, the operation of the first template is monitored by acquiring the first template and the second template corresponding to the scanned file, the extracting frame adding instruction is received, the corresponding extracting frame is added into the first template according to the adding instruction, the position coordinate of the extracting frame is acquired, the size change proportion of the first template relative to the second template is calculated, when the coordinate and the size change proportion are monitored, the corresponding extracting frame is added into the second template according to the coordinate and the size change proportion, and the information in the scanned file is extracted by using the second template to which the extracting frame is added. After the extracting frame adding instruction is received, the position coordinates of the extracting frame are directly obtained, the corresponding extracting frame is added into the second template according to the coordinate and the size change proportion of the first template relative to the second template, the size of the second template is fixed, the position coordinates of the added extracting frame are more accurate, the accuracy of the position of the extracting frame on the template file is improved, and the extracting information of the template file is more accurate.
Drawings
FIG. 1 is a flowchart illustrating a method for processing a template file according to an embodiment;
FIG. 2 is a schematic diagram showing the structure of a template document processing apparatus according to an embodiment;
FIG. 3 is a block diagram of a computer device in one embodiment.
Detailed Description
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
Fig. 1 is a flowchart of a template file processing method of an embodiment, and it should be understood that, although the steps in the flowchart of fig. 1 are shown in order as indicated by arrows, the steps are not necessarily performed in order as indicated by the arrows. Moreover, at least a portion of the steps in fig. 1 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, in different orders, and may be performed alternately or at least partially with respect to other steps or other steps. Taking the application of the method to the terminal as an example for explanation, the method specifically comprises the following steps:
step S102, a first template and a second template corresponding to the scanned file are obtained, and the operation of the first template is monitored.
The scanned file refers to an electronic file which is scanned on a computer by a scanning device, and the format of the scanned file comprises JPG, GIF, PDF and other types. When a batch of scanning files of the same type need to be extracted with the same important position information, the batch of scanning files can be processed through the template file. For example, when extracting various information such as time, departure place, destination, ticket price and the like of a batch of train tickets needing reimbursement, as the specification, size and position of the same information on the tickets are the same, a train ticket can be taken firstly, an extraction frame is added to the position needing information extraction, the extraction frame is made into a template file, and then the template file is used for extracting the information of the same batch of train tickets.
When the template file is manufactured, the terminal firstly obtains one of the same batch of scanned files to be extracted as a screen on which the first template is displayed. The terminal stores a copy of the identical scanned file as a second template, and the size of the second template is fixed and does not change along with the change of the first template. In the process of manufacturing the template, an extraction frame needs to be manually added to determine the position of the information to be extracted, and because the screen sizes of the terminals may be different, operations such as enlarging, reducing and the like need to be performed on the first template. The terminal can monitor whether the size of the first template is changed or not and whether an extraction frame adding instruction exists or not in real time.
And step S104, receiving an extracting frame adding instruction, and adding a corresponding extracting frame in the first template according to the adding instruction.
Step S106, acquiring the position coordinates of the extraction frame.
The extraction frame can be manually drawn or added through a shape tool provided by the terminal. The shape of the extraction frame is not limited, for example, the extraction frame may be a rectangular extraction frame, an elliptical extraction frame, or a polygonal extraction frame. And when the terminal monitors the operation of manually adding the extraction frame, receiving an extraction frame adding instruction, and adding a corresponding extraction frame in a corresponding position of the first template according to the adding instruction. And acquiring the position coordinates of the extraction frame, and calculating the corresponding parameters of the extraction frame according to the position coordinates. For example, when a rectangle extraction box is added, parameters such as the length and the width of the drawn rectangle are calculated.
And step S108, calculating the size change proportion of the first template relative to the second template.
And step S110, when the coordinate and the size change proportion are monitored, adding a corresponding extraction frame in the second template according to the coordinate and the size change proportion.
When the terminal monitors that operations such as amplification and reduction of the first template exist, the size change proportion of the first template relative to the second template is calculated, namely the size change proportion of the first template relative to the initial first template is calculated. And adding extraction frames with the same shape in the second template according to the calculated proportion and corresponding parameters calculated by the position coordinates to obtain the second template added with the extraction frames.
And step S112, extracting the information in the scanned file by using the second template after the extraction frame is added.
After the corresponding extraction frame is added in the second template, the terminal can process the second template after the extraction frame is added, so that the second template can be used as a template file to extract information of scanning files to be extracted of the same type. The processing operation may be to perform transparency processing on the second template, so that when the second template covers the to-be-extracted scanned file, information on the to-be-extracted scanned file in the extraction frame may be acquired through the extraction frame. And taking the processed second template as a template file, and extracting information of the same type of scanned files to be extracted by the terminal by using the template file.
In this embodiment, the operation of the first template is monitored by obtaining the first template and the second template corresponding to the scan file, the adding instruction of the extraction frame is received, the corresponding extraction frame is added to the first template according to the adding instruction, the position coordinate of the extraction frame is obtained, the size change ratio of the first template relative to the second template is calculated, when the coordinate and the size change ratio are monitored, the corresponding extraction frame is added to the second template according to the coordinate and the size change ratio, and the information in the scan file is extracted by using the second template to which the extraction frame is added. The terminal directly acquires the position coordinates of the extraction frame after receiving the extraction frame adding instruction, and adds the corresponding extraction frame in the second template according to the coordinate and the size change proportion of the first template relative to the second template, wherein the second template always keeps the most original size, so that the position of the added extraction frame is more accurate, the position accuracy of the extraction frame on the template file can be improved, and the template file processing method enables the template file to extract information more accurately.
In one embodiment, the step of drawing the corresponding extraction box in the second template according to the coordinates and the corresponding size change ratio includes: acquiring the size of a first module and the size of a second module; mapping the position coordinates of the extraction frame, the size of the first template and the corresponding change proportion to a second template; and drawing a corresponding extraction frame in the second template by using the coordinates, the change proportion and the size of the second template.
In this embodiment, the terminal can monitor the size change condition of the first template in real time, and when monitoring that the first template is enlarged, reduced and the like, the size of the first module and the size of the second template are acquired, and the size change proportion of the first template relative to the second template is calculated, that is, the size change proportion of the first template relative to the initial first template is calculated. And the terminal maps the position coordinates of the extraction frame, the size of the first template and the corresponding change proportion to the second template, and adds the extraction frame with the same shape in the second template according to the proportion obtained by calculation and the corresponding parameters obtained by calculation of the position coordinates to obtain the second template added with the extraction frame.
The manner of adding the corresponding extraction frame on the second template may be that the first template and the second template synchronously add the extraction frame, or that after the extraction frame is added on the first template, the terminal may add the corresponding extraction frame on the second template. When a synchronous adding mode is adopted, a drawing person adds an extraction frame on the first template, and the terminal can add a corresponding extraction frame on the second template in real time through the mapping relation between the first template and the second template, so that the effect of synchronously adding extraction frames on the first template and the second template can be achieved. When the method of adding the extraction frames on the first template and the second template in sequence is adopted, the terminal can add the corresponding extraction frame on the second template after monitoring that the drawing personnel add the extraction frame on the first template.
In the manual drawing process, there may be a problem that the extraction of the extraction frame is not facilitated because the manually drawn lines may not be smooth enough, or the information to be extracted is partially covered. The terminal can also adaptively adjust the extraction frame mapped on the second template through a repair function. And the terminal acquires an adding instruction of the extracting frame, and adjusts the line bar when detecting that the manual drawing mode is adopted, so that the added extracting frame can accurately extract the information of the part to be extracted. For example, when monitoring that the manually drawn line covers the information, the terminal may adjust the position, thickness, smoothness, and the like of the extraction frame line on the second template. In addition, when the terminal detects that the head and the tail of the manually drawn line are not overlapped, the positions of the head and the tail of the line are correspondingly corrected. By adjusting the position, thickness, smoothness and other information of the lines of the extraction frame mapped to the second template, the added extraction frame is more standard and more accurate, and further the extraction information of the template file is more accurate.
In an embodiment, the terminal may further obtain parameters of the extraction frame according to the coordinates, and add the corresponding extraction frame in the second template according to the obtained parameters and the size change ratio of the extraction frame. For example, in the process of making the template, the drawing staff reduces the first template, the terminal monitors the size change of the first module, and the current size change ratio is calculated to be 2:3 according to the size change ratio of the first template relative to the second template. And adding a rectangular extraction frame on the first template by the drawing personnel, calculating according to the position coordinates of the extraction frame to obtain the length of the rectangular extraction frame which is 10cm and the width of which is 8cm, and calculating to add a corresponding rectangular extraction frame in the second template which is 15cm and 12cm in length and width. And randomly acquiring points on the extraction frame on at least one first template, mapping to obtain points corresponding to a second template, and adding a corresponding extraction frame on the second template according to the calculated length and width of the rectangular extraction frame by taking the points on the second template as a reference.
In this embodiment, obtain the size of first module and the size of second template, the position coordinate that will extract the frame, the size of first template and the change proportion that corresponds map to the second template, utilize coordinate and corresponding change proportion and the size of second template to draw corresponding extraction frame in the second template, directly map the extraction frame that adds on the screen on the first template directly to the fixed unchangeable second template of size in other words, make the extraction frame position that adds more accurate, thereby improved the accuracy of extraction frame position coordinate on the template file, the problem that extraction frame position coordinate is not accurate enough on the template file has been solved. Meanwhile, the point on the first module corresponding to the point on the first module is directly found in a mapping mode, a locator in a traditional mode is omitted, the times of calculating and extracting the position coordinates of the frame are reduced, the fraction proportion replaces the proportion of floating point numbers in the traditional mode, the position of the added extraction frame is more accurate, the accuracy of the position coordinates of the extraction frame on the template file is improved, and the problem that the position coordinates of the extraction frame on the template file are not accurate enough is solved.
In one embodiment, the second template has a corresponding type, and the step of extracting the information in the scanned file by using the second template after adding the extraction frame comprises the following steps: loading a plurality of scanning files to be extracted, wherein the types of the scanning files are the same as those of the second template; and covering the second template added with the extraction frame on the scanned file to be extracted, and extracting corresponding information from the scanned file to be extracted through the extraction frame.
The second template has a corresponding type, that is, the to-be-extracted scanned file has a corresponding type, and the same template file corresponds to the same type of to-be-extracted scanned file. The files of the same type refer to files with the same specification and size and the same position of the information to be extracted. Such as train tickets, airline tickets, the same type of invoice, etc. The extraction mode is various, the template file can be adopted to cover the file to be extracted, or other extraction modes can be adopted, and the terminal can utilize the extraction template to complete the information extraction function. The extraction of the corresponding information in the scanned file to be extracted through the extraction frame comprises a serial extraction mode or a parallel extraction mode. When a serial extraction mode is adopted, the terminal acquires the template file and then extracts the information of the template file in a plurality of scanning files in sequence. When a parallel extraction mode is adopted, namely a multithreading concurrent mode is adopted to extract information, the terminal can simultaneously copy template files in a plurality of threads by calling the plurality of threads, and simultaneously extract information of scanning files to be extracted of the same type by using the copied plurality of template files, wherein the number of the copied template files can be the same as or different from that of the scanning files to be extracted. In a parallel processing mode, the extraction tasks can be distributed to different terminals for information extraction, so that the efficiency of extracting the information on the scanned file to be extracted can be further improved.
In this embodiment, the terminal may process the second template to which the extraction frame is added, so that the second template to which the extraction frame is added may be used as a template file to perform information extraction on the same type of to-be-extracted scanned files. The processing operation may be to perform transparency processing on the second template, so that when the second template covers the to-be-extracted scanned file, information on the to-be-extracted scanned file in the extraction frame may be acquired through the extraction frame. And taking the processed second template as a template file, loading a plurality of to-be-extracted scanning files of the same type as the template file, covering the template file added with the extraction frame on the to-be-extracted scanning files, and extracting corresponding information from the to-be-extracted scanning files through the extraction frame. Because one template file can realize the information extraction of all the scanning files to be extracted of the same type, the efficiency of extracting the information of the template to be extracted is greatly improved.
In one embodiment, after the template file extracts information on the to-be-extracted scan file, the terminal may convert the extracted content. When the extraction result is a picture, the terminal converts characters on the scanned file, namely characters, numbers and the like in the image into an editable text format. The terminal converts the characters on the scanned file into a text format, so that the problem that the characters and the numbers in the picture cannot be edited is solved. In addition, because the information extraction is carried out on the scanned file of the original document in the paper form after scanning, characters, numbers and the like in the image are converted into text formats, and the method has great help for processing the extracted information in the later period. For example, when the amount information needs to be counted and other operation operations, the terminal can convert the amount information extracted from the scanned file into a text format and write the text format into the corresponding data table statistical table, so that the data can be directly operated, and the later-stage counting work is facilitated. In addition, the terminal converts the extracted information into a text format, writes the text format into a corresponding data table statistical table, and can conveniently and quickly query the corresponding information.
In one embodiment, the terminal may save the information extracted by the extraction box. And the terminal generates a corresponding data table according to the extracted information, takes the identification of the extraction frame as a field name, takes the extracted information as a field value and further processes the extracted information. In addition, the terminal can also inquire the content extracted by the extraction frame according to the extraction frame identification, so that later-stage statistics is facilitated, the manual processing time is reduced, and the working efficiency is greatly improved.
In one embodiment, the second template to which the extraction frames are added is copied to obtain a plurality of second templates to which the extraction frames are added; calling a plurality of threads, and covering a plurality of second templates added with the extraction frames on a plurality of scanning files to be identified through the plurality of threads; and extracting corresponding information in the scanned file to be identified through an extraction frame.
In this embodiment, extracting the corresponding information from the scanned document to be extracted through the extracting frame may be performed in various ways. When a serial extraction mode is adopted, the terminal acquires the template file and then extracts the information of the template file in a plurality of scanning files in sequence. When a parallel extraction mode is adopted, namely a multithreading concurrent mode is adopted to extract information, the terminal can simultaneously copy template files in a plurality of threads by calling the plurality of threads, and simultaneously extract information of scanning files to be extracted of the same type by using the copied plurality of template files, wherein the number of the copied template files can be the same as or different from that of the scanning files to be extracted. In a parallel processing mode, the extraction tasks can be distributed to different terminals for information extraction, so that the efficiency of extracting the information on the scanned file to be extracted can be further improved.
In one embodiment, the terminal may also check the extracted information. Because the sales reports in daily life are generally checked manually, a large amount of manpower and material resources are consumed, the processing time is long, and the error rate is relatively high. In this case, the terminal can acquire the information acquired from the scanned document, and then check the information to determine authenticity determination of the reimbursement information, authenticity determination of the bill, and the like. It can be understood that the terminal can store the extracted information, and when the information needs to be preliminarily judged, the terminal can check the various types of information by inquiring the stored various types of information, judge whether contradictions exist in the information, judge whether the information is correct and the like, so as to find whether the bill information is not true or the reimbursement data is wrong or not. For example, when the extracted information is for travel reimbursement, the various aspects of the information may include transportation fees, lodging fees, food and public fees, and the like. When checking the travel reimbursement of reimbursers, if finding that the reimbursers respectively request to reimburse a high-speed railway ticket and a train ticket from the same departure to the same destination on the same day, the obtained information has errors, and the reimbursers need to provide reimbursement tickets again. The extracted information is acquired by the terminal for checking, so that the pressure of checking and judging through manual work is reduced, and the time length of reimbursement processing is shortened.
In one embodiment, the template file processing method further includes: receiving a naming instruction corresponding to the extraction frame, and adding a corresponding extraction frame identifier to the extraction frame according to the naming instruction; and acquiring extraction frame identifications, and extracting corresponding information in the scanned file by using the second template added with the extraction frame according to one or more extraction frame identifications.
In this embodiment, the extraction frame corresponds to one or more extraction frame identifiers. The drawing staff may name the corresponding extraction box, for example, the name is named according to the feature of the information of the scanned file to be extracted, which is to be extracted by the extraction box, and when the scanned file to be extracted is a train ticket, the name of the extraction box acquired by the terminal may be departure place information, destination information, time information, a two-dimensional code, a total amount, and the like. The terminal can add a unique extraction frame identifier to each extraction frame according to the code generation algorithm and the acquired naming instruction.
In the traditional technology, the extraction boxes are distinguished by adopting serial numbers distributed by a system, and because different extraction boxes can be used for extracting different information, the subsequent statistical query work is inconvenient by using the serial numbers. It can be understood that the naming instruction can include various information, such as the type of the frame body, the purpose of the frame body, etc., so that the difference of the extraction frame can be distinguished more obviously, and the function of the extraction frame can be visually represented. And the content in the extraction frame can be searched according to the name of the extraction frame in the later period, the time loss caused by looking up the paper bill is reduced, and the working efficiency is improved.
In one embodiment, as shown in fig. 3, there is provided a template file processing apparatus including: a listening module 302, an adding module 304, a calculating module 306, and an extracting module 308, wherein:
and the monitoring module is used for acquiring a first template and a second template corresponding to the scanned file and monitoring the operation of the first template.
The adding module is used for receiving an extracting frame adding instruction and adding a corresponding extracting frame in the first template according to the adding instruction; and when the coordinate and the size change proportion are monitored, adding a corresponding extraction frame in the second template according to the coordinate and the size change proportion.
The calculation module is used for acquiring the position coordinates of the extraction frame; and calculating the size change proportion of the first template relative to the second template.
And the extraction module is used for extracting the information in the scanned file by using the second template added with the extraction frame.
In this embodiment, the operation of the first template is monitored by acquiring the first template and the second template corresponding to the scan file, the instruction for adding the extraction frame is received, the corresponding extraction frame is added to the first template according to the instruction for adding, the position coordinates of the extraction frame are acquired, the size change ratio of the first template relative to the second template is calculated, when the coordinate and the size change ratio are monitored, the corresponding extraction frame is added to the second template according to the coordinate and the size change ratio, and the information in the scan file is extracted by using the second template to which the extraction frame is added. After an extracting frame adding instruction is received, the position coordinates of the extracting frame are directly obtained, the corresponding extracting frame is added into the second template according to the coordinate and the size change proportion of the first template relative to the second template, the second template always keeps the most original size, the position of the added extracting frame is more accurate, the accuracy of the extracting frame position coordinates on the template file is improved, and the extracting information of the template file is more accurate.
In one embodiment, the template file processing apparatus further includes: and the loading module is used for loading a plurality of to-be-extracted scanning files of the same type as the second template. And the extraction module is also used for covering the second template added with the extraction frame on the scanned file to be extracted and extracting corresponding information from the scanned file to be extracted through the extraction frame.
In one embodiment, the template file processing apparatus further includes: and the naming module is used for receiving the naming instruction corresponding to the extraction frame and adding the corresponding extraction frame identifier to the extraction frame according to the naming instruction. And the extraction module is further used for acquiring the extraction frame identifications, and extracting corresponding information in the scanned file by using the second template added with the extraction frame according to one or more extraction frame identifications.
In one embodiment, a computer device is provided, the computer device comprising a memory and a computer program stored on the memory and executable on a processor, the processor performing the steps of: acquiring a first template and a second template corresponding to a scanned file, and monitoring the operation of the first template; receiving an extracting frame adding instruction, and adding a corresponding extracting frame in the first template according to the adding instruction; acquiring the position coordinates of the extraction frame; calculating the size change proportion of the first template relative to the second template; when the coordinate and the size change proportion are monitored, adding a corresponding extraction frame in the second template according to the coordinate and the size change proportion; and extracting the information in the scanned file by using the second template after the extraction frame is added.
In one embodiment, the processor further performs the steps of: acquiring the size of a first module and the size of a second module; mapping the position coordinates of the extraction frame, the size of the first template and the corresponding change proportion to a second template; and drawing a corresponding extraction frame in the second template by using the coordinates, the change proportion and the size of the second template.
In one embodiment, the second template has a corresponding type, and the processor further performs the steps of: loading a plurality of scanning files to be extracted, wherein the types of the scanning files are the same as those of the second template; and covering the second template added with the extraction frame on the scanned file to be extracted, and extracting corresponding information from the scanned file to be extracted through the extraction frame.
In one embodiment, the processor further performs the steps of: copying the second template added with the extraction frames to obtain a plurality of second templates added with the extraction frames; calling a plurality of threads, and covering a plurality of second templates added with the extraction frames on a plurality of scanning files to be extracted through the plurality of threads; and extracting corresponding information in the scanned file to be extracted through the extracting frame.
In one embodiment, the processor further performs the steps of: receiving a naming instruction corresponding to the extraction frame, and adding a corresponding extraction frame identifier to the extraction frame according to the naming instruction; and acquiring extraction frame identifications, and extracting corresponding information in the scanned file by using the second template added with the extraction frame according to one or more extraction frame identifications.
In one embodiment, a computer-readable storage medium is proposed, on which a computer program is stored which, when being executed by a processor, carries out the steps of: acquiring a first template and a second template corresponding to a scanned file, and monitoring the operation of the first template; receiving an extracting frame adding instruction, and adding a corresponding extracting frame in the first template according to the adding instruction; acquiring the position coordinates of the extraction frame; calculating the size change proportion of the first template relative to the second template; when the coordinate and the size change proportion are monitored, adding a corresponding extraction frame in the second template according to the coordinate and the size change proportion; and extracting the information in the scanned file by using the second template after the extraction frame is added.
In one embodiment, the program when executed by a processor implements the steps of: acquiring the size of a first module and the size of a second module; mapping the position coordinates of the extraction frame, the size of the first template and the corresponding change proportion to a second template; and drawing a corresponding extraction frame in the second template by using the coordinates, the change proportion and the size of the second template.
In one embodiment, the second template has a corresponding type, and the program when executed by the processor performs the steps of: loading a plurality of scanning files to be extracted, wherein the types of the scanning files are the same as those of the second template; covering the second template added with the extraction frame on the scanned file to be extracted, and extracting corresponding information from the scanned file to be extracted through the extraction frame.
In one embodiment, the program when executed by a processor implements the steps of: copying the second template to which the extraction frames are added to obtain a plurality of second templates to which the extraction frames are added; calling a plurality of threads, and covering a plurality of second templates added with the extraction frames on a plurality of scanning files to be extracted through the plurality of threads; and extracting corresponding information in the scanned file to be extracted through the extracting frame.
In one embodiment, the program when executed by a processor implements the steps of: receiving a naming instruction corresponding to the extraction frame, and adding a corresponding extraction frame identifier to the extraction frame according to the naming instruction; and acquiring extraction frame identifications, and extracting corresponding information in the scanned file by using the second template added with the extraction frame according to one or more extraction frame identifications.
In one embodiment, a computer device is provided, as shown in fig. 3, comprising a processor, a non-volatile storage medium, an internal memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The nonvolatile storage medium of the computer device stores an operating system and a computer program, and the internal memory of the computer device provides an environment for the operating system and the computer program in the nonvolatile storage medium to run. The computer program is executed by a processor to implement a template file processing method. The network interface of the terminal is used for communicating with an external network interface. The display screen of the terminal can be a touch screen, and the input device can be a touch layer covered on the display screen, and can also be a key, a track ball, a touch pad, an external keyboard, a touch pad or a mouse, and the like, which are set on the shell of the terminal. The computer equipment can be a computer, a mobile phone, a tablet computer and the like, and not only comprises a terminal, but also comprises a server. The structure shown in fig. 3 is a block diagram of only a part of the structure related to the scheme of the present invention, and does not constitute a limitation of the terminal to which the scheme of the present invention is applied, and a specific terminal may include more or less components than those shown in the figure, or combine some components, or have a different arrangement of components.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the computer program is executed. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), or the like. The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above examples only show some embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (8)

1. A template file processing method, the method comprising:
acquiring a first template and a second template corresponding to a batch of scanning files to be extracted of the same type, and monitoring the operation of the first template; the first template is one of the same type of the scanned files to be extracted, and the second template is the scanned file which is completely the same as the first template; the second template is fixed in size and does not change along with the change of the size of the first template;
receiving an extracting frame adding instruction, and adding a corresponding extracting frame in the first template according to the adding instruction;
acquiring the position coordinates of the extraction frame;
when the terminal monitors that the operation of changing the size of the first template exists, calculating the size change proportion of the first template relative to the second template;
when the coordinate and the size change proportion are monitored, the size of the first template and the size of the second template are obtained;
mapping the position coordinates of the extraction frame, the size of the first template and the corresponding change proportion to the second template;
drawing a corresponding extraction frame in the second template by using the coordinates, the change proportion and the size of the second template;
when the extraction frame is detected to be drawn in a manual drawing mode and the information is monitored to be covered by lines in the manually drawn extraction frame, adjusting at least one of the position, thickness and smoothness of the extraction frame on the second template;
extracting information in the scanned file by using the second template added with the extraction frame;
loading a plurality of scanning files to be extracted, wherein the types of the scanning files are the same as those of the second template;
and covering the second template added with the extraction frame on the same type of the scanning file to be extracted, and extracting corresponding information from the scanning file to be extracted through the extraction frame.
2. The method of claim 1, further comprising:
copying the second template to which the extraction frames are added to obtain a plurality of second templates to which the extraction frames are added;
calling a plurality of threads, and covering a plurality of second templates added with the extraction frames on a plurality of scanning files to be extracted through the plurality of threads;
and extracting corresponding information in the scanned file to be extracted through the extraction frame.
3. The method of claim 1, further comprising:
receiving a naming instruction corresponding to the extraction frame, and adding a corresponding extraction frame identifier to the extraction frame according to the naming instruction;
and acquiring the extraction frame identifications, and extracting corresponding information in the scanned file by using a second template added with the extraction frame according to one or more extraction frame identifications.
4. A template file processing apparatus, characterized in that the apparatus comprises:
the monitoring module is used for acquiring a first template and a second template corresponding to a batch of scanning files to be extracted of the same type and monitoring the operation of the first template; the first template is one of the same type of the scanned files to be extracted, and the second template is the scanned file which is completely the same as the first template; the second template is fixed in size and does not change along with the change of the size of the first template;
the adding module is used for receiving an extracting frame adding instruction and adding a corresponding extracting frame in the first template according to the adding instruction;
the calculation module is used for acquiring the position coordinates of the extraction frame; when the terminal monitors that the operation of changing the size of the first template exists, calculating the size change proportion of the first template relative to the second template;
the adding module is further used for acquiring the size of the first template and the size of the second template when the coordinate and the size change proportion are monitored; mapping the position coordinates of the extraction frame, the size of the first template and the corresponding change proportion to the second template; drawing a corresponding extraction frame in the second template by using the coordinates, the change proportion and the size of the second template; when the extraction frame is detected to be drawn in a manual drawing mode and the information is monitored to be covered by lines in the manually drawn extraction frame, adjusting at least one of the position, thickness and smoothness of the extraction frame on the second template; the extraction module is used for extracting information in the scanned file by using the second template added with the extraction frame;
the loading module is used for loading a plurality of scanning files to be extracted, wherein the types of the scanning files are the same as those of the second template;
and the extraction module is used for covering the second template added with the extraction frame on the same type of the scanning file to be extracted, and extracting corresponding information from the scanning file to be extracted through the extraction frame.
5. The apparatus of claim 4, further comprising:
the adding module is further used for copying the second template to which the extracting frames are added to obtain a plurality of second templates to which the extracting frames are added; calling a plurality of threads, and covering a plurality of second templates added with the extraction frames on a plurality of scanning files to be extracted through the plurality of threads; and extracting corresponding information in the scanned file to be extracted through the extraction frame.
6. The apparatus of claim 4, further comprising:
the naming module is used for receiving a naming instruction corresponding to the extraction frame and adding a corresponding extraction frame identifier to the extraction frame according to the naming instruction;
and the extraction module is further used for acquiring the extraction frame identifications, and extracting corresponding information in the scanned file by using the second template added with the extraction frame according to one or more extraction frame identifications.
7. A computer device comprising a memory and a computer program stored on the memory and executable on a processor, characterized in that the processor implements the template file processing method according to any one of claims 1 to 3 when executing the computer program.
8. A computer-readable storage medium on which a computer program is stored, the program, when executed by a processor, implementing the template file processing method according to any one of claims 1 to 3.
CN201711062347.9A 2017-11-02 2017-11-02 Template file processing method and device, computer equipment and storage medium Active CN107861931B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711062347.9A CN107861931B (en) 2017-11-02 2017-11-02 Template file processing method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711062347.9A CN107861931B (en) 2017-11-02 2017-11-02 Template file processing method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN107861931A CN107861931A (en) 2018-03-30
CN107861931B true CN107861931B (en) 2021-07-30

Family

ID=61699816

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711062347.9A Active CN107861931B (en) 2017-11-02 2017-11-02 Template file processing method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN107861931B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109711396A (en) * 2018-11-12 2019-05-03 平安科技(深圳)有限公司 Generation method, device, equipment and the readable storage medium storing program for executing of OCR training sample
CN111160265B (en) * 2019-12-30 2023-01-10 Oppo(重庆)智能科技有限公司 File conversion method and device, storage medium and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101882225A (en) * 2009-12-29 2010-11-10 北京中科辅龙计算机技术股份有限公司 Engineering drawing material information extraction method based on template
CN101923643A (en) * 2010-08-11 2010-12-22 中科院成都信息技术有限公司 General form recognizing method
JP5452307B2 (en) * 2010-03-23 2014-03-26 三菱電機株式会社 Tracking device
CN104298991A (en) * 2014-10-09 2015-01-21 中国石油集团工程设计有限责任公司 Method for extracting information of corner stamp
CN104916034A (en) * 2015-06-09 2015-09-16 普联软件股份有限公司 Bill recognition system and recognition method based on intervenable template

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101882225A (en) * 2009-12-29 2010-11-10 北京中科辅龙计算机技术股份有限公司 Engineering drawing material information extraction method based on template
JP5452307B2 (en) * 2010-03-23 2014-03-26 三菱電機株式会社 Tracking device
CN101923643A (en) * 2010-08-11 2010-12-22 中科院成都信息技术有限公司 General form recognizing method
CN104298991A (en) * 2014-10-09 2015-01-21 中国石油集团工程设计有限责任公司 Method for extracting information of corner stamp
CN104916034A (en) * 2015-06-09 2015-09-16 普联软件股份有限公司 Bill recognition system and recognition method based on intervenable template

Also Published As

Publication number Publication date
CN107861931A (en) 2018-03-30

Similar Documents

Publication Publication Date Title
CN109934244B (en) Format type learning system and image processing apparatus
CN103020619B (en) A kind of method of handwritten entries in automatic segmentation electronization notebook
US10198407B2 (en) System and method for dynamic linking between graphic documents and comment data bases
US8804139B1 (en) Method and system for repurposing a presentation document to save paper and ink
US11586918B2 (en) Methods and systems for automatically detecting design elements in a two-dimensional design document
CN102938061A (en) Convenient and electronic professional laptop and automatic page number identification method thereof
WO2022001256A1 (en) Image annotation method and device, electronic apparatus, and storage medium
CN102982160A (en) Professional notebook convenient for electronization and automatic classification method of electronic documents of professional notebook
US11727701B2 (en) Techniques to determine document recognition errors
CN112784220B (en) Paper contract tamper-proof verification method and system
CN107861931B (en) Template file processing method and device, computer equipment and storage medium
CN107908843B (en) Management system based on drawing of map label information
CN113901933A (en) Electronic invoice information extraction method, device and equipment based on artificial intelligence
CN109726369A (en) A kind of intelligent template questions record Implementation Technology based on normative document
CN114529933A (en) Contract data difference comparison method, device, equipment and medium
CN111723799B (en) Coordinate positioning method, device, equipment and storage medium
CN113762109A (en) Training method of character positioning model and character positioning method
US20190172171A1 (en) Automatically attaching optical character recognition data to images
CN112417826A (en) PDF online editing method and device, electronic equipment and readable storage medium
JP2009031937A (en) Form image processing apparatus and form image processing program
CN111079709B (en) Electronic document generation method and device, computer equipment and storage medium
CN106775960A (en) A kind of unique marker method and system to Windows processes
CN112434997A (en) Date generation device, control method, and non-transitory computer-readable medium
CN113283231A (en) Method for acquiring signature bit, setting system, signature system and storage medium
CN111696154A (en) Coordinate positioning method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant