Print data compression method, print data transfer method, print data compression apparatus, and program

By dynamically determining whether to compress or transfer print data based on its size, the method optimizes data handling for efficient and timely printing.

JP2025138228APending Publication Date: 2025-09-25CASIO COMPUTER CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2024037192
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-03-11
Publication Date
2025-09-25

AI Technical Summary

Technical Problem

Existing compression methods for print data transfer result in varying compression rates, leading to increased printing time due to inefficient data handling.

Method used

A method where a computer executes a compression algorithm on print data, determining whether to transfer it uncompressed or compressed based on the size of the compressed data, ensuring appropriate transfer data generation.

Benefits of technology

This approach reduces data transfer time and printing time by avoiding unnecessary compression, maintaining efficient data handling and minimizing processing load.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025138228000001_ABST
    Figure 2025138228000001_ABST
Patent Text Reader

Abstract

To generate appropriate transfer data according to data.SOLUTION: An information processing apparatus is configured to execute a compression algorithm on first print data, and determine whether to transfer the first print data or second print data to a printer, in accordance with the size of the second print data which is obtained by compressing the first print data with the compression algorithm.SELECTED DRAWING: Figure 4
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The disclosure of this specification relates to a print data compression method, a print data transfer method, a print data compression device, and a program. [Background technology]

[0002] A compression transfer method has been known in the past, in which data is compressed and transferred to a printer (see Patent Document 1). [Prior art documents] [Patent documents]

[0003] [Patent Document 1] Japanese Patent Application Publication No. 9-163142 Summary of the Invention [Problem to be solved by the invention]

[0004] However, in Patent Document 1, the compression rate differs depending on the data, and therefore, compressing and transferring the data may actually increase the time required to print the data.

[0005] In view of the above circumstances, an object of one aspect of the present invention is to provide a technique for generating appropriate transfer data according to data. [Means for solving the problem]

[0006] A print data compression method according to one aspect of the present invention involves a computer executing a compression algorithm on first print data, and determining whether the print data to be transferred to a printing device is the first print data or the second print data, depending on the size of second print data obtained by compressing the first print data using the compression algorithm. [Effects of the Invention]

[0007] According to the above aspect, it is possible to generate appropriate transfer data according to the data. [Brief explanation of the drawings]

[0008] [Figure 1] FIG. 1 is a diagram illustrating an example of a system configuration. [Figure 2] FIG. 1 is a diagram illustrating an example of the configuration of an information processing device. [Figure 3] FIG. 10 is a sequence diagram illustrating an example of a process performed after a print operation. [Figure 4] 10 is a flowchart illustrating an example of processing performed by an information processing device. [Figure 5] 10 is a flowchart illustrating an example of processing performed by a printing device. [Figure 6] FIG. 2 is a diagram illustrating an example of a configuration of print data. [Figure 7] 10 is a flowchart illustrating an example of a transfer print data generation process performed by an information processing apparatus. DETAILED DESCRIPTION OF THE INVENTION

[0009] The system shown in FIG. 1 includes a printing device 1 and an information processing device 100 that transfers print data to the printing device 1. The printing device 1 is a device that prints on a print medium based on received print data. The printing device 1 is not particularly limited, but may be, for example, a label printer that prints on a long piece of tape. The information processing device 100 is, for example, a device on which a user performs a printing operation, such as a smartphone, tablet terminal, laptop computer, or desktop computer. However, the information processing device 100 may be any device that transfers print data to the printing device 1, and may, for example, read out print data created in advance and send it to the printing device 1. The printing device 1 and the information processing device 100 may be connected to each other via a wired or wireless connection so as to be able to communicate with each other.

[0010] 2, the information processing device 100 includes a processor 101, a storage device 102, an input device 103, a display device 104, and a communication device 105. The processor 101 includes, for example, a central processing unit (CPU) and executes a program 102a stored in the storage device 102. The processor 101 may include any electric circuit such as a graphics processing unit (GPU), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or a digital signal processor (DSP).

[0011] The storage device 102 is a non-transitory computer-readable medium, such as any semiconductor memory. The storage device 102 includes volatile memory such as random access memory (RAM), read only memory (ROM), and non-volatile memory such as flash memory. The storage device 102 may also include magnetic storage devices, optical storage devices, and other types of storage devices.

[0012] The storage device 102 stores a program 102a and data 102b. The program 102a is, for example, a program that compresses and transfers print data (described later). The data 102b includes, for example, print data before and after compression.

