CN111176590B - Printing method, device, apparatus and computer readable storage medium based on adaptation - Google Patents

Printing method, device, apparatus and computer readable storage medium based on adaptation Download PDF

Info

Publication number
CN111176590B
CN111176590B CN201911403809.8A CN201911403809A CN111176590B CN 111176590 B CN111176590 B CN 111176590B CN 201911403809 A CN201911403809 A CN 201911403809A CN 111176590 B CN111176590 B CN 111176590B
Authority
CN
China
Prior art keywords
data
printing
sub
identifier
type identifier
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911403809.8A
Other languages
Chinese (zh)
Other versions
CN111176590A (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.)
Shenzhen Micropurchase Technology Co ltd
Original Assignee
Shenzhen Micropurchase 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 Shenzhen Micropurchase Technology Co ltd filed Critical Shenzhen Micropurchase Technology Co ltd
Priority to CN201911403809.8A priority Critical patent/CN111176590B/en
Publication of CN111176590A publication Critical patent/CN111176590A/en
Application granted granted Critical
Publication of CN111176590B publication Critical patent/CN111176590B/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/1242Image or content composition onto a page
    • G06F3/1243Variable data printing, e.g. document forms, templates, labels, coupons, advertisements, logos, watermarks, transactional printing, fixed content versioning
    • 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/1244Job translation or job parsing, e.g. page banding

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)
  • Accessory Devices And Overall Control Thereof (AREA)

Abstract

The invention discloses a printing method, equipment and a computer readable storage medium based on adaptation, wherein the method comprises the following steps: when a print request is received, determining print type information of the print request; acquiring preset template data, analyzing the preset template data, and generating target template data adapted to the printing type information; and adding the printing data corresponding to the printing request into the target template data, generating data to be printed, and printing the data to be printed. According to the invention, through setting the preset template data and the printing type information adaptation of the universality, the corresponding target template data can be adapted to each type of printer and each type of printing file for printing, so that different software is prevented from being switched due to different printing equipment, and the use of a user is facilitated.

Description

