CN114780046A - Printing control method and device, electronic equipment printer and storage medium - Google Patents

Printing control method and device, electronic equipment printer and storage medium Download PDF

Info

Publication number
CN114780046A
CN114780046A CN202210573020.2A CN202210573020A CN114780046A CN 114780046 A CN114780046 A CN 114780046A CN 202210573020 A CN202210573020 A CN 202210573020A CN 114780046 A CN114780046 A CN 114780046A
Authority
CN
China
Prior art keywords
data
printing
protocol
print
printer
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.)
Pending
Application number
CN202210573020.2A
Other languages
Chinese (zh)
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.)
Xiamen Hanyin Electronic Technology Co Ltd
Original Assignee
Xiamen Hanyin 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 Xiamen Hanyin Electronic Technology Co Ltd filed Critical Xiamen Hanyin Electronic Technology Co Ltd
Priority to CN202210573020.2A priority Critical patent/CN114780046A/en
Publication of CN114780046A publication Critical patent/CN114780046A/en
Pending legal-status Critical Current

Links

Images

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/1202Dedicated interfaces to print systems specifically adapted to achieve a particular effect
    • G06F3/1203Improving or facilitating administration, e.g. print management
    • G06F3/1209Improving or facilitating administration, e.g. print management resulting in adapted or bridged legacy communication protocols, e.g. emulation, protocol extension
    • 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
    • G06F3/1247Job translation or job parsing, e.g. page banding by conversion to printer ready format
    • 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/1278Dedicated interfaces to print systems specifically adapted to adopt a particular infrastructure
    • G06F3/1285Remote printer device, e.g. being remote from client or server

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 control method, a printing control device, electronic equipment and a storage medium. The method comprises the following steps: receiving a printing task sent by an upper computer; analyzing the printing task to obtain the data characteristics of the printing task; determining a data analysis protocol corresponding to the printing task according to the data characteristics, and analyzing the printing task according to the data analysis protocol to obtain printing data; the print data is converted into bitmap data, and a print instruction is sent to the printer based on the bitmap data. That is, in the embodiment of the present invention, a data parsing protocol is determined according to data characteristics of a print job, print data obtained according to the data parsing protocol is subjected to data conversion to form bitmap data, and the bitmap data is used as intermediate data for storage and generation of a print instruction, so that a printer can be prompted to print jobs corresponding to different protocols in a data conversion manner, compatibility of multiple protocols of the printer is enhanced, a reuse rate of the device is improved, a cost of the device is reduced, and a data storage capacity of the device is improved.

Description