[0013] The input device 103 is, for example, a keyboard or a mouse. The display device 104 is a display unit of the information processing device 100, and is, for example, a liquid crystal display. The input device 103 and the display device 104 may form a touch panel display. The communication device 105 is a communication unit that communicates with the printing device 1, and may be, for example, a communication unit compatible with wireless communication such as WiFi or BLE, or a wired communication unit.

[0014] In the system shown in FIG. 1, when a user performs a print operation on the information processing device 100, the information processing device 100 generates print data representing the print contents specified in the print operation and transfers it to the printing device 1 (step S10). An example of a print operation is an operation in which the print contents are input and then a print instruction is given. Upon receiving the print data, the printing device 1 prints based on the print data (step S20). The processing performed by the information processing device 100 and the processing performed by the printing device 1 will be described in more detail below.

[0015] In the information processing device 100, when a user performs a print operation, the processor 101 executes the program 102a, thereby starting the processing shown in Fig. 4. First, the processor 101 acquires print data representing the print content specified in the print operation (step S11). The print data acquired in step S11 is an example of first print data, and is information in which information about each pixel (in this example, print density) expressed in a certain number of bits is arranged in the order of the pixels. For example, if the print density is expressed in eight gradations, the number of bits for each pixel should be 3 or more.

[0016] Next, processor 101 executes a compression algorithm on the acquired print data (step S12). The compression algorithm employed in step S12 is not particularly limited. However, in cases where consecutive pixels of the same gradation tend to occur in the print content, such as print data transferred to a label printer, run-length compression or an algorithm based on it is desirable from the viewpoint of compression efficiency. In particular, when handling multi-gradation pixel data, it is desirable to compress using an algorithm based on run-length compression.

[0017] Processor 101 then determines whether the size of the compressed print data obtained by compressing the print data using a compression algorithm exceeds a predetermined size (step S13). The compressed print data is an example of second print data. The predetermined size may be any size that corresponds to the size of the print data before compression, and may be equal to or smaller than the size of the print data before compression. The predetermined size may be, for example, the size of the print data before compression itself. Alternatively, the predetermined size may be, for example, a size that is a certain percentage (for example, 10%) smaller than the size of the print data before compression, or a certain size smaller than the size of the print data before compression.

[0018] Processor 101 may monitor the size of the print data that has been compressed up to that point during compression, and in that case, may determine whether the size of the compressed print data (i.e., the print data after all compression processes are complete) exceeds a predetermined size based on the size of the print data that has been compressed up to that point. In other words, processor 101 may make a determination when the relationship between the compressed print data and the predetermined size becomes clear during compression, even before the compression process is completed.

[0019] Processor 101 determines the print data to be transferred to the printing device (hereinafter referred to as transfer print data) depending on the determination result of step S13. Specifically, processor 101 determines whether the transfer print data is the uncompressed print data or the compressed print data depending on the size of the compressed print data. More specifically, if processor 101 determines in step S13 that the size of the compressed print data exceeds a predetermined size (step S13 YES), it determines the uncompressed print data as the transfer print data (step S14). If processor 101 determines in step S13 that the size of the compressed print data does not exceed the predetermined size (step S13 NO), it determines the compressed print data as the transfer print data (step S15). Note that if processor 101 determines in step S13 that the size of the compressed print data exceeds the predetermined size, it may further stop compressing the print data.

[0020] When the transfer print data is determined, the processor 101 causes the communication device 105 to transfer the transfer print data to the printing device 1 (step S16), and ends the processing shown in Fig. 4. Note that in step S16, the transfer print data may be transferred after flag information is added to determine whether the transfer print data is uncompressed data or compressed data in the printing processing performed by the printing device 1, which will be described later.

[0021] When the printer 1 receives the transfer print data from the information processing device 100, the processor of the printer 1 starts the process shown in Fig. 5. First, the processor of the printer 1 acquires the received transfer print data (step S21) and determines whether the acquired transfer print data is compressed data (step S22). In step S22, the processor makes the determination based on, for example, the flag information added to the transfer print data in step S16.

[0022] If the processor determines that the transfer print data is compressed data (step S22 YES), it decompresses the transfer print data (step S23) and controls the printing mechanism based on the decompressed print data to perform printing (step S24).On the other hand, if the processor determines that the transfer print data is uncompressed data (step S22 NO), it controls the printing mechanism based on the transfer print data to perform printing (step S24).

[0023] 1, the information processing device 100 determines the print data to be transferred based on the size of the compressed print data, thereby generating appropriate print data to be transferred according to the print data, and transferring it to the printing device 1. Therefore, according to the information processing device 100, while the size of the data to be transferred is reduced and the transfer time is shortened as a general rule by performing compressed transfer, in exceptional cases where compression actually increases the transfer time or the time required to complete printing, the extension of these times can be avoided by transferring the data before compression.