Printing method, device, apparatus and computer readable storage medium based on adaptation
Technical Field
The present invention relates to the field of internet technologies, and in particular, to an adaptation-based printing method, apparatus, device, and computer readable storage medium.
Background
The development of internet technology brings great convenience to the life of people, more and more people tend to shop through an internet platform, and the rapid development of application software supporting internet shopping is promoted. In the internet shopping process, a seller typically posts goods to a buyer through an express way, and the express way needs to print an express bill and a sales bill.
Printing devices for printing express orders and sales orders are currently provided on the market, and the types of the printing devices are different, and software for supporting printing of the printing devices is also different. In the using process, if other printing equipment is connected, the seller needs to replace the software at the same time, and the printing of the express bill and the sales bill also need to be frequently switched between the software. As such, the user is inconvenienced.
Disclosure of Invention
The invention mainly aims to provide an adaptive printing method, an adaptive printing device, an adaptive printing equipment and a computer readable storage medium, and aims to solve the technical problem that in the prior art, because software supporting various printing equipment to print is different, the software is replaced or switched, and the user is inconvenient to use.
In order to achieve the above object, the present invention provides an adaptation-based printing method, comprising the steps of:
when a print request is received, determining print type information of the print request;
acquiring preset template data, analyzing the preset template data, and generating target template data adapted to the printing type information;
and adding the printing data corresponding to the printing request into the target template data, generating data to be printed, and printing the data to be printed.
Optionally, the step of obtaining preset template data and analyzing the preset template data to generate target template data adapted to the print type information includes:
acquiring preset template data, and respectively reading a device type identifier and an instruction type identifier in the printing type information;
analyzing the preset template data according to the equipment type identifier to generate equipment template data adapted to the equipment type identifier;
and analyzing the equipment template data according to the instruction type identifier to generate the target template data.
Optionally, the step of analyzing the preset template data according to the equipment type identifier and generating the equipment template data adapted to the equipment type identifier includes:
if the equipment type identifier is a sales order identifier, searching first sub-data corresponding to the sales order identifier in the preset template data, and generating each first sub-data into the equipment template data;
if the equipment type identifier is an electronic face list identifier, second sub-data corresponding to the electronic face list identifier in the preset template data are searched, and the second sub-data are generated into the equipment template data.
Optionally, the step of parsing the device template data according to the instruction type identifier to generate the target template data includes:
analyzing the equipment template data into a plurality of items of sub-data, and searching target sub-data corresponding to the instruction type identifier in the plurality of items of sub-data;
and according to the typesetting mode corresponding to the instruction type identifier, arranging each target sub-data to generate the target template data.
Optionally, the step of adding the print data corresponding to the print request to the target template data, and generating the data to be printed includes:
Reading the printing data corresponding to the printing request and the data codes of the target sub-data;
determining printing sub-data corresponding to each target sub-data in the printing data according to each data code;
and adding the printing data to the target template data according to the printing sub data respectively corresponding to the target sub data to generate data to be printed.
Optionally, when the print request is received, the step of determining the print type information of the print request includes:
when a print request is received, acquiring a device identifier corresponding to the print request, and judging whether the device identifier exists in a preset storage unit or not;
and if the device type identification and the instruction type identification exist in the preset storage unit, determining the device type identification and the instruction type identification corresponding to the device identification in the preset storage unit as the printing type information.
Optionally, the step of determining whether the device identifier exists in a preset storage unit includes:
if the device type identifier does not exist in the preset storage unit, acquiring the device type identifier and the instruction type identifier corresponding to the device identifier based on a preset network;
And determining the equipment type identifier and the instruction type identifier as the printing type information, and storing the equipment identifier, the equipment type identifier and the instruction type identifier in the preset storage unit.
Further, to achieve the above object, the present invention also provides an adaptation-based printing apparatus, including:
a determining module, configured to determine, when a print request is received, print type information of the print request;
the analysis module is used for acquiring preset template data, analyzing the preset template data and generating target template data which is matched with the printing type information;
and the printing module is used for adding the printing data corresponding to the printing request into the target template data, generating data to be printed, and printing the data to be printed.
Further, to achieve the above object, the present invention also provides an adaptation-based printing apparatus, which includes a memory, a processor, and an adaptation-based printing program stored on the memory and executable on the processor, the adaptation-based printing program implementing the steps of the adaptation-based printing method as described above when executed by the processor.
Further, to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon an adaptation-based printing program which, when executed by a processor, implements the steps of the adaptation-based printing method as described above.
When a printing request is received, the printing type information is determined firstly, so that the type of a printer and the type of a printing file aimed at by the printing request are reflected through the printing type information; acquiring preset template data which are preset for all printers and all types of printing files in advance, and analyzing the preset template data to obtain target template data which are matched with the printing type information, wherein the target template data are applicable to printing of the printer type and the printing file type represented by the printing type information; and then adding the print data carried by the print request to the target template data to generate data to be printed for printing. Through setting up the preset template data and the printing type information adaptation of commonality for can all adapt to corresponding target template data to each type printer and each type printing file and print, avoid switching different software because of printing equipment's difference, made things convenient for user's use.
Drawings
FIG. 1 is a schematic diagram of a device hardware operating environment according to an embodiment of an adaptive-based printing device of the present invention;
FIG. 2 is a flow chart of a first embodiment of an adaptation-based printing method according to the present invention;
fig. 3 is a schematic functional block diagram of a printing apparatus according to a preferred embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The invention provides an adaptation-based printing device, and referring to fig. 1, fig. 1 is a schematic structural diagram of a device hardware operation environment related to an embodiment scheme of the adaptation-based printing device.
As shown in fig. 1, the adaptation-based printing device may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
Those skilled in the art will appreciate that the hardware configuration of the adapter-based printing apparatus shown in fig. 1 does not constitute a limitation of the adapter-based printing apparatus, and may include more or fewer components than shown, or may combine certain components, or may be arranged in a different arrangement of components.
As shown in fig. 1, an operating system, a network communication module, a user interface module, and an adaptation-based printing program may be included in a memory 1005, which is a type of computer-readable storage medium. The operating system is a program for managing and controlling the printing equipment and the software resources based on the adaptation, and supports the operation of a network communication module, a user interface module, the printing program based on the adaptation and other programs or software; the network communication module is used to manage and control the network interface 1004; the user interface module is used to manage and control the user interface 1003.
In the hardware structure of the printing device based on adaptation shown in fig. 1, the network interface 1004 is mainly used for connecting to a background server, and performing data communication with the background server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; the processor 1001 may call an adaptation-based printing program stored in the memory 1005 and perform the following operations:
When a print request is received, determining print type information of the print request;
acquiring preset template data, analyzing the preset template data, and generating target template data adapted to the printing type information;
and adding the printing data corresponding to the printing request into the target template data, generating data to be printed, and printing the data to be printed.
Further, the step of obtaining preset template data and analyzing the preset template data to generate target template data adapted to the printing type information includes:
acquiring preset template data, and respectively reading a device type identifier and an instruction type identifier in the printing type information;
analyzing the preset template data according to the equipment type identifier to generate equipment template data adapted to the equipment type identifier;
and analyzing the equipment template data according to the instruction type identifier to generate the target template data.
Further, the step of parsing the preset template data according to the device type identifier, and generating device template data adapted to the device type identifier includes:
If the equipment type identifier is a sales order identifier, searching first sub-data corresponding to the sales order identifier in the preset template data, and generating each first sub-data into the equipment template data;
if the equipment type identifier is an electronic face list identifier, second sub-data corresponding to the electronic face list identifier in the preset template data are searched, and the second sub-data are generated into the equipment template data.
Further, the step of parsing the device template data according to the instruction type identifier to generate the target template data includes:
analyzing the equipment template data into a plurality of items of sub-data, and searching target sub-data corresponding to the instruction type identifier in the plurality of items of sub-data;
and according to the typesetting mode corresponding to the instruction type identifier, arranging each target sub-data to generate the target template data.
Further, the step of adding the print data corresponding to the print request to the target template data, and generating the data to be printed includes:
reading the printing data corresponding to the printing request and the data codes of the target sub-data;
Determining printing sub-data corresponding to each target sub-data in the printing data according to each data code;
and adding the printing data to the target template data according to the printing sub data respectively corresponding to the target sub data to generate data to be printed.
Further, when a print request is received, the step of determining print type information of the print request includes:
when a print request is received, acquiring a device identifier corresponding to the print request, and judging whether the device identifier exists in a preset storage unit or not;
and if the device type identification and the instruction type identification exist in the preset storage unit, determining the device type identification and the instruction type identification corresponding to the device identification in the preset storage unit as the printing type information.
Further, after the step of determining whether the device identifier exists in the preset storage unit, the processor 1001 may call the adaptation-based printing program stored in the memory 1005, and perform the following operations:
if the device type identifier does not exist in the preset storage unit, acquiring the device type identifier and the instruction type identifier corresponding to the device identifier based on a preset network;
And determining the equipment type identifier and the instruction type identifier as the printing type information, and storing the equipment identifier, the equipment type identifier and the instruction type identifier in the preset storage unit.
The specific implementation of the printing device based on the adaptation is basically the same as the following embodiments of the printing method based on the adaptation, and will not be described herein.
The invention further provides a printing method based on the adaptation.
Referring to fig. 2, fig. 2 is a schematic flow chart of a first embodiment of the adaptation-based printing method according to the present invention.
The embodiments of the present invention provide embodiments of an adaptation-based printing method, it being noted that although a logical order is shown in the flowchart, in some cases the steps shown or described may be performed in a different order than what is shown or described herein. Specifically, the adaptation-based printing method in the present embodiment includes:
step S10, when a print request is received, determining print type information of the print request;
the printing method based on the adaptation in the embodiment is applied to a server in communication connection with a terminal, is suitable for adapting different types of printers in communication connection with the terminal through the server, and achieves printing of printing data. The terminal can be a mobile terminal such as a tablet personal computer and a mobile phone, and can also be wearable equipment such as an intelligent bracelet and an intelligent watch. When receiving a print request initiated by a third party application installed on the terminal, the server can adapt to a printer in communication connection with the terminal to print the print data carried by the print request. The printing can be performed in an adaptive manner for printers of different types suitable for office scenes, and also can be performed in an adaptive manner for printers of different types used for printing express orders or sales orders in online shopping express scenes.
Further, the terminal user initiates a print request through the third party application, and when the server receives the print request, the server determines the print type information carried by the print request. The printing type information at least comprises two types of information used for representing the type of the printer connected with the terminal and printing file type information required to be printed. For the printer model, after the terminal is connected with the printer, the connection relationship is established between the terminal and the printer. When a user initiates a print request, the terminal automatically detects the printer connected with the terminal, and then adds the printer type connected with the terminal to the print request. For the print file type information, the print file types in the online shopping express scene comprise an express bill type and a sales bill type, and the two types of files are printed by different types of printers. The type of the print file can be determined to be added to the print request by detecting the type of the printer connected with the terminal; or the user automatically selects the type of print file required when initiating a print request. The method comprises the steps that first information representing the types of printing files and second information representing the types of printers are preset in a server, after a printing request is received, the server reads file information which is carried by the server and is used for representing the types of the required printing files and printer information representing the types of the connected printers, and the file information is compared with the first information to determine the types of the required printing files; and meanwhile, comparing the printer information with the second information to determine the connected and matched printer type, wherein the determined printing file type and the matched printer type jointly form printing type information of a printing request.
Step S20, obtaining preset template data, analyzing the preset template data, and generating target template data adapted to the printing type information;
further, general preset template data suitable for printing by each type of printer is preset, and the preset template data can be stored in a database of the server or a storage unit with a communication connection relation with the server. After the printing type information is determined, the preset template data is requested to be acquired from a database or a storage unit, and the preset template data is analyzed according to the printing type information to generate target template data which is matched with the printing type information. Namely, the data suitable for printing the type of the printing file and the data suitable for the model of the printer are analyzed from the preset template data, and the data are used as target template data for printing. If the preset template data respectively include data sets a and B suitable for printing express sheets and sales sheets, the data set a further includes sub-data sets q1, q2, q3 respectively suitable for printers p1, p2, p3, and the data set B includes data q4, q5, q6 respectively suitable for printers p1, p2, p 3. If the type of the print file required by the representation of the print type information is an express bill and the type of the adapted printer is p2, analyzing the preset template data, screening a data group A from the data group A, and searching a data group q2 from the data group A as target template data adapted to the print type information.
It should be noted that, in the preset template data, data applicable to different print file types and printer models may exist in the form of a data function block, and is not limited to a data set. The data set for realizing the same function of each printer is set up in a data set which is not suitable for distinguishing the data of the same printer by using the identifier of each printer, and the target template data matched with the printing type information is searched by the identifier.
And step S30, adding the printing data corresponding to the printing request to the target template data, generating data to be printed, and printing the data to be printed.
Understandably, the print request initiated by the terminal user through the third party terminal carries the print data representing the required print, after the target template data is generated, the print data carried by the print request is read, the print data is added into the target template data according to the one-to-one correspondence between the print data and the data in the target template data, and the data to be printed is generated for printing, namely, the print of the print data required by the print request is realized. If the printer connected with the subsequent terminal is replaced or more other printers are connected, the target template data suitable for the replaced printer or the newly connected printer is analyzed from the preset template data, and the printing data carried by the printing request is added to the target data, so that the adaptive printing of different printers can be realized, and the printing of a terminal user is facilitated.
When a printing request is received, the printing type information is determined firstly, so that the type of a printer and the type of a printing file aimed at by the printing request are reflected through the printing type information; acquiring preset template data which are preset for all printers and all types of printing files in advance, and analyzing the preset template data to obtain target template data which are matched with the printing type information, wherein the target template data are applicable to printing of the printer type and the printing file type represented by the printing type information; and then adding the print data carried by the print request to the target template data to generate data to be printed for printing. Through setting up the preset template data and the printing type information adaptation of commonality for can all adapt to corresponding target template data to each type printer and each type printing file and print, avoid switching different software because of printing equipment's difference, made things convenient for user's use.
Further, a second embodiment of the adaptation-based printing method of the present invention is presented.
The difference between the second embodiment of the printing method based on adaptation and the first embodiment of the printing method based on adaptation is that the step of obtaining preset template data and analyzing the preset template data to generate target template data adapted to the printing type information includes:
Step S21, acquiring preset template data, and respectively reading a device type identifier and an instruction type identifier in the printing type information;
step S22, analyzing the preset template data according to the equipment type identifier to generate equipment template data adapted to the equipment type identifier;
in this embodiment, the target template data is obtained by analyzing the preset template data of the general type, and the print data is added to the target template data to generate the data to be printed so as to realize the adaptive printing. Specifically, the print file type and the adapted printer model constituting the print type information exist in the print type information in the form of a device type identifier and an instruction type identifier, respectively. After the server acquires the preset template data, the device type identifier and the instruction type identifier in the printing type information are respectively read to be used for respectively determining the type of the printing file to be printed and the printing instruction of the type requirement of the adapted printer.
Further, the preset template data is analyzed according to the equipment type identifier, and data for printing the sales bill and the express bill in the preset template data are searched to generate equipment template data matched with the equipment type identifier. The preset template data are used for setting different types of identifiers for the data for printing different types of printing files, and the data matched with the device type identifiers can be analyzed through the different types of identifiers. Specifically, the step of analyzing the preset template data according to the equipment type identifier and generating the equipment template data adapted to the equipment type identifier includes:
Step S221, if the equipment type identifier is a sales order identifier, searching first sub-data corresponding to the sales order identifier in the preset template data, and generating each first sub-data into the equipment template data;
step S222, if the device type identifier is an electronic face list identifier, searching second sub-data corresponding to the electronic face list identifier in the preset template data, and generating each second sub-data into the device template data.
Furthermore, the sales bill and the express bill contained in the print file type are characterized by a sales bill identifier and an electronic surface bill identifier respectively, and the data used for printing the sales bill in the preset template data all carry the sales bill identifier and the data used for printing the express bill all carry the electronic surface bill identifier. After the device type identifier in the print type information is read, the device type identifier is identified to determine the type of the print file characterized by the device type identifier. If the equipment type identifier is a sales list identifier, the current need of printing the sales list is indicated, and accordingly data carrying the sales list identifier in preset template data are searched and used as first sub-data corresponding to the sales list identifier. After all the first sub-data in the preset template data are found, each piece of first sub-data is added into a preset template which is preset and used for printing the sales bill, and the sales bill is printed as equipment template data.
Further, if the identified equipment type identifier is an electronic face list identifier, indicating that the express bill is required to be printed currently, searching data carrying the electronic face list identifier in preset template data as second sub-data corresponding to the electronic face list identifier. After all second sub-data in the preset template data are found, each second sub-data is added into a preset template which is preset and used for printing the express bill, and the second sub-data are formed into equipment template data so as to print the express bill.
And S23, analyzing the equipment template data according to the instruction type identifier to generate the target template data.
Further, after generating the device template data for printing the type of the print file according to the device type identifier, resolving the device template data again according to the printing instruction which is characterized by the instruction type identifier and is suitable for the type of the printer, searching the device template data for the type of the printer and suitable for printing, and generating all the searched data into target template data. Specifically, according to the instruction type identifier, the step of analyzing the equipment template data to generate target template data includes:
Step S231, analyzing the equipment template data into a plurality of pieces of sub-data, and searching target sub-data corresponding to the instruction type identifier in the plurality of pieces of sub-data;
step S232, arranging each target sub-data according to the typesetting mode corresponding to the instruction type identifier, and generating the target template data.
Further, analyzing the equipment template data to generate a plurality of sub-data; the different sub-data carries sub-identifiers representing the respective applicable printer models, and each sub-data may carry a plurality of sub-identifiers to represent that the sub-data is applicable to printers of a plurality of models. Processing each item of sub data one by one, comparing sub identifications carried by the sub data with the instruction type identifications, and determining whether the sub identifications consistent with the instruction type identifications are contained in the sub identifications. If the sub-identification consistent with the instruction type identification is included, judging that the sub-data is applicable to the printer model characterized by the instruction type identification; if the sub-identification consistent with the instruction type identification is not included, judging that the sub-data is not applicable to the printer model characterized by the instruction type identification. After the child identifiers carried by the current child data are compared with the instruction type identifiers, comparing the child identifiers carried by the next child data with the instruction type identifiers until the child identifiers carried by the child data are compared with the instruction type identifiers, and obtaining the child data which are suitable for the printer model represented by the instruction type identifiers in the child data and serve as target child data corresponding to the instruction type identifiers.
Furthermore, different types of printers have different arrangement requirements on the print data in the process of printing the print data, and the typesetting requirements are represented by the typesetting mode in the implementation. And reading the typesetting mode corresponding to the instruction type identifier to determine the typesetting requirement of the printer model represented by the instruction type identifier. And typesetting the searched target sub-data according to the typesetting mode to obtain target template data so as to facilitate adding the printing data into the target template data according to typesetting required by a printer to generate data to be printed for printing. Specifically, the step of adding print data corresponding to the print request to the target template data, the step of generating data to be printed includes:
step S31, reading the printing data corresponding to the printing request and the data codes of the target sub-data;
step S32, according to the data codes, determining printing sub-data corresponding to each target sub-data in the printing data;
and step S33, adding the printing data to the target template data according to the printing sub data respectively corresponding to the target sub data, and generating data to be printed.
Further, each item of target sub-data for generating the target template data carries different data codes so as to represent the type of each item of target sub-data. And reading the data codes of the target sub-data while reading the print data carried by the print request, so as to determine the data for printing required to be added by the target sub-data through the data codes. Specifically, the print data includes various print sub-data for printing, after the data codes of various target sub-data are read, the print data are searched according to the data codes, and the print sub-data corresponding to the target sub-data in the print data, namely the data for printing, which are required to be added by the target sub-data, are determined. When the codes are consistent with the data codes of the target sub data, a mapping relation is established between the print sub data consistent with the codes and the target sub data as the print sub data corresponding to the target sub data, so that the print sub data corresponding to each target sub data in the print data is determined. And adding the printing sub-data into the target sub-data according to the mapping relation between the printing sub-data and the target sub-data until each item of printing sub-data is added into the target sub-data with the mapping relation, so as to realize that the printing data is added into the target data template according to the printing sub-data corresponding to each item of target sub-data, and generate the data to be printed for printing.
According to the embodiment, the preset template data are analyzed to generate equipment template data, so that different file printing types are adapted; and the device template data is analyzed again to generate target template data so as to adapt to different printer models. And then the print data required to be printed in the print request is added into the target template data to generate data to be printed for printing, so that multi-type printing adaptation of different types of files, multi-device printing adaptation of different types of printers and adaptation for sending the print request to different third parties are realized, and the use of users is facilitated through omnibearing adaptation.
Further, a third embodiment of the adaptation-based printing method of the present invention is presented.
The third embodiment of the adaptation-based printing method is different from the first or second embodiment of the adaptation-based printing method in that, when a print request is received, the step of determining print type information of the print request includes:
step S11, when a print request is received, acquiring a device identifier corresponding to the print request, and judging whether the device identifier exists in a preset storage unit;
Step S12, if the device type identifier and the instruction type identifier exist in the preset storage unit, determining the device type identifier and the instruction type identifier corresponding to the device identifier in the preset storage unit as the print type information.
In order to facilitate quick determination of the type of the print file and the type of the printer represented by the print request, the embodiment is provided with a mechanism for storing a device type identifier carried by the print request and used for representing the type of the file to be printed and an instruction type identifier used for representing the type of the connected printer. Specifically, when the terminal user initiates a print request through a third party application, the printer model number connected by the terminal is simply called a device identifier and is added to the print request to be sent to the server. After receiving the print request, the server reads the device identifier carried by the print request and judges whether the device identifier exists in a preset storage unit. The preset storage unit is a unit preset for storage. If the equipment identifier exists in the preset storage unit, the fact that printing operation is performed on the type of the printer before, file type information representing printing supported by the type of the printer and the type number of the printer are stored in the preset storage unit in a full scale mode in the printing process, namely, the equipment type identifier and the instruction type identifier are stored in the preset storage unit. At this time, the device type identifier and the instruction type identifier corresponding to the device identifier are directly read from the preset storage unit, and are determined to be printing type information, so as to represent the required printing file type and the connected printer model.
Further, in the case where a print operation has not been performed for a printer model characterized by the device identification before, a mechanism is provided to acquire print type information from the network. Specifically, the step of determining whether the device identifier exists in the preset storage unit includes:
step S13, if the device type identifier does not exist in the preset storage unit, acquiring the device type identifier and the instruction type identifier corresponding to the device identifier based on a preset network;
and step S14, determining the equipment type identifier and the instruction type identifier as the printing type information, and storing the equipment identifier, the equipment type identifier and the instruction type identifier in the preset storage unit.
If the equipment identification is judged not to exist in the preset storage unit, file type information of the printer supported by the type represented by the equipment identification and the printer type are not stored in the preset storage unit. At the moment, the device identifier is used as a search keyword for short, and the device type identifier used for representing file type information of printing supported by the printer of the type and the instruction type identifier used for representing the full name of the printer type are searched from a preset network. The preset network is a preset network for remote communication, and may be the internet used by the public, or a private network used by the private, or the like.
Further, the acquired device type identifier and instruction type identifier are determined together as print type information to print the print data in the print request. Simultaneously, the equipment identifier, the equipment type identifier and the instruction type identifier are stored in a preset storage unit, so that the equipment type instruction and the instruction type identifier are read from the preset storage unit according to the equipment identifier to serve as printing type information, and printing of printing data in a printing request is realized.
According to the embodiment, by setting the mechanism for storing the equipment type identifier and the instruction type identifier in the preset storage unit, the equipment identifier for representing the printer model is directly obtained from the preset storage unit as the printing type information, so that the printing file type and the printer model represented by the printing request can be quickly determined after the printing request is received, and the printing efficiency is improved.
The invention further provides a printing device based on the adaptation.
Referring to fig. 3, fig. 3 is a schematic functional block diagram of a first embodiment of an adaptation-based printing device according to the present invention. The adaptation-based printing device comprises:
a determining module 10 for determining, when a print request is received, print type information of the print request;
The parsing module 20 is configured to obtain preset template data, parse the preset template data, and generate target template data adapted to the print type information;
and a printing module 30, configured to add print data corresponding to the print request to the target template data, generate data to be printed, and print the data to be printed.
Further, the parsing module 20 includes:
the first acquisition unit is used for acquiring preset template data and respectively reading the equipment type identifier and the instruction type identifier in the printing type information;
the first analyzing unit is used for analyzing the preset template data according to the equipment type identifier and generating equipment template data matched with the equipment type identifier;
and the second analyzing unit is used for analyzing the equipment template data according to the instruction type identifier to generate the target template data.
Further, the first parsing unit is further configured to:
if the equipment type identifier is a sales order identifier, searching first sub-data corresponding to the sales order identifier in the preset template data, and generating each first sub-data into the equipment template data;
If the equipment type identifier is an electronic face list identifier, second sub-data corresponding to the electronic face list identifier in the preset template data are searched, and the second sub-data are generated into the equipment template data.
Further, the second parsing unit is further configured to:
analyzing the equipment template data into a plurality of items of sub-data, and searching target sub-data corresponding to the instruction type identifier in the plurality of items of sub-data;
and according to the typesetting mode corresponding to the instruction type identifier, arranging each target sub-data to generate the target template data.
Further, the printing module 30 further includes:
a reading unit configured to read print data corresponding to the print request and a data code of each of the target sub-data;
a first determining unit configured to determine print sub-data corresponding to each of the target sub-data in the print data, respectively, according to each of the data codes;
and the adding unit is used for adding the printing data to the target template data according to the printing sub-data respectively corresponding to the target sub-data to generate data to be printed.
Further, the determining module 10 further includes:
The judging unit is used for acquiring the equipment identifier corresponding to the printing request when the printing request is received and judging whether the equipment identifier exists in the preset storage unit or not;
and the second determining unit is used for determining the equipment type identifier and the instruction type identifier corresponding to the equipment identifier in the preset storage unit as the printing type information if the equipment identifier and the instruction type identifier exist in the preset storage unit.
Further, the determining module 10 further includes:
the second acquisition unit is used for acquiring the equipment type identifier and the instruction type identifier corresponding to the equipment identifier based on a preset network if the equipment identifier does not exist in the preset storage unit;
and the storage unit is used for determining the equipment type identifier and the instruction type identifier as the printing type information and storing the equipment identifier, the equipment type identifier and the instruction type identifier in the preset storage unit.
The specific implementation of the printing device based on the adaptation is basically the same as the above embodiments of the printing method based on the adaptation, and will not be described herein.
In addition, the embodiment of the invention also provides a computer readable storage medium.
The computer readable storage medium has stored thereon an adaptation-based printing program which, when executed by a processor, implements the steps of the adaptation-based printing method as described above.
The specific implementation of the computer readable storage medium of the present invention is basically the same as the above embodiments of the printing method based on adaptation, and will not be described herein again.
While the embodiments of the present invention have been described above with reference to the drawings, the present invention is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many modifications may be made thereto by those of ordinary skill in the art without departing from the spirit of the present invention and the scope of the appended claims, which are to be accorded the full scope of the present invention as defined by the following description and drawings, or by any equivalent structures or equivalent flow changes, or by direct or indirect application to other relevant technical fields.