Printing control method and device, electronic equipment printer and storage medium
Technical Field
The present invention relates to computer technologies, and in particular, to a print control method and apparatus, an electronic device, and a storage medium.
Background
With the daily use of electronic offices, various types of printers are on the market, and different printing corresponds to different printing protocols, printing formats and paper sizes. A general printer supports only one printing protocol, and the printing protocols are not compatible with each other, such as: the standard printing protocols comprise ESC, CPCL, TSCL, EPL and the like, wherein each printing protocol can only be used by using a special printer and a printing software in a matching way, and each printer can only support and receive a specific printing instruction set, so that the compatibility of different system software is poor, the equipment reuse rate is low, and the resource waste is caused.
Disclosure of Invention
The invention provides a printing control method, a printing control device, electronic equipment and a storage medium, which are used for enhancing the compatibility of various protocols of a printer and improving the reusability of the equipment.
In a first aspect, an embodiment of the present invention provides a print control method, which is applied to a protocol conversion device, where the protocol conversion device is installed in an upper computer, and the upper computer is connected to a printer, and the method includes:
receiving a printing task sent by the upper computer;
analyzing the printing task to obtain the data characteristics of the printing task;
determining a data analysis protocol corresponding to the printing task according to the data characteristics, and analyzing the printing task according to the data analysis protocol to obtain printing data;
converting the print data into bitmap data, and sending a print instruction to the printer based on the bitmap data.
Further, determining a data parsing protocol corresponding to the print job according to the data characteristics includes:
and matching a data analysis protocol corresponding to the printing task from all preset protocols according to the data characteristics, wherein all the preset protocols are stored in the protocol conversion equipment.
Further, matching a data analysis protocol corresponding to the print job from each preset protocol according to the data characteristics includes:
determining preset matching time according to each preset protocol;
determining whether the data features are matched with features of a current protocol within the preset matching time;
and when the data characteristics are not matched with the characteristics of the current protocol, sequentially executing the data characteristics to be matched with the next protocol until the data analysis protocol corresponding to the printing task is matched from each preset protocol.
Further, converting the print data into bitmap data includes:
determining the content of the printing data, and carrying out bitmap mapping on the interior of the printing data to obtain bitmap information;
and formatting the bitmap information according to a general data format to obtain the bitmap data.
Further, sending a print instruction to the printer based on the bitmap data includes:
acquiring a printing protocol from the printer, and generating a printing instruction according to the bitmap data and the printing protocol;
and sending the printing instruction to the printer so that the printer completes the printing task according to the printing instruction.
Further, the sending the printing instruction to the printer so that the printer completes the printing task according to the printing instruction further includes:
and receiving a new protocol and updating the new protocol to a preset protocol library.
In a second aspect, an embodiment of the present invention further provides a print control apparatus, which is applied to a protocol conversion device, where the protocol conversion device is installed in an upper computer, and the upper computer is connected to a printer, and the apparatus includes:
the task acquisition module is used for receiving the printing tasks sent by the upper computer;
the protocol determining module is used for analyzing the printing task to obtain the data characteristics of the printing task;
the data analysis module is used for determining a data analysis protocol corresponding to the printing task according to the data characteristics and analyzing the printing task according to the data analysis protocol to obtain printing data;
and the instruction generating module is used for converting the printing data into bitmap data and sending a printing instruction to the printer based on the bitmap data.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
a storage device to store one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the printing control method.
In a fourth aspect, the present invention further provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the print control method.
In the embodiment of the invention, the printing tasks sent by the upper computer are received; analyzing the printing task to obtain the data characteristics of the printing task; determining a data analysis protocol corresponding to the printing task according to the data characteristics, and analyzing the printing task according to the data analysis protocol to obtain printing data; the print data is converted into bitmap data, and a print instruction is sent to the printer based on the bitmap data. That is, in the embodiment of the present invention, a data analysis protocol is determined according to data characteristics of a print job, print data is obtained according to the data analysis protocol, data conversion is performed to form bitmap data, the bitmap data is used as intermediate data to store and generate a print instruction, a printer can be prompted to print jobs corresponding to different protocols in a data conversion manner, compatibility of multiple protocols of the printer is enhanced, a reuse rate of the device is improved, cost of the device is reduced, and data storage capacity of the device can be improved by using the bitmap data as intermediate data.
Drawings
FIG. 1 is a schematic flow chart of a printing control method according to an embodiment of the present invention;
FIG. 2 is another schematic flow chart diagram of a printing control method provided by an embodiment of the invention;
fig. 3 is a schematic configuration diagram of a print control apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some structures related to the present invention are shown in the drawings, not all of them.
Fig. 1 is a schematic flowchart of a printing control method according to an embodiment of the present invention, where the method may be executed by a printing control apparatus according to an embodiment of the present invention, and the apparatus may be implemented in software and/or hardware. In a specific embodiment, the device is applied to protocol conversion equipment, the protocol conversion equipment is installed on an upper computer, and the upper computer is connected with a printer. The following embodiments will be described by taking as an example that the apparatus is integrated in an electronic device, and referring to fig. 1, the method may specifically include the following steps:
s110, receiving a printing task sent by an upper computer;
the protocol conversion device may be a device which is implemented in a software and/or hardware manner and has a function of performing data conversion on print data in a print job, and may resolve the situation that the conventions followed by communication between the host computer and the printer are inconsistent by performing data conversion on the print data in the print job, where multiple print protocols are stored in the protocol conversion device, and the print protocols stored in the protocol conversion device are used to perform data analysis on the received print job sent by the host computer, so as to determine the print data in the print job. The host computer can be the computer of direct transmission print order, through the print task that the various information of demonstration confirm printer needs to print on the screen, wherein, print task can contain the data package that the printer needs to print data, print task's the packaging mode and can confirm according to the communication protocol between host computer and the printer, different communication protocol can correspond different packaging modes.
In the specific implementation, on an upper computer or a printer provided with a protocol conversion device, the protocol conversion device receives a print task sent to the printer by the upper computer, analyzes the print task, and obtains data characteristics of the print task, so as to confirm a data analysis protocol corresponding to the print task according to the data characteristics of the print task. The protocol conversion equipment and the upper computer can be connected in a network connection mode, a serial connection mode and a Bluetooth interactive access mode, and can also be integrated in the upper computer; the connection mode of the protocol conversion device and the printer can adopt the connection modes of network connection, serial port connection, wire connection, Bluetooth and the like.
S120, analyzing the print task to obtain the data characteristics of the print task;
in specific implementation, the print data in the print job is packaged in a manner of an instruction set, where the instruction sets corresponding to the preset protocols are different or different, and the instruction set corresponding to each preset protocol has corresponding data features, such as an ESC instruction set, a TSPL instruction set, and a CPCL instruction set, where the data features may be that the instruction set includes a general data symbol, a special data combination rule, a print control language, and the like. And determining the data characteristics of the printing task by analyzing the data language, the data symbol and the data combination rule of the instruction set in the printing task so as to determine the data analysis protocol corresponding to the printing task according to the data characteristics of the printing task and obtain the printing data.
S130, determining a data analysis protocol corresponding to the printing task according to the data characteristics, and analyzing the printing task according to the data analysis protocol to obtain printing data;
in the concrete realization, the data analysis agreement that the print task corresponds can be the print agreement that the host computer used when generating the print task, and this print agreement is used for packing the print data into one package, can also utilize the relevant rule of print agreement can carry out data analysis to the print task, obtains the print data in the print task to in data conversion carries out to the print data, form the print instruction that the printer can discern, accomplish the print task that the host computer sent according to print instruction. And matching the printing protocols according with the data characteristics from the preset protocols according to the data characteristics of the printing tasks, and when the data analysis protocols corresponding to the printing tasks are matched from the preset protocols according to the data characteristics of the printing tasks, analyzing the instructions in the printing tasks by using the data analysis protocols to obtain the printing data, wherein the printing data comprises the contents to be printed by the upper computer.
S140, converting the printing data into bitmap data, and sending a printing instruction to the printer based on the bitmap data.
In a specific implementation, the bitmap data may be display data for displaying the print data in bitmap and vector graphics formats, and the display data may be a pixel group, where each pixel in the pixel group represents a point in the picture, i.e., a point sample. Analyzing an instruction set in a printing task by using a data analysis protocol to obtain printing data, performing dot matrix conversion on the printing data to obtain bitmap data corresponding to the printing data, and actually performing image conversion on the printing data to obtain the bitmap data. The bitmap data is stored by using pixels as memory units, namely, a minimum memory unit can be used for marking a number, and the storage space of the data can be reduced through a mapping rule, so that the aim of increasing the storage capacity is fulfilled. The bitmap data as the imaged data can be subjected to data conversion by a printing protocol of the printer to generate a printer which can execute a printing instruction.
In the embodiment of the invention, the printing tasks sent by the upper computer are received; analyzing the print task to obtain the data characteristics of the print task; determining a data analysis protocol corresponding to the printing task according to the data characteristics, and analyzing the printing task according to the data analysis protocol to obtain printing data; the print data is converted into bitmap data, and a print instruction is sent to the printer based on the bitmap data. That is, in the embodiment of the present invention, a data analysis protocol is determined according to data characteristics of a print job, print data is obtained according to the data analysis protocol, data conversion is performed to form bitmap data, the bitmap data is used as intermediate data to store and generate a print instruction, a printer can be prompted to print jobs corresponding to different protocols in a data conversion manner, compatibility of multiple protocols of the printer is enhanced, a reuse rate of the device is improved, cost of the device is reduced, and data storage capacity of the device can be improved by using the bitmap data as intermediate data.
The printing control method provided by the embodiment of the present invention is further described below, and as shown in fig. 2, the method may specifically include the following steps:
s210, receiving a printing task sent by an upper computer;
s220, analyzing the print task to obtain the data characteristics of the print task;
in a specific implementation, the print data in the print job is packaged in an instruction set manner, where the instruction sets corresponding to the preset protocols are different or different, and the instruction set corresponding to each preset protocol has corresponding data characteristics, such as an ESC instruction set, a TSPL instruction set, and a CPCL instruction set, where the data characteristics may be that the instruction set includes a general data symbol, a special data combination rule, a print control language, and the like. And determining the data characteristics of the printing task by analyzing the data language, the data symbol and the data combination rule of the instruction set in the printing task so as to determine the data analysis protocol corresponding to the printing task according to the data characteristics of the printing task and obtain the printing data.
Such as: the print job issued by the ESC instruction set includes the data characteristics of the instruction combination of 0x1b 0x40, 0x1b 0x4a, 0x1b 0x64 and 0x1d 0x76, etc., and the print job issued by the TSPL instruction set includes! And T, PRINT, and the PRINT task issued by the CPCL contains the data characteristics of command combinations such as SIZE and PRINT.
S230, determining preset matching time according to each preset protocol, and determining whether the data characteristics within the preset matching time are matched with the characteristics of the current protocol;
for example, the preset matching time may be a time required for matching data features of a print job preset according to actual requirements and experimental data with data features of an instruction set corresponding to each preset protocol, may be a unit time preset according to the experimental data, that is, matching time of each preset protocol is consistent, or may be a preset matching time set according to different correspondence of each preset protocol, that is, different preset times of data features of an instruction set corresponding to each preset protocol are inconsistent. The current protocol may be a printing protocol in which feature matching is being performed in a data feature matching process, that is, any one of preset protocols, and in the data feature matching process, each preset protocol may determine matching ordering according to a certain rule and perform matching on each preset protocol once, where the feature of the current protocol may be a data feature of an instruction set of the current protocol. The matching times of the preset protocols can be sorted from large to small, and the matching times can also be sorted from small to large according to the length of the preset matching time when the preset matching time is inconsistent, so that the matching time is reduced.
In a specific implementation, the preset matching time corresponding to each preset protocol in the data feature matching process is determined according to each preset protocol, which may be unit time preset according to experimental data or preset matching time corresponding to different preset protocols. And sequentially matching according to preset matching time corresponding to each preset protocol and matching sequence corresponding to each preset protocol, performing data feature matching on each preset protocol, determining whether the data features are matched with the features of the current protocol within the preset matching time, and determining that the data features are not matched with the data features of the instruction set of the current protocol when the data features are not matched with the data features of the instruction set of the current protocol, namely the data features are not consistent with the data features of the instruction set of the current protocol, or the data features are not consistent with the data features of the instruction set of the current protocol within the preset matching time.
S240, when the data characteristics are not matched with the characteristics of the current protocol, sequentially executing data characteristics to be matched with the next protocol until the data analysis protocol corresponding to the printing task is matched from each preset protocol;
in a specific implementation, the next protocol may be a next matched printing protocol after the current protocol is matched in the data feature matching process, that is, a printing protocol after the current protocol in the sequence. And sequentially matching according to preset matching time corresponding to each preset protocol and matching sequence corresponding to each preset protocol, performing data characteristic matching on each preset protocol, determining whether the data characteristics are matched with the characteristics of the current protocol within the preset matching time, and when the data characteristics are not matched with the data characteristics of the instruction set of the current protocol, namely the data characteristics are not consistent with the data characteristics of the instruction set of the current protocol, sequentially performing data characteristic matching with the next protocol until the data analysis protocol corresponding to the number of the printing persons is matched from each preset protocol. In addition, when the data characteristics cannot be matched with the data characteristics of the instruction set of the current protocol, and the preset matching time is up, the data characteristics are determined not to be matched with the data characteristics of the instruction set of the current protocol, and the data characteristics are sequentially matched with the next protocol until the data analysis protocols corresponding to the number of printing people are matched from each preset protocol. For example, setting the preset matching time to be 3 seconds, determining whether the data features are matched with the data features of the instruction set of the current protocol within 3 seconds, and when the data features are not successfully matched with the data features of the instruction set of the current protocol within 3 seconds, determining that the data features are not matched with the data features of the instruction set of the current protocol, and sequentially executing the matching of the data features and the next protocol within the next 3 seconds until the data analysis protocols corresponding to the number of print persons are matched from the preset protocols.
S250, analyzing the printing task according to a data analysis protocol to obtain printing data, wherein each preset protocol is stored in the protocol conversion equipment;
in the specific implementation, the printing protocols which accord with the data characteristics are matched from all preset protocols according to the data characteristics of the printing tasks, the data characteristics of the printing tasks are matched with the data language, the data symbol and the data combination rule of the instruction sets corresponding to all the preset protocols, when the data characteristics of the instruction sets corresponding to one printing protocol are determined to be consistent with the data characteristics of the printing tasks from all the preset protocols, the data characteristics of the instruction sets corresponding to the printing protocols are matched with the data characteristics of the printing tasks, the printing protocols are used as data analysis protocols corresponding to the printing tasks, and the instruction sets in the printing tasks are analyzed by the data analysis protocols to obtain the printing data. The preset protocols are stored in the protocol conversion equipment and used for matching through data characteristics to determine a data analysis protocol.
S260, converting the printing data into bitmap data, and sending a printing instruction to the printer based on the bitmap data.
Further, converting the print data into bitmap data includes:
determining the content of the printing data, and carrying out bitmap mapping on the content of the printing data to obtain bitmap information;
and formatting the bitmap information according to the general data format to obtain bitmap data.
In a specific implementation, the general data format may be an image file format, such as a BMP file storage format. Analyzing an instruction set in a printing task by using a data analysis protocol to obtain printing data, determining the content of the printing data, carrying out bitmap mapping on the content of the printing data, determining position information of each dot matrix in the bitmap data, and formatting the bitmap information according to a general data format to obtain bitmap data or a bitmap file, so that the printing data and the printing protocol are combined to generate a printing instruction in an image scanning mode.
Further, sending a print instruction to the printer based on the bitmap data includes:
acquiring a printing protocol from a printer, and generating a printing instruction according to bitmap data and the printing protocol;
and sending the printing instruction to the printer so that the printer completes the printing task according to the printing instruction.
In the specific implementation, the protocol conversion equipment is connected with the printer in a communication mode to obtain the printing protocol of the printer, the printing data and the printing protocol are combined in an image scanning mode to generate a printing instruction, the printing instruction is sent to the printer, and the printer completes a printing task according to the received printing instruction.
Further, after sending the printing instruction to the printer to make the printer complete the printing task according to the printing instruction, the method further includes:
and receiving a new protocol and updating the new protocol to a preset protocol library.
In the specific implementation, after the printer instruction is sent to the printer each time, a new protocol needs to be received through the network, the new protocol may be received by a server connected to the network through data update, or the new protocol may be received by a protocol conversion device through data update, the new protocol is updated into a preset protocol library, and the preset matching time and the data feature matching sequence of each preset protocol in the preset protocol library are re-determined, so as to facilitate data feature matching of the received new print task.
In the embodiment of the invention, the printing tasks sent by the upper computer are received; analyzing the print task to obtain the data characteristics of the print task; determining a data analysis protocol corresponding to the printing task according to the data characteristics, and analyzing the printing task according to the data analysis protocol to obtain printing data; the print data is converted into bitmap data, and a print instruction is sent to the printer based on the bitmap data. That is, in the embodiment of the present invention, a data analysis protocol is determined according to data characteristics of a print job, print data is obtained according to the data analysis protocol, data conversion is performed to form bitmap data, the bitmap data is used as intermediate data to store and generate a print instruction, a printer can be prompted to print jobs corresponding to different protocols in a data conversion manner, compatibility of multiple protocols of the printer is enhanced, a reuse rate of the device is improved, cost of the device is reduced, and data storage capacity of the device can be improved by using the bitmap data as intermediate data.
Fig. 3 is a schematic configuration diagram of a print control apparatus according to an embodiment of the present invention, and as shown in fig. 3, the print control apparatus includes:
the task acquisition module 310 is configured to receive a print task sent by an upper computer;
the protocol determining module 320 is configured to analyze a print job to obtain data characteristics of the print job;
the data analysis module 330 is configured to determine a data analysis protocol corresponding to the print task according to the data characteristics, and analyze the print task according to the data analysis protocol to obtain print data;
and the instruction generating module 340 is configured to convert the print data into bitmap data, and send a print instruction to a printer based on the bitmap data.
In one embodiment, the determining, by the data parsing module 330, a data parsing protocol corresponding to the print job according to the data characteristics includes:
and matching a data analysis protocol corresponding to the printing task from all preset protocols according to the data characteristics, wherein all the preset protocols are stored in the protocol conversion equipment.
In an embodiment, the matching, by the data parsing module 330, a data parsing protocol corresponding to the print job from each preset protocol according to the data feature includes:
determining preset matching time according to each preset protocol;
determining whether the data characteristics are matched with the characteristics of the current protocol within the preset matching time;
and when the data characteristics are not matched with the characteristics of the current protocol, sequentially executing the data characteristics to be matched with the next protocol until the data analysis protocol corresponding to the printing task is matched from each preset protocol.
In one embodiment, the instruction generation module 340 converts the print data into bitmap data, including:
determining the content of the printing data, and carrying out bitmap mapping on the content of the printing data to obtain bitmap information;
and formatting the bitmap information according to a general data format to obtain the bitmap data.
In one embodiment, the instruction generating module 340 sends a print instruction to a printer based on the bitmap data, including:
acquiring a printing protocol from the printer, and generating a printing instruction according to the bitmap data and the printing protocol;
and sending the printing instruction to the printer so that the printer completes the printing task according to the printing instruction.
In an embodiment, the instruction generating module 340 sends the printing instruction to the printer, so that after the printer completes the printing task according to the printing instruction, the method further includes:
and receiving a new protocol and updating the new protocol to a preset protocol library.
The device in the embodiment of the invention receives the printing task sent by the upper computer; analyzing the print task to obtain the data characteristics of the print task; determining a data analysis protocol corresponding to the printing task according to the data characteristics, and analyzing the printing task according to the data analysis protocol to obtain printing data; the print data is converted into bitmap data, and a print instruction is sent to the printer based on the bitmap data. That is, in the embodiment of the present invention, a data parsing protocol is determined according to data characteristics of a print job, the print job is obtained according to the data parsing protocol and is subjected to data conversion to form bitmap data, the bitmap data is used as intermediate data to store and generate a print instruction, a printer can be prompted to print jobs corresponding to different protocols by using a data conversion method, compatibility of multiple protocols of the printer is enhanced, a reuse rate of the device is improved, device cost is reduced, and data storage capacity of the device can be improved by using the bitmap data as intermediate data.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. FIG. 4 illustrates a block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention. The electronic device 12 shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiment of the present invention.
As shown in FIG. 4, electronic device 12 is embodied in the form of a general purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by electronic device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. The electronic device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, and commonly referred to as a "hard drive"). Although not shown in FIG. 4, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination of which may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of embodiments of the invention as described.
Electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with electronic device 12, and/or with any devices (e.g., network card, modem, etc.) that enable electronic device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the electronic device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via the network adapter 20. As shown, the network adapter 20 communicates with the other modules of the electronic device 12 over the bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, to name a few.
The processing unit 16 executes various functional applications and data processing by running a program stored in the system memory 28, for example, implementing a print control method provided by an embodiment of the present invention, the method including:
receiving a printing task sent by the upper computer;
analyzing the printing task to obtain the data characteristics of the printing task;
determining a data analysis protocol corresponding to the printing task according to the data characteristics, and analyzing the printing task according to the data analysis protocol to obtain printing data;
converting the print data into bitmap data, and sending a print instruction to the printer based on the bitmap data.
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for controlling printing, where the method includes:
receiving a printing task sent by the upper computer;
analyzing the printing task to obtain the data characteristics of the printing task;
determining a data analysis protocol corresponding to the printing task according to the data characteristics, and analyzing the printing task according to the data analysis protocol to obtain printing data;
converting the print data into bitmap data, and sending a print instruction to the printer based on the bitmap data.
Computer storage media for embodiments of the present invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, or the like, as well as conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will appreciate that the present invention is not limited to the particular embodiments described herein, and that various obvious changes, rearrangements and substitutions will now be apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in some detail by the above embodiments, the invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the invention, and the scope of the invention is determined by the scope of the appended claims.