[0024] Below, examples of compression algorithms and procedures for generating print data for transfer are given to further explain the above-mentioned processing performed by the information processing device 100. In the following examples, the compression algorithm used is an algorithm that converts 8-level print data, in which the gradation information is arranged in the order of the pixels and the gradation of each pixel is expressed in 3 bits, into 8-level print data in 1-byte units, consisting of 3 bits expressing the gradation and 5 bits expressing the number of consecutive occurrences of that gradation.

[0025] Here, as shown in FIG. 6, the print content of the print data is "ABC" with a white background (gradation 111), "A" in black (gradation 000), "B" in dark gray (gradation 010), and "C" in light gray (gradation 101).

[0026] When the information processing device 100 receives a print operation specifying the print content shown in FIG. 6, it acquires print data d[i] of N×M pixels and starts the process shown in FIG. 7. First, the processor 101 initializes each variable (step S101). Specifically, it assigns d[0] to variable A, assigns 1 to variables n and i, and assigns 0 to variable j. Variable A is a variable that stores the gradation (3 bits) of the previous pixel. Variable d is an array whose size is the number of pixels that store the print data, and each element of the array stores pixel data indicating the gradation (3 bits) of the pixel. Here, pixel data is unit data that makes up the print data and has a data length (3 bits in this case) corresponding to the number of gradations. Variable n is a variable that stores the number of consecutive occurrences of the same gradation (5 bits). Variable i is a variable that stores the number when pixel data in the print data are aligned one-dimensionally and counted. Variable j is a variable that stores the number when unit data in the compressed print data are aligned one-dimensionally and counted.

[0027] Next, processor 101 reads the next pixel data d[i] from the print data and compares it with the gradation A of the immediately preceding pixel (step S102). If the gradations do not match (step S102 NO), processor 101 adds variable A (3 bits) to the most significant 3 bits of c[j] and adds variable n (5 bits) to the least significant 5 bits of c[j] (step S103). Note that variable c is an array that stores the compressed print data, and each element of the array is unit data that makes up the compressed print data, and stores 1-byte unit data consisting of 3 bits that represent a gradation and 5 bits that represent the number of consecutive occurrences of that gradation.

[0028] The processor 101 then updates the variable A to the latest pixel data d[i] read in step S102 (step S104). The processor 101 then increments the variable j (step S108) and determines whether the incremented variable j has reached its upper limit (step S109). The upper limit of the variable j is determined in advance based on the data size stored in the array c from the 0th element (c[0]) to the jth element (c[j]). In this example, the upper limit of the variable j is a value calculated by dividing the total data size (3 bits × array size) stored in the array d by 8 bits (1 byte). When the variable j reaches its upper limit (step S109 YES), it is clear that the compressed print data will exceed the uncompressed print data. Therefore, determining that compression is not expected to shorten the transfer time, the processor 101 stops compressing the print data and terminates the process shown in FIG. 7. In this case, the processor 101 determines that the uncompressed print data (d) will be the print data to be transferred.

[0029] If it is determined that the variable j has not reached the upper limit (step S109 NO), the processor 101 resets the variable n, which indicates the number of consecutive occurrences, to 1 (step S110), and increments the variable i in preparation for reading the next pixel data (step S111). Thereafter, the processor 101 determines whether the incremented variable i is the number of the last pixel (step S112), and if it has not reached the number of the last pixel, the process returns to step S102 and repeats the above-described processing.

[0030] If the gradations match in step S102 (YES in step S102), processor 101 increments variable n, which indicates the number of consecutive occurrences (step S105), and determines whether or not the incremented variable n exceeds the maximum number (31) that can be expressed in 5 bits (step S106). If not (NO in step S106), processor 101 increments variable i in preparation for reading the next pixel data (step S111). Thereafter, processor 101 determines whether or not the incremented variable i is the number of the last pixel (step S112), and if it has not reached the number of the last pixel (NO in step S112), the process returns to step S102 and repeats the above-described processing.

[0031] If it is determined in step S106 that the variable n has exceeded the maximum number of times that can be expressed in 5 bits (step S106 YES), the processor 101 adds the variable A (3 bits) to the most significant 3 bits of c[j] and adds 31 to the least significant 5 bits of c[j] (step S107). Then, the processor 101 performs the processes from step S108 onwards. As a result, the part whose number of consecutive occurrences exceeds 31 is stored in the next element of the array c.

[0032] If it is determined in step S112 that the variable i has reached the number of the last pixel (step S112 YES), the processor 101 adds the variable A (3 bits) to the most significant 3 bits of c[j] and adds n to the least significant 5 bits of c[j] (step S113), completing the compression of the print data and terminating the processing in Fig. 7. That is, in this case, the processor 101 determines the compressed print data (c) as the print data to be transferred.