Claims (8)

1. An adaptation-based printing method, characterized in that the adaptation-based printing method comprises the steps of:
when a print request initiated by a terminal user through a third party application is received, determining print type information of the print request, wherein the print request comprises a model of a printer in a connection state with the terminal;
Acquiring preset template data, and respectively reading a device type identifier and an instruction type identifier in the printing type information, wherein the preset template data comprises data in the form of a data function block;
analyzing the preset template data according to the equipment type identifier to generate equipment template data adapted to the equipment type identifier;
analyzing the equipment template data into a plurality of items of sub data, wherein each item of sub data correspondingly carries a sub identifier, and the sub identifier is used for representing the printer model applicable to the equipment type identifier;
comparing the sub-identifiers carried by each item of sub-data with the instruction type identifier, and if the sub-identifiers are consistent with the instruction type identifier, judging that the corresponding sub-data is applicable to the printer model represented by the instruction type identifier;
the sub data which is applicable to the printer model represented by the instruction type identifier in each item of sub data is used as target sub data corresponding to the instruction type identifier;
according to the typesetting mode corresponding to the instruction type identifier, arranging all the target sub-data to generate target template data;
and adding the printing data corresponding to the printing request into the target template data, generating data to be printed, and printing the data to be printed.
2. The adaptation-based printing method of claim 1, wherein the parsing the preset template data according to the device type identifier, and generating device template data adapted to the device type identifier, comprises:
if the equipment type identifier is a sales order identifier, searching first sub-data corresponding to the sales order identifier in the preset template data, and generating each first sub-data into the equipment template data;
if the equipment type identifier is an electronic face list identifier, second sub-data corresponding to the electronic face list identifier in the preset template data are searched, and the second sub-data are generated into the equipment template data.
3. The adaptation-based printing method according to claim 1, wherein the step of adding print data corresponding to the print request to the target template data, generating data to be printed, comprises:
reading the printing data corresponding to the printing request and the data codes of the target sub-data;
determining printing sub-data corresponding to each target sub-data in the printing data according to each data code;
And adding the printing data to the target template data according to the printing sub data respectively corresponding to the target sub data to generate data to be printed.
4. An adaptation-based printing method according to any one of claims 1-3, wherein said step of determining the print type information of a print request when receiving a print request initiated by an end user via a third party application comprises:
when a print request initiated by a third party application by a terminal user is received, acquiring a device identifier corresponding to the print request, and judging whether the device identifier exists in a preset storage unit or not;
and if the device type identification and the instruction type identification exist in the preset storage unit, determining the device type identification and the instruction type identification corresponding to the device identification in the preset storage unit as the printing type information.
5. The adaptation-based printing method according to claim 4, wherein the step of determining whether the device identifier exists in a preset storage unit comprises:
if the device type identifier does not exist in the preset storage unit, acquiring the device type identifier and the instruction type identifier corresponding to the device identifier based on a preset network;
And determining the equipment type identifier and the instruction type identifier as the printing type information, and storing the equipment identifier, the equipment type identifier and the instruction type identifier in the preset storage unit.
6. An adaptation-based printing device, the adaptation-based printing device comprising:
a determining module, configured to determine, when a print request initiated by a third party application by a terminal user is received, print type information of the print request, where the print request includes a model of a printer in a connection state with the terminal;
an parsing module, the parsing module comprising:
the first acquisition unit is used for acquiring preset template data and respectively reading the equipment type identifier and the instruction type identifier in the printing type information, wherein the preset template data comprises data in the form of a data function block;
the first analyzing unit is used for analyzing the preset template data according to the equipment type identifier and generating equipment template data matched with the equipment type identifier;
the second analysis unit is further used for analyzing the equipment template data into a plurality of items of sub-data, wherein each item of sub-data correspondingly carries a sub-identifier, and the sub-identifier is used for representing the printer model applicable to the equipment type identifier; comparing the sub-identifiers carried by each item of sub-data with the instruction type identifier, and if the sub-identifiers are consistent with the instruction type identifier, judging that the corresponding sub-data is applicable to the printer model represented by the instruction type identifier; the sub data which is applicable to the printer model represented by the instruction type identifier in each item of sub data is used as target sub data corresponding to the instruction type identifier; according to the typesetting mode corresponding to the instruction type identifier, arranging all the target sub-data to generate target template data;
And the printing module is used for adding the printing data corresponding to the printing request into the target template data, generating data to be printed, and printing the data to be printed.
7. An adaptation-based printing device, characterized in that it comprises a memory, a processor and an adaptation-based printing program stored on the memory and executable on the processor, which adaptation-based printing program, when executed by the processor, implements the steps of the adaptation-based printing method according to any of claims 1-5.
8. A computer readable storage medium, characterized in that it has stored thereon an adaptation-based printing program, which when executed by a processor implements the steps of the adaptation-based printing method according to any of claims 1-5.
CN201911403809.8A 2019-12-27 2019-12-27 Printing method, device, apparatus and computer readable storage medium based on adaptation Active CN111176590B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911403809.8A CN111176590B (en) 2019-12-27 2019-12-27 Printing method, device, apparatus and computer readable storage medium based on adaptation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911403809.8A CN111176590B (en) 2019-12-27 2019-12-27 Printing method, device, apparatus and computer readable storage medium based on adaptation

