CN117420974A - Thermal printer page mode control method and related device - Google Patents

Thermal printer page mode control method and related device Download PDF

Info

Publication number
CN117420974A
CN117420974A CN202311738692.5A CN202311738692A CN117420974A CN 117420974 A CN117420974 A CN 117420974A CN 202311738692 A CN202311738692 A CN 202311738692A CN 117420974 A CN117420974 A CN 117420974A
Authority
CN
China
Prior art keywords
printing
target
content
text
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
Application number
CN202311738692.5A
Other languages
Chinese (zh)
Other versions
CN117420974B (en
Inventor
请求不公布姓名
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhuhai Xinye Electronic Technology Co Ltd
Original Assignee
Zhuhai Xinye Electronic Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhuhai Xinye Electronic Technology Co Ltd filed Critical Zhuhai Xinye Electronic Technology Co Ltd
Priority to CN202311738692.5A priority Critical patent/CN117420974B/en
Publication of CN117420974A publication Critical patent/CN117420974A/en
Application granted granted Critical
Publication of CN117420974B publication Critical patent/CN117420974B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1223Dedicated interfaces to print systems specifically adapted to use a particular technique
    • G06F3/1237Print job management
    • G06F3/1253Configuration of print job parameters, e.g. using UI at the client
    • G06F3/1257Configuration of print job parameters, e.g. using UI at the client by using pre-stored settings, e.g. job templates, presets, print styles
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1202Dedicated interfaces to print systems specifically adapted to achieve a particular effect
    • G06F3/1203Improving or facilitating administration, e.g. print management
    • G06F3/1208Improving or facilitating administration, e.g. print management resulting in improved quality of the output result, e.g. print layout, colours, workflows, print preview
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1202Dedicated interfaces to print systems specifically adapted to achieve a particular effect
    • G06F3/1211Improving printing performance
    • G06F3/1215Improving printing performance achieving increased printing speed, i.e. reducing the time between printing start and printing end
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1223Dedicated interfaces to print systems specifically adapted to use a particular technique
    • G06F3/1237Print job management
    • G06F3/1242Image or content composition onto a page
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1223Dedicated interfaces to print systems specifically adapted to use a particular technique
    • G06F3/1237Print job management
    • G06F3/125Page layout or assigning input pages onto output media, e.g. imposition
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Record Information Processing For Printing (AREA)

Abstract

The embodiment of the invention provides a page mode control method and a related device for a thermal printer, belonging to the technical field of printers. The method comprises the following steps: acquiring a page mode printing request, wherein the page mode printing request comprises a file to be printed, and carrying out content analysis on the file to be printed to obtain corresponding printing content; determining a target description text corresponding to the file to be printed according to the association relation of the printing content and the printing content; determining initial typesetting information corresponding to a file to be printed according to the target description text; printing and typesetting the file to be printed according to the initial typesetting information to obtain intermediate typesetting information; screening the intermediate typesetting information to obtain target typesetting information corresponding to the file to be printed; and obtaining a printing strategy required by the thermal printer when the file to be printed is printed according to the target typesetting information, and executing page mode printing operation according to the printing strategy. The problem of thermal printer can't carry out intelligent typesetting, lead to the printing effect relatively poor, can't satisfy user's demand is solved.

Description

Thermal printer page mode control method and related device
Technical Field
The invention relates to the technical field of printers, in particular to a page mode control method and a related device of a thermal printer.
Background
The thermal printing technology is a high-speed and low-noise printing technology and is widely applied to the fields of cash registers, bar code printers and the like. In the conventional thermal printer, the printing modes are largely classified into a dot matrix mode and a page mode. The dot matrix mode is to print line by line according to a fixed dot matrix format, the speed is high, the typesetting is fixed, and the intelligent typesetting can not be performed according to the content. The page mode can freely control typesetting, but a large amount of typesetting processing is needed, so that the printing speed is slower.
In the traditional thermal printer, since intelligent typesetting processing cannot be performed, typesetting can often be performed only according to a fixed format, and accurate typesetting cannot be performed according to the association relation of printing contents, so that a printing result is inaccurate. Meanwhile, since a large number of typesetting processes are required before each printing, the printing speed is relatively slow. In addition, the traditional thermal printer cannot perform intelligent typesetting treatment, cannot meet the requirement of a user on the printing effect, and has poor printing effect and cannot meet the requirement of the user.
Disclosure of Invention
The embodiment of the invention mainly aims to provide a page mode control method and a related device for a thermal printer, and aims to solve the problems that the traditional thermal printer cannot conduct intelligent typesetting processing, cannot meet the requirement of a user on a printing effect, and the printing effect is poor and cannot meet the requirement of the user.
In a first aspect, an embodiment of the present invention provides a method for controlling a page mode of a thermal printer, including:
acquiring a page mode printing request, wherein the page mode printing request comprises a file to be printed, and carrying out content analysis on the file to be printed to obtain printing content corresponding to the file to be printed;
performing association analysis on the printing content to obtain an association relationship corresponding to the printing content;
determining a target description text corresponding to the file to be printed according to the association relation and the printing content;
determining initial typesetting information corresponding to the file to be printed according to the target description text;
printing and typesetting the file to be printed according to the initial typesetting information to obtain intermediate typesetting information;
screening the intermediate typesetting information to obtain target typesetting information corresponding to the file to be printed;
And obtaining a printing strategy required by the thermal printer when the thermal printer prints the file to be printed according to the target typesetting information, and executing page mode printing operation according to the printing strategy.
In a second aspect, an embodiment of the present invention provides a thermal printer page mode control apparatus, including:
the data acquisition module is used for acquiring a page mode printing request, wherein the page mode printing request comprises a file to be printed, and content analysis is carried out on the file to be printed to obtain printing content corresponding to the file to be printed;
the relation determining module is used for carrying out association analysis on the printing content to obtain an association relation corresponding to the printing content;
the text determining module is used for determining a target description text corresponding to the file to be printed according to the association relation and the printing content;
the typesetting generation module is used for determining initial typesetting information corresponding to the file to be printed according to the target description text;
the typesetting determining module is used for printing and typesetting the file to be printed according to the initial typesetting information to obtain intermediate typesetting information;
the typesetting screening module is used for screening the intermediate typesetting information to obtain target typesetting information corresponding to the file to be printed;
And the strategy determining module is used for obtaining a printing strategy required by the thermal printer when the file to be printed is printed according to the target typesetting information, and executing page mode printing operation according to the printing strategy.
In a third aspect, the embodiment of the present invention further provides a terminal device, where the terminal device includes a processor, a memory, a computer program stored on the memory and executable by the processor, and a data bus for implementing connection communication between the processor and the memory, where the computer program, when executed by the processor, implements the steps of any one of the thermal printer page mode control methods provided in the present specification.
In a fourth aspect, an embodiment of the present invention further provides a storage medium for computer readable storage, wherein the storage medium stores one or more programs, and the one or more programs are executable by one or more processors to implement the steps of any one of the thermal printer page mode control methods as provided in the present specification.
According to the method and the device for typesetting, reasonable typesetting can be carried out according to the association relation of the content through association analysis and intelligent typesetting processing of the printing content, so that typesetting accuracy is improved. The method is not limited to a fixed format any more, and typesetting can be automatically adjusted according to the characteristics of the content, so that the printing result is more accurate; after the page mode printing request is acquired, carrying out association analysis on printing content corresponding to a file to be printed in the page mode printing request, and further determining a corresponding target description text according to an association analysis result, so that initial typesetting information corresponding to the printing content is determined according to the target description text, the problem that a traditional thermal printer cannot acquire individual typesetting for the printing content according to the relation between the printing content before each printing is avoided, and printing quality and printing efficiency are greatly improved; through intelligent typesetting processing, a printing strategy required by printing the printed file can be obtained according to the target typesetting information, so that the printing effect is further improved. The printing strategy can be optimized according to the characteristics and the requirements of the printed file, so that the printing result is clearer and clearer, and the requirement of a user on the printing effect can be met. Therefore, through the correlation analysis and the intelligent typesetting treatment, the technical problems in aspects of typesetting accuracy, printing speed, printing effect and the like of the traditional thermal printer are effectively solved, printing quality and efficiency are improved, and requirements of users on printing quality and speed are met.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a page mode control method for a thermal printer according to an embodiment of the present invention;
FIG. 2 is a flow chart of substep S102 of the thermal printer page mode control method of FIG. 1;
FIG. 3 is a schematic block diagram of a page mode control device of a thermal printer according to an embodiment of the present invention;
fig. 4 is a schematic block diagram of a structure of a terminal device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The flow diagrams depicted in the figures are merely illustrative and not necessarily all of the elements and operations/steps are included or performed in the order described. For example, some operations/steps may be further divided, combined, or partially combined, so that the order of actual execution may be changed according to actual situations.
It is to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
The embodiment of the invention provides a page mode control method and a related device for a thermal printer. The method for controlling the page mode of the thermal printer can be applied to terminal equipment, and the terminal equipment can also be equipment arranged on the printer. Printers include, but are not limited to, thermal printers, ticket printers, bar code printers.
Some embodiments of the invention are described in detail below with reference to the accompanying drawings. The following embodiments and features of the embodiments may be combined with each other without conflict.
Referring to fig. 1, fig. 1 is a flowchart of a method for controlling a page mode of a thermal printer according to an embodiment of the invention.
As shown in fig. 1, the thermal printer page mode control method includes steps S101 to S107.
Step S101, a page mode printing request is obtained, wherein the page mode printing request comprises a file to be printed, and content analysis is carried out on the file to be printed to obtain printing content corresponding to the file to be printed.
When a user needs to print a file or needs other printing, sending a page mode printing request to a printer, further obtaining the page mode printing request by the printer, analyzing the page mode printing request to obtain a storage path corresponding to the file to be printed, further obtaining the file to be printed from the storage path by the printer, and further analyzing the content of the file to be printed to obtain the printing content corresponding to the file to be printed.
For example, a user triggers a page mode print request on a mobile phone, but a file to be printed is stored on a server, after receiving the page mode print request, the printer analyzes the page mode print request to obtain a storage position corresponding to the file to be printed, and further obtains the file to be printed corresponding to the page mode print request according to the storage position, so that the file to be printed uses a python-doc library to analyze the content, and print content corresponding to the file to be printed is obtained. The print content includes at least text information, image information, and form information.
Step S102, performing association analysis on the printing content to obtain an association relationship corresponding to the printing content.
Illustratively, the print content includes text information including at least a first piece of text, a second piece of text, and a third piece of text, and the association relationship between the text information is obtained by using a relationship classification model. The relation classification model is a BERT model, and the association relation between text information is obtained according to relation prediction between sentences in the BERT model.
For example, inputting the first text segment and the second text segment into a relation classification model to obtain a first vector and a second vector corresponding to the first text segment and the second text segment respectively, fusing the first vector and the second vector by using a full connection layer in a BERT model to obtain probability information of a corresponding association relation between the first text segment and the second text segment, and determining the association relation corresponding to the first text segment and the second text segment according to the probability information; inputting the second text and the third text into a relation classification model to obtain a second vector and a third vector corresponding to the second text and the third text respectively, fusing the second vector and the third vector by using a full connection layer in the BERT model to obtain probability information of the corresponding association relation between the second text and the third text, determining the association relation corresponding to the second text and the third text according to the probability information, and so on. The classification results corresponding to the relationship classification model comprise causal relationships, parallel relationships, irrelevant relationships and the like.
Optionally, the model structure of the relationship classification model is not particularly limited, and the model structure can be set by a user according to actual requirements.
In some embodiments, the print content includes text content, image content and table content, and the performing association analysis on the print content obtains an association relationship corresponding to the print content, specifically referring to fig. 2, step S102 includes: substep S1021 to substep S1024.
And S1021, performing text classification on the text content to obtain a first target text corresponding to the image content and a second target text corresponding to the table content.
Illustratively, a text classification model is established for determining whether text content is descriptive content corresponding to image content or table content. The text classification model can be a word bag model, firstly, keyword extraction is carried out on text content by utilizing TF-IDF to obtain keywords corresponding to the text content, then word vectorization is carried out on the keywords, and then a linear classifier is used for classifying the word vectorization result to obtain whether the text content is image content or descriptive content corresponding to table content.
After the description content corresponding to the image content is obtained by using the text classification model, the regular matching is carried out on the figure number in the description content by using the regular expression, so that a figure number matching result is obtained, and further, the image content corresponding to the figure number matching result is obtained, so that the text content is determined to be a first target text corresponding to the image content.
For example, if the result of the figure number matching is fig. 1, the text content is determined as the first target text corresponding to the image in fig. 1.
After the descriptive content corresponding to the table content is obtained by using the text classification model, the table number in the descriptive content is subjected to regular matching by using the regular expression, a table number matching result is obtained, and then the table content corresponding to the table number matching result is obtained, so that the text content is determined to be a second target text corresponding to the table content.
For example, if the table number matching result is table 1, the text content is determined as the second target text corresponding to the table in table 1.
Optionally, the model structure of the text classification model may also be a neural network model or a machine learning model, and the model structure of the text classification model is not particularly limited in the application, and a user can select the model according to actual requirements.
Sub-step S1022, generating a first generated image corresponding to the first target text according to the text generated image model, and comparing the first generated image with the image content to obtain a first relationship between the first target text and the image content.
Illustratively, the text-generated image model comprises a text encoder, an attention mechanism and an image generator, wherein the text encoder converts input text into a vector form, and the attention mechanism is used for corresponding key information in the input text to different areas in the image generation process, so that the generated image focuses more on a part related to the description of the input text, namely, the divergence direction of the image generator in image generation is limited; the image generator converts text codes corresponding to the input text into images through a generator network, namely, images matched with the input text are obtained.
Illustratively, a first target text is input to a text-generated image model to obtain a first generated image corresponding to the first target text. That is, a text generated image model is utilized to generate a first generated image corresponding to a first target text, and then similarity comparison is carried out on the first generated image and image content, when the similarity between the first generated image and the image content is large, the user is shown that the image content can be imagined according to the first target text even if the user does not look at the image content; when the similarity between the first generated image and the image content is smaller, the user is indicated to need to use the image content to further understand the information conveyed by the first target text. When the similarity between the first generated image and the image content is large, determining that the first relation between the first target text and the image content is weak correlation; when the similarity between the first generated image and the image content is small, the first relation between the first target text and the image content is determined to be a strong correlation.
And step S1023, generating a second generated image corresponding to the second target text according to the text generated image model, obtaining a corresponding prediction form in the second generated image, and comparing the prediction form with the form content to obtain a second relation between the second target text and the form content.
Illustratively, the second target text is input to the text-generated image model to obtain a second generated image corresponding to the second target text. That is, a second generated image corresponding to a second target text is generated by using a text generated image model, then target segmentation is performed on the second generated image to obtain different image areas, then feature extraction is performed on each image area to obtain a feature extraction result corresponding to the image area, and then the feature extraction result is classified, so that a prediction table corresponding to the second generated image is obtained. Therefore, similarity comparison is carried out on the predicted form and the form content, and when the similarity between the predicted form and the form content is large, the predicted form and the form content indicate that the form content can be imagined according to the second target text even if the user does not look at the form content; when the similarity between the predictive form and the form content is small, it is indicated that the user needs to resort to the form content to further understand the information conveyed by the second target text. Thus, when the similarity between the predicted form and the form content is large, determining that the second relationship between the second target text and the form content is a weak correlation; when the similarity between the predicted form and the form content is small, the second relationship between the second target text and the form content is determined to be a strong correlation.
And step S1024, determining the association relation corresponding to the printing content according to the first relation and the second relation.
The first target text and the second target text are removed from the text content after the first relation between the first target text and the image content and the second relation between the second target text and the table content are obtained, and the residual text is obtained, so that relation analysis is further carried out on the residual text, and the association relation between the residual text is obtained by utilizing a relation classification model. The relation classification model is a BERT model, and the association relation between text information is obtained according to relation prediction between sentences in the BERT model. Thereby obtaining a third relationship between the remaining text. And finally, the first relationship, the second relationship and the third relationship are jointly determined to be the association relationship corresponding to the printing content.
And step 103, determining a target description text corresponding to the file to be printed according to the association relation and the printing content.
By way of example, the associated content corresponding to the association relation is obtained from the print content, the text quantity corresponding to the associated content is calculated, and then the target description text corresponding to the file to be printed is generated by utilizing the text description rule according to the text quantity and the association relation.
In some embodiments, the determining, according to the association relationship and the print content, the target description text corresponding to the file to be printed includes: obtaining a first duty ratio corresponding to the first target text in the printing content, a second duty ratio corresponding to the second target text in the printing content and a third duty ratio corresponding to the text content in the printing content; obtaining a fourth duty ratio corresponding to the image content in the printing content and a fifth duty ratio corresponding to the table content in the printing content; determining a first descriptive text according to the first duty cycle, the fourth duty cycle and the first relation; determining a second descriptive text according to the second duty cycle, the fifth duty cycle and the second relationship; determining a third descriptive text according to the first duty ratio, the second duty ratio and the third duty ratio; and determining a target description text corresponding to the file to be printed according to the first description text, the second description text and the third description text.
Illustratively, a first print size corresponding to the print content and a second print size corresponding to the first target text are obtained, and a ratio between the second print size and the first print size is calculated to determine a first duty ratio corresponding to the first target text in the print content. The print size may be a print size or a print area.
Illustratively, a third print size corresponding to the second target text is obtained, and a ratio between the third print size and the first print size is calculated to determine a second duty ratio corresponding to the second target text in the print content. And obtaining a fourth printing size corresponding to the text content, and further calculating the ratio between the fourth printing size and the first printing size to determine a third corresponding duty ratio of the rest text in the printed content.
Illustratively, a fifth printing size corresponding to the image content is obtained, and then a ratio between the fifth printing size and the first printing size is calculated to determine a fifth corresponding duty ratio of the image content in the printing content; and obtaining a sixth printing size corresponding to the table contents, and further calculating the ratio between the sixth printing size and the first printing size to determine a fifth corresponding duty ratio of the table contents in the printing contents.
For example, the text image description rule may be set according to actual experience using the text image description rule between the image and the text. If a picture including text and an image is drawn, the text is 70% of the whole content, the image is 30% of the whole content, and the image needs to be tightly connected with the text.
Illustratively, after determining the text image description rule, the first duty ratio, the fourth duty ratio and the first relation are filled into the text image description rule, so as to determine a first description text corresponding between the image information and the first target text.
The text form rules may also be set based on actual experience, illustratively using text form description rules between the form and the text. If a picture including text and a form is drawn, the text is 80% of the whole content, and the form is 20% of the whole content, wherein the form needs to be tightly connected with the text.
Illustratively, after determining the text form description rule, the second duty ratio, the fifth duty ratio, and the second relationship are filled into the text form description rule, thereby determining a corresponding second descriptive text between the form information and the second target text.
The first target text and the second target text are removed from the text content by subtracting the first duty ratio from the third duty ratio, and the duty ratio information corresponding to the remaining text is determined, so that the third descriptive text corresponding to the remaining text is determined according to the duty ratio information.
The first description text, the second description text and the third description text are combined, so that the combined content is determined to be the target description text corresponding to the file to be printed.
Step S104, determining initial typesetting information corresponding to the file to be printed according to the target description text.
Setting a plurality of typesetting styles, determining description texts corresponding to the typesetting styles, and establishing a mapping table between the typesetting styles and the description texts; and calculating the text similarity between the target description text and the description text in the mapping table to obtain a similarity value between the description text and the target description text in the mapping table, and determining the typesetting style corresponding to the description text with the similarity value as initial typesetting information corresponding to the file to be printed when the similarity value is greater than or equal to a preset value.
In some embodiments, the determining, according to the target description text, initial typesetting information corresponding to the file to be printed includes: the target description text passes through a text description layer of a template generation model, and a description vector corresponding to the target description text is obtained; the description vector passes through a template generation layer corresponding to the template generation model to obtain template information corresponding to the description vector; and determining initial typesetting information corresponding to the file to be printed in the template information through a template confirmation layer corresponding to the template generation model.
Illustratively, the template generating model is used for generating initial typesetting information matched with the target description text according to the target description text. The template generation model comprises a text description layer, a template generation layer and a template confirmation layer, wherein the text description layer is used for encoding the target description text into a hidden vector to obtain a description vector corresponding to the target description text; the template generation layer is used for generating all template information which can be corresponding to the target description text according to the description vector. The template confirmation layer comprises a discriminator which is used for screening initial typesetting information which is most suitable for the discrimination conditions from the template information. After the target description text is obtained, the target description text passes through a text description layer of a template generation model, and description vectors corresponding to the target description text are obtained; the description vector passes through a template generation layer corresponding to the template generation model to obtain template information corresponding to the description vector; and determining initial typesetting information corresponding to the file to be printed in the template information through a template confirmation layer corresponding to the template generation model.
Optionally, the specific model structure of the template generation model is not particularly limited, and a user can set the model according to actual requirements.
And step 105, printing and typesetting the file to be printed according to the initial typesetting information to obtain intermediate typesetting information.
Illustratively, the initial layout information is used to characterize the layout effect between the respective duty information of the print content. And filling the printing content corresponding to the file to be printed into the initial typesetting information, so that the printing content is presented into the initial typesetting information, and further determining the result of the printing content presented into the initial typesetting information as intermediate typesetting information.
And S106, screening the intermediate typesetting information to obtain the target typesetting information corresponding to the file to be printed.
By way of example, the intermediate typesetting information is fed back to the user, so that the user can select from the intermediate typesetting information, and the target typesetting information corresponding to the file to be printed can be obtained according to the selection result of the user.
In some embodiments, the filtering the intermediate typesetting information to obtain the target typesetting information corresponding to the file to be printed includes: acquiring a recommendation weight corresponding to the intermediate typesetting information, and determining a recommendation value corresponding to the intermediate typesetting information according to the recommendation weight; determining the target typesetting information corresponding to the file to be printed according to the recommended value; wherein calculating the recommendation weight according to the following formula comprises:
W represents the recommended weight corresponding to the intermediate layout information,indicating that the time information corresponding to the intermediate layout information is obtained,/>representing the first storage time corresponding to the intermediate typesetting information; v represents the forgetting speed corresponding to the intermediate typesetting information.
The method includes the steps of obtaining initial typesetting information corresponding to intermediate typesetting information, obtaining intermediate typesetting information generated by the initial typesetting information, storing the intermediate typesetting information in a corresponding first storage time in a database, obtaining the intermediate typesetting information generated by the initial typesetting information, storing the intermediate typesetting information in all corresponding storage times in the database, further obtaining time intervals of each adjacent storage time, and further calculating an average value of each time interval to determine forgetting speed corresponding to the intermediate typesetting information. And obtaining the corresponding time information of the middle typesetting information at the current time and determining the time information as time information t. Thereby storing the time information t for the first timeSubstitution of forgetting rate v to +.>Thereby obtaining the recommendation weight corresponding to the middle typesetting information.
Illustratively, when the intermediate typesetting information is determined from the initial typesetting information, simultaneously obtaining a recommendation probability corresponding to the intermediate typesetting information, and multiplying the recommendation probability by a recommendation weight to obtain a recommendation value corresponding to the intermediate typesetting information; and further determining the middle typesetting information corresponding to the maximum value of the recommended value as target typesetting information corresponding to the file to be printed.
Step S107, obtaining a printing strategy required by the thermal printer when printing the file to be printed according to the target typesetting information, and executing page mode printing operation according to the printing strategy.
The printing size corresponding to the target typesetting information and the single-sided and double-sided printing effect corresponding to the target typesetting information are obtained, and then a printing strategy required when the file to be printed is determined according to the printing size and the single-sided and double-sided printing effect, so that the page mode printing operation required to be executed by the thermal printer in each printing page of the file to be printed is adjusted according to the printing strategy.
For example, when the file to be printed is printed, page parameters to be set for the first page printing content and the second page printing content are different, and then parameters such as the size, margin, line spacing and the like of the page are set for different page printing contents in a corresponding page mode according to the printing strategy, for example, the GS (L instruction is used for setting the page size, the GS (P instruction is used for setting the page margin and the like).
The page mode print operation may also control the print operation by way of appropriate instruction or command control bytes, for example. This includes printing text, images, bar codes, setting fonts, font sizes, styles, and the like. The specific instruction and command control bytes will vary depending on the model of the printer. For example, an ESC/P command control byte (e.g., ESC (v 0)) or an ESC/POS command control byte (e.g., GS v 0) may be used to control a particular printing operation.
In some embodiments, the obtaining, according to the target typesetting information, a printing policy required by the thermal printer when printing the file to be printed includes: obtaining initial page information corresponding to the target typesetting information; converting the initial page information into target page information supported by the thermal printer; and determining a printing strategy required by the file to be printed when printing is performed according to the target page information.
By way of example, the font size and the style corresponding to the text content, the printing mode corresponding to the image content or the table content in the target typesetting information are obtained, and then the printing setting corresponding to the text content and the printing mode corresponding to the image content or the table content are determined as the initial page information. And adjusting the initial page information according to the printing setting of the thermal printer, so as to obtain target page information required by the thermal printer when printing the target typesetting information. And then determining a printing strategy required by printing the file to be printed according to the target page information.
In some embodiments, the initial page information includes a page spacing and a print direction; the obtaining the initial page information corresponding to the target typesetting information comprises the following steps: obtaining an initial image corresponding to the target typesetting information, and carrying out target recognition on the initial image to obtain a recognition result; obtaining a target distance corresponding to the initial image according to the identification result, and determining the page space corresponding to the target typesetting information according to the target distance; and carrying out direction classification on the identification result to obtain the printing direction corresponding to the target typesetting information.
Illustratively, the initial page information includes a page spacing and a print direction. Firstly, storing target typesetting information into an initial image, further carrying out target identification on the initial image, obtaining printing content contained in the initial image and position information corresponding to the printing content, and further determining the printing content and the position information corresponding to the printing content as an identification result corresponding to the initial image.
The method includes the steps of determining a target distance occupied by print content in an initial image according to position information corresponding to the print content in a recognition result, further obtaining size information corresponding to the initial image, further subtracting the target distance from the size information to obtain remaining distance information, dividing the remaining distance information by 2 to obtain a division result, and determining the division result as a page distance corresponding to initial page information of target typesetting information. And further, after the corresponding page space in the initial page information is obtained, obtaining the corresponding target page space in the target page information according to a conversion formula between the initial image and the thermal printer for the page space.
The identification result includes print content, character information in the initial image is identified by utilizing an OCR technology, so as to obtain a character position and content information corresponding to the character information, and further direction identification is performed on the content information, so as to obtain a print direction corresponding to the content information, and further determine a print direction corresponding to the target typesetting information.
One application scenario of the thermal printer page mode control method provided in this embodiment is: the method comprises the steps that a user terminal corresponding to a user sends a page mode printing request to a printer, the printer obtains a file to be printed corresponding to the page mode printing request, content analysis is carried out on the file to be printed to obtain printing content corresponding to the file to be printed, then corresponding incidence relation of the corresponding printing content is determined according to different printing content, then target description text corresponding to the file to be printed is determined according to the incidence relation and the printing content, initial typesetting information corresponding to the file to be printed is obtained according to the target description text, printing typesetting is carried out on the file to be printed according to the initial typesetting information, intermediate typesetting information is obtained, accordingly target typesetting information is screened out from the intermediate typesetting information, a printing strategy required when the thermal printer prints the file to be printed is obtained according to the target typesetting information, and finally page mode printing operation is carried out according to the printing strategy. The problem that the traditional thermal printer cannot obtain the personalized typesetting for the printing content according to the relation between the printing content before each printing is avoided, so that the printing quality and the printing efficiency are greatly improved; through intelligent typesetting processing, a printing strategy required by printing the printed file can be obtained according to the target typesetting information, so that the printing effect is further improved. The printing strategy can be optimized according to the characteristics and the requirements of the printed file, so that the printing result is clearer and clearer, and the requirement of a user on the printing effect can be met. Therefore, through the correlation analysis and the intelligent typesetting treatment, the technical problems in aspects of typesetting accuracy, printing speed, printing effect and the like of the traditional thermal printer are effectively solved, printing quality and efficiency are improved, and requirements of users on printing quality and speed are met.
Referring to fig. 3, fig. 3 is a schematic diagram of a thermal printer page mode control device 200 provided in the embodiment of the present application, where the thermal printer page mode control device 200 includes a data obtaining module 201, a relationship determining module 202, a text determining module 203, a typesetting generating module 204, a typesetting determining module 205, a typesetting screening module 206, and a policy determining module 207, where the data obtaining module 201 is configured to obtain a page mode print request, and the page mode print request includes a file to be printed, and perform content analysis on the file to be printed to obtain print content corresponding to the file to be printed; the relationship determining module 202 is configured to perform association analysis on the print content to obtain an association relationship corresponding to the print content; a text determining module 203, configured to determine a target description text corresponding to the file to be printed according to the association relationship and the print content; the typesetting generating module 204 is configured to determine initial typesetting information corresponding to the file to be printed according to the target description text; the typesetting determining module 205 is configured to print and typeset the file to be printed according to the initial typesetting information, so as to obtain intermediate typesetting information; the typesetting screening module 206 is configured to screen the intermediate typesetting information to obtain target typesetting information corresponding to the file to be printed; the policy determining module 207 is configured to obtain a printing policy required by the thermal printer when printing the file to be printed according to the target typesetting information, and execute a page mode printing operation according to the printing policy.
In some embodiments, the print content includes text content, image content, and table content, and the relationship determining module 202 performs, in the process of performing the association analysis on the print content to obtain the association relationship corresponding to the print content:
performing text classification on the text content to obtain a first target text corresponding to the image content and a second target text corresponding to the table content;
generating a first generated image corresponding to the first target text according to a text generated image model, and comparing the first generated image with the image content to obtain a first relation between the first target text and the image content;
generating a second generated image corresponding to the second target text according to the text generated image model, obtaining a corresponding prediction form in the second generated image, and comparing the prediction form with the form content to obtain a second relation between the second target text and the form content;
and determining the association relation corresponding to the printing content according to the first relation and the second relation.
In some embodiments, the text determining module 203 performs, in the process of determining the target description text corresponding to the file to be printed according to the association relationship and the print content, the following steps:
Obtaining a first duty ratio corresponding to the first target text in the printing content, a second duty ratio corresponding to the second target text in the printing content and a third duty ratio corresponding to the text content in the printing content;
obtaining a fourth duty ratio corresponding to the image content in the printing content and a fifth duty ratio corresponding to the table content in the printing content;
determining a first descriptive text according to the first duty cycle, the fourth duty cycle and the first relation;
determining a second descriptive text according to the second duty cycle, the fifth duty cycle and the second relationship;
determining a third descriptive text according to the first duty ratio, the second duty ratio and the third duty ratio;
and determining a target description text corresponding to the file to be printed according to the first description text, the second description text and the third description text.
In some embodiments, the typesetting generation module 204 performs, in the process of determining the initial typesetting information corresponding to the file to be printed according to the target description text:
the target description text passes through a text description layer of a template generation model, and a description vector corresponding to the target description text is obtained;
The description vector passes through a template generation layer corresponding to the template generation model to obtain template information corresponding to the description vector;
and determining initial typesetting information corresponding to the file to be printed in the template information through a template confirmation layer corresponding to the template generation model.
In some embodiments, the typesetting screening module 206 performs, in the process of screening the intermediate typesetting information to obtain the target typesetting information corresponding to the file to be printed, the following steps:
acquiring a recommendation weight corresponding to the intermediate typesetting information, and determining a recommendation value corresponding to the intermediate typesetting information according to the recommendation weight;
determining the target typesetting information corresponding to the file to be printed according to the recommended value;
wherein calculating the recommendation weight according to the following formula comprises:
w represents the recommended weight corresponding to the intermediate layout information,indicating that the time information corresponding to the intermediate layout information is obtained, < >>Representing the first storage time corresponding to the intermediate typesetting information; v represents the forgetting speed corresponding to the intermediate typesetting information.
In some embodiments, the policy determining module 207 performs, in the process of obtaining the printing policy required by the thermal printer when printing the document to be printed according to the target layout information:
Obtaining initial page information corresponding to the target typesetting information;
converting the initial page information into target page information supported by the thermal printer;
and determining a printing strategy required by the file to be printed when printing is performed according to the target page information.
In some embodiments, the initial page information includes a page spacing and a print direction; the policy determining module 207 performs, in the process of obtaining the initial page information corresponding to the target typesetting information:
obtaining an initial image corresponding to the target typesetting information, and carrying out target recognition on the initial image to obtain a recognition result;
obtaining a target distance corresponding to the initial image according to the identification result, and determining the page space corresponding to the target typesetting information according to the target distance;
and carrying out direction classification on the identification result to obtain the printing direction corresponding to the target typesetting information.
In some embodiments, the thermal printer page mode control apparatus 200 may be applied to a terminal device.
It should be noted that, for convenience and brevity of description, the specific working process of the above-described thermal printer page mode control device 200 may refer to the corresponding process in the foregoing thermal printer page mode control method embodiment, and will not be repeated herein.
Referring to fig. 4, fig. 4 is a schematic block diagram of a structure of a terminal device according to an embodiment of the present invention.
As shown in fig. 4, the terminal device 300 includes a processor 301 and a memory 302, the processor 301 and the memory 302 being connected by a bus 303, such as an I2C (Inter-integrated Circuit) bus.
In particular, the processor 301 is used to provide computing and control capabilities, supporting the operation of the entire terminal device. The processor 301 may be a central processing unit (Central Processing Unit, CPU), the processor 301 may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field-programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Specifically, the Memory 302 may be a Flash chip, a Read-Only Memory (ROM) disk, an optical disk, a U-disk, a removable hard disk, or the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 4 is merely a block diagram of a portion of the structure related to the embodiment of the present invention, and does not constitute a limitation of the terminal device to which the embodiment of the present invention is applied, and that a specific server may include more or less components than those shown in the drawings, or may combine some components, or have a different arrangement of components.
The processor is used for running a computer program stored in the memory, and implementing any one of the page mode control methods of the thermal printer provided by the embodiment of the invention when the computer program is executed.
In an embodiment, the processor is configured to run a computer program stored in a memory and to implement the following steps when executing the computer program:
acquiring a page mode printing request, wherein the page mode printing request comprises a file to be printed, and carrying out content analysis on the file to be printed to obtain printing content corresponding to the file to be printed;
performing association analysis on the printing content to obtain an association relationship corresponding to the printing content;
determining a target description text corresponding to the file to be printed according to the association relation and the printing content;
determining initial typesetting information corresponding to the file to be printed according to the target description text;
printing and typesetting the file to be printed according to the initial typesetting information to obtain intermediate typesetting information;
screening the intermediate typesetting information to obtain target typesetting information corresponding to the file to be printed;
and obtaining a printing strategy required by the thermal printer when the thermal printer prints the file to be printed according to the target typesetting information, and executing page mode printing operation according to the printing strategy.
In some embodiments, the print content includes text content, image content and table content, and the processor 301 performs, in the process of performing association analysis on the print content to obtain an association relationship corresponding to the print content:
performing text classification on the text content to obtain a first target text corresponding to the image content and a second target text corresponding to the table content;
generating a first generated image corresponding to the first target text according to a text generated image model, and comparing the first generated image with the image content to obtain a first relation between the first target text and the image content;
generating a second generated image corresponding to the second target text according to the text generated image model, obtaining a corresponding prediction form in the second generated image, and comparing the prediction form with the form content to obtain a second relation between the second target text and the form content;
and determining the association relation corresponding to the printing content according to the first relation and the second relation.
In some embodiments, the processor 301 performs, in the process of determining the target description text corresponding to the file to be printed according to the association relationship and the print content, the following steps:
Obtaining a first duty ratio corresponding to the first target text in the printing content, a second duty ratio corresponding to the second target text in the printing content and a third duty ratio corresponding to the text content in the printing content;
obtaining a fourth duty ratio corresponding to the image content in the printing content and a fifth duty ratio corresponding to the table content in the printing content;
determining a first descriptive text according to the first duty cycle, the fourth duty cycle and the first relation;
determining a second descriptive text according to the second duty cycle, the fifth duty cycle and the second relationship;
determining a third descriptive text according to the first duty ratio, the second duty ratio and the third duty ratio;
and determining a target description text corresponding to the file to be printed according to the first description text, the second description text and the third description text.
In some embodiments, the processor 301 performs, in determining the initial typesetting information corresponding to the file to be printed according to the target description text:
the target description text passes through a text description layer of a template generation model, and a description vector corresponding to the target description text is obtained;
The description vector passes through a template generation layer corresponding to the template generation model to obtain template information corresponding to the description vector;
and determining initial typesetting information corresponding to the file to be printed in the template information through a template confirmation layer corresponding to the template generation model.
In some embodiments, the processor 301 performs, in a process of screening the intermediate layout information to obtain the target layout information corresponding to the file to be printed, the following steps:
acquiring a recommendation weight corresponding to the intermediate typesetting information, and determining a recommendation value corresponding to the intermediate typesetting information according to the recommendation weight;
determining the target typesetting information corresponding to the file to be printed according to the recommended value;
wherein calculating the recommendation weight according to the following formula comprises:
w represents the recommended weight corresponding to the intermediate layout information,indicating that the time information corresponding to the intermediate layout information is obtained, < >>Representing the first storage time corresponding to the intermediate typesetting information; v represents the forgetting speed corresponding to the intermediate typesetting information.
In some embodiments, the processor 301 performs, in obtaining a print policy required by the thermal printer when printing the document to be printed according to the target composition information:
Obtaining initial page information corresponding to the target typesetting information;
converting the initial page information into target page information supported by the thermal printer;
and determining a printing strategy required by the file to be printed when printing is performed according to the target page information.
In some embodiments, the initial page information includes a page spacing and a print direction; the processor 301 executes, in the process of obtaining the initial page information corresponding to the target typesetting information:
obtaining an initial image corresponding to the target typesetting information, and carrying out target recognition on the initial image to obtain a recognition result;
obtaining a target distance corresponding to the initial image according to the identification result, and determining the page space corresponding to the target typesetting information according to the target distance;
and carrying out direction classification on the identification result to obtain the printing direction corresponding to the target typesetting information.
It should be noted that, for convenience and brevity of description, specific working processes of the terminal device described above may refer to corresponding processes in the foregoing embodiment of the page mode control method of the thermal printer, and will not be described in detail herein.
Embodiments of the present invention also provide a storage medium for computer-readable storage, where one or more programs are stored, where the one or more programs are executable by one or more processors to implement the steps of any one of the thermal printer page mode control methods provided in the embodiments of the present invention.
The storage medium may be an internal storage unit of the terminal device according to the foregoing embodiment, for example, a hard disk or a memory of the terminal device. The storage medium may also be an external storage device of the terminal device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the terminal device.
Those of ordinary skill in the art will appreciate that all or some of the steps, systems, functional modules/units in the apparatus, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware embodiment, the division between the functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed cooperatively by several physical components. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes both volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as known to those skilled in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer. Furthermore, as is well known to those of ordinary skill in the art, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media.
It should be understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations. It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments. While the invention has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions may be made therein without departing from the spirit and scope of the invention as defined by the appended claims. Therefore, the protection scope of the invention is subject to the protection scope of the claims.

Claims (10)

1. A method for controlling a page mode of a thermal printer, the method comprising:
acquiring a page mode printing request, wherein the page mode printing request comprises a file to be printed, and carrying out content analysis on the file to be printed to obtain printing content corresponding to the file to be printed;
performing association analysis on the printing content to obtain an association relationship corresponding to the printing content;
determining a target description text corresponding to the file to be printed according to the association relation and the printing content;
determining initial typesetting information corresponding to the file to be printed according to the target description text;
printing and typesetting the file to be printed according to the initial typesetting information to obtain intermediate typesetting information;
screening the intermediate typesetting information to obtain target typesetting information corresponding to the file to be printed;
and obtaining a printing strategy required by the thermal printer when the thermal printer prints the file to be printed according to the target typesetting information, and executing page mode printing operation according to the printing strategy.
2. The method according to claim 1, wherein the print content includes text content, image content and table content, and the performing association analysis on the print content to obtain the association relationship corresponding to the print content includes:
Performing text classification on the text content to obtain a first target text corresponding to the image content and a second target text corresponding to the table content;
generating a first generated image corresponding to the first target text according to a text generated image model, and comparing the first generated image with the image content to obtain a first relation between the first target text and the image content;
generating a second generated image corresponding to the second target text according to the text generated image model, obtaining a corresponding prediction form in the second generated image, and comparing the prediction form with the form content to obtain a second relation between the second target text and the form content;
and determining the association relation corresponding to the printing content according to the first relation and the second relation.
3. The method according to claim 2, wherein the determining the target description text corresponding to the file to be printed according to the association relationship and the print content includes:
obtaining a first duty ratio corresponding to the first target text in the printing content, a second duty ratio corresponding to the second target text in the printing content and a third duty ratio corresponding to the text content in the printing content;
Obtaining a fourth duty ratio corresponding to the image content in the printing content and a fifth duty ratio corresponding to the table content in the printing content;
determining a first descriptive text according to the first duty cycle, the fourth duty cycle and the first relation;
determining a second descriptive text according to the second duty cycle, the fifth duty cycle and the second relationship;
determining a third descriptive text according to the first duty ratio, the second duty ratio and the third duty ratio;
and determining a target description text corresponding to the file to be printed according to the first description text, the second description text and the third description text.
4. The method according to claim 1, wherein the determining initial typesetting information corresponding to the file to be printed according to the target description text includes:
the target description text passes through a text description layer of a template generation model, and a description vector corresponding to the target description text is obtained;
the description vector passes through a template generation layer corresponding to the template generation model to obtain template information corresponding to the description vector;
and determining initial typesetting information corresponding to the file to be printed in the template information through a template confirmation layer corresponding to the template generation model.
5. The method according to claim 1, wherein the screening the intermediate layout information to obtain the target layout information corresponding to the document to be printed includes:
acquiring a recommendation weight corresponding to the intermediate typesetting information, and determining a recommendation value corresponding to the intermediate typesetting information according to the recommendation weight;
determining the target typesetting information corresponding to the file to be printed according to the recommended value;
wherein calculating the recommendation weight according to the following formula comprises:
w represents the recommended weight corresponding to the intermediate layout information,indicating that the time information corresponding to the intermediate layout information is obtained, < >>Representing the first storage time corresponding to the intermediate typesetting information; v represents the forgetting speed corresponding to the intermediate typesetting information.
6. The method according to claim 1, wherein the obtaining a printing strategy required by the thermal printer when printing the document to be printed according to the target typesetting information includes:
obtaining initial page information corresponding to the target typesetting information;
converting the initial page information into target page information supported by the thermal printer;
And determining a printing strategy required by the file to be printed when printing is performed according to the target page information.
7. The method of claim 6, wherein the initial page information includes a page spacing and a print direction; the obtaining the initial page information corresponding to the target typesetting information comprises the following steps:
obtaining an initial image corresponding to the target typesetting information, and carrying out target recognition on the initial image to obtain a recognition result;
obtaining a target distance corresponding to the initial image according to the identification result, and determining the page space corresponding to the target typesetting information according to the target distance;
and carrying out direction classification on the identification result to obtain the printing direction corresponding to the target typesetting information.
8. A thermal printer page mode control apparatus, comprising:
the data acquisition module is used for acquiring a page mode printing request, wherein the page mode printing request comprises a file to be printed, and content analysis is carried out on the file to be printed to obtain printing content corresponding to the file to be printed;
the relation determining module is used for carrying out association analysis on the printing content to obtain an association relation corresponding to the printing content;
The text determining module is used for determining a target description text corresponding to the file to be printed according to the association relation and the printing content;
the typesetting generation module is used for determining initial typesetting information corresponding to the file to be printed according to the target description text;
the typesetting determining module is used for printing and typesetting the file to be printed according to the initial typesetting information to obtain intermediate typesetting information;
the typesetting screening module is used for screening the intermediate typesetting information to obtain target typesetting information corresponding to the file to be printed;
and the strategy determining module is used for obtaining a printing strategy required by the thermal printer when the file to be printed is printed according to the target typesetting information, and executing page mode printing operation according to the printing strategy.
9. A terminal device, characterized in that the terminal device comprises a processor and a memory;
the memory is used for storing a computer program;
the processor is configured to execute the computer program and to implement the thermal printer page mode control method according to any one of claims 1 to 7 when the computer program is executed.
10. A computer storage medium for computer storage, wherein the computer storage medium stores one or more programs executable by one or more processors to implement the steps of the thermal printer page mode control method of any one of claims 1 to 7.
CN202311738692.5A 2023-12-18 2023-12-18 Thermal printer page mode control method and related device Active CN117420974B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311738692.5A CN117420974B (en) 2023-12-18 2023-12-18 Thermal printer page mode control method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311738692.5A CN117420974B (en) 2023-12-18 2023-12-18 Thermal printer page mode control method and related device

Publications (2)

Publication Number Publication Date
CN117420974A true CN117420974A (en) 2024-01-19
CN117420974B CN117420974B (en) 2024-03-26

Family

ID=89530605

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311738692.5A Active CN117420974B (en) 2023-12-18 2023-12-18 Thermal printer page mode control method and related device

Country Status (1)

Country Link
CN (1) CN117420974B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117666981A (en) * 2024-01-29 2024-03-08 珠海芯烨电子科技有限公司 TTS voice broadcasting method, device and printer
CN117707443A (en) * 2024-02-05 2024-03-15 珠海芯烨电子科技有限公司 Local word stock management method and related device for thermal printer

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103885731A (en) * 2012-12-20 2014-06-25 北大方正集团有限公司 Data printing method and device
JP2015053065A (en) * 2014-10-20 2015-03-19 セイコーエプソン株式会社 Print control server, print control method, and print control program
CN107728967A (en) * 2017-11-13 2018-02-23 成都创慧科达科技有限公司 It is a kind of can Automatic Typesetting printer sharing and printer sharing composition method
US20190014222A1 (en) * 2017-07-06 2019-01-10 Open Text Sa Ulc System and method for controlling the printing of documents, and performing analytics regarding documents printed, in a distributed enterprise environment
CN114063938A (en) * 2020-07-31 2022-02-18 株式会社理光 Print data processing apparatus, printing system, and print data processing method
CN114879920A (en) * 2022-07-12 2022-08-09 北京高德品创科技有限公司 Printing data typesetting method and device, printer, electronic equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103885731A (en) * 2012-12-20 2014-06-25 北大方正集团有限公司 Data printing method and device
JP2015053065A (en) * 2014-10-20 2015-03-19 セイコーエプソン株式会社 Print control server, print control method, and print control program
US20190014222A1 (en) * 2017-07-06 2019-01-10 Open Text Sa Ulc System and method for controlling the printing of documents, and performing analytics regarding documents printed, in a distributed enterprise environment
CN107728967A (en) * 2017-11-13 2018-02-23 成都创慧科达科技有限公司 It is a kind of can Automatic Typesetting printer sharing and printer sharing composition method
CN114063938A (en) * 2020-07-31 2022-02-18 株式会社理光 Print data processing apparatus, printing system, and print data processing method
CN114879920A (en) * 2022-07-12 2022-08-09 北京高德品创科技有限公司 Printing data typesetting method and device, printer, electronic equipment and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117666981A (en) * 2024-01-29 2024-03-08 珠海芯烨电子科技有限公司 TTS voice broadcasting method, device and printer
CN117666981B (en) * 2024-01-29 2024-05-14 珠海芯烨电子科技有限公司 TTS voice broadcasting method, device and printer
CN117707443A (en) * 2024-02-05 2024-03-15 珠海芯烨电子科技有限公司 Local word stock management method and related device for thermal printer
CN117707443B (en) * 2024-02-05 2024-04-26 珠海芯烨电子科技有限公司 Local word stock management method and related device for thermal printer

Also Published As

Publication number Publication date
CN117420974B (en) 2024-03-26

Similar Documents

Publication Publication Date Title
CN117420974B (en) Thermal printer page mode control method and related device
US11086918B2 (en) Method and system for multi-label classification
CN107239786B (en) Character recognition method and device
US9626555B2 (en) Content-based document image classification
US9892342B2 (en) Automatic image product creation for user accounts comprising large number of images
CN105718428B (en) A kind of output method and output device of text
CN112036295B (en) Bill image processing method and device, storage medium and electronic equipment
CN110533079B (en) Method, apparatus, medium, and electronic device for forming image sample
JP6795195B2 (en) Character type estimation system, character type estimation method, and character type estimation program
US10956713B2 (en) High recall additive pattern recognition for image and other applications
CN117389492B (en) Thermal printer order reminding method and related device
CN110738262A (en) Text recognition method and related product
US11675966B2 (en) Table of contents generation
CN111630521A (en) Image processing method and image processing system
CN117472301B (en) Thermal printer buffer printing method and related device
US20220269898A1 (en) Information processing device, information processing system, information processing method, and non-transitory computer readable medium
CN117707444A (en) Cloud printer abnormal state discernment maintenance management system
EP1978727B1 (en) Automatic colorization of monochromatic printer documents
CN112651392A (en) Certificate information acquisition method and device, storage medium and computer equipment
US9594946B2 (en) Image product creation based on face images grouped using image product statistics
EP4191433A1 (en) Method, device, and system for analyzing unstructured document
US9495617B2 (en) Image product creation based on face images grouped using image product statistics
CN114581900A (en) Method and device for identifying video subtitles, electronic equipment and storage medium
CN112882665A (en) Method and device for generating printing template, electronic equipment and storage medium
CN117931106B (en) Cloud printer data processing method and related device based on edge computing

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