[0033] According to the process in Figure 7, the print data shown in Figure 6 is compressed into the following print data after compression. If the print data shown in Figure 6 is scanned starting from the top left pixel, the beginning of the data will contain 17 white pixels, 6 black pixels, 1 white pixel, 1 black pixel, 2 white pixels, .... Therefore, the beginning of the print data in the compressed print data will be expressed in binary as "111 10001B 000 00110B 000 00001B 111 00010B...". Additionally, the part of the print data corresponding to "B" contains 7 dark gray pixels, 1 white pixel, 1 dark gray pixel, 2 white pixels, 1 dark gray pixel, .... For this reason, the part of the print data that corresponds to "B" is expressed in binary as "010 00111B 111 00001B 010 00001B 111 00010B 010 00001B..." in the compressed print data. Additionally, the part of the print data that corresponds to "C" consists of a sequence of five light grays, two whites, one light gray, five whites, one light gray, and... For this reason, the part of the print data that corresponds to "C" is expressed in binary as "101 00101B 111 00010B 101 00001B 111 00101B 101 00001B..." in the compressed print data. Additionally, there are 34 consecutive whites at the end of the print data. Because this exceeds the maximum number of consecutive occurrences that can be expressed in 5 bits, which is 31 (2^5 - 1), the end of the compressed print data is expressed by dividing the number of consecutive occurrences into two: 31 and 3. Therefore, the end of the print data is expressed in binary as "111 11111B 111 00011B".

[0034] As described above, in the process of FIG. 7, pixel data, which are unit data of print data, are read sequentially from the beginning during the print data compression process. Furthermore, when the gradation value indicated by the read pixel data differs from the gradation value indicated by the pixel data read immediately before, one or more consecutively read pixel data indicating the same gradation value are compressed together to generate unit data indicating the gradation value indicated by the one or more pixel data indicating the same gradation value and the number of consecutive occurrences of that gradation value. This enables print data in which the same gradation value occurs consecutively to be compressed at a high compression rate, thereby shortening the transfer time (the time from time t1 to time t2 shown in FIG. 3) between the information processing device 100 and the printing device 1. Furthermore, because the data can be compressed sequentially from the beginning, it is possible to identify the compressed size during the compression process and stop the compression midway under specified conditions. Furthermore, because it is not necessary to simultaneously store both the uncompressed and compressed print data in memory, memory size can also be reduced.

[0035] 7, during the compression process of the print data, pixel data, which are unit data of the print data, are read sequentially from the beginning, and when the gradation value indicated by the read pixel data differs from the gradation value indicated by the pixel data read immediately before, different processing is performed depending on whether the number of consecutive occurrences of one or more pixel data indicating the same gradation value read in succession does not exceed a predetermined upper limit (31). If the number of consecutive occurrences of one or more pixel data indicating the same gradation value read in succession does not exceed the predetermined upper limit, processor 101 compresses the one or more pixel data together to generate one unit data indicating the gradation value indicated by the one or more pixel data and the number of consecutive occurrences of that gradation value. On the other hand, if the number of consecutive occurrences of one or more pixel data indicating the same gradation value read in succession exceeds the predetermined upper limit, processor 101 divides the one or more pixel data into two or more pieces and compresses each piece to generate two or more unit data indicating the gradation value indicated by the one or more pixel data and the number of consecutive occurrences of that gradation value. This makes it possible to compress the print data at a high compression rate without designing the unit data of the compressed print data to be excessively large in accordance with the large number of consecutive occurrences that occur infrequently, and also makes it possible to deal with the large number of consecutive occurrences that occur rarely.

[0036] 7, if the print data cannot be compressed at a high compression rate, i.e., if the compressed data size exceeds a predetermined size, the information processing device 100 stops the compression of the print data midway and transfers the uncompressed print data to the printing device 1. This stops unnecessary compression performed by the information processing device 100, thereby reducing the processing load on the information processing device 100. Furthermore, because the compression is stopped midway before completion and transfer is started, the time required from the printing operation to the start of transfer (the time from time t0 to t1 in FIG. 3) can be shortened. Furthermore, the transfer time (the time from time t1 to t2 in FIG. 3) can be shortened compared to transferring compressed data that exceeds a predetermined size. Furthermore, because data decompression processing is not required after transfer, the time required for the printing process performed by the printing device 1 (the time from time t2 to t3 in FIG. 3) can also be shortened.

