CN107256134A - It is virtually method and apparatus, the POS terminal of computer printer by POS terminal - Google Patents

It is virtually method and apparatus, the POS terminal of computer printer by POS terminal Download PDF

Info

Publication number
CN107256134A
CN107256134A CN201710278727.XA CN201710278727A CN107256134A CN 107256134 A CN107256134 A CN 107256134A CN 201710278727 A CN201710278727 A CN 201710278727A CN 107256134 A CN107256134 A CN 107256134A
Authority
CN
China
Prior art keywords
data
printed
pos terminal
printing
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.)
Granted
Application number
CN201710278727.XA
Other languages
Chinese (zh)
Other versions
CN107256134B (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.)
PAX Computer Technology Shenzhen Co Ltd
Original Assignee
PAX Computer Technology Shenzhen 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 PAX Computer Technology Shenzhen Co Ltd filed Critical PAX Computer Technology Shenzhen Co Ltd
Priority to CN201710278727.XA priority Critical patent/CN107256134B/en
Priority to PCT/CN2017/102215 priority patent/WO2018196262A1/en
Publication of CN107256134A publication Critical patent/CN107256134A/en
Application granted granted Critical
Publication of CN107256134B publication Critical patent/CN107256134B/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/1202Dedicated interfaces to print systems specifically adapted to achieve a particular effect
    • G06F3/1203Improving or facilitating administration, e.g. print management
    • 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/1224Client or server resources management
    • 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/128Direct printing, e.g. sending document file, using memory stick, printing from a camera
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07GREGISTERING THE RECEIPT OF CASH, VALUABLES, OR TOKENS
    • G07G5/00Receipt-giving machines

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Software Systems (AREA)
  • Accessory Devices And Overall Control Thereof (AREA)
  • Record Information Processing For Printing (AREA)

Abstract

The present invention relates to a kind of method and apparatus, POS terminal by POS terminal virtually for computer printer.Methods described is included by the first printing driving receiving printing orders, and obtains the first data to be printed according to the print command, and the first printing driving is used to provide type of printer for POS terminal printer;Driven by the described first printing and call printing servo programe that the described first data to be printed are converted to the second data to be printed for meeting POS terminal;Described second data to be printed are sent to the printer of POS terminal, so that the printer of the POS terminal is printed to the described second data to be printed.Improve the utilization rate of POS printers.

Description