Claims (9)

1. A printing control method is characterized by being applied to protocol conversion equipment, wherein the protocol conversion equipment is installed on an upper computer, the upper computer is connected with a printer, and the printing control method comprises the following steps:
receiving a printing task sent by the upper computer;
analyzing the printing task to obtain the data characteristics of the printing task;
determining a data analysis protocol corresponding to the printing task according to the data characteristics, and analyzing the printing task according to the data analysis protocol to obtain printing data;
converting the print data into bitmap data, and sending a print instruction to the printer based on the bitmap data.
2. The method of claim 1, wherein determining a data parsing protocol for the print job based on the data characteristics comprises:
and matching a data analysis protocol corresponding to the printing task from all preset protocols according to the data characteristics, wherein all the preset protocols are stored in the protocol conversion equipment.
3. The method according to claim 2, wherein matching a data parsing protocol corresponding to the print job from among the preset protocols according to the data characteristics comprises:
determining preset matching time according to each preset protocol;
determining whether the data characteristics are matched with the characteristics of the current protocol within the preset matching time;
and when the data characteristics are not matched with the characteristics of the current protocol, sequentially executing the data characteristics to be matched with the next protocol until the data analysis protocol corresponding to the printing task is matched from each preset protocol.
4. The method of claim 1, wherein converting the print data into bitmap data comprises:
determining the content of the printing data, and carrying out bitmap mapping on the content of the printing data to obtain bitmap information;
and formatting the bitmap information according to a general data format to obtain the bitmap data.
5. The method of claim 4, wherein sending a print instruction to the printer based on the bitmap data comprises:
acquiring a printing protocol from the printer, and generating a printing instruction according to the bitmap data and the printing protocol;
and sending the printing instruction to the printer so that the printer completes the printing task according to the printing instruction.
6. The method of claim 5, wherein issuing the print instruction to the printer to cause the printer to complete the print job in accordance with the print instruction further comprises:
and receiving a new protocol and updating the new protocol to a preset protocol library.
7. The utility model provides a print control device, its characterized in that is applied to protocol conversion equipment, protocol conversion equipment installs in the host computer, the host computer is connected the printer, print control device includes:
the task acquisition module is used for receiving the printing task sent by the upper computer;
the protocol determining module is used for analyzing the printing task to obtain the data characteristics of the printing task;
the data analysis module is used for determining a data analysis protocol corresponding to the printing task according to the data characteristics and analyzing the printing task according to the data analysis protocol to obtain printing data;
and the instruction generating module is used for converting the printing data into bitmap data and sending a printing instruction to the printer based on the bitmap data.
8. An electronic device, characterized in that the electronic device comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the print control method of any one of claims 1 to 6.
9. A computer-readable storage medium on which a computer program is stored, the program realizing the print control method according to any one of claims 1 to 6 when executed by a processor.
CN202210573020.2A 2022-05-24 2022-05-24 Printing control method and device, electronic equipment printer and storage medium Pending CN114780046A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210573020.2A CN114780046A (en) 2022-05-24 2022-05-24 Printing control method and device, electronic equipment printer and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210573020.2A CN114780046A (en) 2022-05-24 2022-05-24 Printing control method and device, electronic equipment printer and storage medium