Publications (2)

Publication Number Publication Date
CN111176590A CN111176590A (en) 2020-05-19
CN111176590B true CN111176590B (en) 2024-03-19

Family

ID=70646515

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911403809.8A Active CN111176590B (en) 2019-12-27 2019-12-27 Printing method, device, apparatus and computer readable storage medium based on adaptation

Country Status (1)

Country Link
CN (1) CN111176590B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112035076A (en) * 2020-08-25 2020-12-04 上海中通吉网络技术有限公司 JSON-based printing analysis method, device, equipment and printing system
CN112044801B (en) * 2020-08-27 2022-07-22 上海哥瑞利软件股份有限公司 Sorting machine cleaning management method and system
CN112496553A (en) * 2020-11-20 2021-03-16 航天信息股份有限公司 Method and system for printing card based on printing template
WO2024043924A1 (en) * 2022-08-22 2024-02-29 Hewlett-Packard Development Company, L.P. Presets for image generation devices
CN118192906A (en) * 2022-12-14 2024-06-14 北京京东振世信息技术有限公司 Electronic bill processing method, device, equipment and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101966783A (en) * 2009-07-27 2011-02-09 中兴通讯股份有限公司 Transaction evidence printing method and system
CN106940628A (en) * 2016-01-04 2017-07-11 平安科技(深圳)有限公司 Document Method of printing and device
CN108319435A (en) * 2018-01-24 2018-07-24 北京三快在线科技有限公司 Method of printing, device and the electronic equipment of bill
CN108509158A (en) * 2017-07-25 2018-09-07 平安科技(深圳)有限公司 Declaration form Method of printing, device, storage medium and computer equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4375085B2 (en) * 2004-03-30 2009-12-02 ブラザー工業株式会社 Display printing system, program, and recording medium
JP2018069512A (en) * 2016-10-27 2018-05-10 セイコーエプソン株式会社 Printer and control method for the same

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101966783A (en) * 2009-07-27 2011-02-09 中兴通讯股份有限公司 Transaction evidence printing method and system
CN106940628A (en) * 2016-01-04 2017-07-11 平安科技(深圳)有限公司 Document Method of printing and device
CN108509158A (en) * 2017-07-25 2018-09-07 平安科技(深圳)有限公司 Declaration form Method of printing, device, storage medium and computer equipment
CN108319435A (en) * 2018-01-24 2018-07-24 北京三快在线科技有限公司 Method of printing, device and the electronic equipment of bill

