Method and system for encoding recognition and decoding calculation in a printer
By using photoelectric sensors to identify and calculate the coded grids on the printing paper during the printing process, the problem of lack of identification and decoding of coded information in the existing technology is solved, realizing the effective use of coded information and supporting information statistics and business operations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING SPIRIT TECH DEV
- Filing Date
- 2022-07-18
- Publication Date
- 2026-07-07
AI Technical Summary
Existing technologies lack methods for identifying and calculating coded information in printed paper, making it impossible to effectively utilize pre-printed coded information for business operations and information adjustments.
During the printing process, a dedicated photoelectric sensor is used to collect information from the coded grids on the printing paper. The infrared spectral data of the coded grids is identified by photoelectric reflective and photoelectric through-beam sensors. After filtering and amplification, the MCU performs calculations, performs binary decoding using preset decoding rules, and converts the data into decimal coded values.
It enables the identification and decoding of coded information on printed paper, obtains mapped content information, and supports subsequent information statistics and business operations.
Smart Images

Figure CN115268803B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of printing technology, and more specifically to a method and system for encoding recognition and decoding calculation in a printer. Background Technology
[0002] On the outer edge of each label printing sheet, coded grids are pre-printed according to numerical codes. Then, information and content defined by these codes, such as corresponding customer information or related advertising content, are pre-printed according to the rules governing these codes, further expanding the functionality and commercial applications of the printing paper. Based on the pre-printed content and information, statistical analysis can be performed, and business operations or information adjustments can be made based on the statistical data. Current technology lacks methods for identifying and calculating the coded information within the printing paper. Summary of the Invention
[0003] Therefore, the present invention provides a method and system for encoding recognition and decoding calculation in a printer, so as to realize the recognition and decoding calculation of pre-printed encodings on printing paper.
[0004] To achieve the above objectives, the present invention provides the following technical solution:
[0005] According to a first aspect of the present invention, a method for encoding recognition and decoding calculation in a printer is provided, the method comprising:
[0006] During the printing process, the paper feed motor drives the printing paper to move in the paper output direction, and the dedicated photoelectric sensor for decoding collects information from the pre-printed coded grids on the printing paper.
[0007] The collected data is identified and calculated to obtain the encoding information of each encoding cell. The obtained encoding information is then decoded using a preset decoding rule to obtain the mapping content information.
[0008] Furthermore, code grids are pre-printed on the printing paper, specifically including:
[0009] Individual codes are distinguished by pre-printing black or white codes in the coding grids on the printing paper, where black represents "1" in binary and white represents "0" or vice versa.
[0010] Furthermore, the method also includes:
[0011] When printing paper with coded labels, the printer uses data collected by the gap sensor to calculate the beginning of the paper, and then starts counting the number of drive pulses of the printer's paper feed stepper motor in sequence. At the beginning of each pulse, the dedicated photoelectric sensor collects data once, and each collection is saved in sequence. Finally, the printer uses data collected by the gap sensor to calculate the end of the label paper, and then finishes printing one label.
[0012] Furthermore, information is collected from the encoded grid using a dedicated photoelectric sensor for decoding, specifically including:
[0013] The dedicated photoelectric sensors for decoding are divided into two groups: one group is a photoelectric reflective acquisition sensor, and the other group is a photoelectric through-beam acquisition sensor.
[0014] The photoelectric reflective acquisition sensor emits infrared light through an infrared emitting tube, which hits the coding grid. The reflective receiving tube then receives the infrared spectral data reflected back from the coding grid. After being filtered and amplified by the acquisition circuit, the data is sent to the MCU in the printer for processing and identification.
[0015] The photoelectric through-beam sensor emits infrared light through an infrared emitting tube, which hits the coding grid. The through-beam receiving tube receives the infrared spectral data transmitted back from the coding grid. After being filtered and amplified by the acquisition circuit, the data is sent to the MCU in the printer for processing and identification.
[0016] Finally, the data collected by the two sets of sensors are compared and corrected to ensure the accuracy of the identification.
[0017] Furthermore, the collected data is identified and calculated to obtain the encoding information for each encoding cell, specifically including:
[0018] After the printer finishes printing, it calculates the length of a single sheet of paper by multiplying the number of drive pulses of the paper feed stepper motor by the distance the paper is fed by a single pulse. Then, it divides the length by the height of a known single coded cell to calculate the total number of coded cells on the sheet.
[0019] Then, by dividing the number of pulses driven by the stepper motor for feeding a single sheet of printing paper by the total number of coded grids, the number of pulses and the pulse sequence number of each coded grid are calculated. This is the number of times and the sequence number of data collected by the dedicated photoelectric sensor for decoding each coded grid.
[0020] Then, based on the filtering algorithm, the first and last few data collections of each coding cell are removed. The specific number of times is set according to the effect of the filtering algorithm. The remaining data collections are then added together and divided by the number of times they are added to obtain the average value. The average value is then compared with the pre-set threshold to calculate the coding information of each coding cell.
[0021] Furthermore, the acquired encoded information is decoded using preset decoding rules to obtain mapped content information, specifically including:
[0022] The binary code is decoded according to the encoding rules and finally converted into a decimal encoded value before being sent to the host computer.
[0023] According to a second aspect of the present invention, an encoding recognition and decoding calculation system for a printer is provided, the system comprising:
[0024] The data acquisition module is used to move the paper in the output direction driven by the paper feed motor during the printing process, and to collect information from the pre-printed coded grids on the paper using a dedicated decoding photoelectric sensor.
[0025] The encoding recognition and decoding calculation module is used to recognize and calculate the collected data, obtain the encoding information of each encoding cell, and decode the obtained encoding information using a preset decoding rule to obtain the decoded information.
[0026] Furthermore, the encoding recognition and decoding calculation module is specifically used for:
[0027] After the printer finishes printing, it calculates the length of a single sheet of paper by multiplying the number of drive pulses of the paper feed stepper motor by the distance the paper is fed by a single pulse. Then, it divides the length by the height of a known single coded cell to calculate the total number of coded cells on the sheet.
[0028] Then, by dividing the number of pulses driven by the stepper motor for feeding a single sheet of printing paper by the total number of coded grids, the number of pulses and the pulse sequence number of each coded grid are calculated. This is the number of times and the sequence number of data collected by the dedicated photoelectric sensor for decoding each coded grid.
[0029] Then, based on the filtering algorithm, the first and last few data collections of each coding cell are removed. The specific number of times is set according to the effect of the filtering algorithm. The remaining data collections are then added together and divided by the number of times they are added to obtain the average value. The average value is then compared with the pre-set threshold to calculate the coding information of each coding cell.
[0030] The present invention has the following advantages:
[0031] This invention proposes a method and system for encoding recognition and decoding calculation in a printer. During the printing process, a paper feed motor moves the printing paper in the output direction. A dedicated photoelectric sensor for decoding collects information from pre-printed encoding grids on the printing paper. The collected data is recognized and calculated to obtain the encoding information of each encoding grid. The acquired encoding information is then decoded using preset decoding rules to obtain the mapped content information. This enables the recognition and calculation of encoded information in the printing paper, obtaining the corresponding content or information contained in the encoding, facilitating subsequent information statistics, adjustments, and commercial operations. Attached Figure Description
[0032] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely exemplary, and those skilled in the art can derive other embodiments based on the provided drawings without creative effort.
[0033] Figure 1 This is a flowchart illustrating an encoding recognition and decoding calculation method in a printer according to Embodiment 1 of the present invention;
[0034] Figure 2 This is a schematic diagram illustrating the application of encoding in label printing paper in an encoding recognition and decoding calculation method for a printer according to Embodiment 1 of the present invention.
[0035] Figure 3 This is a schematic diagram of photoelectric sensor acquisition in a printer encoding recognition and decoding calculation method provided in Embodiment 1 of the present invention;
[0036] Figure 4 This is a schematic diagram of the encoded information content in a printer encoding recognition and decoding calculation method provided in Embodiment 1 of the present invention;
[0037] Figure 5 This is a schematic diagram of the encoded information data mapping result in a printer encoding recognition and decoding calculation method provided in Embodiment 1 of the present invention. Detailed Implementation
[0038] The following specific embodiments illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0039] Example 1
[0040] like Figure 1 As shown in the figure, this embodiment proposes a method for encoding recognition and decoding calculation in a printer, the method including:
[0041] S100: During the printing process, the paper feed motor drives the printing paper to move in the paper output direction, and the dedicated decoding photoelectric sensor collects information from the pre-printed coded grids on the printing paper.
[0042] S200. The collected data is identified and calculated to obtain the encoding information of each encoding cell. The obtained encoding information is then decoded using a preset decoding rule to obtain the mapping content information.
[0043] In this embodiment, the printing paper includes, but is not limited to, label printing paper. Label printing paper will be used as an example for illustration.
[0044] 1. Label Printing Paper Coding Instructions:
[0045] like Figure 2 As shown, the codes are arranged vertically on the outer edge of each label sheet in a rectangular or square grid format, according to a certain proportional size. Individual codes are distinguished by pre-printing black or white text within the grid, where black represents "1" and white represents "0" or vice versa. Then, all the "1"s and "0"s represented by the grids on each label sheet are encoded in binary format and used according to the encoding rules. The number of codes depends on the number of vertically arranged grids on the outer edge of each label sheet; the more grids, the more codes.
[0046] 2. Identification method:
[0047] like Figure 3 As shown, when the printer prints paper with coded labels, the paper feed motor moves the label paper in the output direction. When the label paper reaches the dedicated photoelectric sensor for decoding, the sensor automatically collects the information data of the coded grid on each label. The dedicated photoelectric sensor for decoding consists of two groups. One group is a photoelectric reflective sensor, which emits infrared light through an infrared emitter to hit the coded grid. The reflective receiver then receives the infrared spectrum data reflected back from the coded grid. After filtering and amplification by the acquisition circuit, the data is sent to the MCU in the printer for processing and identification. The other group is a photoelectric through-beam sensor, which emits infrared light through an infrared emitter to hit the coded grid. The through-beam receiver then receives the infrared spectrum data transmitted back from the coded grid. After filtering and amplification by the acquisition circuit, the data is sent to the MCU in the printer for processing and identification. Finally, the data collected by the two groups of sensors are compared and corrected to ensure the accuracy of the identification.
[0048] 3. Decoding calculation method:
[0049] When printing paper with coded labels, the printer uses data collected by the gap sensor to calculate the beginning of the label paper, and then starts to count the number of drive pulses of the printer's paper feed stepper motor in sequence. At the beginning of each pulse, the dedicated photoelectric sensor collects data once, and each collection is saved in sequence. Then, using the data collected by the gap sensor, the printer calculates the end of the label paper, and the printing of one label paper is completed.
[0050] After the printer completes the printing job, it calculates the length of a single label sheet by multiplying the number of drive pulses of the stepper motor for feeding the label paper by the distance of a single pulse (the distance of a single pulse is calculated based on the motor parameters and structural design dimensions and is preset in the printer system, but can be adjusted). Then, it divides the length by the height of a single coded cell (the height of the coded cell is preset in the printer system and can be adjusted) to calculate the total number of coded cells on the label sheet. Next, the number of pulses driven by the stepper motor for single label printing is divided by the number of coded grids to calculate the number of pulses and pulse sequence number for each coded grid (i.e., the number of times and the sequence number of data collected by the dedicated photoelectric sensor for decoding each coded grid). Then, according to the filtering algorithm, the first and last few data collections for each coded grid are removed. The specific number of times is set according to the effect of the filtering algorithm (3 times in this embodiment). The remaining data collections are then added together and divided by the number of additions to obtain the average value. The average value is then compared with a pre-set threshold to calculate whether the code for each coded grid is "1" or "0" (greater than or equal to the threshold is "1", less than the threshold is "0"). Finally, binary decoding is performed according to the encoding rules, and the result is converted into a decimal encoded value and sent to the host computer. The encoding information is as follows: Figure 4 As shown, the encoded information data mapping result is as follows: Figure 5 As shown.
[0051] Example 2
[0052] Corresponding to Embodiment 1 above, this embodiment proposes an encoding recognition and decoding calculation system in a printer, the system comprising:
[0053] The data acquisition module is used to move the paper in the output direction driven by the paper feed motor during the printing process, and to collect information from the pre-printed coded grids on the paper using a dedicated decoding photoelectric sensor.
[0054] The encoding recognition and decoding calculation module is used to recognize and calculate the collected data, obtain the encoding information of each encoding cell, decode the obtained encoding information using preset decoding rules, and obtain the mapping content information.
[0055] Furthermore, the encoding recognition and decoding calculation module is specifically used for:
[0056] After the printer finishes printing, it calculates the length of a single sheet of paper by multiplying the number of drive pulses of the paper feed stepper motor by the distance the paper is fed by a single pulse. Then, it divides the length by the height of a known single coded cell to calculate the total number of coded cells on the sheet.
[0057] Then, by dividing the number of pulses driven by the stepper motor for feeding a single sheet of printing paper by the total number of coded grids, the number of pulses and the pulse sequence number of each coded grid are calculated. This is the number of times and the sequence number of data collected by the dedicated photoelectric sensor for decoding each coded grid.
[0058] Then, based on the filtering algorithm, the first and last few data collections of each coded cell are removed. The specific number of times is set according to the effect of the filtering algorithm. The remaining data collections are then added together and divided by the number of times they are added to obtain the average value. The average value is then compared with the pre-set threshold to calculate the encoding information of each coded cell.
[0059] The functions performed by each component in the encoding recognition and decoding calculation system of the printer provided in this embodiment of the invention have been described in detail in the above embodiment 1, so they will not be repeated here.
[0060] Although the present invention has been described in detail above with general descriptions and specific embodiments, modifications or improvements can be made to it, which will be obvious to those skilled in the art. Therefore, all such modifications or improvements made without departing from the spirit of the present invention fall within the scope of protection claimed by the present invention.
Claims
1. A method for encoding recognition and decoding calculation in a printer, characterized in that, The method includes: During the printing process, the paper feed motor drives the printing paper to move in the paper output direction, and the dedicated photoelectric sensor for decoding collects information from the pre-printed coded grids on the printing paper. The collected data is identified and calculated to obtain the encoding information of each encoding cell, and the obtained encoding information is decoded using a preset decoding rule to obtain the mapping content information; The collected data is identified and calculated to obtain the encoding information for each coded cell, specifically including: After the printer finishes printing, it calculates the length of a single sheet of paper by multiplying the number of drive pulses of the paper feed stepper motor by the distance the paper is fed by a single pulse. Then, it divides the length by the height of a known single coded cell to calculate the total number of coded cells on the sheet. Then, by dividing the number of pulses driven by the stepper motor for feeding a single sheet of printing paper by the total number of coded grids, the number of pulses and the pulse sequence number of each coded grid are calculated. This is the number of times and the sequence number of data collected by the dedicated photoelectric sensor for decoding each coded grid. Then, according to the filtering algorithm, the first few and last few data collections of each coding cell are removed. The specific number of times is set according to the effect of the filtering algorithm. The remaining data collections are added together and divided by the number of times they are added to obtain the average value. The average value is then compared with the pre-set threshold to calculate the coding information of each coding cell. The acquired encoded information is decoded using preset decoding rules to obtain mapped content information, specifically including: The binary code is decoded according to the encoding rules and finally converted into a decimal encoded value and sent to the host computer. The corresponding mapping content information is obtained based on the decimal encoded value.
2. The encoding recognition and decoding calculation method in a printer according to claim 1, characterized in that, Pre-print the coding grid on the printing paper, specifically including: Individual codes are distinguished by pre-printing black or white codes in the coding grids on the printing paper, where black represents "1" in binary and white represents "0" or vice versa.
3. The encoding recognition and decoding calculation method in a printer according to claim 1, characterized in that, The method further includes: When printing paper with coded labels, the printer uses data collected by the gap sensor to calculate the beginning of the paper, and then starts counting the number of drive pulses of the printer's paper feed stepper motor in sequence. At the beginning of each pulse, the dedicated photoelectric sensor collects data once, and each collection is saved in sequence. Finally, the printer uses data collected by the gap sensor to calculate the end of the label paper, and then finishes printing one label.
4. The encoding recognition and decoding calculation method in a printer according to claim 1, characterized in that, Information is collected from the encoded grid using a dedicated photoelectric sensor for decoding, specifically including: The dedicated photoelectric sensors for decoding are divided into two groups: one group is a photoelectric reflective acquisition sensor, and the other group is a photoelectric through-beam acquisition sensor. The photoelectric reflective acquisition sensor emits infrared light through an infrared emitting tube, which hits the coding grid. The reflective receiving tube then receives the infrared spectral data reflected back from the coding grid. After being filtered and amplified by the acquisition circuit, the data is sent to the MCU in the printer for processing and identification. The photoelectric through-beam sensor emits infrared light through an infrared emitting tube, which hits the coding grid. The through-beam receiving tube receives the infrared spectral data transmitted back from the coding grid. After being filtered and amplified by the acquisition circuit, the data is sent to the MCU in the printer for processing and identification. Finally, the data collected by the two sets of sensors are compared and corrected to ensure the accuracy of the identification.
5. A printer encoding recognition and decoding calculation system, characterized in that, The system includes: The data acquisition module is used to move the paper in the output direction driven by the paper feed motor during the printing process, and to collect information from the pre-printed coded grids on the paper using a dedicated decoding photoelectric sensor. The encoding recognition and decoding calculation module is used to recognize and calculate the collected data, obtain the encoding information of each encoding cell, decode the obtained encoding information using preset decoding rules, and obtain the mapping content information. The encoding recognition and decoding calculation module is specifically used for: After the printer finishes printing, it calculates the length of a single sheet of paper by multiplying the number of drive pulses of the paper feed stepper motor by the distance the paper is fed by a single pulse. Then, it divides the length by the height of a known single coded cell to calculate the total number of coded cells on the sheet. Then, by dividing the number of pulses driven by the stepper motor for feeding a single sheet of printing paper by the total number of coded grids, the number of pulses and the pulse sequence number of each coded grid are calculated. This is the number of times and the sequence number of data collected by the dedicated photoelectric sensor for decoding each coded grid. Then, according to the filtering algorithm, the first few and last few data collections of each coding cell are removed. The specific number of times is set according to the effect of the filtering algorithm. The remaining data collections are added together and divided by the number of times they are added to obtain the average value. The average value is then compared with the pre-set threshold to calculate the coding information of each coding cell. The acquired encoded information is decoded using preset decoding rules to obtain mapped content information, specifically including: The binary code is decoded according to the encoding rules and finally converted into a decimal encoded value and sent to the host computer. The corresponding mapping content information is obtained based on the decimal encoded value.