Disclosure of Invention
The embodiment of the invention provides a printing data transmission method, a printing data transmission device, printing data transmission equipment and a storage medium, which are used for solving the problems that data cannot be accurately transmitted and are easy to lose after a printing interruption in the prior art.
In a first aspect, an embodiment of the present invention provides a print data transmission method, where the method includes:
judging whether the main control board is connected with the host;
when the main control board is connected with the host computer, controlling the host computer to send the printing data to the main control board;
acquiring receiving information of the main control board for receiving the printing data, and judging whether the printing data is stored in a cache space on the main control board according to the receiving information;
and when the printing data is not stored in the cache space on the main control board, controlling the host to send the printing data to the main control board again.
Preferably, the receiving information includes: the receiving time of the main control board receiving the printing data, and the size of the printing data actually received when the main control board receives the printing data.
Preferably, the acquiring the receiving information of the main control board receiving the printing data, and determining whether the printing data is stored in the buffer space on the main control board according to the receiving information includes:
acquiring the receiving time of the main control board for receiving the printing data, and judging whether the receiving time is greater than a threshold A;
and when the receiving time is greater than a threshold value A, the main control board fails to receive the printing data, and the printing data is not stored in the cache space on the main control board.
Preferably, the acquiring the receiving information of the main control board receiving the printing data, and determining whether the printing data is stored in the buffer space on the main control board according to the receiving information includes:
and when the receiving time is less than or equal to a threshold value A, the main control board successfully receives the printing data, and the printing data is stored in a cache space on the main control board.
Preferably, the obtaining of the receiving information of the main control board receiving the print data and determining whether the print data is stored in the buffer space on the main control board according to the receiving information further includes:
acquiring the size of the print data and the size of the actually received print data, and judging whether the size of the actually received print data is equal to the size of the print data or not;
and when the size of the actually received printing data is smaller than that of the printing data, the printing data is not stored in the buffer space on the main control board.
Preferably, the size of the buffer space is equal to 3 times of the space required by the printer nozzle to scan the data printed once and store the data into the memory.
Preferably, the size of the buffer space is equal to 5 times of the space required by the printer nozzle to scan the data printed once and store the data into the memory.
In a second aspect, an embodiment of the present invention provides a print data transmission apparatus, including:
the judging module is used for judging whether the main control panel is connected with the host;
the data sending module is used for sending the printing data to the main control panel by the host computer when the main control panel is connected with the host computer;
the data cache module is used for acquiring receiving information of the main control board for receiving the printing data and judging whether the printing data is stored in a cache space on the main control board according to the receiving information;
and the data retransmission module is used for retransmitting the printing data to the main control board when the printing data is not stored in the cache space on the main control board.
In a third aspect, an embodiment of the present invention provides a print data transmission apparatus, including: at least one processor, at least one memory, and computer program instructions stored in the memory, which when executed by the processor, implement the method of the first aspect of the embodiments described above.
In a fourth aspect, embodiments of the present invention provide a storage medium having stored thereon computer program instructions, which when executed by a processor, implement the method of the first aspect in the above embodiments.
In summary, according to the print data transmission method, the apparatus, the device, and the storage medium provided in the embodiments of the present invention, the host sends the print data to the main control board again through the data retransmission module when the printing is interrupted and the print data is not stored in the buffer space on the main control board, so that the print data is not lost and is accurately transmitted, and when the interruption time is very short, the print module of the printer can extract the buffer data from the buffer space for printing when the printing is interrupted, and can continue to print normally when the printing is switched on, thereby ensuring that the printing is not stopped, and improving the printing efficiency.
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.
Referring to fig. 2, an embodiment of the present invention provides a method for transmitting print data, where the method determines a connection condition between the main control board and the host, and when the main control board is connected to the host, the host sends the print data to the main control board; then obtaining the receiving information of the main control board for receiving the printing data, and judging whether the printing data is stored in the cache space on the main control board; when the printing data is not stored in the cache space on the main control board, the host sends the printing data to the main control board again, so that printing can be continuously and accurately transmitted to the main control board. The method specifically comprises the following steps:
s1, judging whether the main control board is connected with the host;
s2, when the main control board is connected with the host computer, the host computer sends the printing data to the main control board;
s3, acquiring receiving information of the main control board for receiving the printing data, and judging whether the printing data is stored in a cache space on the main control board according to the receiving information;
and S4, when the printing data is not stored in the buffer space on the main control board, the host sends the printing data to the main control board again.
Preferably, the step S3 specifically includes:
acquiring the receiving time of the main control board for receiving the printing data, and judging whether the receiving time is greater than a threshold A;
and when the receiving time is greater than a threshold value A, the main control board fails to receive the printing data, and the printing data is not stored in the cache space on the main control board.
And when the receiving time is less than or equal to a threshold value A, the main control board successfully receives the printing data, and the printing data is stored in a cache space on the main control board.
Preferably, when the reception time is less than or equal to a threshold a, acquiring the size of the print data and the size of the actually received print data, and determining whether the size of the actually received print data is equal to the size of the print data;
and when the size of the actually received printing data is smaller than that of the printing data, the printing data is not stored in the buffer space on the main control board. The case where the print data is not stored in the buffer space on the main control board includes that the host is not connected to the main control board, connection is unstable, connection is made but data cannot be transmitted, and the like.
When the size of the actually received print data is equal to the size of the print data, it indicates that the print data is completely stored in the buffer space on the main control board.
Referring to fig. 3, the step of sending the print data to the main control board by the host includes:
s21, the host sends a connection request to the main control board;
s22, when the host receives the connection response sent by the main control board, the host sends the printing data to the main control board and records the sending start time when the host starts sending the printing data; the printing data at least comprises 1pass data, and the 1pass data is data which is sprayed by a sprayer N of the printer in a primary scanning direction L1 of a printing medium B. Referring to fig. 4, after the nozzle N scans the print 1pass data once in the main scanning direction L1 of the print medium B, and then the print medium B moves a certain distance in the sub-scanning direction L2 of the nozzle N, the nozzle N scans the print 1pass data once again in the main scanning direction L1 of the print medium B, and this is repeated until all the print data are printed, so that the print data at least include 1pass data in order to ensure the continuity of the data. In this embodiment, the host sends the print data to the main control board and sends a crc (cyclic Redundancy check) Redundancy check code of the print data, which is used for the main control board to perform self-checking on the received print data to determine the correctness of the print data.
S23, obtaining the scheduled sending time of the host computer for sending the printing data, waiting for the receiving response sent back by the main control board, if the host computer does not receive the receiving response after the scheduled sending time, repeating the step S21, if the host computer receives the receiving response in the sending time, then carrying out the next step; the case where the host does not receive the reception acknowledgement at the predetermined transmission time includes: the host computer is disconnected with the main control board or the communication is disconnected, and the host computer is unstable in connection with the main control board, so that data transmission is slow and overtime.
S24, judging the content information of the receiving response, if the content information is the receiving failure, repeating the step S21, if the content information is the receiving success, carrying out the next step; specifically, the content information indicating that the reception failed includes: the main control board carries out self-checking on the received printing data to find that the content of the printing data is wrong, the printing data is less than 1pass, and the data cache space on the main control board is smaller than the data size of 1 pass.
S25, the host computer fetches the next print data, and repeats the step S21.
Referring to fig. 5, the step of the main control board receiving the print data includes:
s31, controlling the main control board to start receiving the printing data and recording the receiving time of the printing data;
s32, acquiring the preset receiving time of the main control board for receiving the printing data, if the printing data is not received within the preset receiving time, the receiving fails, repeating the step S31, and if the printing data is received within the preset receiving time, carrying out the next step;
s33, obtaining the size of the buffer space, when the buffer space is smaller than the size of the printing data, waiting until the buffer space is larger than the size of the printing data, when the buffer space is larger than the size of the printing data, storing the printing data into the buffer space and sending the receiving success information, and then repeating the step S31.
Preferably, the size of the buffer space is equal to 3 times of the space required by storing the data sprayed once by scanning of a printer nozzle into the memory, and the size of the buffer space is set according to the printing requirement when the main control board is powered on and initialized. In this embodiment, the size of the print data of 1pass is 60M, the print data of 1pass represents the data amount required by the nozzle to scan the print medium 1 time, and when the print request is printed with the maximum width (the print width exceeds the width of paper of 594mm × 420 mm), the buffer space is required to buffer at least 3 to 5 passes of data, and in this embodiment, the size of the buffer space is 256M.
Preferably, the size of the buffer space is equal to 5 times of the space required by the printer nozzle to scan the data printed once and store the data into the memory.
Referring to fig. 6, in the present embodiment, the main control board includes: the printing data transmission system comprises a Micro Control Unit (MCU), a memory unit DDR3 and an interface unit, wherein the Micro Control Unit (MCU), the memory unit DDR3 and the interface unit are mutually connected and communicated through a bus, and during data transmission, the Micro Control Unit (MCU) automatically carries printing data transmitted from the interface unit and stores the printing data into the DDR3 memory unit through DMA, wherein the interface unit is a USB interface or a network interface.
Referring to fig. 7, an embodiment of the present invention provides a print data transmission apparatus, including:
a judging module 100, configured to judge whether the main control board is connected to the host;
a data sending module 200, configured to send the print data to the main control board when the main control board is connected to the host;
a data caching module 300, configured to obtain receiving information of the main control board receiving the print data, and determine whether the print data is stored in a caching space on the main control board according to the receiving information;
a data retransmission module 400, configured to, when the print data is not stored in the cache space on the main control board, the host resends the print data to the main control board.
Preferably, the receiving information includes: the receiving time of the print data received by the main control board, and the size of the print data actually received when the print data is received by the main control board.
Preferably, the data caching module 300 includes:
a first receiving time judging unit, configured to acquire the receiving time for the main control board to receive the print data, and judge whether the receiving time is greater than a threshold a;
and the first cache judging unit is used for failing to receive the printing data by the main control board when the receiving time is greater than a threshold value A, and the printing data is not stored in the cache space on the main control board.
Preferably, the data caching module 300 further includes:
a second receiving time judging unit, configured to acquire the receiving time for the main control board to receive the print data, and judge whether the receiving time is greater than a threshold a;
and the second cache judging unit is used for successfully receiving the printing data by the main control board when the receiving time is less than or equal to a threshold value A, and storing the printing data into a cache space on the main control board.
Preferably, the obtaining of the receiving information of the main control board receiving the print data and determining whether the print data is stored in the buffer space on the main control board according to the receiving information further includes:
acquiring the size of the print data and the size of the actually received print data, and judging whether the size of the actually received print data is equal to the size of the print data or not;
and when the size of the actually received printing data is smaller than or equal to that of the printing data, the printing data is not stored in the buffer space on the main control board.
Preferably, the size of the buffer space is equal to 3 times of the space required by the printer nozzle to scan the data printed once and store the data into the memory.
Preferably, the size of the buffer space is equal to 5 times of the space required by the printer nozzle to scan the data printed once and store the data into the memory.
Referring to fig. 8, the present invention further provides a printing apparatus, including a host 10, a main control board 20, a print data transmission device (not shown), and a printing module 30, wherein the host 10 transmits the print data to the main control board 20 through the print data transmission device, and the main control board 20 transmits the print data to the printing module 30 through a network cable or a USB; the host 10 is connected to the data retransmission module 400 in the print data transmission device, the main control board is connected to the data buffer module 300 in the print data transmission device, when printing, the host 10 transmits the print data to the data buffer space of the print data transmission device through the network cable or the USB, and the print module 30 extracts the data from the buffer space for printing; in the printing process, when the connection between the host 10 and the main control board 20 is interrupted, the data retransmission module 400 on the host 10 is controlled to retransmit the print data, so that the print data is guaranteed not to be lost and accurately transmitted, meanwhile, the print module 30 can extract the cache data from the cache space to print, and the normal printing can be continued when the printing is switched on, so that the printing is not stopped, and the printing efficiency is improved.
In addition, the print data transmission method of the embodiment of the present invention described in conjunction with fig. 2 may be implemented by a print data transmission apparatus. Fig. 9 is a schematic diagram showing a hardware configuration of the print data transmission apparatus according to the embodiment of the present invention.
The print data transmission device may include a processor 401 and a memory 402 storing computer program instructions.
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 a particular embodiment, the 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 transmission methods in the above-described embodiments by reading and executing computer program instructions stored in the memory 402.
In one example, the print data transmission apparatus may further include a communication interface 403 and a bus 410. As shown in fig. 9, 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 embodiments of the present invention.
Bus 410 includes hardware, software, or both to couple the components of the print data transfer device 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 transmission method in the above embodiments, embodiments of the present invention may 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 transmission methods in the above embodiments.
In summary, the print data transmission method, apparatus, device and storage medium provided in the embodiments of the present invention determine a connection condition between the main control board and the host, and when the main control board is connected to the host, the host sends the print data to the main control board; then obtaining the receiving information of the main control board for receiving the printing data, and judging whether the printing data is stored in the cache space on the main control board; when the printing data is not stored in the cache space on the main control board, the host sends the printing data to the main control board again, so that printing can be continuously and accurately transmitted to the main control board.
It is to be understood that the invention is not limited to the specific arrangements and instrumentality described above and shown in the drawings. A detailed description of known methods is omitted herein for the sake of brevity. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present invention are not limited to the specific steps described and illustrated, and those skilled in the art can make various changes, modifications and additions or change the order between the steps after comprehending the spirit of the present invention.
The functional blocks shown in the above-described structural block diagrams may be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it may be, for example, an electronic circuit, an Application Specific Integrated Circuit (ASIC), suitable firmware, plug-in, function card, or the like. When implemented in software, the elements of the invention are the programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine-readable medium or transmitted by a data signal carried in a carrier wave over a transmission medium or a communication link. A "machine-readable medium" may include any medium that can store or transfer information. Examples of a machine-readable medium include electronic circuits, semiconductor memory devices, ROM, flash memory, Erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, Radio Frequency (RF) links, and so forth. The code segments may be downloaded via computer networks such as the internet, intranet, etc.
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 person skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the present invention, and these modifications or substitutions should be covered within the scope of the present invention.