Also Published As

Publication number Publication date
CN111176590A (en) 2020-05-19

Similar Documents

Publication Publication Date Title
CN111176590B (en) Printing method, device, apparatus and computer readable storage medium based on adaptation
CN110750222A (en) Printing method, printing device, computer equipment and storage medium
WO2018161401A1 (en) Data obtaining method and system for associated report
WO2014032419A1 (en) Method and system for obtaining consultation information based on picture
CN111475788A (en) Cross-border e-commerce platform account registration method, device, terminal and storage medium
US20140368849A1 (en) Information processing apparatus, information processing method, and computer readable medium
CN108039173B (en) Voice information input method, mobile terminal, system and readable storage medium
TWI777070B (en) Binding, migration method and apparatus, computing device and storage medium
US10031706B2 (en) Managing print jobs
US20130254650A1 (en) System for off-line editing a web page
KR102205686B1 (en) Method and apparatus for ranking candiate character and method and device for inputting character
CN111145143B (en) Problem image determining method and device, electronic equipment and storage medium
US20200051036A1 (en) Assisted Assignments in a Digital Concierge System
US20230236779A1 (en) Printing system, printing control apparatus, control method for printing control apparatus, and storage medium
CN110166823B (en) Screen projection method and related device
CN103488745A (en) Information obtaining method and terminal
CN108363707B (en) Method and device for generating webpage
US20190007520A1 (en) Electronic device and operation method thereof and server host device
US20230325904A1 (en) Method and component of processing commodity, electronic device, and computer-readable medium
US20130191545A1 (en) Information sending method, device, and system
CN113256253A (en) Data processing method, device, equipment, computer readable storage medium and product
US20150195237A1 (en) Mail extraction method, mail extraction device, and program
CN111008252A (en) Data synchronization method, device, equipment and computer readable storage medium
CN112104571A (en) Service distribution method, device, computer equipment and computer storage medium
US20140289741A1 (en) Cooperation method, image processing device, and 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