[0037] The above-described embodiments are illustrative examples provided to facilitate understanding of the invention. The present invention is not limited to the above-described embodiments and should be understood to encompass various modifications and alternatives to the above-described embodiments. For example, it will be understood that the above-described embodiments can be embodied by modifying the components without departing from the spirit of the invention. It will also be understood that various embodiments can be implemented by appropriately combining multiple components disclosed in the above-described embodiments. Furthermore, those skilled in the art will understand that various embodiments can be implemented by deleting some components from all the components shown in the embodiments or by adding some components to the components shown in the embodiments. In other words, the above-described print data compression method, print data transfer method, print data compression device, and program can be variously modified and altered without departing from the scope of the claims.

[0038] In the above-described embodiment, eight-level print data was exemplified, but the print data is not limited to eight-level data and may be 16-level or 32-level print data. In addition, in the above-described embodiment, eight-level pixel data is expressed using three bits, but it may be expressed using four or more bits. For example, pixel data for two pixels may be expressed using four bits so that exactly one byte occupies two pixels. In the above-described embodiment, the unit data of the compressed print data is one byte, and five bits of that are used to represent the number of consecutive occurrences. However, the size of the area representing the number of consecutive occurrences is not limited to five bits. It is also possible to use as many bits as statistically necessary to increase the compression rate for the area representing the number of consecutive occurrences. [Explanation of symbols]

[0039] 1: Printing device, 100: Information processing device, 101: Processor

Claims

1. The computer performing a compression algorithm on the first print data; The print data to be transferred to the printing device is determined to be either the first print data or the second print data depending on the size of the second print data obtained by compressing the first print data using the compression algorithm. A print data compression method comprising:

2. 2. The print data compression method of claim 1, The computer further comprises: monitoring a size of the compressed print data while compressing the first print data with the compression algorithm; In determining the print data, determining, based on the size of the compressed print data monitored while the first print data is being compressed using the compression algorithm, that the size of the second print data exceeds a predetermined size corresponding to the size of the first print data; and When the size of the second print data does not exceed the predetermined size, the second print data is determined to be the print data to be transferred to the printing device. A print data compression method comprising:

3. 3. The print data compression method according to claim 2, The computer further comprises: When it is determined based on the size of the compressed print data that the size of the second print data exceeds the predetermined size corresponding to the size of the first print data, compression of the first print data is stopped. A print data compression method comprising:

4. 4. The print data compression method according to claim 1, In the compression of the first print data, reading out unit data constituting the first print data, each of which has a data length corresponding to the number of gradations, in order from the beginning; When the gradation value indicated by the read unit data is different from the gradation value indicated by the unit data read immediately before, one or more of the unit data indicating the same gradation value that have been successively read are compressed together to generate data indicating the gradation value indicated by the one or more unit data and the number of consecutive occurrences of the gradation value. A print data compression method comprising:

5. 4. The print data compression method according to claim 1, In the compression of the first print data, reading out unit data constituting the first print data, each of which has a data length corresponding to the number of gradations, in order from the beginning; When the gradation value indicated by the read unit data is different from the gradation value indicated by the unit data read immediately before, If the number of consecutive occurrences of one or more unit data pieces indicating the same gradation value that have been read out consecutively does not exceed a predetermined upper limit value, compressing the one or more unit data pieces together to generate data indicating the gradation value indicated by the one or more unit data pieces and the number of consecutive occurrences; If the number of consecutive occurrences exceeds the predetermined upper limit, the one or more unit data are divided into two or more pieces and each piece is compressed to generate two or more pieces of data indicating the gradation value indicated by the one or more unit data and the number of consecutive occurrences. A print data compression method comprising:

6. The computer performing a compression algorithm on the first print data; monitoring a size of the compressed print data while compressing the first print data with the compression algorithm; When it is determined based on the size of the compressed print data that the size of second print data obtained by compressing the first print data using the compression algorithm exceeds a predetermined size corresponding to the size of the first print data, the first print data is transferred to a printing device; When the size of the second print data does not exceed the predetermined size, the second print data is transferred to the printing device. A print data transfer method comprising:

7. a processor; The processor: compressing the first print data with a compression algorithm; and determining whether the print data to be transferred to the printing device is the first print data or the second print data, depending on the size of the second print data obtained by compressing the first print data using the compression algorithm. A print data compression device comprising:

8. To the computer compressing the first print data with a compression algorithm; The print data to be transferred to the printing device is determined to be either the first print data or the second print data depending on the size of the second print data obtained by compressing the first print data using the compression algorithm. A program characterized by executing a process.

Citation Information

Patent Citations

  • Gradation data compressed transfer system for printer

    JP1997163142A