Publications (1)

Publication Number Publication Date
CN114780046A true CN114780046A (en) 2022-07-22

Family

ID=82407912

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210573020.2A Pending CN114780046A (en) 2022-05-24 2022-05-24 Printing control method and device, electronic equipment printer and storage medium

Country Status (1)

Country Link
CN (1) CN114780046A (en)

Similar Documents

Publication Publication Date Title
US8274666B2 (en) Projector/printer for displaying or printing of documents
US20130155464A1 (en) Print application
JP5238526B2 (en) System and method for print resource management
US20020129097A1 (en) System and method for distributed processing
US6476938B1 (en) Print control system and method
CN102111519A (en) Image forming system and image forming method in image forming system
US10380387B2 (en) Integrated smart card printing and encoding
JP2000305739A (en) Printing system
US7203898B2 (en) Document processing method and apparatus
US7643160B2 (en) Spool file modifying device
JP2007200324A (en) Mime type-based printer driver selection
CN108259958B (en) Remote control key response method, device, equipment and storage medium
CN114780046A (en) Printing control method and device, electronic equipment printer and storage medium
US7339694B2 (en) Chit printing system, chit printing apparatus and chit printing method
US20060044608A1 (en) Information processing apparatus, information processing method, and system
US20040075859A1 (en) Printer instruction processing
EP2851806B1 (en) Enabling routing of data on a network based on a portion of data accessed from a non-network enabled device
KR101058039B1 (en) Image Forming Method and System Using MMML Data
JP2006235935A (en) Printing system
JP2008299845A (en) Rendering system and rendering method for transparent object
JP2002157108A (en) Image processing method, storage medium, and image forming device
US11782655B2 (en) Method and apparatus for handling image forming abnormality, image forming apparatus, and storage medium
US20140233051A1 (en) Document distribution server and program for document distribution server
JP2008306728A (en) System and method for processing document
CN116001460A (en) Dynamic calibration method and dynamic calibration device for color printer

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