Disclosure of Invention
The embodiment of the invention provides a method, a device, equipment and a storage medium for processing print data, which are used for solving the technical problem of how to efficiently and simply read image data from a memory correctly.
In a first aspect, an embodiment of the present invention provides a print data processing method, where the method includes:
acquiring a logic channel parameter corresponding to the logic channel number and the number of the current printing task according to the logic channel number;
acquiring task parameters corresponding to the current printing task and the printing position of the current printing task according to the serial number of the current printing task;
obtaining a storage address and a printing parameter of channel data corresponding to the logic channel according to the logic channel parameter, the task parameter corresponding to the current printing task and the printing position;
extracting the channel data from a printing memory according to the storage address, and processing the channel data and the printing parameters to obtain printing data;
one of the logical channels corresponds to one of the physical channels, and one of the physical channels corresponds to one of the printing colors or one of the printing nozzles or one of the rows of nozzles in the printing nozzle.
Preferably, the job parameter includes a print size of a target image corresponding to a current print job, the logical channel parameter includes a channel offset, a channel enable signal, and channel dot data, the print position includes a coordinate value of the current print job in a first direction relative to the print platform and a current print coordinate value in a second direction perpendicular to the first direction, and the current print coordinate value of the current print job is incremented by 1 after all the logical channels complete one data read.
Preferably, after obtaining the storage address and the printing parameter of the channel data corresponding to the logical channel according to the logical channel parameter, the task parameter corresponding to the current printing task, and the printing position, the method further includes:
determining the printing range of the target image in the second direction according to the printing size and the printing position of the target image;
judging whether the logic channel is in the printing range or not according to the current printing coordinate value of the current printing task;
when the logical channel is within the print range, the channel data is valid;
when the logical channel is not within the print range, the channel data is invalid.
Preferably, the extracting the channel data from the print memory according to the storage address, and processing the channel data and the print parameter to obtain the print data includes:
when the channel data is valid, extracting the channel data according to the storage address;
processing the channel data according to task parameters to obtain printing data;
wherein the processing includes one or more of masking processing, feathering processing, and merging processing, and the processing the task parameters further includes, for masking processing: the end pixel position of the start mask, the start pixel position of the end mask.
Preferably, after the extracting the channel data from the print memory according to the storage address and processing the channel data and the print parameter to obtain the print data, the method further includes:
and inputting the printing data corresponding to the logic channel number into the corresponding physical channel according to the logic channel number for ink-jet printing.
In a second aspect, an embodiment of the present invention provides a print data processing apparatus, including:
the channel parameter acquisition module is used for acquiring the corresponding logical channel parameters and the serial number of the current printing task according to the logical channel serial number;
the task parameter acquisition module is used for acquiring the task parameters corresponding to the current printing task and the printing position of the current printing task according to the current printing task number;
the data address acquisition module is used for acquiring a storage address and a printing parameter of channel data corresponding to the logic channel according to the logic channel parameter, the task parameter corresponding to the current printing task and the printing position;
the printing data acquisition module is used for extracting the channel data from the printing memory according to the storage address and processing the channel data and the printing parameters to obtain printing data;
one of the logical channels corresponds to one of the physical channels, and one of the physical channels corresponds to one of the printing colors or one of the printing nozzles or one of the rows of nozzles in the printing nozzle.
Preferably, the apparatus further comprises:
the printing range determining module is used for determining the printing range of the target image in the second direction according to the printing size and the printing position of the target image;
and the judging module is used for judging whether the logic channel is in the printing range according to the current printing coordinate value of the current printing task.
Preferably, the apparatus further comprises:
the printing module is used for inputting the printing data corresponding to the logic channel number into a corresponding physical channel for ink-jet printing according to the logic channel number;
in a third aspect, an embodiment of the present invention provides a print data processing apparatus including: at least one processor, at least one memory, and computer program instructions stored in the memory that, when executed by the processor, implement the method of the first aspect of the embodiments described above.
In a fourth aspect, an embodiment of the present invention provides a storage medium, on which computer program instructions are stored, which when executed by a processor implement the method of the first aspect in the foregoing embodiments.
In summary, the print data processing method, apparatus, device and storage medium provided in the embodiments of the present invention; the invention takes the logic channel as a unit to obtain various parameters, obtains the storage address of the corresponding channel data through parameter calculation, reads the channel data according to the correct storage address, processes the data simply and efficiently by taking the logic channel as a unit, binds the channel data in the printing memory with the logic channel through the storage address, ensures the one-to-one correspondence between each logic channel and the corresponding channel data, accurately extracts the channel data corresponding to each logic channel from the printing memory, inputs the channel data into the corresponding physical channel for ink-jet printing, and solves the technical problem that the image data cannot be correctly read from the memory and accurately transmitted.
Detailed Description
Features and exemplary embodiments of various aspects of the present invention will be described in detail below, and in order to make objects, technical solutions and advantages of the present invention more apparent, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not to be construed as limiting the invention. It will be apparent to one skilled in the art that the present invention may be practiced without some of these specific details. The following description of the embodiments is merely intended to provide a better understanding of the present invention by illustrating examples of the present invention.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The embodiment of the invention provides a printing data processing method, which takes a logic channel as a unit to obtain various parameters, obtains the storage address of the corresponding channel data through parameter calculation, the data processing is simple and efficient by taking the logic channel as a unit according to the reading channel data with correct storage address, binding the channel data in the printing memory with the logic channels through the storage addresses, ensuring the one-to-one correspondence between each logic channel and the corresponding channel data, the channel data corresponding to each logic channel can be accurately extracted from the printing memory, one logic channel corresponds to one physical channel, the channel data is processed and then accurately output according to the corresponding relation between the logic channels and the physical channels, and the technical problem that the image data cannot be accurately read from the memory and accurately transmitted is solved.
Referring to fig. 1, the method specifically includes the following steps:
s1, acquiring the corresponding logic channel parameters and the serial number of the current print task according to the logic channel serial number;
the logic channels are configured by the printing system and exist virtually, each configured logic channel has identity information, namely the logic channel number in the invention, the physical channels are distributed into a plurality of printing modules according to the printing requirement aiming at each printing, each printing module comprises a plurality of physical channels, meanwhile, a plurality of logic channels are configured for each physical channel according to the printing requirement and the distribution condition, the configuration is that the printing module, the physical channel and the logical channel are bound invisibly, namely the printing module can determine the physical channel owned by the printing module, the logical channel required by the printing module can be determined through the physical channel, the corresponding physical channel can be found through the logical channel, and the printing module to which the printing module belongs can be determined through the physical channel. When one-time printing is needed, the printing module, the physical channel and the logic channel are configured, the logic channel is used as a bridge for extracting data during printing, the logic channel is used as the bridge for extracting data, the physical channel corresponding to each logic channel is determined to be the largest according to the serial number of the logic channel, the logic channel parameter and the serial number of the current printing task of each logic channel are determined, one printing task can be printed when a common primary machine is started for printing a plurality of printing tasks, for example, 300 parts of variable images need to be printed, each time of printing has a same background image and a variable image at the same position of the background image, each part is a printing task, and each printing task has identity information, namely the serial number of the printing task in the invention, and each printing module of the printing tasks is provided with a task queue, and task statistics is carried out when each task is printed, so that the serial number of the current printing task can be obtained when the printing data is extracted by the logic channel. The physical channel is a data volume corresponding to one spray head in one-time ignition printing, or a data volume of one color in the spray head, or a data volume of a row of spray holes. If the physical channels are data volumes corresponding to one nozzle, each physical channel only belongs to one production line according to printing requirements, and each physical channel is configured with one logical channel, so that the logical channels and the physical channels are in one-to-one mapping relation.
S2, acquiring task parameters corresponding to the current printing task and the printing position of the current printing task according to the serial number of the current printing task;
s3, obtaining the storage address and the printing parameter of the channel data corresponding to the logic channel according to the logic channel parameter, the task parameter corresponding to the current printing task and the printing position;
s4, extracting the channel data from the printing memory according to the storage address, and processing the channel data and the printing parameters to obtain printing data.
Referring to fig. 2, specifically, in a certain printing, it is required to first obtain a logic channel number, and obtain a logic channel parameter corresponding to the logic channel number and a current print task number of the logic channel while obtaining the logic channel number; the method comprises the steps of simultaneously obtaining task parameters and a printing position of a task according to a current printing task number, then obtaining a storage address and a printing parameter of channel data corresponding to a logical channel in a printing memory through logic channel parameters, the task parameters corresponding to the current printing task and the printing position, correctly extracting the channel data from the printing memory according to the storage address, carrying out data processing on the channel data according to the printing parameter to obtain printing data, and then accurately inputting the printing data into a physical channel according to a mapping relation between the logical channel and the physical channel to carry out ink jet printing.
The task parameters include the printing size of a printing target image corresponding to a current printing task, the number of physical channels and the position of the physical channels which are required to be used in the printing process are determined according to the size of each printing target image, then the logical channels are configured for the printing task according to the number of the physical channels, and the logical channel parameters such as the relative position between each logical channel are determined according to the position of the physical channels, so that the logical channel parameters include channel offset, channel enable and channel insertion points, the channel offset is used for judging whether the corresponding channel works in the current printing task, the channel insertion points are specifically used for calculating the storage address of the corresponding data in the memory, that is, the data address of the channel corresponding to the logical channel of a certain printing task is: the number of the channel plug points is x, the data length corresponding to the logic channel and the initial data address of the current printing line. And the printing position comprises a coordinate value of the current printing task in a first direction relative to the printing platform and a current printing coordinate value in a second direction perpendicular to the first direction, and when all the logic channels finish one-time data reading, the current printing coordinate value of the current printing task is added with 1. Specifically, referring to fig. 3, the printing size of the printing target image F in the current task parameter is the length of two nozzles along the nozzle arrangement direction (x direction), in this example, a nozzle is defined that can print 300 pixels (that is, the number of nozzles owned by a nozzle is 300), the length of a nozzle along the direction perpendicular to the nozzle arrangement direction (y direction), and the specific printing position is the position from the 3 rd nozzle to the 4 th nozzle. Taking an example that one physical channel corresponds to one nozzle, when each physical channel is configured with one logical channel, the channel offset of the logical channel PCH0 in the x-axis direction is 0 distance of the nozzles, that is, no offset, the channel offset of the logical channel PCH1 in the x-axis direction is 1 distance of the nozzles, that is, 300 pixels, the channel offset of the logical channel PCH2 in the x-axis direction is 2 distances of the nozzles, that is, 600 pixels, and so on, the channel offset of each logical channel in the x-axis direction is obtained. The print image is processed by the image raster processor and is arranged according to original data, namely 720 pixel points are required to be printed on each inch of each row of the 720 × 720DPI image, but the actual spray head only has 360 nozzles, namely 360 pixels are printed at most once, and 720 pixels are required to be printed twice, so that the data is required to be split, in order to ensure that the 720 pixel points are evenly printed on the data and are staggered into two parts and are subjected to interpolation numbering, namely each part has one interpolation point, when the logical channel is used for data extraction, the channel interpolation point number of the logical channel is required to be changed, namely the logical channel is required to extract the channel data to accurately calculate the address of data storage. The printing position is an accurate coordinate value of a target image printed specifically relative to the printing platform, so that the printing device knows the specific printing position of the target image clearly, as shown in fig. 3, the coordinate value of a current print job in the printing position relative to the printing platform in a first direction (X direction) is 600 pixels, the range of the current print coordinate value in a second direction (Y direction) perpendicular to the first direction is 300 pixels to 600 pixels, when all logic channels finish one data reading, the current print coordinate value of the current print job is added by 1, the current print coordinate value is a value of a Y-axis accumulator of the printing device, the Y-axis accumulator is connected with a raster in the Y direction of the printing device, and a specific position count is obtained according to the raster.
Referring to fig. 4, in the step S3: after the storage address and the printing parameter of the channel data corresponding to the logical channel are obtained according to the logical channel parameter, the task parameter corresponding to the current printing task and the printing position, the method further comprises the following steps:
s31, determining the printing range of the printing target image in the second direction according to the printing size and the printing position of the target image;
s32, judging whether the channel offset is in the printing range according to the current printing coordinate value of the current printing task;
s33, when the channel offset is within the printing range, the channel data is valid;
and S34, when the channel offset is not in the printing range, the channel data is invalid.
Specifically, as shown in fig. 3, an xy two-dimensional coordinate system is established with the direction in which the nozzles are arranged as the x-axis, the direction in which the printing medium moves as the y-axis, the length of one nozzle is 300 pixels, the printing size of the print target image F in the current job parameter is 600 pixels, which are the lengths of two nozzles, 300 pixels, which are the lengths of two nozzles, in the direction perpendicular to the nozzle arrangement direction, the specific printing position is 600 → 1200, which is the position from the 3 rd nozzle to the 4 th nozzle, which is the coordinate in the x-axis direction, the printing range of the print target image F is 600 → 1200, the y-axis direction is 300 → 600, whether the logical channel is located in the printing range is determined according to the current printing coordinate value of the current printing job, and when the current printing coordinate value is within the 300 → 600 range, the logical channel is within the printing range, the channel data is valid; when the current print coordinate value is not within the range of 300 → 600, the logical channel is not within the print range, the channel data is invalid, and no ink is discharged when the channel data is invalid.
When the channel data is valid, please refer to fig. 5, the step S4: extracting the channel data from the printing memory according to the storage address, and processing the channel data and the printing parameters to obtain printing data specifically includes:
s41, when the channel data is valid, extracting the channel data according to the storage address;
and S42, processing the channel-free data according to the task parameters to obtain printing data.
The specific treatment includes one or more of a masking treatment, a feathering treatment, and a combining treatment. Processing the task parameters for masking includes: the end pixel position of the start mask, the start pixel position of the end mask. Referring to fig. 3, when the Y-axis accumulator value reaches 300, the channel data is valid, but not all the channel data are data of the target image, so that the data not belonging to the target image need to be masked, for example, the channel data corresponding to the logical channel PCH0, the logical channel PCH1, the logical channel PCH4, the logical channel PCH5, and the logical channel PCH6 in this embodiment need to be masked, the channel data corresponding to the logical channel PCH0, the logical channel PCH1, the logical channel PCH4, the logical channel PCH5, and the logical channel PCH6 are masked according to the task parameter to be processed into no ink data, at this time, the end position 600 pixel position of the logical channel PCH1 is the end pixel position of the start mask, and the start mask area is all the logical channels in the 0-600 pixel area, the start of the logical channel PCH4, i.e. 1200 pixel locations, is the start pixel location of the end mask, and the end mask region is all logical channels of the 1200 to 2100 pixel regions; when certain images need higher printing quality, feathering the images during printing to ensure that the printing effect is better, and specifically performing AND operation on channel data and feathering template data to obtain printing data; when the variable image is printed, each image in a class of variable images has a same background image, and the same position of each image has a variable image which changes according to a certain rule.
In another implementation, the method further comprises:
inputting the printing data corresponding to the logic channel number into a corresponding physical channel for ink-jet printing according to the logic channel number; the physical channel corresponds to a spray head or a color or a row of spray holes, and therefore image data are correctly distributed to the corresponding physical spray heads.
Referring to fig. 6, an embodiment of the present invention provides a print data processing apparatus, including:
a channel parameter obtaining module 10, configured to obtain a logic channel parameter corresponding to the logical channel number and a number of the current print job according to the logic channel number;
the task parameter acquiring module 20 is configured to acquire a task parameter corresponding to the current print task and a print position of the current print task according to the current print task number;
a data address obtaining module 30, configured to obtain, according to the logical channel parameter, the task parameter corresponding to the current print task, and the print position, a storage address and a print parameter of channel data corresponding to the logical channel;
the printing data acquisition module 40 is configured to extract the channel data from the printing memory according to the storage address, and process the channel data and the printing parameters to obtain printing data;
one of the logical channels corresponds to one of the physical channels, and one of the physical channels corresponds to one of the printing colors or one of the printing nozzles or one of the rows of nozzles in the printing nozzle.
Preferably, the apparatus further comprises:
a printing range determining module 50, configured to determine a printing range of the printing target image in the second direction according to the printing size of the target image and the printing position;
a determining module 60, configured to determine whether the channel offset is within the printing range according to the current printing coordinate value of the current printing task.
Preferably, the apparatus further comprises:
and the printing module 70 is configured to input the corresponding printing data into the corresponding physical channel according to the logical channel number to perform inkjet printing.
Preferably, the print data acquiring module 40 further includes:
a channel data extracting unit, configured to extract the channel data according to the storage address when the channel data is valid;
the printing data acquisition unit is used for processing the channel data according to the task parameters to obtain printing data;
wherein the processing includes one or more of masking processing, feathering processing, and merging processing, and the processing the task parameters further includes, for masking processing: the end pixel position of the start mask, the start pixel position of the end mask.
In addition, the print data processing method of the embodiment of the present invention described in conjunction with fig. 1 may be implemented by a print data processing apparatus. Fig. 7 shows a hardware configuration diagram of a print data processing apparatus according to an embodiment of the present invention.
The print data processing apparatus may comprise a processor 401 and a memory 402 in which computer program instructions are stored.
Specifically, the processor 401 may include a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or may be configured as one or more Integrated circuits implementing embodiments of the present invention.
Memory 402 may include mass storage for data or instructions. By way of example, and not limitation, memory 402 may include a Hard Disk Drive (HDD), floppy Disk Drive, flash memory, optical Disk, magneto-optical Disk, tape, or Universal Serial Bus (USB) Drive or a combination of two or more of these. Memory 402 may include removable or non-removable (or fixed) media, where appropriate. The memory 402 may be internal or external to the data processing apparatus, where appropriate. In a particular embodiment, the memory 402 is a non-volatile solid-state memory. In particular embodiments, memory 402 includes Read Only Memory (ROM). Where appropriate, the ROM may be mask programmed ROM, programmable ROM (prom), erasable prom (eprom), electrically erasable prom (eeprom), electrically rewritable ROM (earom), or flash memory, or a combination of two or more of these.
The processor 401 realizes any one of the print data processing methods in the above-described embodiments by reading and executing computer program instructions stored in the memory 402.
In one example, the print data processing apparatus may further include a communication interface 403 and a bus 410. As shown in fig. 7, the processor 401, the memory 402, and the communication interface 403 are connected via a bus 410 to complete communication therebetween.
The communication interface 403 is mainly used for implementing communication between modules, apparatuses, units and/or devices in the embodiment of the present invention.
Bus 410 includes hardware, software, or both to couple the components of the print data processing apparatus to each other. By way of example, and not limitation, a bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hypertransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an infiniband interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a video electronics standards association local (VLB) bus, or other suitable bus or a combination of two or more of these. Bus 410 may include one or more buses, where appropriate. Although specific buses have been described and shown in the embodiments of the invention, any suitable buses or interconnects are contemplated by the invention.
In addition, in combination with the print data processing method in the above embodiment, the embodiment of the present invention can be implemented by providing a computer-readable storage medium. The computer readable storage medium having stored thereon computer program instructions; the computer program instructions, when executed by a processor, implement any of the print data processing methods in the above embodiments.
In summary, the print data processing method, apparatus, device and storage medium provided in the embodiments of the present invention; the invention takes the logic channel as a unit to obtain various parameters, obtains the storage address of the corresponding channel data through parameter calculation, reads the channel data according to the correct storage address, processes the data simply and efficiently by taking the logic channel as a unit, binds the channel data in the printing memory with the logic channel through the storage address, ensures the one-to-one correspondence between each logic channel and the corresponding channel data, accurately extracts the channel data corresponding to each logic channel from the printing memory, inputs the channel data into the corresponding physical channel for ink-jet printing, and solves the technical problem that the image data cannot be correctly read from the memory and accurately transmitted.
It should also be noted that the exemplary embodiments mentioned in this patent describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above-described steps, that is, the steps may be performed in the order mentioned in the embodiments, may be performed in an order different from the order in the embodiments, or may be performed simultaneously.
As described above, only the specific embodiments of the present invention are provided, and it can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the system, the module and the unit described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. It should be understood that the scope of the present invention is not limited thereto, and any equivalent modifications or substitutions can be easily made by those skilled in the art within the technical scope of the present invention.