A kind of printing device
Technical field
The present invention relates to a kind of printing device.
Background of invention
Most of in the market low and middle-end laser printers adopt the rasterisation print data stream to print control, and most printer controllers wherein are that employing general processor or general processor are the printer application specific processor of kernel; With general processor or with general processor is that the process that the printer application specific processor of kernel is handled the rasterisation print data stream is: the internal memory that the stream of rasterized data (encoded compression) of port is deposited in printer controller with the DMA passage of general processor, general processor need repeatedly be handled stream of rasterized data, each processing all needs internally to deposit into the row read-write, because general processor is difficult to reach the requirement of real-time output when the reduction data with rasterized that decompresses is handled, therefore the rasterisation restoring data need be deposited and go back internal memory.Requiring to need general processor to have quite high performance under certain print speed condition like this, the more complicated of memory management simultaneously.For level and smooth port transmission speed, raising print speed, need in internal memory, cushion the multipage data, therefore internal memory is had relatively high expectations.
Because general processor not only will carry out work such as command interpretation and data decompression, and to keep in real time managing and disposing with the communication of main frame and to printing hardware, also to be responsible for the management of internal memory simultaneously, this makes that the work load of general processor is excessive, need the higher cost input, could satisfy the requirement on its performance.
Summary of the invention
At above-mentioned normal printer existing problem and shortage in print procedure, the purpose of this invention is to provide a kind of printing device.This equipment can effectively solve the problem that print data is repeatedly stored in storer, thereby has better met the requirement of real-time.Simultaneously, design a kind of independently memory control module and internally deposit into the line pipe reason, to alleviate the work load of general processor.
In order to achieve the above object, printing device of the present invention comprises: 1. printing device, and described printing device comprises: printer data input interface, printer interface protocol module, port arbitration modules, sdram interface, SDRAM (synchronous random access memory), general processor, printing device movement interface and printer engine;
Described printer interface protocol module is responsible for and will be imported described printer data input interface through the print data stream that forms after print driver, print processor program, the language monitor routine processes;
Described port arbitration modules is responsible for input port is managed, the port arbitration;
Described data stream stores among the described SDRAM by described sdram interface;
Described general processor reads the data of storer by described sdram interface and analyzes, and according to file content movement is carried out initialization and necessary setting.
It is characterized in that described printing device also comprises device page end character string to described print data before described print data stream deposits described SDRAM in to be monitored, for described memory management module provides the page or leaf counting;
Its feature also is, described printing device also comprises a memory control module and command interpretation and data decompression module;
Described memory control module is used for described SDRAM is carried out memory management;
Command interpretation and data decompression module are responsible for flow through command interpretation and data decompression module of the rasterisation print data in the page or leaf handled and be reduced into printable data with rasterized;
In due course, described general processor is finished analysis to the header file and the top margin file of print job, and after the movement of printer is provided with, described command interpretation and data decompression module obtain the control of reading of described SDRAM, read the data stream that comprises condensed instruction and packed data, compressed encoding is reduced according to condensed instruction; Stream of rasterized data after the reduction is exported by the relevant output format of movement by the printer engine interface module.
More particularly, described memory control module is controlled to be a toroidal memory with described SDRAM, and this control module comprises three memory management units: write pointer (lpWrite), read pointer (lpRead) and current type face starting position pointer (lpCurrentJob); Described write pointer (lpWrite) points to the position that data stream is written into storer, described read pointer (lpRead) points to the position that data stream is read out storer, and described current type face starting position pointer (lpCurrentJob) points to the position of current type face starting position; Described memory management module is determined described SDRAM is carried out the address of read or write according to the value and the mutual relationship thereof of described three memory management units, and indicates the state of described SDRAM.
Because the present invention has adopted command interpretation and the data decompression module that is separated with general processor, therefore can guarantee certain decompression speed, and can reach the requirement of real-time decompression real time print, thereby avoided that print data needs the repeatedly phenomenon of storage in the existing printing device.
In addition, the present invention has also adopted independently memory control module, is used for memory page is simply controlled, and does not need general processor that storer is managed, and therefore, has alleviated the burden of general-purpose storage.
By above-mentioned 2 beneficial effects as can be seen, because general processor need not again print data to be carried out command interpretation and decompression, also need not store memory is managed, therefore the performance requirement for general processor will reduce greatly, thereby reduce the cost expense.
Description of drawings
By the accompanying drawing of the following detailed and the corresponding embodiment of the invention, will understand the present invention fully more comprehensively.Certainly, accompanying drawing should not be used to limit the invention in the specific example, and it just plays the effect of explaining and helping to understand.Fig. 1 shows the module frame chart that adopts printing device of the present invention.Fig. 2 shows the logical schematic of the storer annular management of the method for the invention.
Embodiment
As shown in Figure 1, rasterisation print data stream after process print driver, print processor program, the language monitor routine processes enters the printer controller port by the parallel port or the USB port of PC, the rasterisation print data stream that reaches earlier will obtain print processing power, disposal right discharges after the entire job printing is finished, and the rasterisation print data stream that does not obtain print processing power will be inhibited in port; Port arbitration logic is responsible for Port Management, port arbitration.
Control is monitored the page end character string of rasterisation print data stream, the page or leaf counting is provided for multipage face annular memory management module.What be responsible for this operation of control can be an independent module, is independent of other modules of this equipment, and certainly, this function realizes among also can being integrated in other modules.All do not break away from essential characteristic of the present invention.
Then, this rasterisation print data stream enters SDRAM and stores, rasterisation print data stream after the storage is managed by memory control module, when the data stream in the storer during more than or equal to one page, general processor reads the data of storer and analyzes the operation header file and the top margin file by the SDARM interface, according to file content movement is carried out initialization and necessary setting, start afterwards and simplify rasterisation PCL interpreter and data decompression module.Simplify rasterisation PCL interpreter and data decompression module and be activated the control of reading that the back obtains SDRAM, flow through PCL interpreter and data decompression module of rasterisation print data in the page or leaf handled and is reduced into printable data with rasterized, the control of reading with SDRAM after one page is finished discharges, by the analyzing and processing between general processor work page or leaf.Repeat this processing procedure and after general processor is handled end of job command string in the rasterisation print data stream, finish this print procedure.
Stream of rasterized data after the reduction is exported by the relevant output format of movement by the printer engine interface module; Can keep in communication with movement simultaneously at data output simple general-purpose processor.
Introduce command interpretation of the present invention and decompression process below in detail.Header file that fulfils assignment at the simple general-purpose processor according to preferred specific embodiments and top margin file analysis, initialization is provided with the back and starts and simplify rasterisation PCL interpreter and data decompression module to movement, Processing tasks is undertaken by this module, this module is reduced to compressed encoding according to condensed instruction obtaining reading to read after the control and comprising the data stream of simplifying rasterisation PCL condensed instruction and compressed encoding of SDRAM.For the efficient that improves compressed encoding has adopted the shared coding of multiple coding techniques, different coding methods is by PCL instruction indication; Coding adopts in the row fragmentation technique in the coding and row, makes and press and rise (when pressure rises with not condensed instruction) scope to be restricted to minimum.In case module is finished current page and handled (running into the EOP instruction), module discharges the control of reading of SDRAM.
This module can independently be finished page explanation and the data decompression of interior rasterisation PCL instruction, can guarantee certain decompression speed, and guaranteeing decompresses in real time prints.
To contrast Fig. 2 below and describe the preferred storage management method of the present invention in detail.This method is a kind of memory management technology that is used for storaging printing data stream.An internal memory that distributes is considered as toroidal memory, position, the read pointer lpRead sensing data stream that memory management module (hardware module) management write pointer lpWrite sensing data stream is written into storer is read out the position of storer, current type face starting position pointer lpCurrentJob points to the position that current type face begins, and three pointers are done the rotation of " suitable " hour hands as indicator; LpWrite is to " suitable " hour hands time interval " sky " internal memory of lpCurrentJob, and new data stream can be accepted in this interval.If receive ' operation begins ' order, lpCurrentJob=lpRead=lpWrite=0; LpWrite counting when data stream is written into internal memory, this moment, lpWrite resembled the rotation of indicator work ' suitable ' hour hands, and lpWrite=0 when lpWrite reaches the length of this piece internal memory crosses ' 12 ' back as indicator and returns zero.LpRead counting when data stream is read out internal memory, this moment, lpRead also resembled the rotation of indicator work ' suitable ' hour hands, if this page needs ' copy ' many parts after the page data output, memory management module is after receiving CopyCommand (copy command), lpCurrentJob is composed to lpRead, it is contrary to resemble a lpRead ' ' hour hands push the position of lpCurrentJob, and the current page data will be repeated output once.After if current page output is finished or ' copy ' meet the requirements of umber, memory management module will be received CurrentPagePrintedCom (current page is printed and finished order), administration module composes lpRead to lpCurrentJob, it is suitable to resemble a lpCurrentJob ' ' hour hands push the position of lpRead, then can descend the printing of one page, the page data of last time this moment is with abandoned.LpRead=0 when lpRead reaches the length of this piece internal memory is the same with lpWrite.This memory management module obtains the length of ' sky ' internal memory simultaneously, and (if the internal memory length=2**N that distributes, MemoryEmptyLength=lpCurrentJob-lpWrite) overflow automatically the .N+1 position.PC can obtain ' the print control unit status word string ' that comprise ' internal storage state ' by corresponding order and obtain internal storage state.
Need not consider ' page ' form when using this annular storage administration print data stream, whether the language monitor program only need need to continue transmission by what ' obtaining internal storage state ' order obtained that ' sky ' internal storage state (as whether ' sky ' internal memory of 64k-bytede is arranged) comes specified data stream, guarantee that hardware corridor does not get clogged, improve the service efficiency of internal memory simultaneously, store the packed data of a plurality of pages.
This scheme memory management is simple, and the simple general-purpose processor only needs to send ' operation begins ', ' copy ' or orders such as ' current page are printed and finished ' according to analyzing page header file result and current page output back.
According to above description, those of ordinary skill in the art can be easy to implement method of the present invention.Certainly, foregoing invention can specifically be implemented in other special shape, and does not deviate from marrow or the basic feature that is disclosed.