It is virtually method and apparatus, the POS terminal of computer printer by POS terminal
Technical field
The present invention relates to computer application field, more particularly to a kind of is virtually computer printer by POS terminal Method and apparatus, POS terminal.
Background technology
Current POS has been widely used in various payment occasions, as one of mainstream electronic channel of disbursement.
The effect of the printer of current POS terminal is only to print required consumption certificate after merchandising, to printer For belong to that equipment is vacant, be far from reaching the printing amount allowed in printer apparatus lifetime specification, utilization rate is low.
The content of the invention
Based on this, it is necessary to for POS printer utilization rates it is low the problem of there is provided one kind by POS terminal virtually for calculate Method and apparatus, the POS terminal of machine printer, can improve the utilization rate of POS terminal.
A kind of is virtually the method for computer printer by POS terminal, is comprised the following steps:
Receiving printing orders are driven by the first printing, and the first data to be printed, institute are obtained according to the print command The first printing is stated to drive for providing type of printer for POS terminal printer;
Call printing servo programe to be converted to the described first data to be printed by the described first printing driving and meet POS Second data to be printed of terminal;
Described second data to be printed are sent to the printer of POS terminal, so that the printer of the POS terminal is to institute The second data to be printed are stated to be printed.
In one of the embodiments, methods described also includes:
By the first of acquisition the data storage to be printed under specified file directory path;
Printing servo programe is called to be read from the specified file directory path by the described first printing driving described First data to be printed, and the described first data to be printed are converted to the second data to be printed for meeting POS terminal.
In one of the embodiments, it is described that printing servo programe is called by described first by the described first printing driving Data to be printed, which are converted to, to be met the second data to be printed of POS terminal and includes:
Printing servo programe is called by the described first data conversion monochrome bitmap to be printed by the described first printing driving Data, and the monochrome bitmap data are converted into dot matrix array data, the dot matrix array data meets POS ends to be described Second data to be printed at end.
In one of the embodiments, the step of the printer that the described second data to be printed are sent to POS terminal Suddenly include:
Described second data to be printed are sent to the print agent program of POS terminal, and pass through the print agent journey Described second data to be printed are transferred to the printer of the POS terminal by sequence.
A kind of is virtually the method for computer printer by POS terminal, including:
The second of POS terminal wait to beat by the print agent program of POS terminal meeting of receiving that printing servo programe sends Printing evidence, and the described second data to be printed are sent to the printer of the POS terminal;Wherein, the described second number to be printed The first printing is driven what the first data conversion to be printed obtained was obtained according to for the printing servo programe;
Second data to be printed are printed by the printer of the POS terminal.
In one of the embodiments, the print agent program by POS terminal receives printing servo programe and sent The data to be printed for meeting POS terminal the step of include:
The dot matrix array data that printing servo programe is sent, the dot matrix are received by the print agent program of POS terminal Described first printing is driven the first data to be printed obtained to be converted to monochrome bit by array data for the printing servo programe After diagram data, then obtained by the monochrome bitmap data are changed.
A kind of is virtually the device of computer printer by POS terminal, including:
Printing drive module, for providing type of printer for POS terminal printer, receiving printing orders, and according to institute State print command and obtain the first data to be printed;
Print servo programe module, for the described first data to be printed are converted to meet the second of POS terminal wait beat Printing evidence, the described second data to be printed is sent to the printer of POS terminal, so that the printer of the POS terminals is to institute The second data to be printed are stated to be printed.
In one of the embodiments, the printing drive module is additionally operable to exist the first of acquisition the data storage to be printed Under specified file directory path, and the printing servo programe module is called to read institute from the specified file directory path The first data to be printed are stated, and the described first data to be printed are converted to the second data to be printed for meeting POS terminal.
In one of the embodiments, the printing drive module is additionally operable to call the printing servo programe module by institute The first data conversion monochrome bitmap data to be printed are stated, and the monochrome bitmap data are converted into dot matrix array data, institute It is second data to be printed for meeting POS terminal to state dot matrix array data.
In one of the embodiments, the printing servo programe module is additionally operable to send the described second data to be printed To the print agent program of POS terminal, and by the print agent program the described second data to be printed are transferred to described The printer of POS terminal.
A kind of POS terminal, including:
Print agent program module, for receiving the second number to be printed for meeting POS terminal that printing servo programe is sent According to, and the described second data to be printed are sent to the printer of the POS terminal;Wherein, the described second data to be printed are First printing is driven what the first data conversion to be printed obtained was obtained by the printing servo programe;
Print module, for printing the described second data to be printed.
In one of the embodiments, the print agent program is additionally operable to receive the dot matrix number that printing servo programe is sent Described first printing is driven the first number to be printed obtained by group data, the dot matrix array data for the printing servo programe According to being converted to after monochrome bitmap data, then obtained by the monochrome bitmap data are changed.
Above-mentioned is virtually method and apparatus, the POS terminal of printer by POS terminal, and the is obtained by the first printing driving One data to be printed, call printing servo programe that the first data to be printed are converted to the second number to be printed for meeting POS terminals According to the printer that the second data to be printed are sent into POS terminal is printed, and improves the utilization rate of POS printers.
Brief description of the drawings
Fig. 1 is the application scenarios schematic diagram for the method in one embodiment being virtually computer printer by POS terminal;
Fig. 2 is the flow chart for the method in one embodiment being virtually computer printer by POS terminal;
Fig. 3 is the printing flow chart of Windows operating system in one embodiment;
Fig. 4 A are the workflow diagram of print.er port monitor in one embodiment;
Fig. 4 B are figure example schematic diagram in one embodiment;
Fig. 5 is the POS terminal flow chart for the method in one embodiment being virtually computer printer by POS terminal;
Fig. 6 is that print data is transferred to the workflow diagram that POS terminal 120 is printed by one embodiment Computer 110;
Fig. 7 is the structured flowchart that POS terminal is virtually Windows print apparatus in one embodiment;
Fig. 8 is the structured flowchart for the device in one embodiment being virtually computer printer by POS terminal;
The workflow diagram that it is virtually computer printer device by POS terminal that Fig. 9 is in one embodiment.
Embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, it is right below in conjunction with drawings and Examples The present invention is further elaborated.It should be appreciated that specific embodiment described herein is used only for explaining the present invention, and It is not used in the restriction present invention.
Fig. 1 is the application scenarios schematic diagram for the method in one embodiment being virtually computer printer by POS terminal.Such as Shown in Fig. 1, the application scenarios include computer 110 and POS terminal 120.Computer 110 can be by wired with POS terminal 120 Or communication enters row data communication.Windows operating system, (SuSE) Linux OS etc. can be installed on computer 110. Wired mode can be the connection communications such as serial ports, USB cable, Ethernet.Communication can be the modes such as WIFI.Computer 110 can drive receiving printing orders by the first printing, and obtain the first data to be printed, described the according to the print command One printing driving is used to provide type of printer for POS terminal printer, and printing servo is called by the described first printing driving Program is converted to the described first data to be printed the second data to be printed for meeting POS terminal, by the described second number to be printed According to the printer for being sent to POS terminal, so that the printer of the POS terminal 120 is beaten the described second data to be printed Print.
Fig. 2 is the flow chart for the method in one embodiment being virtually computer printer by POS terminal.As shown in Fig. 2 A kind of is virtually the method for computer printer by POS terminal, is described with computer angle, including step 202 is to step 206. Wherein:
Step 202, receiving printing orders are driven by the first printing, and it is to be printed according to print command acquisition first Data, the first printing driving is used to provide type of printer for POS terminal printer.
Specifically, computer can receive the print command that user triggers by the first printing driving of installation, and according to this Print command obtains the first data to be printed.First data to be printed can be word forms, PDF formatted datas, picture format Data, TXT formatted datas etc..
Step 204, printing servo programe is called by the described first data conversion to be printed by the described first printing driving For the second data to be printed for meeting POS terminal.
Specifically, printing servo programe refers to meet treating for POS terminal for data to be printed in computer to be converted to The application program of print data.First printing is driven through function call printing servo programe.
Step 206, the described second data to be printed are sent to the printer of POS terminal, so that the POS terminals Printer is printed to the described second data to be printed.
Specifically, the second data to be printed are sent to POS terminal by the printing servo programe of computer by rendezvous protocol Printer printed.The rendezvous protocol refers to meet the agreement for entering row data communication between computer and POS terminal.
Above-mentioned is virtually the method for printer by POS terminal, obtains the first data to be printed by the first printing driving, adjusts First data to be printed are converted to the second data to be printed for meeting POS terminal with printing servo programe, it is to be printed by second The printer that data are sent to POS terminal is printed, and improves the utilization rate of POS printers.
In one embodiment, it is above-mentioned virtually also to include POS terminal for the method for computer printer:By the of acquisition One data storage to be printed is under specified file directory path.
Specifically, user is needed before calling the first printing to drive, and configures system relevant parameter, and specify a file Directory path, for storing the first data to be printed.For example in Windows systems, path can be set to by user: HKEY_CURRENT_USER SOFTWARE ImagePrinter, for store the first data to be printed.In addition, can also pass through First printing driving is installed to be automatically performed the configuration of system relevant parameter.The configuration system relevant parameter, refer to table 1.
Table 1
In one embodiment, it is above-mentioned virtually also to include POS terminal for the method for computer printer:Pass through described One printing driving calls printing servo programe to read the described first data to be printed from the specified file directory path, and will First data to be printed are converted to the second data to be printed for meeting POS terminal.
Specifically, the first printing driving obtains print command, and the described first data to be printed then are converted into bitmap number According to and store it under specified file directory path.Then, the first printing driving calls printing servo programe to obtain described refer to Determine the bitmap data in file directory path, and the described first data to be printed are converted to meet the second of POS terminal and wait to beat Printing evidence.
Fig. 3 is the printing flow chart of Windows operating system in one embodiment.Windows print drivers are based on Increase income (GNU License) ImagePrinter exploitation, belong to windows platform virtual printer driving classification, also It is to say, ImagePriter is a kind of developing instrument for being used to realize virtual printer driving, the effect in printing flow is A port monitor, and the realization of port drivers is provided.Port drivers are the first printing driving.Such as Fig. 3 institutes Show, the printing flow of windows operating systems includes:
Step 302, print application is started.
Specifically, print application creates a device context and is drawing an object thereon, then calls GDI Corresponding function interface is corresponding to this device context in (Graphics Device Interface GDIs) Printer sends a print request.It is one equipment operating environment of configuration to create a device context.GDI is Windows The GDI of offer, it is a core component of Windows systems, is the heart of Windows graphing capabilitys, it The information that major function is responsible between Windows systems and mapping program is exchanged.All graph and image processings and font Handle, in all realization and GDI such as color management function.
Step 304, device context is created.
Specifically, GDI function calls corresponding printed drivers handles print request.
Step 306, GDI GDI calls corresponding printed driver.
Specifically, print driver creates a print job, and calls GDI functions to pass through printing interface DLL (DLL For interface document) and printing curve DLL result is returned into GDI.
Step 308, GDI functions call print spooling system.
Wherein, the print spooling technology of Windows operating system is primarily referred to as when host-processor is passed to external equipment When sending data, in order to reduce take host-processor time (because the speed of port is typically well below the speed of processor) and Using it is a kind of additional storage (being usually hard disk) is used as the buffer storage of port, specific transmission work by Backstage is come a kind of technology for handling.
Step described above, is the intrinsic flow of printer driver developing Windows.I.e. if on Windows platforms Printed driver is developed, then needs to realize above step.
Step 310, print spooling system calls language monitor.Language monitor is mainly used in the double of back printer To communication, the state of monitor printer obtains and handles some events.
Specifically, printing off line calls print request processor so as to beating that print job is sent into application program specifies On print machine.Then, print job is sent to local printing supplier by print request processor, if the type of print job is Indirect printing, then print job is just stored on disk by local printing supplier with the form of original spool file, And later printing fragment is constantly attached in spool file, until application call, EndDoc functions are terminated Untill one print job.Above step 302 can repeatedly, for producing a complete spool text to step 310 Part.Following local printing supplier starts a background thread, and printing main thread is according to printing VSE/POWER resource Monitoring situation, select one it is optimal at the time of trigger the resolving of spool file.Now, printing main thread will be called StartDocPort functions start a thread in print processor to start to parse work.Printer processor thread dispatching ReadPrinter is to activate local printing supplier to read the print spooling file of the generation from disk.Meanwhile, beat Print processor also have invoked WritePrinter functions to activate the language monitor of printing machine operation so that data are passed through into thing Reason port is sent on corresponding printer.
Step 312, language monitor calls port monitor.
Specifically, print language monitor calls the function of port monitor to send data to printer.Port-monitoring Device controls the communication between printer and physical port.Its effect is to be transmitted to port device or receive number from port device According to (some port monitors only have transmitting function).General, operating system can provide port monitor to support some types Port (LPT, COMN etc.) used for printer, at this moment avoid the need for developer and the port monitor of oneself be provided.But If the port type of printer is not given tacit consent in operating system in the port type list supported, developer is needed to write certainly Oneself print.er port monitor is simultaneously installed with printed driver.Wherein, ImagePrinter is in printing flow Effect is a port monitor, while providing the realization of port drivers.
Fig. 4 A are the workflow diagram of print.er port monitor in Fig. 3.In realization in port monitor, by configuring WriteFile, realizes the function that bitmap data is write under specific file directory path.As shown in Figure 4 A, print.er port is supervised The workflow of visual organ includes:
Step 404, open printing port.
Specifically, print spooling 402 first has to call the OpenPort functions of port monitor, the main work(of the function It can be opening a port and return to a handle for identifying the port.In the subsequent calls of spool, the handle using as The input parameter of other processing functions is used.Handle is the basis of whole Windows programmings.One handle refers to one used The long numerical value of unique 4 bytes of integer value, i.e., one (being 8 bytes in 64 programs), comes different right in identification application As with it is similar in different examples, such as, a window, button, icon, scroll bar, output equipment, control or file Deng.
Step 406, print job is started.
Specifically, after a port is opened, print spooling then calls StartDocPort functions to start one Individual print job.StartPort functions are mainly by calling Windows API (Application Programming Interface application programming interfaces) provide CreateFile functions come set up one and kernel port driving between Data link.
Step 408, judge still to write data to printing is machine-readable.
Specifically, after data link is set up, print spooling can carry out bidirectional operation as needed, one kind be to Printer writes data, and print spooling first calls the WritePort functions of port monitor and then can repeatedly adjusted in this case The WriteFile functions provided with Windows API send data to be driven to kernel port.In the described first printing driving In, by configurable write inbound port 410, and call WriteFile functions, to specified file path catalogue under write bitmap number According to.Another be to printing machine-readable data, now print spooling first call the ReadPort functions of port monitor then The ReadFile functions for recalling Windows API offers drive reading hardware information from kernel port.
Step 412, data are transmitted.
Specifically, write to printer after data, print spooling can call GetPrinterDataFromPort letters Number, the main function of the function is by calling the DeviceloControl functions that Windows API are provided to be beaten come final realize Print the data transfer between driver and the driving of kernel port.
Step 414, printing flow is completed.
Specifically, after above operation is completed, print spooling calls EndDocPort functions to terminate a printing work Industry.The main function of the function is Shen in the data link and StartDocPort functions for discharge the foundation of CreateFile functions All system resources please.
Step 416, judge whether also have operation to be printed in print queue.
Specifically, after a print job is completed as procedure described above, print spooling is checked and this port Check that having other files or not needs printing in connected print queue.If so, then program is returned to StartDocPort functions repeat said process, if not provided, print spooling just closes this port.
Step 418, close port.
Specifically, the ClosePort functions of port monitor are used for close port.It is being to put that the main function of the function, which is, All system resources applied in OpenPort functions.
In one embodiment, it is described to call printing servo programe to wait to beat described first by the described first printing driving The second data to be printed that printing meets POS terminal according to being converted to include:Printing servo is called by the described first printing driving Program is converted to dot matrix array by the described first data conversion monochrome bitmap data to be printed, and by the monochrome bitmap data Data, the dot matrix array data is second data to be printed for meeting POS terminal.
Specifically, called by the described first printing driving after printing servo programe, printing servo programe will specify text The first data to be printed are obtained under part directory path.Judge whether the first data to be printed are monochrome bitmap data simultaneously, if First data to be printed are polyenergetic bitmap data, are first converted to bitmap data after monochrome bitmap data, then by monochrome bit Diagram data is converted to dot matrix array data, and the dot matrix array data is second data to be printed for meeting POS terminal.Its In, the dot matrix array data includes initial character, the byte number and graph data of each row figure.Wherein:
Initial character [1Byte], the line number for representing figure.
Byte number [2Byte, high byte is preceding], the graph data [width of a line of the first row figure of the first row figure For 384 points].
The byte number [2Byte, high byte is preceding] of second row figure.The like.The third line, fourth line etc..
Wherein, there are data (stain) on 1 expression position, 0 represents no data (white point) on the position, for example:
As shown in Figure 4 B, the pixel of figure is 98*44 pixels
Array after conversion is:
The first character section 0x2C of dot matrix array is that the line number (namely height) of expression image is 44.That is 0X2C is ten Senary, is converted to the decimal system for 44, i.e. 44 rows.By that analogy.
In one embodiment, it is described to wrap the step of described second data to be printed are sent into the printer of POS terminal Include:Described second data to be printed are sent to the print agent program of POS terminal, and by the print agent program by institute State the printer that the second data to be printed are transferred to the POS terminal.
Specifically, printing servo programe is converted to monochrome bitmap data after dot matrix array data, by arranging communication association View is sent to POS terminal.Arrange communications protocol and use LRC (Longitudinal Redundancy Check lonitudinal redundances schools Test) authentication mechanism.In dot matrix array data after servo programe is transferred to the print agent program of POS terminal, it can carry out first LRC is verified, it is ensured that the accuracy and integrality of dot matrix array data, if dot matrix array data is wrong, the printing generation of POS terminal Reason program will return to an error code and give printing servo programe;Printing servo programe will resend dot matrix array data to The print agent program of POS terminal;Correct complete data are transferred to the printing of the POS terminal by last print agent program Machine, completes print out task.Wherein, the agreement communications protocol includes data head, data length, data content, LRC checkings, sound Should wrap, response bag data head, response bag data content, LRC checking etc..Specifically, when sending array data, data are first sent Head, retransmits data content, and the definition of data head form refer to table 2.
Table 2
Wherein, bebinning character represents the opening flag of data, and data header information includes:The length of packet, device type The index information of information, the type of packet, and order, the initialization for transmitting data.Wherein, data content form is determined Justice refer to table 3.
Table 3
Data packet length is the length of the whole data in addition to beginning character, and when receiving terminal is received, data are received first Packet length, then receives remaining data again.Type of data packet and command index include parsing form, and computation scheme is really counted According to content, the information such as data radical.LRC is data check, for the XOR value of other data in addition to bebinning character, it is ensured that data Accuracy.The specific form of data content is as follows, if parameter is integer, refer to using 4 byte representations (high position is preceding) Table 4.
Table 4
Parameter 1 Parameter 2 Parameter 2 。。。 Parameter n
In data successful print or after data transmission procedure is finished, POS terminal will return information watched to printing Program is taken, its definition for returning to response bag refer to table 5.
Table 5
Wherein bebinning character represents the opening flag of data, and data header information includes:The length of packet, device type letter The index information of breath, the type of packet, and order, the initialization for transmitting data, data content form definition please be joined According to table 6.
Table 6
Packet each several part implication is identical with above-mentioned packet implication, and data content has more an error code, if wrong Code (ErrorCode) is LRC check errors by mistake, or response bag check errors itself, then PC ends resend a number According to bag.Error code is defined as follows:
Above-mentioned the step of described second data to be printed are sent into the printer of POS terminal, communications protocol is tested using LRC Card mechanism, it is ensured that the integrality and correctness of dot matrix array data, allows needed for POS printers accurately print user The data wanted.
Fig. 5 is the flow chart for the POS terminal method in another embodiment being virtually computer printer by POS terminal.Such as Shown in Fig. 5, it is virtually the method for computer printer by POS terminal, is described with POS terminal angle, including step 502 and step 504.Wherein:
Step 502, POS terminals are met by what the print agent program of POS terminal received that printing servo programe sends Second data to be printed, and the described second data to be printed are sent to the printer of the POS terminal;Wherein, described second First printing is driven what the first data conversion to be printed obtained was obtained by data to be printed for the printing servo programe.
Step 504, second data to be printed are printed by the printer of the POS terminal.
In one embodiment, the print agent program by POS terminal receives the symbol that printing servo programe is sent The step of data to be printed for closing POS terminal, includes:
The dot matrix array data that printing servo programe is sent, the dot matrix are received by the print agent program of POS terminal Described first printing is driven the first data to be printed obtained to be converted to monochrome bit by array data for the printing servo programe After diagram data, then obtained by the monochrome bitmap data are changed.
By above step, the data that print data is converted to suitable printer printing are completed, and ensure that data Complete and correctness, successfully by POS printers virtually be computer printer, improve the utilization rate of POS printers.
In an example, the described second data to be printed are sent to by the print agent program by POS terminal The step of POS terminal printer, includes:
The print agent program by POS terminal receive printing servo programe send meet treating for POS terminal After print data, the verification to the second data to be printed is carried out, correct the second complete data to be printed are then sent to POS Terminal printer is printed.
Specifically, the print agent program monitoring FPDP of POS terminal, when POS terminal print agent program monitoring is to beating After the dot matrix array data that print servo programe is sent, POS terminal print agent program can be second to dot matrix array data first Data to be printed carry out LRC checkings, judge whether dot matrix array data is correct and complete, if correctly, described second is waited to beat Printing comes out the second data-printing to be printed according to POS terminal printer is sent to, and then sending one to computer terminal has printed Into return value, and complete print out task.If the second data to be printed are incorrect or imperfect, POS terminal print agent journey Sequence can send an error code to computer terminal, and computer terminal printing servo programe will resend the second data to be printed To POS ends print agent program, it is transferred to POS terminal printer until the second data to be printed are correct complete and completes printing Task.
It is above-mentioned from POS terminal describe be virtually by POS terminal computer printer method, by rendezvous protocol by second Data to be printed are sent to POS terminal, and the mode that most data-printing comes out at last, it is ensured that the accuracy and integrality of data, User is set to print correct data by POS terminal printer.
Fig. 6 is that print data is transferred to the workflow diagram that POS terminal 120 is printed by one embodiment Computer 110. As shown in fig. 6, being provided with the first printing driving and printing servo programe on computer 110.Printing is installed in POS terminal 120 Agent and printer.Described with computer angle, print data is transferred to POS terminal 120 and printed by computer 110 Process include:
Step 602, printing driving selection instruction is received, and obtains the first printing driving.
Specifically, printing driving selection instruction can select POS terminal printer type institute to receive user at printing interface The instruction of generation.Selection instruction is driven to obtain the first printing driving according to the printing.First printing driving can be whole suitable for POS Hold the driver of printer.
Step 604, the first data to be printed are sent under specified file directory path by the first printing driving, and search tune With printing servo programe.
Specifically, first printing driving by the first data conversion to be printed into bitmap data, and by bitmap data send to Under the file directory path specified, and call printing servo programe.
Step 606, the first data to be printed are converted to dot matrix array data, dot matrix array number by the printing servo programe Sent according to the as second data to be printed, and by the second data to be printed to the print agent module of POS terminal, the printing end is beaten Print proxy module is the program that POS terminal is used for receiving computer terminal.
Specifically, the first data to be printed that computer terminal printing servo programe will be obtained under specified file directory path, Whether the bitmap data for then judging the first data to be printed is monochrome bitmap data, is then converted to monochrome bitmap data a little Battle array array, dot matrix array is the described second data to be printed, then sends the second data to be printed to POS by rendezvous protocol The print agent module at end.According to the POS terminal print agent program by monitoring PORT COM, obtain described in changed and treated Print data, and call POS printers;According to the POS printers, the data to be printed are printed.
Fig. 7 is the structured flowchart for the device in one embodiment being virtually computer printer by POS terminal.Such as Fig. 7 institutes Show, a kind of is virtually the device of computer printer by POS terminal, is described with computer angle, including printing drive module 702 With printing servo programe module 704.Wherein:
Printing drive module 702 is used to provide type of printer for POS terminal printer, receiving printing orders, and according to The print command obtains the first data to be printed.
Printing servo programe module 704, which is used to be converted to the described first data to be printed, to be met the second of POS terminal and treats Print data, the described second data to be printed is sent to the printer of POS terminal, so that the printer pair of the POS terminal Second data to be printed are printed.
In one embodiment, the printing drive module is additionally operable to specifying the first of acquisition the data storage to be printed Under file directory path, and the printing servo programe module is called to read described the from the specified file directory path One data to be printed, and the described first data to be printed are converted to the second data to be printed for meeting POS terminal.
In one of the embodiments, the printing drive module is additionally operable to call the printing servo programe module by institute The first data conversion monochrome bitmap data to be printed are stated, and the monochrome bitmap data are converted into dot matrix array data, institute It is second data to be printed for meeting POS terminal to state dot matrix array data.
In one of the embodiments, the printing servo programe module is additionally operable to send the described second data to be printed To the print agent program of POS terminal, and by the print agent program the described second data to be printed are transferred to described The printer of POS terminal.
Fig. 8 is the internal structure block diagram of POS terminal in one embodiment.As shown in figure 8, a kind of POS terminal includes printing Broker module 802 and print module 804.Wherein:
Print agent program module 802 is used to receiving that printing servo programe to send meets the second to be printed of POS terminal Data, and the described second data to be printed are sent to the printer of the POS terminal;Wherein, the described second data to be printed The first printing is driven what the first data conversion to be printed obtained was obtained for the printing servo programe.
Print module 804 is used to print the described second data to be printed.
In one embodiment, the print agent program is additionally operable to receive the dot matrix array number that printing servo programe is sent According to the described first printing is driven the first data to be printed obtained to turn by the dot matrix array data for the printing servo programe It is changed to after monochrome bitmap data, then obtained by the monochrome bitmap data are changed.
Referring to Fig. 9, Fig. 9 is the workflow diagram that POS terminal is virtually computer printer system in an embodiment, should System can include:
Printing drive module 902, for selecting POS printers printing driving and obtaining user's print command, will wait to beat Printing evidence is sent under specified file directory path, and printing servo programe is called in lookup.
Servo programe module 904 is printed, for obtaining data to be printed, and judges whether data to be printed are monochrome bitmap Data, if not monochrome bitmap data, convert thereof into after monochrome bitmap data, monochrome bitmap data are converted into dot matrix number Group data, and data are sent to POS terminal device by rendezvous protocol.
Whether just print agent module 906, receive the data that printing servo programe module is sent, and judge data Really, completely., will be again to computer terminal printing servo programe request dot matrix array data, then by dot matrix if data are wrong Array data is sent to print module.
Print module 908, receives dot matrix array data, and dot matrix array data is printed, and completes print out task, and Feed back print result.
Above-mentioned is virtually the method for printer by POS terminal, and by the printing procedure merging with computer terminal, user need not Do extra work just can print simple document using POS printers.And can be supported between computer terminal and POS A variety of on-link mode (OLM)s, it is not limited to traditional parallel port cable on-link mode (OLM), computer terminal can use serial ports, USB cable, with The too mode such as net, WiFi links POS printers and carrys out printed document, improves the utilization rate of POS printers.
One of ordinary skill in the art will appreciate that realize all or part of flow in above-described embodiment method, being can be with The hardware of correlation is instructed to complete by computer program, described program can be stored in a non-volatile computer and can be read In storage medium, the program is upon execution, it may include such as the flow of the embodiment of above-mentioned each method.Wherein, described storage is situated between Matter can be magnetic disc, CD, read-only memory (Read-Only Memory, ROM) etc..
Embodiment described above only expresses the several embodiments of the present invention, and it describes more specific and detailed, but simultaneously Therefore the limitation to the scope of the claims of the present invention can not be interpreted as.It should be pointed out that for one of ordinary skill in the art For, without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to the guarantor of the present invention Protect scope.Therefore, the protection domain of patent of the present invention should be determined by the appended claims.

Claims (12)

1. a kind of is virtually the method for computer printer by POS terminal, it is characterised in that comprised the following steps:
Receiving printing orders are driven by the first printing, and the first data to be printed, described the are obtained according to the print command One printing driving is used to provide type of printer for POS terminal printer;
Call printing servo programe to be converted to the described first data to be printed by the described first printing driving and meet POS terminal The second data to be printed;
Described second data to be printed are sent to the printer of POS terminal, so that the printer of the POS terminal is to described Two data to be printed are printed.
2. according to the method described in claim 1, it is characterised in that methods described also includes:
By the first of acquisition the data storage to be printed under specified file directory path;
Printing servo programe is called to read described first from the specified file directory path by the described first printing driving Data to be printed, and the described first data to be printed are converted to the second data to be printed for meeting POS terminal.
3. according to the method described in claim 1, it is characterised in that described that printing servo is called by the described first printing driving Program, which is converted to the described first data to be printed, to be met the second data to be printed of POS terminal and includes:
Printing servo programe is called by the described first data conversion monochrome bitmap data to be printed by the described first printing driving, And the monochrome bitmap data are converted into dot matrix array data, the dot matrix array data meets POS terminal to be described Second data to be printed.
4. according to the method described in claim 1, it is characterised in that described that described second data to be printed are sent to POS ends The step of printer at end, includes:
Described second data to be printed are sent to the print agent program of POS terminal, and will by the print agent program Second data to be printed are transferred to the printer of the POS terminal.
5. a kind of is virtually the method for computer printer by POS terminal, it is characterised in that including:
The second number to be printed for meeting POS terminal that printing servo programe is sent is received by the print agent program of POS terminal According to, and the described second data to be printed are sent to the printer of the POS terminal;Wherein, the described second data to be printed are First printing is driven what the first data conversion to be printed obtained was obtained by the printing servo programe;
Second data to be printed are printed by the printer of the POS terminal.
6. method according to claim 5, it is characterised in that the print agent program by POS terminal is received and beaten What print servo programe was sent includes the step of meeting the data to be printed of POS terminal:
The dot matrix array data that printing servo programe is sent, the dot matrix array are received by the print agent program of POS terminal Described first printing is driven the first data to be printed obtained to be converted to monochrome bitmap number by data for the printing servo programe According to rear, then obtained by the monochrome bitmap data are changed.
7. a kind of is virtually the device of computer printer by POS terminal, it is characterised in that including:
Printing drive module, for providing type of printer for POS terminal printer, receiving printing orders, and beaten according to described Print instruction obtains the first data to be printed;
Servo programe module is printed, the second number to be printed of POS terminal is met for the described first data to be printed to be converted to According to the described second data to be printed being sent to the printer of POS terminal, so that the printer of the POS terminal is to described Two data to be printed are printed.
8. device according to claim 7, it is characterised in that the printing drive module is additionally operable to treat the first of acquisition Print data is stored under specified file directory path, and calls the printing servo programe module from the specified file mesh Record reads the described first data to be printed in path, and the described first data to be printed are converted to meet the second of POS terminal Data to be printed.
9. device according to claim 7, it is characterised in that the printing drive module is additionally operable to call the printing to watch Program module is taken to be converted to a little by the described first data conversion monochrome bitmap data to be printed, and by the monochrome bitmap data Battle array array data, the dot matrix array data is second data to be printed for meeting POS terminal.
10. device according to claim 7, it is characterised in that the printing servo programe module is additionally operable to described Two data to be printed are sent to the print agent program of POS terminal, and wait by the print agent program to beat described second Printing is according to the printer for being transferred to the POS terminal.
11. a kind of POS terminal, it is characterised in that including:
Print agent program module, for receiving the second data to be printed for meeting POS terminal that printing servo programe is sent, and Described second data to be printed are sent to the printer of the POS terminal;Wherein, the described second data to be printed are beaten to be described First printing is driven what the first data conversion to be printed obtained was obtained by print servo programe;
Print module, for printing the described second data to be printed.
12. POS terminal according to claim 11, it is characterised in that the print agent program is additionally operable to receive printing The dot matrix array data that servo programe is sent, the dot matrix array data drives the described first printing for the printing servo programe Dynamic the first data to be printed obtained are converted to after monochrome bitmap data, then obtained by the monochrome bitmap data are changed 's.
CN201710278727.XA 2017-04-25 2017-04-25 Method and device for virtualizing POS terminal as computer printer and POS terminal Active CN107256134B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710278727.XA CN107256134B (en) 2017-04-25 2017-04-25 Method and device for virtualizing POS terminal as computer printer and POS terminal
PCT/CN2017/102215 WO2018196262A1 (en) 2017-04-25 2017-09-19 Method for virtualizing pos terminal into computer printer, computer, pos terminal, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710278727.XA CN107256134B (en) 2017-04-25 2017-04-25 Method and device for virtualizing POS terminal as computer printer and POS terminal

Publications (2)

Publication Number Publication Date
CN107256134A true CN107256134A (en) 2017-10-17
CN107256134B CN107256134B (en) 2020-01-21

Family

ID=60027229

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710278727.XA Active CN107256134B (en) 2017-04-25 2017-04-25 Method and device for virtualizing POS terminal as computer printer and POS terminal

Country Status (2)

Country Link
CN (1) CN107256134B (en)
WO (1) WO2018196262A1 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108388411A (en) * 2018-03-05 2018-08-10 菲尼克斯(南京)智能制造技术工程有限公司 Laser printing system, laser printing method and the conversion equipment for printer computer
CN109859414A (en) * 2018-12-21 2019-06-07 艾体威尔电子技术(北京)有限公司 A kind of method and system realizing POS machine Logo array modification and generating
CN110377246A (en) * 2019-07-19 2019-10-25 厦门顶尖电子有限公司 A kind of Method of printing and without character library printer
CN112035074A (en) * 2019-06-04 2020-12-04 中兴通讯股份有限公司 Printing implementation method, device and system and storage medium
CN112486429A (en) * 2020-11-26 2021-03-12 四川长虹电器股份有限公司 Method for automatically configuring printer by terminal
CN112925487A (en) * 2021-02-05 2021-06-08 北京互金新融科技有限公司 Printing method and device of target content, storage medium and electronic device

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220012034A1 (en) * 2020-07-10 2022-01-13 Roll, Inc Driver software for reading outgoing data from a point of sale (pos) system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101408836A (en) * 2007-10-09 2009-04-15 北京书生国际信息技术有限公司 Print implementing method
CN102053806A (en) * 2009-10-29 2011-05-11 精工爱普生株式会社 Printer driver, printer control method, and recording medium
CN104813271A (en) * 2012-12-28 2015-07-29 精工爱普生株式会社 Data conversion system, data conversion device, and data conversion method
WO2016129226A1 (en) * 2015-02-12 2016-08-18 セイコーエプソン株式会社 Printer driver and pos system
CN106408798A (en) * 2016-09-22 2017-02-15 上海寰果信息科技有限公司 Pos machine printing method and printing system
CN106445426A (en) * 2016-08-31 2017-02-22 深圳市华阳信通科技发展有限公司 Printing driver-based text data acquisition and printing control method and system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007072711A (en) * 2005-09-06 2007-03-22 Seiko Epson Corp On-demand print monitoring system, on-demand print monitoring method, on-demand print monitoring program and on-demand printer
CN102999299A (en) * 2011-09-13 2013-03-27 北京路模思科技有限公司 System and method for monitoring print data in Windows print process
US9542676B2 (en) * 2014-11-13 2017-01-10 Seiko Epson Corporation Host device, printing system, and data processing method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101408836A (en) * 2007-10-09 2009-04-15 北京书生国际信息技术有限公司 Print implementing method
CN102053806A (en) * 2009-10-29 2011-05-11 精工爱普生株式会社 Printer driver, printer control method, and recording medium
CN104813271A (en) * 2012-12-28 2015-07-29 精工爱普生株式会社 Data conversion system, data conversion device, and data conversion method
WO2016129226A1 (en) * 2015-02-12 2016-08-18 セイコーエプソン株式会社 Printer driver and pos system
CN106445426A (en) * 2016-08-31 2017-02-22 深圳市华阳信通科技发展有限公司 Printing driver-based text data acquisition and printing control method and system
CN106408798A (en) * 2016-09-22 2017-02-15 上海寰果信息科技有限公司 Pos machine printing method and printing system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
贺忠海: "《医学电子仪器设计》", 31 December 2014 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108388411A (en) * 2018-03-05 2018-08-10 菲尼克斯(南京)智能制造技术工程有限公司 Laser printing system, laser printing method and the conversion equipment for printer computer
CN108388411B (en) * 2018-03-05 2021-05-18 菲尼克斯(南京)智能制造技术工程有限公司 Laser printing system, laser printing method and conversion device for printer computer
CN109859414A (en) * 2018-12-21 2019-06-07 艾体威尔电子技术(北京)有限公司 A kind of method and system realizing POS machine Logo array modification and generating
CN112035074A (en) * 2019-06-04 2020-12-04 中兴通讯股份有限公司 Printing implementation method, device and system and storage medium
WO2020244379A1 (en) * 2019-06-04 2020-12-10 中兴通讯股份有限公司 Printing implementation method, device, and system, and storage medium
CN110377246A (en) * 2019-07-19 2019-10-25 厦门顶尖电子有限公司 A kind of Method of printing and without character library printer
CN112486429A (en) * 2020-11-26 2021-03-12 四川长虹电器股份有限公司 Method for automatically configuring printer by terminal
CN112925487A (en) * 2021-02-05 2021-06-08 北京互金新融科技有限公司 Printing method and device of target content, storage medium and electronic device

Also Published As

Publication number Publication date
CN107256134B (en) 2020-01-21
WO2018196262A1 (en) 2018-11-01

Similar Documents

Publication Publication Date Title
CN107256134A (en) It is virtually method and apparatus, the POS terminal of computer printer by POS terminal
US7466442B2 (en) Printing system and method for customization of a print job
US8255894B2 (en) Update data transmission method, computer program for practicing the method, host device and firmware writing system
US6665081B1 (en) Print system printer driver and printer
US20060092467A1 (en) Print job workflow system
US20030081240A1 (en) Method and apparatus for adjusting print settings for a file
US20110242565A1 (en) Printer control system, printing method, and storage medium
EP1830250B1 (en) Non-postscript printer description file generating tool
US20100165399A1 (en) Job status monitoring system, job status monitoring method, program, and storage medium
JP2008262543A (en) Discontinuous transfer of pdf data for pdf direct printing
US20130107289A1 (en) Rasterization of printing data
US10380387B2 (en) Integrated smart card printing and encoding
JPH05177884A (en) Controller for printer
US20130258377A1 (en) Printer control system, printing method, and storage medium
US20030121003A1 (en) Application launcher testing framework
US20060209334A1 (en) Methods and systems for providing index data for print job data
CN100382002C (en) Printing method and apparatus for rectifying error and computer readable recording medium
US20090024919A1 (en) Image forming apparatus to set additional emulation functions and an image processing method thereof
US20110242582A1 (en) Printer control system, printing method, and storage medium
US8400671B2 (en) System and method for selectively disabling document rendering
JP2008052698A (en) Apparatus and method for identifying language format
JPH11296317A (en) Data processor and control method for the same
JP4586839B2 (en) Image processing apparatus, printing system, and program
US8248643B2 (en) Image forming apparatus
KR100657307B1 (en) Print data processing method and apparatus

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