CN114138214B - Method and device for automatically generating print file and electronic equipment - Google Patents
Method and device for automatically generating print file and electronic equipment Download PDFInfo
- Publication number
- CN114138214B CN114138214B CN202210099880.7A CN202210099880A CN114138214B CN 114138214 B CN114138214 B CN 114138214B CN 202210099880 A CN202210099880 A CN 202210099880A CN 114138214 B CN114138214 B CN 114138214B
- Authority
- CN
- China
- Prior art keywords
- target
- file
- interval
- attribute information
- data type
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 40
- 238000007405 data analysis Methods 0.000 claims abstract description 29
- 238000013507 mapping Methods 0.000 claims abstract description 13
- 238000003860 storage Methods 0.000 claims description 16
- 238000010586 diagram Methods 0.000 abstract description 19
- 238000007639 printing Methods 0.000 abstract description 16
- 230000004044 response Effects 0.000 abstract description 5
- 238000004590 computer program Methods 0.000 description 9
- 230000006870 function Effects 0.000 description 8
- 238000012545 processing Methods 0.000 description 7
- 238000004891 communication Methods 0.000 description 6
- 238000004519 manufacturing process Methods 0.000 description 6
- 238000012360 testing method Methods 0.000 description 6
- PCTMTFRHKVHKIS-BMFZQQSSSA-N (1s,3r,4e,6e,8e,10e,12e,14e,16e,18s,19r,20r,21s,25r,27r,30r,31r,33s,35r,37s,38r)-3-[(2r,3s,4s,5s,6r)-4-amino-3,5-dihydroxy-6-methyloxan-2-yl]oxy-19,25,27,30,31,33,35,37-octahydroxy-18,20,21-trimethyl-23-oxo-22,39-dioxabicyclo[33.3.1]nonatriaconta-4,6,8,10 Chemical compound C1C=C2C[C@@H](OS(O)(=O)=O)CC[C@]2(C)[C@@H]2[C@@H]1[C@@H]1CC[C@H]([C@H](C)CCCC(C)C)[C@@]1(C)CC2.O[C@H]1[C@@H](N)[C@H](O)[C@@H](C)O[C@H]1O[C@H]1/C=C/C=C/C=C/C=C/C=C/C=C/C=C/[C@H](C)[C@@H](O)[C@@H](C)[C@H](C)OC(=O)C[C@H](O)C[C@H](O)CC[C@@H](O)[C@H](O)C[C@H](O)C[C@](O)(C[C@H](O)[C@H]2C(O)=O)O[C@H]2C1 PCTMTFRHKVHKIS-BMFZQQSSSA-N 0.000 description 5
- 238000004458 analytical method Methods 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 4
- 239000000047 product Substances 0.000 description 4
- 238000007619 statistical method Methods 0.000 description 4
- 239000013065 commercial product Substances 0.000 description 3
- 238000009826 distribution Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 239000000463 material Substances 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 230000009471 action Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 102100035353 Cyclin-dependent kinase 2-associated protein 1 Human genes 0.000 description 1
- 102100031554 Double C2-like domain-containing protein alpha Human genes 0.000 description 1
- 101000866272 Homo sapiens Double C2-like domain-containing protein alpha Proteins 0.000 description 1
- 101100152729 Mus musculus Tenm4 gene Proteins 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012015 optical character recognition Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 238000011282 treatment Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1201—Dedicated interfaces to print systems
- G06F3/1202—Dedicated interfaces to print systems specifically adapted to achieve a particular effect
- G06F3/1211—Improving printing performance
- G06F3/1215—Improving printing performance achieving increased printing speed, i.e. reducing the time between printing start and printing end
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/13—File access structures, e.g. distributed indices
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/14—Details of searching files based on file metadata
- G06F16/148—File search processing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1201—Dedicated interfaces to print systems
- G06F3/1202—Dedicated interfaces to print systems specifically adapted to achieve a particular effect
- G06F3/1211—Improving printing performance
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Library & Information Science (AREA)
- Processing Or Creating Images (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a method and a device for automatically generating a print file and electronic equipment, wherein the method comprises the following steps: displaying a data analysis graph of one or more objects through a two-dimensional coordinate system on a current interface; in response to a printing instruction for a target interval in the data analysis diagram, determining a target data type and a target data interval included in the target interval; acquiring target file attribute information corresponding to the target data type based on the mapping relation between the data type and the file attribute information; and extracting a target text in the target data interval corresponding to the attribute information of the target file from the index file associated with the object, and generating a print file according to the target text. The method for automatically generating the print file improves the printing efficiency and saves the printing time; the method and the device ensure the accuracy of the printed file while performing source tracing and divergence of the data text.
Description
Technical Field
The invention relates to the technical field of printer data processing, in particular to a method and a device for automatically generating a print file and electronic equipment.
Background
With the development of science and technology, a user can call a printing function at a terminal at any time to print an online file or an offline file.
The inventor finds that although a user can check printed files, trend statistics of print data, statistical analysis of data in the printed files and the like at a printer client, if the user generates some new file printing requirements according to the statistical analysis, the user needs to manually edit and generate the desired printed files and then print the files through a printer. In the whole process, corresponding files need to be searched according to statistical analysis, and then target texts are found from the files to be copied and pasted to generate printed files, so that not only is a large amount of time needed, but also the risk of inaccurate omission exists, the printing efficiency is low, the file accuracy is not high, and the operation is complicated.
In the prior art, patent application CN113805937A mainly proposes a file generation method, which obtains target file materials from a file material library and compares the target file materials with a user instruction to generate a target file; patent application CN103885731A proposes a method and apparatus for data printing, specifically, a template is provided, and a data source to be printed is matched with the template to generate a corresponding print file. The above prior art method has certain use limitations and also has low matching accuracy.
Disclosure of Invention
In order to solve the above technical problems or at least partially solve the above technical problems, embodiments of the present invention provide a method, an apparatus, an electronic device, and a storage medium for automatically generating a print file, which can automatically generate a corresponding print file based on a data analysis diagram, thereby improving printing efficiency and saving printing time; in addition, the target texts forming the print file are determined according to the target attribute information corresponding to the index file and the data analysis graph, and the accuracy of the print file is ensured while the source of the data texts is diverged.
In one aspect of the present invention, a method for automatically generating a print file is provided, including:
responding to an operation instruction of a user on a target interval in a data analysis graph of one or more objects, and determining a target data category and a target data interval included in the target interval; acquiring target file attribute information corresponding to the target data type based on the mapping relation between the data type and the file attribute information; and extracting a target text in the target data interval corresponding to the attribute information of the target file from the index file associated with the object, and generating a print file according to the target text.
In another aspect of the present invention, there is also provided an apparatus for automatically generating a print file, including:
the determining module is configured to respond to an operation instruction of a user on a target interval in the data analysis graph of one or more objects, and determine a target data category and a target data interval which are included in the target interval;
the acquisition module is configured to acquire target file attribute information corresponding to a target data type based on a mapping relation between the data type and the file attribute information;
and the generating module is configured to extract a target text which corresponds to the attribute information of the target file and is in the target data interval from the index file associated with the object, and generate a print file according to the target text.
The present invention also provides an electronic device, including:
one or more processors; storage means for storing one or more programs; the one or more programs, when executed by one or more processors, cause the one or more processors to implement the method for automatically generating a print file described and used in the above aspects.
The present invention also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of automatically generating a print file as described and used in the above aspects.
The present invention also provides a computer program product comprising a computer program or instructions which, when executed by a processor, implements the method of automatically generating a print file as described and used in the above aspects.
Compared with the prior art, the technical scheme provided by the invention at least has the following advantages:
according to the method, the device, the electronic equipment and the storage medium for automatically generating the print file, on one hand, the corresponding print file can be automatically generated based on the data analysis diagram, so that the printing efficiency is improved, and the printing time is saved; in addition, the target texts forming the print file are determined according to the target attribute information corresponding to the index file and the data analysis graph, and the accuracy of the print file is ensured while the source of the data texts is diverged.
Drawings
The above and other features, advantages and aspects of various embodiments of the present invention will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
FIG. 1 is a flow chart of a method of automatically generating a print document in an embodiment of the present invention;
FIG. 2 is another flow chart of a method for automatically generating a print document in an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of an apparatus for automatically generating a print document according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device in an embodiment of the present invention.
Detailed Description
Embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present invention are shown in the drawings, it should be understood that the present invention may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present invention. It should be understood that the drawings and the embodiments of the present invention are illustrative only and are not intended to limit the scope of the present invention.
It should be understood that the various steps recited in the method embodiments of the present invention may be performed in a different order and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the invention is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present invention are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions executed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in the present invention are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that reference to "one or more" unless the context clearly dictates otherwise.
Referring to fig. 1, an embodiment of the present invention provides a flowchart of a method for automatically generating a print file.
And step S110, displaying a data analysis diagram of one or more objects on the current interface through a two-dimensional coordinate system.
In the scheme, the printer client or the server can store all printed files of the user, perform statistical analysis on the content in the files, and establish a relationship map among a plurality of objects and a database corresponding to each object. The object may be any object having individual characteristics, such as a human, a plant, an animal, a commodity, a school, and the like, among others. For example, in a teaching scene, the printed file includes test paper of each subject of each student, so that a relationship map between objects (students, class, grade, subject, school, area) and data related to examinations corresponding to the objects can be established; in a company scenario, the printed document includes the production process and sales condition of each commodity, so that a relationship map between objects (commodity, sales time, sales area, company) and production process and sales related data corresponding to each object can be established.
In this step, keywords of a plurality of analysis angles, such as "examination score distribution at the end of each shift of XX grade", "subject score average score of XX grade", "sales volume of XX company X in each quarter" and the like, may be displayed on the printer client, so that the user may select a desired analysis dimension, and based on the selection of the user, a data analysis graph of one or more objects related to the keywords at the analysis angle is displayed through a two-dimensional coordinate system. The object is determined based on the keywords under the analysis angle, and if the keywords are 'test score distribution at the end of each class in the XX grade', the object comprises a plurality of-classes in the XX grade; if the keyword is "sales volume for each quarter of the XX company X goods", the object includes one-XX company X goods.
Step S120, in response to a print instruction for the target section in the data analysis diagram, determining a target data type and a target data section included in the target section.
Specifically, when the user wants to analyze a detailed text corresponding to a certain part of data in the graph. For example, when viewing the data analysis graph of "XX-grade examination score distribution at end of each class", the user may want to know the name of a student, wrong question subject, ordinary test score, etc. with scores in the interval of 60-70; in viewing the "sales volume per quarter of XX company X goods" data analysis chart, the user may want to know the production process, return situation, and the like of the quarter X goods. Therefore, the user can frame data to be known in the data analysis diagram, and obtain target sections (abscissa sections and ordinate sections) from the rectangular frame to be framed.
In general, the data category may be determined based on the coordinate title in which the data is located. For example, if the ordinate title is a score, the data category of the ordinate data is the score, and if the abscissa title is a class, the data category of the abscissa data is the class. In this step, the data type of the target data is determined according to the abscissa title and the ordinate title, and the abscissa interval or the ordinate interval corresponding to the target data is selected as the target data interval. The target data is a detailed text which the user wants to know the data, so that the data which the user wants to know can be determined by analyzing the abscissa title, the ordinate title and the keywords of the data analysis chart.
Preferably, the target data category can be determined by the following scheme:
determining a first data type of a horizontal coordinate corresponding to the target interval and a second data type of a vertical coordinate corresponding to the target interval; and selecting the target data type from the first data type and the second data type according to the range of the target interval corresponding to the horizontal coordinate and the vertical coordinate respectively.
Specifically, the interval range includes a full interval range and a partial interval range, and if the user selects the full interval range on the abscissa, the ordinate selects the partial interval range, which indicates that the user wants to know the detailed text of the target data corresponding to the ordinate partial interval in the full interval range on the abscissa.
In the previous example, the vertical coordinate corresponding to the rectangular frame selected by the user is the score, so that the second data category is the score, and the corresponding interval range is 60-70 scores; the abscissa is a class, so the first data category is a class, and the range of the abscissa is a whole class because the user wants to know the names of students whose whole class scores are in the range of 60-70, wrong subjects, ordinary test scores, and the like. That is, the user wants to know the names of students with scores ranging from 60 to 70 in the whole grade range, wrong questions, ordinary test results, and the like, and therefore the data type of the target data is the score.
Further, the vertical coordinate corresponding to the rectangular frame selected by the user is the sales volume, so that the second data category is the sales volume, and the corresponding interval range is all; the abscissa is each quarter, so the first data class is time and the corresponding interval range is the first quarter. That is, the user wants to know the production process, return condition, etc. of all the sold X goods in the first quarter, and therefore the data type of the target data is time.
Step S130, obtaining target file attribute information corresponding to the target data type based on the mapping relationship between the data type and the file attribute information.
Before executing the step, a mapping relation between the data types and the file attribute information is established in advance according to the database corresponding to each object, namely, the file attribute information of the text associated with each data type is determined by combing and analyzing the printing file content of each object, and the mapping relation between the two is established. The mapping includes one-to-one and one-to-many. For example, the data type "score" has a mapping relationship with the file attribute information "student name", "wrong question", "school", and the data type "time" has a mapping relationship with the file attribute information "commodity X production process", "commodity X return rate", "commodity X stock".
Preferably, if the target file attribute information corresponding to the target data type includes multiple types, the multiple types of target file attribute information are displayed at a preset position of the data analysis diagram for selection by a user.
Specifically, the user may not need to print the text under the multiple target file attribute information corresponding to the target data category, so that the keywords of the multiple target file attribute information may be displayed in the form of a pop-up window or a bubble at the preset position of the data analysis diagram, so that the user may select the final target file information that the user wants to print, and then execute step S140.
Step S140, extracting a target text in the target data interval corresponding to the target file attribute information from the index file associated with the object, and generating a print file according to the target text.
Specifically, in the database corresponding to each object, each text content corresponding to the object is labeled with the corresponding file attribute information, and an index file corresponding to the object is generated.
In this step, according to the determined attribute information of the target file, the candidate text in the target data interval is searched in the index file corresponding to the object, and the target text corresponding to the attribute information of the target file is extracted from the candidate text. Furthermore, the target text may have a rereaded text (such as wrong title, manufacturing process, etc.), so the target document may be typeset after being deduplicated, and a print document may be generated.
Preferably, the object may be decomposed into a plurality of sub-objects based on different dimensions (for example, the object class may be decomposed into a plurality of sub-object classes according to class dimensions and a plurality of sub-object students according to person dimensions, the object product may be decomposed into a plurality of types of sub-object products according to product dimensions and may be decomposed into products in each time period according to time dimensions), in order to improve the indexing efficiency, the index file may be divided based on any dimension or any several dimensions corresponding to the object, and each dimension includes the index file corresponding to a plurality of sub-objects. That is, the index file of the object grade can be split into index files of a plurality of classes or index files of a plurality of students, and the index file of the object commodity can be split into index files of various types of commodities or index files of commodities in various time periods.
On the basis, the target index file can be determined firstly in the step through the following method, and then the target text can be directly found from the target index file.
Determining a target dimension corresponding to the object in the data graph according to coordinate titles corresponding to the horizontal coordinate and the vertical coordinate respectively; and determining a target index file based on the sub-object identification under the target dimension included in the target interval.
Specifically, the target dimension corresponding to the object may be determined according to the coordinate titles corresponding to the abscissa and the ordinate, for example, if the abscissa is each class, the target dimension is a class dimension, and if the abscissa is each quarter, the target dimension is a time dimension. After the target dimension is determined, the corresponding sub-object identifier is found from the range of the horizontal coordinate interval or the range of the vertical coordinate interval of the target interval, and the index file of the sub-object represented by the sub-object identifier is determined as the target index file.
According to the method, the device, the electronic equipment and the storage medium for automatically generating the print file, provided by the embodiment of the invention, on one hand, the corresponding print file can be automatically generated based on the data analysis chart, so that the printing efficiency is improved, and the printing time is saved; in addition, the target texts forming the print file are determined according to the target attribute information corresponding to the index file and the data analysis graph, and the accuracy of the print file is ensured while the source of the data texts is diverged.
As some optional implementations of the embodiment of the present invention, the index file is a two-dimensional table obtained by extracting a key text from an uploaded file and/or a machine-readable card based on the object identifier and the file attribute information.
Specifically, the server can acquire and store a file uploaded by a user through a client, extract an object identifier from the file, and form a key text by using a keyword or a key phrase corresponding to each file attribute information, wherein if all or part of contents of the file correspond to certain file attribute information, a text link is generated by the contents, and the text link and the object identifier form the key text; further, the server may also obtain the machine-readable card scanned by the scanner, identify the object identifier in the machine-readable card and the filling information of each question in the answering area, obtain a plurality of keywords or key phrases corresponding to the file attribute information based on the filling information, such as scores, wrong question numbers, and the like, combine the keywords or key phrases corresponding to the object identifier and the file attribute information into a key text, and also obtain the test question content corresponding to the wrong question numbers, generate text links, and combine them into the key text.
And determining the key text corresponding to each object identifier in each file attribute information to obtain the index file in the form of a two-dimensional table. As shown in table 1, the index file includes an object identification for each row of objects, and a text or text link for the object identification under each column of text attribute information.
TABLE 1
Sales volume for one quarter | Rate of return | Making logs | |
Commercial product (Q1) | 18342 | Xx% | Doc1 Doc2 Doc3… |
Commercial product (Q2) | 25678 | Yy% | Doc4 Doc5 Doc6… |
Commercial product (Q3) | 19765 | Aa % | Doc7 Doc8 Doc9… |
As shown in fig. 2, the identification of the object in the machine readable card and the filling information of each topic in the answering area are realized by the following scheme:
step S210, obtaining a gray picture obtained by reading a card by a scanner, and positioning a plurality of preset identification blocks.
In this step, the square outline of the identification block is mainly searched in the gray-scale picture, and the square outline is used for positioning and determining the size of the machine-readable card. Generally, four corners of the machine-readable card are respectively provided with a black identification block for identification according to pixels and outlines, and in order to identify the front and back of the answer sheet, the size of the identification block on each corner can be different.
In practice, the machine readable card is printed, so that the black mark block has phenomena of 'black vertical lines passing through the mark block, white vertical lines passing through the mark block (lack of ink), and a large amount of ink lacking in the inner part and the edge of the mark block', and the like, thereby causing the mark block not to be correctly identified, or the width and the height of the mark block to be obviously too large or too small. In order to solve the problem, the scheme performs different treatments on the x direction and the y direction respectively. In the x direction, performing average filtering with the window length of 9 to reduce the influence of vertical lines as much as possible; in the y direction, a basic gaussian filter is made. Meanwhile, the square outline of the identification block is directly searched in smaller areas at four corners of the machine-readable card, so that the wrong selection of the square outline is avoided, and the identification rate of the identification block is improved.
And S220, zooming the gray-scale picture based on the identification block to obtain a target gray-scale picture, wherein the size of the target gray-scale picture is consistent with that of the machine-readable card template.
Specifically, the gray-scale picture is obtained by scanning, and is different from the size of the original answer sheet. Therefore, the gray scale picture is zoomed by taking the identification blocks as action points until the central point of each identification block in the gray scale picture coincides with the central point of the identification block corresponding to the identification block in the machine-readable card template, and the size of the obtained target gray scale picture is consistent with that of the machine-readable card template.
And step S230, determining the identification area of the target gray-scale picture and the answering area of each question through the machine-readable card template.
In this step, the machine-readable card template is covered in the target gray-scale picture, so as to obtain the identification area of the target gray-scale picture, the answering area of each question and the approximate area of each option in the answering area.
Step S240, aiming at the answering area of each question, determining the target option of each question according to the pixel gray value of each option, identifying the identification area, and determining the object identification of the machine-readable card.
In the step, on one hand, filling answers of each question in the answering area are identified, and on the other hand, object identification of the identification area is identified.
Specifically, for the answering area, the filled option has a plurality of black pixel points, and the gray value is high. Therefore, firstly, the gray map is subjected to binarization processing, the gray of the pixel point of which the gray value meets the preset condition is counted as a numerical value 1, and the gray of the pixel point of which the gray value does not meet the preset condition is counted as 0; secondly, a gray level average value can be calculated based on the gray level values of all pixels included in each option, before that, a gray level range corresponding to the filled target option is determined through a large amount of filling data, a gray level threshold value is generated based on the gray level range, and the option with the gray level average value falling into the gray level threshold value is used as the target option.
For the identification area, the object identification may be the name of the object or a string of characters representing the object. If the object mark of the mark area is handwritten or printed, recognizing the object mark by an optical character recognition technology to obtain the object mark; if the object identification of the identification area is filled characters, calculating the gray average value of all pixels in each option in each row or each column according to the scheme of the answering area to obtain the target option in each row or each column, and stringing together to obtain the target object identification.
Furthermore, as an optional implementation manner of the embodiment of the present invention, the inventor finds that, after printing and scanning, the identification block at 4 corners on the machine-readable card may not be kept as it is, and often has ink marks missing, so that a small amount of deviation occurs in the center point of the identification block, and there often occurs a deviation of several pixels in correspondence with the machine-readable card template that is not strictly stitched. Although the shift of several pixels is an order of magnitude small for the whole picture, it will have a relatively large effect for each fill-in option, and at this time, if the gray threshold is set to be relatively high, then the option which is easy to appear to be clearly filled in is not recognized; if the gray threshold is set to be low, then it is easy to see that there is no padding, but ABCD or 1234 in the selection, and the middle bracket itself, are also black, resulting in false positives as having padding.
Therefore, the following scheme can also be adopted to determine the target option: determining the central point of each option in the answering area according to the machine-readable card template, and obtaining a circumscribed rectangle of the central point based on the preset width and height; determining a filling area in the external rectangle, and eliminating target pixel points in the filling area which are matched with pixel points occupied by characters in options corresponding to the machine-readable card template; calculating the average gray value of the residual pixel points in the filling area after the target pixel points are removed; the target option is determined based on the average gray value.
Specifically, after the central point of each option is determined in the answering area according to the machine-readable card template, a circumscribed rectangle of the central point can be obtained based on the preset width and height of the options, and a plurality of pixels are respectively expanded outwards from four vertexes of the circumscribed rectangle to construct a slightly larger rectangular area. As mentioned above, there is expected and actual offset of a few pixels, and after enlarging a few pixels, it is guaranteed that the enlarged rectangular area will encompass the actual complete fill-in option. And then, drawing the outline of the actual filling area of the option according to the gray value of each pixel point in the rectangular area. The gray level is analyzed in the actual filling area of the option, and compared with the gray level analyzed in the rectangular area positioned by the machine-readable card template, the accuracy is greatly improved.
Further, for the calculation of the gray value in the actual filling area, it is decided whether the option is judged to be filled or not. In the scheme, firstly, the outer edge (such as a bracket part) of the option included in the actual filling area is removed to obtain an inner area, so that the influence of the gray value of the outer edge of the option is reduced; secondly, since the ABCD or 1234 in the selection is also black, there is some influence on the gray value determination, and meanwhile, the ABCD or 1234 has different influences on the average gray value due to different geometric shapes. Therefore, the sample pattern of the ABCD is obtained from the card reading template. For example, when the actual filling area comprises the letter A, based on the pixel point corresponding to the letter A in the machine-readable card template, removing the target pixel point matched with the actual filling area in the actual filling area to obtain the residual pixel points in the actual filling area; and then calculating the mean value of the gray values of the residual pixel points, thereby eliminating the influence of the ABCD or 1234 gray value on the average gray value as much as possible.
In one embodiment, referring to fig. 3, a schematic diagram of an apparatus for automatically generating a print document is provided. The apparatus may be used to perform the method of automatically generating a print file shown in fig. 1 or 2, the apparatus including: a presentation module 310, a determination module 320, an acquisition module 330, and a generation module 340; wherein,
a display module 310, configured to display a data analysis graph of one or more objects through a two-dimensional coordinate system on a current interface; a determining module 320, configured to determine, in response to a print instruction for a target interval in the data analysis graph, a target data category and a target data interval included in the target interval; an obtaining module 330, configured to obtain target file attribute information corresponding to a target data category based on a mapping relationship between the data category and the file attribute information; the generating module 340 is configured to extract a target text in the target data interval corresponding to the target file attribute information from the index file associated with the object, and generate a print file according to the target text.
Preferably, the determining module 320 is further configured to determine a first data category of an abscissa corresponding to the target interval and a second data category of an ordinate corresponding to the target interval; and selecting the target data type from the first data type and the second data type according to the range of the target interval corresponding to the horizontal coordinate and the vertical coordinate respectively.
Preferably, the index file is divided based on any one or any several dimensions corresponding to the object, each dimension includes index files corresponding to a plurality of sub-objects, and the determining module 320 is further configured to determine a target dimension corresponding to the object in the data map according to coordinate titles corresponding to the abscissa and the ordinate, respectively; and determining a target index file based on the sub-object identification under the target dimension included in the target interval.
Preferably, if the target file attribute information corresponding to the target data type includes multiple types, the multiple types of target file attribute information are displayed at a preset position of the data analysis diagram for selection by a user.
Preferably, the index file is a two-dimensional table obtained by extracting a key text of the uploaded file and/or the machine-readable card based on the object identification and the file attribute information; the index file includes object identifications of the objects, and texts or text links of the object identifications under the respective text attribute information.
Preferably, the obtaining module 330 is further configured to obtain a grayscale picture obtained by reading a card by a scanner, and locate a plurality of preset identification blocks; zooming the gray-scale picture based on the identification block to obtain a target gray-scale picture, wherein the size of the target gray-scale picture is consistent with that of the machine-readable card template; determining an identification area of the target gray level picture and a response area of each question through a machine-readable card template; aiming at the answering area of each question, determining the target option of each question according to the pixel gray value of each option, identifying the identification area and determining the object identification of the machine-readable card; and generating a text or a text link corresponding to the object identifier under each file attribute information according to the target option of each topic.
Preferably, the obtaining module 330 is further configured to determine a central point of each option in the answering area according to the machine-readable card template, and obtain a circumscribed rectangle of the central point based on a preset width and height; determining a filling area in the external rectangle, and eliminating target pixel points in the filling area which are matched with pixel points occupied by characters in options corresponding to the machine-readable card template; calculating the average gray value of the residual pixel points in the filling area after the target pixel points are removed; the target option is determined based on the average gray value.
It should be noted that, the apparatus for automatically generating a print file according to the embodiment of the present invention is corresponding to a technical solution that can be used for executing the above method embodiments, and the implementation principle and the technical effect are similar, and are not described herein again.
Fig. 4 is a schematic structural diagram of an electronic device in an embodiment of the present invention. Referring now specifically to FIG. 4, a schematic diagram of an electronic device 400 suitable for use in implementing embodiments of the present invention is shown. The electronic device 400 in the embodiment of the present invention may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), a wearable electronic device, and the like, and a fixed terminal such as a digital TV, a desktop computer, a smart home device, and the like. The electronic device shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 4, the electronic device 400 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 401 that may perform various appropriate actions and processes to implement the methods of embodiments described herein, according to a program stored in a Read Only Memory (ROM) 402 or a program loaded from a storage means 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data necessary for the operation of the electronic apparatus 400 are also stored. The processing device 401, the ROM402, and the RAM 403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
Generally, the following devices may be connected to the I/O interface 405: input devices 406 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 407 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 408 including, for example, tape, hard disk, etc.; and a communication device 409. The communication means 409 may allow the electronic device 400 to communicate wirelessly or by wire with other devices to exchange data. While fig. 4 illustrates an electronic device 400 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present invention, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, an embodiment of the invention includes a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart, thereby implementing the method for automatically generating a print file as described above. In such an embodiment, the computer program may be downloaded and installed from a network via the communication device 409, or from the storage device 408, or from the ROM 402. The computer program performs the above-described functions defined in the methods of embodiments of the invention when executed by the processing apparatus 401.
It should be noted that the computer readable medium of the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the terminals, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to:
displaying a data analysis graph of one or more objects through a two-dimensional coordinate system on a current interface; in response to a printing instruction for a target interval in the data analysis diagram, determining a target data type and a target data interval included in the target interval; acquiring target file attribute information corresponding to the target data type based on the mapping relation between the data type and the file attribute information; and extracting a target text in the target data interval corresponding to the attribute information of the target file from the index file associated with the object, and generating a print file according to the target text.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of methods, apparatus, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present invention may be implemented by software or hardware. Where the name of an element does not in some cases constitute a limitation on the element itself.
The foregoing description is only exemplary of the preferred embodiments of the invention and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents is encompassed without departing from the spirit of the disclosure. For example, the above features and (but not limited to) features having similar functions disclosed in the present invention are mutually replaced to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Also, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the invention. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.
Claims (7)
1. A method of automatically generating a print document, the method comprising:
responding to an operation instruction of a user on a target interval in a data analysis graph of one or more objects, and determining a target data interval included in the target interval; determining a first data type of a horizontal coordinate corresponding to the target interval and a second data type of a vertical coordinate corresponding to the target interval; selecting a target data type from the first data type and the second data type according to the range of the target interval corresponding to the abscissa and the ordinate respectively;
acquiring target file attribute information corresponding to the target data type based on the mapping relation between the data type and the file attribute information;
determining a target dimension corresponding to the object in the data analysis graph according to coordinate titles corresponding to the abscissa and the ordinate respectively; determining a target index file based on the sub-object identification under the target dimension included in the target interval; the target index file is divided based on any dimension or any several dimensions corresponding to the object, and each dimension comprises index files corresponding to a plurality of sub-objects; and extracting a target text corresponding to the attribute information of the target file and in the target data interval from the target index file associated with the object, and generating a print file according to the target text.
2. The method for automatically generating a print file according to claim 1, wherein if the target file attribute information corresponding to the target data type includes a plurality of types, the plurality of types of target file attribute information are displayed at a preset position of the data analysis graph for selection by a user.
3. The method for automatically generating a print file according to claim 1 or 2, wherein the index file is a two-dimensional table obtained by extracting a key text from an uploaded file and/or a machine-readable card based on the object identifier and the file attribute information; the index file comprises object identifications of the objects and texts or text links of the object identifications under the text attribute information.
4. The method of automatically generating a print file according to claim 3, further comprising:
acquiring a gray picture obtained by scanning the machine-readable card, and positioning a plurality of preset identification blocks;
zooming the gray-scale picture based on the identification block to obtain a target gray-scale picture, wherein the size of the target gray-scale picture is consistent with that of the machine-readable card template;
determining the identification area of the target gray level picture and the answering area of each question through the machine-readable card template;
aiming at the answering area of each question, determining the target option of each question according to the pixel gray value of each option, identifying the identification area and determining the object identification of the machine-readable card;
and generating a text or a text link corresponding to the object identifier under each file attribute information according to the target option of each topic.
5. The method of automatically generating a print file according to claim 4, wherein the determining, for the answer area of each topic, the target option of each topic according to the pixel gray scale value of each option comprises:
determining a central point of each option in the answering area according to the machine-readable card template, and obtaining a circumscribed rectangle of the central point based on a preset width and height;
determining a filling area in the external rectangle, and eliminating target pixel points in the filling area which are matched with pixel points occupied by characters in options corresponding to the machine-readable card template;
calculating the average gray value of the residual pixel points in the filling area after the target pixel points are removed;
and determining a target option based on the average gray value.
6. An apparatus for automatically generating a print document, comprising:
the determining module is configured to respond to an operation instruction of a user on a target interval in a data analysis graph of one or more objects, and determine a target data interval included in the target interval; determining a first data type of a horizontal coordinate corresponding to the target interval and a second data type of a vertical coordinate corresponding to the target interval; selecting a target data type from the first data type and the second data type according to the range of the target interval corresponding to the abscissa and the ordinate respectively;
the acquisition module is configured to acquire target file attribute information corresponding to the target data type based on the mapping relation between the data type and the file attribute information;
the generating module is configured to determine a target dimension corresponding to the object in the data analysis graph according to coordinate titles corresponding to the abscissa and the ordinate respectively; determining a target index file based on the sub-object identification under the target dimension included in the target interval; the target index file is divided based on any dimension or any several dimensions corresponding to the object, and each dimension comprises index files corresponding to a plurality of sub-objects; and extracting a target text corresponding to the attribute information of the target file and in the target data interval from the target index file associated with the object, and generating a print file according to the target text.
7. An electronic device, characterized in that the electronic device comprises:
one or more processors;
storage means for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement a method of automatically generating a print file as recited in any of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210099880.7A CN114138214B (en) | 2022-01-27 | 2022-01-27 | Method and device for automatically generating print file and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210099880.7A CN114138214B (en) | 2022-01-27 | 2022-01-27 | Method and device for automatically generating print file and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114138214A CN114138214A (en) | 2022-03-04 |
CN114138214B true CN114138214B (en) | 2022-04-29 |
Family
ID=80382095
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210099880.7A Active CN114138214B (en) | 2022-01-27 | 2022-01-27 | Method and device for automatically generating print file and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114138214B (en) |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100664311B1 (en) * | 2005-11-18 | 2007-01-04 | 삼성전자주식회사 | Image forming apparatus for automatically forming index and the automatically index forming method thereof |
US7760405B2 (en) * | 2007-08-30 | 2010-07-20 | Business Objects Software Ltd | Apparatus and method for integrating print preview with data modeling document editing |
JP5187057B2 (en) * | 2008-08-07 | 2013-04-24 | 株式会社リコー | Layout printing system, layout document browsing method, and program |
CN104657094A (en) * | 2015-01-30 | 2015-05-27 | 深圳市亿思达科技集团有限公司 | 3D (three dimensional) printing method and 3D printing system |
CN109976683B (en) * | 2019-02-28 | 2022-08-02 | 广州达安临床检验中心有限公司 | Data printing method, device, equipment and storage medium |
CN112230870B (en) * | 2020-12-08 | 2021-04-06 | 中博信息技术研究院有限公司 | Method and device for printing form data |
-
2022
- 2022-01-27 CN CN202210099880.7A patent/CN114138214B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN114138214A (en) | 2022-03-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108073910B (en) | Method and device for generating human face features | |
CN112560849B (en) | Neural network algorithm-based grammar segmentation method and system | |
CN113837151B (en) | Table image processing method and device, computer equipment and readable storage medium | |
CN113221632A (en) | Document picture identification method and device and computer equipment | |
CN111061933A (en) | Picture sample library construction method and device, readable storage medium and terminal equipment | |
CN112396032B (en) | Writing detection method and device, storage medium and electronic equipment | |
CN114005126A (en) | Table reconstruction method and device, computer equipment and readable storage medium | |
CN112347997A (en) | Test question detection and identification method and device, electronic equipment and medium | |
CN111126486A (en) | Test statistical method, device, equipment and storage medium | |
CN112801099B (en) | Image processing method, device, terminal equipment and medium | |
CN115393872B (en) | Method, device and equipment for training text classification model and storage medium | |
CN114937270A (en) | Ancient book word processing method, ancient book word processing device and computer readable storage medium | |
CN111062377B (en) | Question number detection method, system, storage medium and electronic equipment | |
CN112860845A (en) | Test question retrieval method and device, electronic equipment and storage medium | |
CN112883926A (en) | Identification method and device for table medical images | |
WO2013039063A1 (en) | Answer processing device, answer processing method, recording medium, and seal | |
CN112269872A (en) | Resume analysis method and device, electronic equipment and computer storage medium | |
CN108369647B (en) | Image-based quality control | |
CN114138214B (en) | Method and device for automatically generating print file and electronic equipment | |
CN112487897A (en) | Handwriting content evaluation method and device and electronic equipment | |
JP2020502710A (en) | Web page main image recognition method and apparatus | |
CN115221452B (en) | Portal construction method, system, electronic equipment and medium based on visual configuration | |
CN117520343A (en) | Information extraction method, server and storage medium | |
CN111027533A (en) | Conversion method and system of point-to-read coordinates, terminal device and storage medium | |
CN115858695A (en) | Information processing method and device 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 |