CN107861931A - Template file processing method, device, computer equipment and storage medium - Google Patents
Template file processing method, device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN107861931A CN107861931A CN201711062347.9A CN201711062347A CN107861931A CN 107861931 A CN107861931 A CN 107861931A CN 201711062347 A CN201711062347 A CN 201711062347A CN 107861931 A CN107861931 A CN 107861931A
- Authority
- CN
- China
- Prior art keywords
- template
- extraction
- frame
- extracted
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/166—Editing, e.g. inserting or deleting
- G06F40/186—Templates
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Image Analysis (AREA)
- Character Input (AREA)
Abstract
The present invention relates to a kind of template file processing method, device, computer equipment and storage medium, methods described includes:The first template and the second template corresponding to scanning file are obtained, the operation to first template is monitored;Extraction frame addition instruction is received, frame is extracted according to corresponding to addition instruction addition in first template;Obtain the position coordinates of the extraction frame;Calculate the change in size ratio of relatively described second template of first template;When listening to the coordinate and change in size ratio, added according to the coordinate and change in size ratio in second template corresponding to extract frame;The information in the second template extraction scanning file after frame is extracted using addition.Extraction frame positional accuracy on template file can be improved using this method so that template file extraction information is more accurate.
Description
Technical field
The application is related to field of computer technology, is set more particularly to a kind of template file processing method, device, computer
Standby and storage medium.
Background technology
In daily life, people are often handled the file of a collection of same type using template file.Such as with carrying
Before the template file made the information extraction of same area is carried out to the file of a collection of same type.Making the mistake of template file
Cheng Zhong, in order to adapt to screen, may exist and template file is zoomed in or out, then to add extraction frame, make mould
The situation of plate file.
Extraction frame manually adds on template file, in traditional approach, when obtaining the extraction position coordinates of addition, leads to
Often need first to position extraction frame with finger URL, then the coordinate using finger URL and the position of extraction frame and finger URL
Relation calculates extraction position coordinates.Because template file size may be changed, extraction frame position is needed by multiple
Calculating can just obtain, and can so cause extraction frame position not accurate enough.How to improve and the accurate of frame position is extracted on template file
Property so that template file extraction information more accurately turns into a technical problem for needing to solve at present.
The content of the invention
Based on this, it is necessary to for above technical problem, there is provided one kind, which can improve, extracts frame position standard on template file
True property so that template file extracts information more accurate template file processing method, device, computer equipment and readable storage
Medium.
A kind of template file processing method, methods described include:
The first template and the second template corresponding to scanning file are obtained, the operation to first template is monitored;
Extraction frame addition instruction is received, frame is extracted according to corresponding to addition instruction addition in first template;
Obtain the position coordinates of the extraction frame;
Calculate the change in size ratio of relatively described second template of first template;
When listening to the coordinate and change in size ratio, according to the coordinate and change in size ratio described second
Extraction frame corresponding to being added in template;
The information in the second template extraction scanning file after frame is extracted using addition.
In one of the embodiments, it is described to be drawn according to the coordinate and change in size ratio in second template
The step of corresponding extraction frame, includes:
Obtain the size of first module and the size of second template;
The position coordinates of the extraction frame, the size of first template and corresponding change ratio are mapped to described
Second template;
Added using the coordinate and the size of the change ratio and second template in second template
Corresponding extraction frame.
In one of the embodiments, second template has a corresponding type, after the extraction frame using addition
The step of information in second template extraction scanning file, includes:
Loading and multiple scanning files to be extracted of the second template same type;
The addition is extracted to the second template after frame to be covered in the scanning file to be extracted, passes through the extraction
Frame extracts corresponding information in the scanning file to be extracted.
In one of the embodiments, methods described also includes:
The addition is extracted to the second template after frame to be replicated, obtains the second template after multiple addition extraction frames;
Multiple threads are called, the second template after multiple addition extraction frames is respectively overlay in multiple treat by multiple threads
In the scanning file of extraction;
Corresponding information is concurrently extracted in the scanning file to be extracted by the extraction frame.
In one of the embodiments, methods described also includes:
Name instruction corresponding to the extraction frame is received, according to the name instruction to being carried corresponding to the extraction frame addition
Collimation mark is taken to know;
Obtain the extraction collimation mark to know, known according to one or more extraction collimation marks, the after frame is extracted using addition
Corresponding information in two template extraction scanning files.
A kind of template file processing unit, described device include:
Module is monitored, for obtaining the first template corresponding to scanning file and the second template, to the behaviour of first template
Monitored;
Add module, for receiving extraction frame addition instruction, added according to the addition instruction in first template
Corresponding extraction frame;When listening to the coordinate and change in size ratio, according to the coordinate and change in size ratio in institute
State extraction frame corresponding to being added in the second template;
Computing module, for obtaining the position coordinates of the extraction frame;Calculate relatively described second mould of first template
The change in size ratio of plate;
Extraction module, for utilizing the information in the second template extraction scanning file added after extracting frame.
In one of the embodiments, described device also includes:
Load-on module, for loading multiple scanning files to be extracted with the second template same type;
Extraction module, it is additionally operable to the second template after the addition extraction frame being covered in the scanning file to be extracted
On, corresponding information is extracted in the scanning file to be extracted by the extraction frame.
In one of the embodiments, described device also includes:
Module is named, instruction is named corresponding to the extraction frame for receiving, according to the name instruction to the extraction
Extraction collimation mark is known corresponding to frame addition;
Extraction module, it is additionally operable to obtain the extraction collimation mark and knows, known according to one or more extraction collimation marks, using adds
Add the corresponding information in the second template extraction scanning file after extraction frame.
A kind of computer equipment, the computer equipment include memory and are stored on the memory and can be described
The computer program run on processor, realize what is provided in the above embodiment of the present invention during the computing device described program
The step of template file processing method.
A kind of computer-readable recording medium, is stored thereon with computer program, and the program is realized when being executed by processor
The step of template file processing method provided in the above embodiment of the present invention.
Above-mentioned template file processing method, device, computer equipment and readable storage medium storing program for executing, by obtaining scanning file pair
The first template and the second template answered, the operation to the first template are monitored, and are received extraction frame addition instruction, are referred to according to addition
Order extracts frame corresponding to being added in the first template, obtains the position coordinates of extraction frame, calculates the first template with respect to the second template
Change in size ratio, when listening to coordinate and change in size ratio, according to coordinate and change in size ratio in the second template
Extraction frame corresponding to middle addition, the information in the second template extraction scanning file after frame is extracted using addition.Due to receiving
After extraction frame addition instruction, the position coordinates of extraction frame is directly obtained, according to coordinate and the chi of relative second template of the first template
Very little change ratio, adds corresponding extraction frame in the second template, and the size of the second template immobilizes so that the extraction of addition
Frame position coordinates is more accurate, improves the accuracy that frame position is extracted on template file so that template file extraction information is more
It is accurate to add.
Brief description of the drawings
Fig. 1 is the schematic flow sheet of template file processing method in one embodiment;
Fig. 2 is the structural representation of template file processing unit in one embodiment;
Fig. 3 is the structural representation of one embodiment Computer equipment.
Embodiment
Each technical characteristic of embodiment described above can be combined arbitrarily, to make description succinct, not to above-mentioned reality
Apply all possible combination of each technical characteristic in example to be all described, as long as however, the combination of these technical characteristics is not deposited
In contradiction, the scope that this specification is recorded all is considered to be.
Fig. 1 is the flow chart of the template file processing method of one embodiment, it should be understood that although Fig. 1 flow
Each step in figure is shown successively according to the instruction of arrow, but these steps are not necessarily necessarily according to arrow instruction
Order performs successively.Moreover, at least a portion step in Fig. 1 can include more sub-steps or multiple stages, this is a little
Step or stage are not necessarily to perform completion in synchronization, but can be performed different at the time of, its execution sequence
Also it is not necessarily and carries out successively, but can be with other steps either sub-step of other steps or at least a portion in stage
Perform in turn or alternately.It is applied to illustrate exemplified by terminal in this way, this method specifically includes:
Step S102, obtains the first template and the second template corresponding to scanning file, and the operation to the first template is supervised
Listen.
Scanning file refers to that the file of papery passes through scanning device scanning to the e-file on computer, the lattice of scanning file
The formula type such as including JPG, GIF and PDF.Carried when the scanning file that a collection of same type be present needs to do identical critical positions information
When taking, this batch scanning file can be handled by template file.Such as when to a collection of train ticket for needing to submit an expense account
When the multi-aspect informations such as time, departure place, destination, admission fee are extracted, due to the specification, size, identical information of train ticket
Position is identical on ticket, can first take a train ticket, to needing the position addition for extracting information to extract frame, is made
Into template file, then using template file to carrying out information extraction with a collection of train ticket.
When making template file, terminal is first obtained with one in a collection of scanning file to be extracted, is shown as the first template
Show screen.Terminal preserves a identical scanning file and fixed as the second template, the size of the second template, not with
The change of first template and change., it is necessary to manually add extraction frame during making template, the position of information to be extracted is determined
Put, because the screen size of terminal may be different, it is necessary to be amplified to the first template, reduce etc. and to operate.Terminal can be real-time
The template of monitoring first whether there is change in size, and with the presence or absence of extraction frame addition instruction.
Step S104, extraction frame addition instruction is received, frame is extracted according to corresponding to addition instruction addition in the first template.
Step S106, obtain the position coordinates of extraction frame.
Extraction frame can be that the artificial shape tool for carrying out manual drawing or being provided by terminal adds.
It is unlimited to extract the shape of frame, for example extraction frame can be rectangular extraction frame, ellipses recognition frame or polygon extraction frame etc..Work as end
When end listens to the operation of artificial addition extraction frame, extraction frame addition instruction is received, and according to addition instruction in the first template
Extraction frame corresponding to being added in relevant position.And the position coordinates of extraction frame is obtained, the phase of extraction frame is calculated according to position coordinates
Answer parameter.Such as when addition be rectangular extraction frame when, parameter such as length and width of rectangle etc. drawn by calculating.
Step S108, calculate change in size ratio of first template with respect to the second template.
Step S110, when listening to coordinate and change in size ratio, according to coordinate and change in size ratio in the second mould
Extraction frame corresponding to being added in plate.
When terminal monitoring to exist the first template is amplified, the operation such as reduces when, to the first template the second mould relatively
The change in size ratio of plate is calculated, i.e. the relative change in size ratio with the first initial template of the first template.According to meter
The corresponding parameter that obtained ratio and position coordinates is calculated adds the extraction frame of same shape in the second template,
Obtain the second template after addition extraction frame.
Step S112, the information in the second template extraction scanning file after frame is extracted using addition.
After extraction frame corresponding to being added in the second template, terminal can be to adding at the second template after extracting frame
Reason so that it can carry out information extraction as template file to the scanning file to be extracted of same type.Handling operation can be
Transparency process is carried out to the second template so that when the second template covers scanning file to be extracted, can be obtained by extracting frame
Take the information in extraction inframe scanning file to be extracted.Using the second template after processing by as template file, terminal can profit
Information extraction is carried out to the scanning file to be extracted of same type with template file.
In the present embodiment, by obtaining the first template corresponding to scanning file and the second template, the operation to the first template
Monitored, receive extraction frame addition instruction, extract frame according to corresponding to addition instruction addition in the first template, obtain extraction
The position coordinates of frame, change in size ratio of first template with respect to the second template is calculated, when listening to coordinate and change in size ratio
During example, add according to coordinate and change in size ratio in the second template corresponding to extraction frame, using add after extraction frame the
Information in two template extraction scanning files.Because terminal receives extraction frame addition instruction, the position of extraction frame is just directly obtained
Coordinate is put, according to coordinate and the first template with respect to the change in size ratio of the second template, is carried in the second template corresponding to addition
Frame is taken, the second template is always maintained at the size of most original, and the extraction frame position so added is more accurate, so as to improve mould
Frame positional accuracy is extracted on plate file so that template file extracts the more accurate template file processing method of information.
In one embodiment, the extraction according to corresponding to coordinate and corresponding change in size ratio are drawn in the second template
The step of frame, includes:Obtain the size of the first module and the size of the second template;Position coordinates, the first template of frame will be extracted
Size and corresponding change ratio map to the second template;Existed using coordinate and the size of change ratio and the second template
Extraction frame corresponding to being drawn in second template.
In the present embodiment, terminal can monitor the change in size situation of the first template in real time, when listen in the presence of pair
When first template such as is amplified, reduced at the operation, the size of the first module and the size of the second template are obtained, to the first template
Change in size ratio with respect to the second template is calculated, i.e. the relative change in size ratio with the first initial template of the first template
Example.Terminal will extract the position coordinates of frame, the size of the first template and corresponding change ratio and map to the second template, terminal
The corresponding parameter that ratio and position coordinates according to being calculated are calculated adds same shape in the second template
Frame is extracted, obtains the second template after addition extraction frame.
The mode that corresponding extraction frame is added in the second template can be that the first template and the addition of the second template synchronous carry
Take in frame or the first template after addition extraction frame, terminal can add corresponding extraction frame in the second template again.
When by the way of synchronously adding, drawing personnel add extraction frame in the first template, terminal can by the first template with
The mapping relations of second template, corresponding extraction frame is added in the second template in real time, can reached in the first template and the
The effect of two template synchronous addition extraction frame.When using successively when by the way of being added in the first template, the second template, terminal meeting
Extraction frame and then the corresponding extraction frame of addition in the second template are added in the first template listening to drawing personnel.
During hand drawn, it is understood that there may be because the lines manually drawn may be not smooth enough, or treat and carry
The information taken has the problem of part overlaid etc. is unfavorable for extracting the extraction of frame.Terminal can also be by repair function, to being mapped to
Extraction frame in second template carries out the adjustment of adaptability.Terminal gets extraction frame addition instruction, detects using hand
The dynamic mode drawn, then be adjusted to lines so that the extraction frame of addition can accurately treat the progress of extract part information
Information extraction.For example when the lines for listening to hand drawn have covering to information, terminal can adjust to be extracted in the second template
The position of wire bar and thickness, smoothness etc..In addition, when terminal detects that the rostral-caudal of the lines of hand drawn is not heavy
Close, then can correct lines head and tail position accordingly.The position for the extraction wire bar being mapped to by adjustment in the second template
Put, the information such as thickness and smoothness so that the extraction frame more specification of addition, more accurately, and then cause template file extraction
Information is more accurate.
In one embodiment, terminal can also obtain extracting the parameter of frame according to coordinate, further according to obtained extraction frame
Parameter and change in size ratio added in the second template corresponding to extraction frame.For example, during template is made, draw
Personnel are reduced to the first template, the change in size of terminal monitoring to the first module, according to the first template with respect to the second mould
Current change in size ratio is calculated as 2 in the change in size ratio of plate:3.Drawing personnel with the addition of square in the first template
The extraction frame of shape, rectangular extraction frame long 10cm, wide 8cm are calculated according to the position coordinates of extraction frame, then can be calculated the
Rectangular extraction frame long 15cm, wide 12cm corresponding to addition in two templates.Arbitrarily obtain and extracted at least one first template on frame
Point, obtain corresponding to point in the second template by mapping, on the basis of the point in the second obtained template, according to calculating
To rectangular extraction frame length and width corresponding extraction frame is added in the second template.
In the present embodiment, obtain the first module size and the second template size, by extract frame position coordinates,
The size of first template and corresponding change ratio map to the second template, utilize coordinate and corresponding change ratio and the
The size of two templates draw in the second template corresponding to extraction frame, equivalent to will directly be added on screen in the first template
Extraction frame is mapped directly in changeless second template of size so that the extraction frame position of addition is more accurate, so as to carry
Frame position coordinates accuracy is extracted on high template file, extraction on template file is solved frame position coordinates is not accurate enough and ask
Topic.Meanwhile the point corresponding to the point in the first module in the first module is directly found by way of mapping, eliminate traditional mould
Finger URL in formula, reduce the number for calculating extraction frame position coordinates, and floating in traditional approach is replaced with fraction scale
Points ratio, all make it that the extraction frame position of addition is more accurate, and frame position coordinates standard is extracted on template file so as to improve
True property, solve the problems, such as that extraction frame position coordinates is not accurate enough on template file.
In one embodiment, the second template has corresponding type, and the second template extraction after frame is extracted using addition
The step of information in scanning file, includes:Loading and multiple scanning files to be extracted of the second template same type;It will add
Add the second template after extraction frame to be covered in scanning file to be extracted, carried by extracting frame in scanning file to be extracted
Take corresponding information.
Second template has corresponding type, i.e., scanning file to be extracted has corresponding type, same template file pair
Answer same type of scanning file to be extracted.Same type of file refers to that specification, size are identical, information position to be extracted phase
Same file.Such as invoice of train ticket, plane ticket, same type etc..Extracting mode is various, the template file covering that can be used
File to be extracted, or other extracting modes, terminal, which can utilize, extracts the function that template completes information extraction.It is logical
Extraction frame is crossed to extract corresponding information in scanning file to be extracted and include serial extracting mode or parallel extracting mode.
When the serial extracting mode of use, after terminal obtains template file, template file is distinguished successively in multiple scanning files
Extract information.When using parallel extracting mode, i.e., when information extraction is carried out by the way of multi-thread concurrent, terminal can be with
By calling multiple threads, template file is replicated simultaneously in multiple threads, it is simultaneously right using the multiple template file after duplication
The scanning file to be extracted of same type carries out information extraction, and the template file quantity after duplication can be with scanning text to be extracted
The quantity of part is identical, can also be different from the quantity of scanning file to be extracted.Under parallel processing mode, it will can also extract
Task is distributed to different terminals and carries out information extraction, so can further be improved to the information in scanning file to be extracted
The efficiency of extraction.
In the present embodiment, terminal can be handled the second template after addition extraction frame so that after addition extraction frame
Second template can carry out information extraction as template file to the scanning file to be extracted of same type.It can be pair to handle operation
Second template carries out transparency process so that when the second template covers scanning file to be extracted, can be obtained by extracting frame
Extract the information in inframe scanning file to be extracted.Using the second template after processing as template file, loading and template file
After multiple scanning files to be extracted of same type, the template file added after extracting frame is covered in scanning text to be extracted
On part, corresponding information is extracted in scanning file to be extracted by extracting frame.Because a template file can be realized to same
The information extraction of all scanning files to be extracted of type, greatly improve the effect of the extraction to the upper information of template to be extracted
Rate.
In one embodiment, after template file extracts to the information in scanning file to be extracted, terminal can be right
The content of extraction is changed.When it is picture to extract result, terminal by the character in scanning file, i.e., word in image,
Numeral etc., it is converted into editable text formatting.Terminal is so solved by the way that the character in scanning file is converted into text formatting
Determine the problem of can not entering edlin to the word in picture, numeral.Further, since using to paper-based form original document
Scanning file after scanning carries out information extraction, and word, numeral in image etc. are converted into text formatting, will be to the later stage to extraction
Information afterwards, which carries out processing, larger help.For example, when needing that amount information is carried out the arithmetic operation such as counting, terminal can
So that the amount information extracted from scanning file is converted into text formatting, corresponding tables of data statistical form is write, thus
Arithmetic operation directly can be carried out to data, facilitate the statistical work in later stage.In addition, terminal is written by the information extracted conversion
This form, write in corresponding tables of data statistical form, corresponding information can also be conveniently and quickly searched.
In one embodiment, terminal can preserve to the information of extraction frame extraction.Terminal is according to the information of extraction
Corresponding tables of data is generated, extraction collimation mark is known as field name, the information extracted is as field value, to the information extracted
It is further processed.Inquired about in addition, terminal can also know the content extracted to extraction frame according to extraction collimation mark, side
The statistics of phase after an action of the bowels, the time of the artificial treatment of reduction, greatly improve operating efficiency.
In one embodiment, the second template added after extracting frame is replicated, after obtaining multiple addition extraction frames
The second template;Call multiple threads, by multiple threads by it is multiple addition extract frames after the second templates be respectively overlay in it is more
In individual scanning file to be identified;By extracting frame corresponding information is concurrently extracted in the scanning file to be identified.
In the present embodiment, corresponding information is extracted in scanning file to be extracted by extracting frame, can be by a variety of
Mode is carried out.When using serial extracting mode, after terminal obtains template file, template file is swept multiple successively respectively
Retouch and information is extracted in file.When using parallel extracting mode, i.e., when information extraction is carried out by the way of multi-thread concurrent,
Terminal can replicate template file simultaneously by calling multiple threads in multiple threads, utilize the multiple template text after duplication
Part carries out information extraction to the scanning file to be extracted of same type simultaneously, the template file quantity after duplication can with it is to be extracted
Scanning file quantity it is identical, can also be different from the quantity of scanning file to be extracted.Under parallel processing mode, may be used also
Information extraction is carried out so that extraction task is distributed to different terminals, so can further be improved in scanning file to be extracted
Information extraction efficiency.
In one embodiment, terminal can also be checked the information extracted.Due to submitting an expense account one in daily life
As be all to be checked by manually, it is necessary to consume substantial amounts of manpower and materials, and the time handled is long, error rate also phase
To higher.Under this situation, terminal can get the information obtained from scanning file, and information is checked afterwards, judge
The information authenticity of reimbursement judges, the true and false of bill judges etc..It is appreciated that terminal can preserve the information that extraction obtains, when
When needing tentatively to judge information, terminal can be by inquiring about the polytype information preserved, to polytype
Information is checked, and judges to whether there is repugnance in these information, and whether information is correct etc., to have discovered whether
The situations such as billing information is untrue or reimbursement data are wrong.Such as when the information of extraction is to be used for reimbursing travelling expenses, each side
The information in face can include transportation expenses, hotel expense, board expenses and office incidental expense etc..When checking the trip reimbursement of reimbursement personnel, such as
Fruit finds reimbursement personnel on the same day from same to same destination, respectively one high guaranteed votes of request reimbursement, a train ticket,
Then show that information is wrong, it is necessary to which submit an expense account personnel provides reimbursement bill again.The information extracted is obtained by terminal to be checked,
Reduce by manually check the pressure of judgement, and reduce the duration of reimbursement processing.
In one embodiment, template file processing method also includes:Name instruction corresponding to extraction frame is received, according to life
Name instruction is known to extraction collimation mark corresponding to extraction frame addition;Obtain extraction collimation mark to know, known according to one or more extraction collimation mark, profit
The corresponding information in the second template extraction scanning file after frame is extracted with addition.
In the present embodiment, extracting has one or more extraction collimation mark to know corresponding to frame.Drawing personnel can be to corresponding
Extraction frame be named, such as, named according to the feature of the information of the extraction frame scanning file to be extracted to be extracted, when
When scanning file to be extracted is train ticket, the name of extraction frame that terminal is got may be departure place information, destination information, when
Between information, Quick Response Code, total amount etc..Terminal can be further according to coding generating algorithm, with reference to the name instruction got, to each
The individual unique extraction collimation mark of extraction frame addition is known.
In conventional art, extract frame is made a distinction using the sequence number of system distribution, due to different extraction frames
Information for extracting may be different, so worked with the inconvenient follow-up statistical query of sequence number.It is understood that name refers to
Many information, such as the type of framework, purposes of framework etc. can be included in order, so can more obviously distinguish extraction
The difference of frame, and can intuitively represent the effect of extraction frame.And be advantageous to the later stage according to extraction frame title in extraction frame
Content searched, reduce and consult the time loss that brings of paper-bill, improve operating efficiency.
In one embodiment, as shown in Figure 3, there is provided a kind of template file processing unit, including:Monitoring module 302,
Add module 304, computing module 306 and extraction module 308, wherein:
Module is monitored, for obtaining the first template corresponding to scanning file and the second template, the operation to the first template is entered
Row is monitored.
Add module, for receiving extraction frame addition instruction, carried according to corresponding to addition instruction addition in the first template
Take frame;When listening to coordinate and change in size ratio, added and corresponded in the second template according to coordinate and change in size ratio
Extraction frame.
Computing module, for obtaining the position coordinates of the extraction frame;Calculate size of first template with respect to the second template
Change ratio.
Extraction module, for utilizing the information in the second template extraction scanning file added after extracting frame.
In the present embodiment, by obtaining the first template corresponding to scanning file and the second template, to the behaviour of the first template
Monitored, receive extraction frame addition instruction, extract frame according to corresponding to addition instruction addition in the first template, acquisition carries
Take the position coordinates of frame, calculate change in size ratio of first template with respect to the second template, when listening to coordinate and change in size
During ratio, added according to coordinate and change in size ratio in the second template corresponding to extract frame, after extracting frame using addition
Information in second template extraction scanning file.After receiving extraction frame addition instruction, the position of extraction frame is directly obtained
Coordinate, according to coordinate and the first template with respect to the change in size ratio of the second template, corresponding extract is added in the second template
Frame, the second template are always maintained at the size of most original so that the extraction frame position of addition is more accurate, so as to improve template text
Frame position coordinates accuracy is extracted on part so that template file extraction information is more accurate.
In one embodiment, template file processing unit also includes:Load-on module is identical with the second template for loading
Multiple scanning files to be extracted of type.Extraction module, it is additionally operable to the second template added after extracting frame being covered in and waits to carry
In the scanning file taken, corresponding information is extracted in scanning file to be extracted by extracting frame.
In one embodiment, template file processing unit also includes:Module is named, for receiving life corresponding to extraction frame
Name instruction, known according to name instruction to extracting collimation mark corresponding to extraction frame addition.Extraction module, it is additionally operable to obtain the extraction frame
Mark, known according to one or more extraction collimation marks, extracted using addition in the second template extraction scanning file after frame
Corresponding information.
In one embodiment, there is provided a kind of computer equipment, computer equipment include memory and be stored in storage
On device and the computer program that can run on a processor, computing device following steps:Obtain first corresponding to scanning file
Template and the second template, the operation to the first template are monitored;Extraction frame addition instruction is received, according to addition instruction first
Extraction frame corresponding to being added in template;Obtain the position coordinates of the extraction frame;Calculate chi of first template with respect to the second template
Very little change ratio;When listening to coordinate and change in size ratio, added according to coordinate and change in size ratio in the second template
Extraction frame corresponding to adding;The information in the second template extraction scanning file after frame is extracted using addition.
In one of the embodiments, processor also executes the following steps:Obtain the size and the second mould of the first module
The size of plate;The position coordinates of frame, the size of the first template and corresponding change ratio will be extracted and map to the second template;Profit
Corresponding extraction frame is drawn in the second template with coordinate and the size of change ratio and the second template.
In one of the embodiments, the second template has corresponding type, and processor also executes the following steps:Loading with
Multiple scanning files to be extracted of second template same type;The second template added after extracting frame is covered in be extracted
In scanning file, corresponding information is extracted in scanning file to be extracted by extracting frame.
In one of the embodiments, processor also executes the following steps:The second template after extracting frame will be added to carry out
Replicate, obtain the second template after multiple addition extraction frames;Multiple threads are called, frame is extracted into multiple additions by multiple threads
The second template afterwards is respectively overlay in multiple scanning files to be extracted;By extracting frame in scanning file to be extracted simultaneously
Hair extraction corresponding information.
In one of the embodiments, processor also executes the following steps:Name instruction corresponding to extraction frame is received, according to
Name instruction is known to extraction collimation mark corresponding to extraction frame addition;Obtain extraction collimation mark to know, known according to one or more extraction collimation mark,
The corresponding information in the second template extraction scanning file after frame is extracted using addition.
In one embodiment it is proposed that a kind of computer-readable recording medium, is stored thereon with computer program, the journey
Following steps are realized when sequence is executed by processor:The first template and the second template corresponding to scanning file are obtained, to the first template
Operation monitored;Extraction frame addition instruction is received, frame is extracted according to corresponding to addition instruction addition in the first template;Obtain
Take the position coordinates of extraction frame;Calculate change in size ratio of first template with respect to the second template;When listening to coordinate and size
During change ratio, added according to coordinate and change in size ratio in the second template corresponding to extract frame;Frame is extracted using addition
The information in the second template extraction scanning file afterwards.
In one of the embodiments, following steps are realized when the program is executed by processor:Obtain the chi of the first module
Very little and the second template size;The position coordinates of frame, the size of the first template and the mapping of corresponding change ratio will be extracted
To the second template;Corresponding extraction frame is drawn in the second template using coordinate and the size of change ratio and the second template.
In one of the embodiments, the second template has corresponding type, is realized such as when the program is executed by processor
Lower step:Loading and multiple scanning files to be extracted of the second template same type;The addition is extracted to second after frame
Template is covered in the scanning file to be extracted, and phase is extracted in the scanning file to be extracted by the extraction frame
Answer information.
In one of the embodiments, following steps are realized when the program is executed by processor:Frame is extracted into the addition
The second template afterwards is replicated, and obtains the second template after multiple addition extraction frames;Multiple threads are called, pass through multiple threads
Multiple additions are extracted to the second template after frame to be respectively overlay in multiple scanning files to be extracted;Waiting to carry by extracting frame
Corresponding information is concurrently extracted in the scanning file taken.
In one of the embodiments, following steps are realized when the program is executed by processor:Receive corresponding to extraction frame
Name instruction, known according to name instruction to extracting collimation mark corresponding to extraction frame addition;Obtain extraction collimation mark to know, according to one or more
Individual extraction collimation mark is known, and the corresponding information in the second template extraction scanning file after frame is extracted using addition.
In one embodiment, there is provided a kind of computer equipment, as shown in figure 3, the computer equipment is including passing through
Processor, non-volatile memory medium, built-in storage, network interface, display screen and the input unit of bus of uniting connection.Wherein,
The processor of computer equipment is used to provide calculating and control ability.The memory of the computer equipment includes non-volatile memories
Medium, built-in storage.The non-volatile memory medium of the computer equipment is stored with operating system and computer program, the calculating
The built-in storage of machine equipment provides environment for the operating system in non-volatile memory medium and the operation of computer program.The meter
To realize a kind of template file processing method when calculation machine program is executed by processor.The network interface of the terminal is used for and outside
Network interface is communicated.The display screen of terminal can be touch-screen etc., and input unit can be the touch covered on display screen
Layer, can also be the button set in terminal enclosure, trace ball, Trackpad, external keyboard, Trackpad or mouse etc..The meter
It can be computer, mobile phone, tablet personal computer etc. to calculate machine equipment, and computer equipment not only includes terminal, in addition to server.In Fig. 3
The block diagram of the structure shown, the only part-structure related to the present invention program, do not form and the present invention program is applied
The restriction of terminal thereon, specific terminal can include more some than more or less parts shown in figure, or combination
Part, or arranged with different parts.
One of ordinary skill in the art will appreciate that realize all or part of flow in above-described embodiment method, being can be with
The hardware of correlation is instructed to complete by computer program, described computer program can be stored in non-volatile computer can
Read in storage medium, the computer program is upon execution, it may include such as the flow of the embodiment of above-mentioned each method.Wherein, institute
The storage medium stated can be magnetic disc, CD, read-only memory (Read-Only Memory, ROM) etc..Above example
Each technical characteristic can be combined arbitrarily, to make description succinct, not owned to each technical characteristic in above-described embodiment
Possible combination is all described, as long as however, contradiction is not present in the combination of these technical characteristics, is all considered to be this explanation
The scope that secretary carries.
Above example only expresses the several embodiments of the present invention, and its description is more specific and detailed, but can not
Therefore it is interpreted as the limitation to the scope of the claims of the present invention.It should be pointed out that for the person of ordinary skill of the art,
Without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to the protection model of the present invention
Enclose.Therefore, the protection domain of patent of the present invention should be determined by the appended claims.
Claims (10)
1. a kind of template file processing method, methods described include:
The first template and the second template corresponding to scanning file are obtained, the operation to first template is monitored;
Extraction frame addition instruction is received, frame is extracted according to corresponding to addition instruction addition in first template;
Obtain the position coordinates of the extraction frame;
Calculate the change in size ratio of relatively described second template of first template;
When listening to the coordinate and change in size ratio, according to the coordinate and change in size ratio in second template
Extraction frame corresponding to middle addition;
The information in the second template extraction scanning file after frame is extracted using addition.
2. according to the method for claim 1, it is characterised in that it is described according to the coordinate and change in size ratio described
Include corresponding to being drawn in second template the step of extraction frame:
Obtain the size of first module and the size of second template;
The position coordinates of the extraction frame, the size of first template and corresponding change ratio are mapped to described second
Template;
Drawn and corresponded in second template using the coordinate and the size of the change ratio and second template
Extraction frame.
3. according to the method for claim 1, it is characterised in that second template has corresponding type, the utilization
The step of adding the information in the second template extraction scanning file after extraction frame includes:
Loading and multiple scanning files to be extracted of the second template same type;
The addition is extracted to the second template after frame to be covered in the scanning file to be extracted, existed by the extraction frame
Corresponding information is extracted in the scanning file to be extracted.
4. according to the method for claim 3, it is characterised in that methods described also includes:
The addition is extracted to the second template after frame to be replicated, obtains the second template after multiple addition extraction frames;
Call multiple threads, by multiple threads by it is multiple addition extract frames after the second templates be respectively overlay in it is multiple to be extracted
Scanning file on;
Corresponding information is concurrently extracted in the scanning file to be extracted by the extraction frame.
5. according to the method for claim 1, it is characterised in that methods described also includes:
Name instruction corresponding to the extraction frame is received, according to the name instruction to extracting frame corresponding to the extraction frame addition
Mark;
Obtain the extraction collimation mark to know, known according to one or more extraction collimation marks, the second mould after frame is extracted using addition
Corresponding information in plate extraction scanning file.
6. a kind of template file processing unit, it is characterised in that described device includes:
Module is monitored, for obtaining the first template corresponding to scanning file and the second template, the operation to first template is entered
Row is monitored;
Add module, for receiving extraction frame addition instruction, added according to the addition instruction in first template corresponding
Extraction frame;When listening to the coordinate and change in size ratio, according to the coordinate and change in size ratio described
Extraction frame corresponding to being added in two templates;
Computing module, for obtaining the position coordinates of the extraction frame;Calculate relatively described second template of first template
Change in size ratio;
Extraction module, for utilizing the information in the second template extraction scanning file added after extracting frame.
7. device according to claim 6, it is characterised in that described device also includes:
Load-on module, for loading multiple scanning files to be extracted with the second template same type;
Extraction module, it is additionally operable to the second template after the addition extraction frame being covered in the scanning file to be extracted,
Corresponding information is extracted in the scanning file to be extracted by the extraction frame.
8. device according to claim 6, it is characterised in that described device also includes:
Module is named, instruction is named corresponding to the extraction frame for receiving, the extraction frame is added according to the name instruction
Extraction collimation mark is known corresponding to adding;
Extraction module, it is additionally operable to obtain the extraction collimation mark knowledge, is known according to one or more extraction collimation marks, carried using addition
Take the corresponding information in the second template extraction scanning file after frame.
9. a kind of computer equipment, the computer equipment includes memory and is stored on the memory and can be at the place
The computer program run on reason device, it is characterised in that realized described in the computing device during computer program such as power 1 to 5
Template file processing method described in any one.
10. a kind of computer-readable recording medium, is stored thereon with computer program, it is characterised in that the program is by processor
The template file processing method as described in 1 to 5 any one of power is realized during execution.
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 true CN107861931A (en) | 2018-03-30 |
CN107861931B 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) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111160265A (en) * | 2019-12-30 | 2020-05-15 | Oppo(重庆)智能科技有限公司 | File conversion method and device, storage medium and electronic equipment |
WO2020098078A1 (en) * | 2018-11-12 | 2020-05-22 | 平安科技(深圳)有限公司 | Method and apparatus for generating ocr training sample, device and readable storage medium |
Citations (5)
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 |
-
2017
- 2017-11-02 CN CN201711062347.9A patent/CN107861931B/en active Active
Patent Citations (5)
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 |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020098078A1 (en) * | 2018-11-12 | 2020-05-22 | 平安科技(深圳)有限公司 | Method and apparatus for generating ocr training sample, device and readable storage medium |
CN111160265A (en) * | 2019-12-30 | 2020-05-15 | Oppo(重庆)智能科技有限公司 | File conversion method and device, storage medium and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN107861931B (en) | 2021-07-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20210073531A1 (en) | Multi-page document recognition in document capture | |
US20160179313A1 (en) | Page-independent multi-field validation in document capture | |
US20210366055A1 (en) | Systems and methods for generating accurate transaction data and manipulation | |
CN110263009A (en) | Generation method, device, equipment and the readable storage medium storing program for executing of log classifying rules | |
KR102065788B1 (en) | Method for providing safty inspection service for real estate with handheld based device | |
CN102411540B (en) | Automatic management system of workflow-based common software testing process | |
CN109978894A (en) | A kind of lesion region mask method and system based on three-dimensional mammary gland color ultrasound | |
CN110136153A (en) | A kind of image processing method, equipment and storage medium | |
CN105677716A (en) | Computer data acquisition, processing and analysis system | |
CN103544554B (en) | The system and method for the program degree of deferring to of evaluation operation personnel in nuclear power station | |
WO2024212418A1 (en) | Federated learning system, federated learning method, and federated learning device | |
CN111784801B (en) | Automatic drawing method and system for parking space plan of completion monomer building | |
CN110969610A (en) | Power equipment infrared chart identification method and system based on deep learning | |
CN111476013A (en) | Information collection method, information collection device, information collection medium, and electronic device | |
CN107861931A (en) | Template file processing method, device, computer equipment and storage medium | |
CN101609570A (en) | A kind of wireless telltale clock attendance checking system and Work attendance method | |
CN116680867A (en) | Transformer visual fault diagnosis method and system based on refined three-dimensional model | |
CN103902511B (en) | The data conversion amplification display method and system of a kind of data form | |
CN110147941A (en) | Content of examination acquisition methods, Stakeholder Evaluation method and device | |
CN112215211B (en) | Method for extracting chamber branch link topological relation based on CAD drawing data | |
CN114299478A (en) | Image processing method and device combining RPA and AI and electronic equipment | |
CN111783211B (en) | Automatic generation method and generation system for laminated plan of completion monomer building | |
CN107423276A (en) | A kind of analysis report generation method and device | |
CN110443202A (en) | Paper font carefully and neatly spends instant analysis platform, method and storage medium | |
KR102120999B1 (en) | Method for providing safty inspection service for real estate having compatibility between mixed format file |
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 |