Print control method, ticket print method, apparatus, device, and readable medium

By obtaining the measured length of the previous print and the target length range of the receipt printer, the receipt printer is controlled to print according to the target length. This solves the problem that the receipt printer cannot recognize the length after changing the paper size, achieves more accurate printing control, reduces resource waste and improves print quality.

CN117360097BActive Publication Date: 2026-06-26ZHEJIANG CAINIAO SUPPLY CHAIN MANAGEMENT CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG CAINIAO SUPPLY CHAIN MANAGEMENT CO LTD
Filing Date
2022-06-30
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing receipt printers cannot accurately identify paper length after changing the paper size, resulting in wasted resources and decreased print quality.

Method used

By obtaining the measured length of the previously printed ticket and combining it with a pre-determined target length range, the target length of the ticket to be printed is determined, and a control command is sent to the ticket printer to ensure that it prints according to the target length.

Benefits of technology

This reduces resource waste, improves the quality of invoice printing, and avoids large areas of blank paper or overlapping content on the printing paper.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117360097B_ABST
    Figure CN117360097B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a printing control method, a bill printing method, a device, an apparatus and a readable medium. The embodiments of the method comprise: obtaining a measured length of a first bill printed by a bill printer last time; determining a target length of a second bill to be printed based on the measured length and a target length interval, the target length interval being determined based on lengths of historical bills printed by the bill printer; and sending the target length to the bill printer to control the bill printer to print the second bill according to the target length. This embodiment reduces resource waste and improves bill printing quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a printing control method, a ticket printing method, an apparatus, a device, and a readable medium. Background Technology

[0002] A receipt printer is an IoT (Internet of Things) device that can be classified and named differently depending on its application in different industries. For example, in the logistics field, it can be called a receipt printer or label printer; in the financial field, it can be called a mobile POS (Point of Sale) machine; and in the pharmaceutical field, it can be called a medicine inventory machine or medicine inventory device.

[0003] In existing technologies, receipt printers are typically compatible with various sizes of receipt paper. However, in abnormal situations such as when users change the size of the receipt paper, the receipt printer cannot accurately identify the length of the new receipt paper. This results in large areas of blank paper and overlapping printed content, leading to resource waste and reduced print quality. Summary of the Invention

[0004] This application provides a printing control method, a ticket printing method, an apparatus, a device, and a readable medium to reduce resource waste while improving ticket printing quality.

[0005] In a first aspect, embodiments of this application provide a printing control method applied to a control device. The method includes: obtaining the measured length of a first ticket previously printed by a ticket printer; determining a target length of a second ticket to be printed based on the measured length and a predetermined target length range, wherein the target length range is determined based on the lengths of historical tickets printed by the ticket printer; and sending the target length to the ticket printer to control the ticket printer to print the second ticket according to the target length.

[0006] Secondly, embodiments of this application provide a ticket printing method applied to a ticket printer. The method includes: determining the measured length of a previously printed first ticket; sending the measured length to a control device and receiving a target length returned by the control device, wherein the target length is determined using one or more of the printing control methods described in embodiments of this application; and printing a second ticket according to the target length.

[0007] Thirdly, embodiments of this application also provide a printing control device applied to a control equipment. The device includes: an acquisition unit for acquiring the measured length of a first ticket previously printed by the ticket printer; a first determination unit for determining a target length of a second ticket to be printed based on the measured length and a pre-determined target length range, wherein the target length range is determined based on the length of historical tickets printed by the ticket printer; and a first sending unit for sending the target length to the ticket printer to control the ticket printer to print the second ticket according to the target length.

[0008] Fourthly, this application also provides a ticket printing device for use in a ticket printer. The device includes: a determining unit for determining the measured length of a previously printed first ticket; a first receiving unit for sending the measured length to a control device and receiving a target length returned by the control device, wherein the target length is determined using one or more printing control methods described in this application; and a printing unit for printing a second ticket according to the target length.

[0009] Fifthly, embodiments of this application also provide an electronic device, including: a processor; and a memory storing executable code thereon, wherein when the executable code is executed, the processor performs one or more of the printing control methods or the ticket printing methods described in one or more of the embodiments of this application.

[0010] Sixthly, embodiments of this application also provide one or more machine-readable media having executable code stored thereon, which, when executed, causes a processor to perform one or more printing control methods or one or more ticket printing methods as described in embodiments of this application.

[0011] Compared with the prior art, the embodiments of this application have the following advantages:

[0012] In this embodiment, by obtaining the measured length of the first ticket previously printed by the ticket printer, and then determining the target length of the second ticket to be printed based on the measured length and a pre-determined target length range, the target length is finally sent to the ticket printer. This allows the ticket printer to be controlled to print the second ticket according to the target length. Since the target length range is determined based on the lengths of historically printed tickets, it reflects whether the measured length is abnormal. Determining the target length of the second ticket to be printed based on this target length range ensures that the length setting of the second ticket is more reasonable and accurate in case of abnormalities, reducing the occurrence of large areas of blank paper or overlapping printed content caused by abnormal situations. This reduces resource waste and improves the quality of ticket printing. Attached Figure Description

[0013] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:

[0014] Figure 1 This is a schematic diagram illustrating an application scenario of the printing control method of this application;

[0015] Figure 2 This is a schematic diagram illustrating another application scenario of the printing control method of this application;

[0016] Figure 3 This is a flowchart of one embodiment of the printing control method of this application;

[0017] Figure 4 This is a schematic diagram of the inter-device interaction process in one embodiment of the printing control method of this application;

[0018] Figure 5 This is a flowchart of one embodiment of the invoice printing method of this application;

[0019] Figure 6 This is a schematic diagram of an embodiment of a printing control device according to this application;

[0020] Figure 7 This is a schematic diagram of an embodiment of a ticket printing device according to this application;

[0021] Figure 8 This is a schematic diagram of the structure of a device provided in an embodiment of this application. Detailed Implementation

[0022] The present application will now be described in further detail 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 not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.

[0023] It should be noted that all actions involving the acquisition of signals, information, or data in this application are carried out in compliance with the relevant data protection laws and policies of the country where the application is located, and with the authorization granted by the owner of the relevant device.

[0024] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0025] The embodiments of this application can be applied to invoice printing scenarios. For example, they may include, but are not limited to: printing scenarios such as logistics pickup slips and logistics waybills in the logistics field; printing scenarios of consumer invoices in the financial field; printing scenarios of drug documents and inspection documents in the pharmaceutical field; printing scenarios of queue receipts and restaurant detailed receipts in the catering field; and printing scenarios of product labels in the supermarket field.

[0026] In the invoice printing scenario applicable to the embodiments of this application, invoices can be printed using an invoice printer. An invoice printer is an IoT (Internet of Things) device, which can be classified differently in different fields, thus having different names. For example, in the logistics field, it can be called a receipt printer or label printer; in the financial field, it can be called a mobile POS (Point of Sale) machine; in the pharmaceutical field, it can be called a drug inventory machine or drug inventory device. Typically, invoice printers can accommodate various sizes of invoice paper. Different sizes of invoice paper can have different lengths. The invoice printing paper can be thermal paper or non-thermal paper; the embodiments of this application do not limit the material of the invoice printing paper. An invoice printer may only have invoice printing-related functions, or it may have both invoice printing-related functions and other functions, such as copying, scanning, and printing of non-invoice forms; the embodiments of this application do not limit the functions of the invoice printer.

[0027] In this embodiment, the receipt printer can communicate with a control device to receive or send information. The control device can be a smart device in the Internet of Things (IoT), such as a logistics PDA (Personal Digital Assistant) in the logistics field or a multifunction printer in the medical field, or a terminal device such as a mobile phone, tablet computer, laptop computer, or desktop computer. Here, the receipt printer and the control device can interact via wired or wireless connection. The aforementioned wireless connection methods may include, but are not limited to, 3G / 4G connection, WiFi connection, Bluetooth connection, WiMAX (World Interoperability for Microwave Access) connection, Zigbee connection, UWB (ultra-wideband) connection, and other currently known or future wireless connection methods.

[0028] The following explanation uses the logistics sector as an example. (See also...) Figure 1The schematic diagram shows that the control device can be a logistics PDA. A logistics PDA, also known as a barcode scanner in the logistics field, is one of the important devices for intelligent logistics management. It can be equipped with a memory, processor, camera, communication module, etc. The document printer can be a printer used to print logistics waybills. Logistics waybills can include, but are not limited to, sender's slips, receiver's slips, and sender / receiver slips containing sender and receiver information. Logistics waybills of the same type can have one or more specifications. Logistics waybills of different types can have the same or different specifications. The document printer described above can print at least one specification of logistics waybill. The length of logistics waybills of different specifications can be different.

[0029] In this scenario, the logistics PDA can communicate with the ticket printer via Bluetooth or other communication modules to obtain the measured length of the previously printed logistics waybill (referred to as the first logistics waybill). This previously printed first logistics waybill is the latest logistics waybill printed by the ticket printer up to the current moment. This measured length can be detected by the ticket printer. For example, it can be detected by sensors, rollers, or other devices installed on the ticket printer. Taking a ticket printer equipped with rollers as an example, the ticket printer can first obtain the number of rotations the rollers made during the previous printing period; then, based on the number of rotations and the circumference of the rollers, determine the measured length of the previously printed first waybill.

[0030] Because the measured length and the actual length of the logistics waybill printing paper may differ due to paper jams, paper changes, printer malfunctions, incorrect measured lengths, or measurement errors, directly controlling the printing of the second logistics waybill based on the measured length of the first waybill would result in paper waste or poor print quality. In this scenario, after obtaining the measured length of the first logistics waybill, the logistics PDA can determine the target length of the second logistics waybill based on the measured length and a pre-defined target length range. This target length is then sent to the ticket printer to control it to print the second logistics waybill according to the target length. The target length range can be determined based on the lengths of historical logistics waybills printed by the ticket printer. These historical waybills can be logistics waybills printed within a specified historical period (e.g., within 10 minutes); all logistics waybills printed since the printer was turned on this time; or several recently printed logistics waybills (e.g., the three most recently printed waybills). The length of historical logistics waybills can be the actual measured length, which can be detected by the invoice printer during the printing process of each historical logistics waybill, and can be sent to the logistics PDA by the invoice printer after printing is completed.

[0031] Since the target length range is determined based on the length of historical logistics waybills printed by the ticket printer, it reflects whether the measured length of the previous logistics waybill was abnormal. The logistics PDA can determine the target length based on the result of judging whether the measured length is abnormal. For example, if the measured length is not abnormal, the target length can be determined based on the target length range (e.g., a length can be selected from the target length range as the target length). If the measured length is abnormal, the number of abnormal prints can be further analyzed. If the number of abnormal prints is greater than or equal to the target number (e.g., 3 times), it means that the logistics waybill printing paper of the ticket printer may have been changed to other specifications. In this case, the target length can be determined based on the measured length. If the number of abnormal prints is less than the target number, it means that the ticket printer may have returned a length error. In this case, the target length can still be determined based on the target length range. Therefore, in abnormal situations such as users changing the printing paper specifications or the ticket printer returning an error in the measured length, the setting of the printing length of the next logistics waybill can be more reasonable and accurate, reducing the occurrence of large areas of blank printing paper or overlapping printed content caused by abnormal situations. Thus, resource waste is reduced and the quality of ticket printing is improved.

[0032] It should be noted that due to printing deviations, the actual measured length of the second logistics waybill printed by the ticket printer according to the target length is usually not equal to the target length. After the second logistics waybill is printed, it can be used as the first logistics waybill to continue the above process. In this way, for each logistics waybill printed, the target length of the next logistics waybill to be printed can be determined based on the actual measured length of the logistics waybill and the pre-determined target length range, thereby continuously controlling the ticket printer to print according to the target length for the next printing.

[0033] In some scenarios, considering the printing offset of printers, the length of each size of logistics waybill paper can be used as a standard length. A length range corresponding to each standard length is pre-defined, resulting in a set of length ranges containing multiple length ranges. A length range can be understood as a floating range of the standard length, and the length ranges in the set do not intersect. For example, the length of a logistics waybill can be represented by the number of pixel rows. If each millimeter corresponds to 8 rows of pixels, then a 4-centimeter long logistics waybill paper corresponds to 320 rows of pixels, and its standard length can be recorded as 320, with its corresponding length range set as [300, 340]. Similarly, a 4.5-centimeter long logistics waybill paper corresponds to 360 rows of pixels, and its standard length can be recorded as 360, with its corresponding length range set as [341, 380]. A 6-centimeter long logistics waybill paper corresponds to 480 rows of pixels, and its standard length can be recorded as 480, with its corresponding length range set as [460, 500]. In this example, the length interval set may include the length interval [300, 340] corresponding to the standard length of 320, the length interval [341, 380] corresponding to the standard length of 360, and the length interval [460, 500] corresponding to the standard length of 480. In this scenario, the target length determined by the logistics PDA can be the standard length corresponding to one of the length intervals in the length interval set. This allows for standardized length return, facilitating information retrieval and other processing based on the standardized length.

[0034] It should be noted that different ticket printers may have different printing offsets. Even the same ticket printer may have different printing offsets when using different sizes of logistics waybill paper. To improve the accuracy of length range settings, the applicable length range for each size of logistics waybill paper for each ticket printer can be determined by statistically analyzing the measured lengths of a large number of historical logistics waybills. For example, for ticket printer A, the length range corresponding to the standard length of 320 can be set to [295, 335], and the length range corresponding to the standard length of 480 can be set to [455, 495]. For ticket printer B, the length range corresponding to the standard length of 320 can be set to [305, 345], and the length range corresponding to the standard length of 480 can be set to [465, 505]. In practice, each ticket printer can store a configuration file, which records the applicable length range set and the standard length corresponding to each length range in the set. By using statistically measured data to set different fluctuation ranges for different ticket printers and logistics waybill printing paper of different specifications, different length intervals can be obtained, which can improve the accuracy and relevance of the length interval setting. At the same time, since the target length is the standard length corresponding to one of the length intervals in the length interval set, the length can be standardized for different ticket printers and different ticket printing papers, which further facilitates information acquisition and other processing based on the standardized length.

[0035] In some scenarios, the target length range can be one of the length ranges in the set of length ranges, selected from the set of length ranges based on the length of historical logistics waybills printed by the ticket printer. For example, if the majority of historical logistics waybills correspond to pixel rows in the range [300, 340], or if multiple (e.g., three) recently printed historical logistics waybills correspond to pixel rows in the range [300, 340], then [300, 340] can be used as the target length range, and the currently used logistics waybill printing paper is determined to be 4 cm long, corresponding to 320 rows of pixels. The target length can be the standard length corresponding to one of the length ranges in the set of length ranges. One of the length ranges can be the target length range or other length ranges, specifically determined based on the relationship between the measured length and the target length range. It is understood that during the operation of the ticket printer, the specifications of the logistics waybill printing paper may be changed, resulting in a change in the length range to which the measured length of the historical logistics waybill belongs. Therefore, the target length range can also be updated to other length ranges in the set of length ranges as the number of printing jobs increases.

[0036] In some scenarios, logistics PDAs can determine the target length based on the relationship between the measured length and the target length range. Specifically, if the measured length falls within the target length range, it means the measured length is not abnormal, i.e., no user has replaced the shipping label printing paper. In this case, the logistics PDA can determine the standard length corresponding to the target length range as the target length of the second shipping label to be printed. For example, if the target length range is [300, 340], its corresponding standard length is 320. If the measured length of the first shipping label printed previously was 315, it can be assumed that the shipping label printing paper used by the ticket printer has not been replaced. In this case, the standard length of 320 can be determined as the target length of the second shipping label to be printed.

[0037] Conversely, if the measured length does not belong to the target length range, it means the measured length is abnormal. For example, if the target length range is [300, 340], and the measured length of the first logistics waybill printed previously is 355, its length range could be the length range [341, 380] corresponding to the standard length of 360, instead of the target length range [300, 340], therefore the measured length is abnormal. In this case, the logistics PDA can first select a candidate length range (such as [341, 380] in the example above) from the preset length range set. Then, based on the relationship between the length of the historical documents printed for the target number (e.g., 3) and the candidate length range, the target length is determined. Specifically, if the length of each historical document printed for the target number of consecutively printed documents belongs to the candidate length range, it means that the length of the logistics waybill printing paper has changed, i.e., the user has changed to a different specification of logistics waybill printing paper. At this point, the target length range can be replaced with a candidate length range (such as [341, 380] in the example above), and the standard length corresponding to the candidate length range (such as 360 in the example above) can be determined as the target length of the second logistics waybill to be printed. If, among the consecutively printed target number of invoices, there are invoices whose length does not belong to the candidate length range, it can be considered that the printer may be returning incorrect measured data. In this case, the standard length corresponding to the target length range (such as [300, 340] in the example above) (such as 320 in the example above) can be determined as the target length of the second logistics waybill to be printed. This allows for a more reasonable and accurate setting of the printing length of the next logistics waybill in abnormal situations such as the user changing the paper size or the invoice printer returning incorrect measured length, reducing the occurrence of large areas of blank paper or overlapping printed content caused by abnormal situations. This reduces resource waste and improves the quality of invoice printing.

[0038] It should be noted that if the measured length does not belong to the target length range, and there is no candidate length range to which the measured length belongs in the preset length range set, the standard length cannot be obtained. In this case, the measured length can be directly determined as the target length of the second logistics waybill to be printed and returned.

[0039] In some scenarios, the target length range may not yet be recorded, meaning there is no predetermined target length range. In this case, the logistics PDA can construct the target length range based on historical logistics waybills. Specifically, the logistics PDA can first select a candidate length range from a preset set of length ranges, belonging to the measured length of the first logistics waybill printed previously. If the selection is successful, it indicates that a candidate length range exists in the set of length ranges, and that the measured length is applicable to a certain type of logistics waybill printing paper. At this point, the number and / or percentage of lengths belonging to this candidate length range in the historical logistics waybills printed by the ticket printer can be determined. If the number and / or percentage meet preset conditions, the candidate length range can be determined as the target length range. For example, if the percentage of lengths belonging to this candidate length range in the historical logistics waybills printed by the ticket printer is greater than or equal to 75%, then this candidate length range can be determined as the target length range. As another example, if the percentage of lengths belonging to this candidate length range in the historical logistics waybills printed by the ticket printer is greater than or equal to 75% and the number is greater than 10, then this candidate length range can be determined as the target length range. Therefore, a suitable target length interval can be successfully constructed even when there is no predetermined target length interval.

[0040] Conversely, if selection fails, it indicates that there is no candidate length interval in the length interval set to which the measured length belongs, meaning the measured length is either too large or too small, constituting abnormal data. In this case, the length intervals in the length interval set can be sorted based on the lengths of historical logistics waybills printed by the ticket printer, and the target length interval can be selected from the length interval set based on the sorting results. As an example, the length intervals can be sorted according to the number of historical logistics waybills whose lengths fall within each length interval, and the length interval at the top of the sorted list can be selected as the target length interval. Thus, a suitable target length interval can be successfully constructed even when a pre-determined target length interval does not exist.

[0041] In some scenarios, after determining the target length of the second logistics waybill to be printed, the logistics PDA can also obtain additional information besides the document information based on the target length. This additional information is then sent to the document printer, allowing the printer to print it onto the second waybill. The additional information can be of various types besides the document information. For example, it could be promotional information to enrich the information on the logistics waybill and provide convenience for the user.

[0042] The logistics PDA can acquire additional information in various ways. For example, it can first determine the type of the second logistics waybill to be printed based on the target length; then, based on the type of the second logistics waybill, it can acquire additional information. For instance, the type of logistics waybill can include black-and-white and color logistics waybills, and different types of waybills can be categorized by length. Logistics waybills with a length greater than a certain preset threshold can be color logistics waybills, while those with a length less than or equal to the threshold can be black-and-white logistics waybills. The type of additional information can include black-and-white additional information and color additional information. If the type of the second logistics waybill is black-and-white, then black-and-white additional information can be acquired. If the type of the second logistics waybill is color, then color additional information can be acquired. As another example, the logistics PDA can have built-in additional information applicable to different specifications of logistics waybills. The logistics PDA can first determine the specifications of the second logistics waybill based on the target length, and then extract the additional information applicable to that specification of logistics waybill.

[0043] In some scenarios, see Figure 2 As shown, the logistics PDA can also communicate with a server to obtain additional information by requesting the server. The server can be a local server or a cloud-based server. Specifically, after determining the target length of the second logistics waybill to be printed, the logistics PDA can send the target length to the server, allowing the server to determine the document type based on the target length and select additional information based on the document type. Then, it can receive the additional information returned by the server. Because the server has strong storage and data processing capabilities, it can store a large amount of information and select additional information from it. This further enhances the richness of the information in the logistics waybill, providing convenience for users.

[0044] It should be noted that the embodiments of this application can be applied to any invoice printing scenario, such as logistics pickup invoice printing scenario in the logistics field, consumer invoice printing scenario in the financial field, drug invoice or inspection invoice printing scenario in the pharmaceutical field, queue receipt or catering details in the catering field, and product label printing scenario in the supermarket field, etc., and are not limited to the above-mentioned application scenarios.

[0045] Continue to refer to Figure 3 The diagram illustrates a flowchart of an embodiment of the printing control method of this application. This printing control method can be applied to a control device. The control device can be a smart device in the Internet of Things (IoT), such as a logistics PDA in the logistics field or a multifunction printer in the pharmaceutical field, or a terminal device such as a mobile phone, tablet computer, laptop computer, or desktop computer. The control device can communicate with a receipt printer. The flow of this printing control method may include the following steps:

[0046] Step 301: Obtain the measured length of the first ticket previously printed by the ticket printer.

[0047] In this embodiment, the control device can communicate with the ticket printer via a Bluetooth module or other communication module to obtain the measured length of the ticket previously printed by the ticket printer (referred to as the first ticket). The previously printed first ticket is the latest ticket printed by the ticket printer up to the current time. This measured length can be detected by the ticket printer, for example, through sensors, rollers, or other devices installed on the ticket printer. Taking a ticket printer equipped with rollers as an example, the ticket printer can first obtain the number of rotations of the rollers during the previous printing period. Then, based on the number of rotations and the circumference of the rollers, the measured length of the previously printed first ticket can be determined.

[0048] Step 302: Determine the target length of the second ticket to be printed based on the measured length and the predetermined target length range.

[0049] In this embodiment, after obtaining the measured length of the first ticket, the control device can determine the target length of the ticket to be printed (which may be referred to as the second ticket) based on the measured length and a predetermined target length range. The target length range can be determined based on the lengths of historical tickets printed by the ticket printer. These historical tickets can be tickets printed by the ticket printer within a specified historical period (e.g., within 10 minutes); all tickets printed by the ticket printer since its current startup; or several recently printed tickets (e.g., the three most recently printed tickets). The length of the historical tickets can be the measured length, which can be detected by the ticket printer during the printing process of each historical ticket and can be sent to the control device by the ticket printer after printing is completed.

[0050] Since the target length range is determined based on the lengths of historical receipts printed by the receipt printer, it reflects whether the measured length of the previous receipt was abnormal. The control device can determine the target length based on the result of judging whether the measured length is abnormal. For example, if the measured length is not abnormal, the target length can be determined based on the target length range (e.g., a length can be selected from the target length range as the target length). If the measured length is abnormal, the number of abnormal prints can be further analyzed. If the number of abnormal prints is greater than or equal to the target number (e.g., 3 times), it means that the receipt printer's paper may have been changed to another specification, and the target length can be determined based on the measured length. If the number of abnormal prints is less than the target number, it means that the receipt printer may have returned a length error, and the target length can still be determined based on the target length range. Therefore, in cases of abnormalities such as users changing paper specifications or the receipt printer returning an incorrect measured length, the setting of the next receipt's printing length is more reasonable and accurate, reducing the occurrence of large areas of blank paper or overlapping printed content caused by abnormalities. This reduces resource waste and improves the quality of receipt printing.

[0051] Step 303: Send the target length to the ticket printer to control the ticket printer to print the second ticket according to the target length.

[0052] In this embodiment, after determining the target length, the control device can send the target length to the ticket printer to control the ticket printer to print the second ticket according to the target length.

[0053] It should be noted that due to printing deviations, the actual measured length of the second ticket printed by the ticket printer according to the target length is usually not equal to the target length. After the second ticket is printed, it can be used as the first ticket, and the above process can continue. In this way, for each ticket printed, the target length of the next ticket to be printed can be determined based on the actual measured length of the ticket and the pre-determined target length range, thereby continuously controlling the ticket printer to print the next ticket according to the target length.

[0054] The method provided in the above embodiments of this application obtains the measured length of a first ticket previously printed by the ticket printer, then determines the target length of the second ticket to be printed based on the measured length and a pre-determined target length range, and finally sends the target length to the ticket printer, thereby controlling the ticket printer to print the second ticket according to the target length. Since the target length range is determined based on the lengths of historical tickets printed by the ticket printer, the target length range can reflect whether the measured length is abnormal. Determining the target length of the second ticket to be printed based on this target length range allows for a more reasonable and accurate setting of the second ticket length in abnormal situations, reducing the occurrence of large areas of blank paper or overlapping printed content caused by abnormal situations. Therefore, it reduces resource waste and improves the quality of ticket printing.

[0055] In some optional embodiments, the receipt printer can be compatible with various sizes of receipt paper. Considering the printing offset of the receipt printer, the length of each size of receipt paper can be used as a standard length, and a length interval corresponding to each standard length can be pre-defined to obtain a set of length intervals. A length interval can be understood as a floating range of the standard length, and the length intervals in the set of length intervals do not intersect. As an example, the length of a receipt can be represented by the number of pixel rows. If each millimeter corresponds to 8 rows of pixels, then a 4-centimeter receipt paper corresponds to 320 rows of pixels, and the standard length can be recorded as 320, with its corresponding length interval set as [300, 340]. Similarly, a 4.5-centimeter receipt paper corresponds to 360 rows of pixels, and the standard length can be recorded as 360, with its corresponding length interval set as [341, 380]. A 6-centimeter receipt paper corresponds to 480 rows of pixels, and the standard length can be recorded as 480, with its corresponding length interval set as [460, 500]. The length range set may include the length range [300, 340] corresponding to the standard length of 320, the length range [341, 380] corresponding to the standard length of 360, and the length range [460, 500] corresponding to the standard length of 480. It should be noted that the standard length and length range can be set according to the actual situation and are not limited to the above examples.

[0056] In this embodiment, the target length determined by the logistics PDA can be a standard length corresponding to one of the length intervals in the aforementioned length interval set. This allows for standardized length return, facilitating information retrieval and other processing based on the standardized length. The target length interval can be one of the length intervals in the aforementioned length interval set, selected from the set based on the lengths of historical tickets printed by the ticket printer. For example, if the majority of historical tickets correspond to pixel rows in [300, 340], or if multiple (e.g., three) recently printed historical tickets correspond to pixel rows in [300, 340], then [300, 340] can be used as the target length interval, and the currently used ticket printing paper is considered to be 4 cm long with 320 pixel rows. The target length can be a standard length corresponding to one of the length intervals in the aforementioned length interval set. One of the length intervals can be the target length interval or other length intervals, determined based on the relationship between the measured length and the target length interval. Understandably, during the operation of a receipt printer, the paper specifications may be changed, resulting in a change in the length range to which the measured length of historical receipts belongs. Therefore, the target length range may also be updated to other length ranges within the length range set as the number of print jobs increases.

[0057] It should be noted that different ticket printers may have different printing offsets. Even the same ticket printer may have different printing offsets when using different sizes of ticket paper. To improve the accuracy of length range settings, the applicable length range for each ticket printer and each size of ticket paper can be determined by statistically analyzing the measured lengths of a large number of historical tickets. For example, for ticket printer A, the length range corresponding to a standard length of 320 can be set to [295, 335], and the length range corresponding to a standard length of 480 can be set to [455, 495]. For ticket printer B, the length range corresponding to a standard length of 320 can be set to [305, 345], and the length range corresponding to a standard length of 480 can be set to [465, 505]. Each ticket printer can store a configuration file, which records the applicable length range set and the standard length corresponding to each length range in the set. By statistically analyzing measured data to set different fluctuation ranges for different ticket printers and different sizes of ticket paper, the accuracy and specificity of length range settings can be improved. Meanwhile, since the target length is the standard length corresponding to one of the length intervals in the length interval set, it is possible to achieve standardized return of the length for different ticket printers and different ticket printing papers, which further facilitates information acquisition and other processing based on the standardized length.

[0058] In some optional embodiments, in step 302 above, if the measured length falls within the target length range, it means the measured length is not abnormal, i.e., no abnormal situation such as the user replacing the ticket printing paper has occurred. In this case, the standard length corresponding to the target length range can be determined as the target length of the second ticket to be printed. For example, if the target length range is [300, 340], its corresponding standard length is 320. If the measured length of the first ticket printed previously is 315, it can be considered that the ticket printing paper used by the ticket printer has not been replaced. In this case, the standard length 320 can be determined as the target length of the second ticket to be printed.

[0059] In some optional embodiments, in step 302 above, if the measured length does not belong to the target length range, it means that the measured length is abnormal. In this case, the control device can first select a candidate length range to which the measured length belongs from a preset set of length ranges. Then, based on the relationship between the length of the historical tickets of the target number of consecutively printed tickets (e.g., 3) and the candidate length range, the target length is determined. For example, if the target length range is [300, 340], and the measured length of the first ticket printed previously is 355, its candidate length range can be the length range [341, 380] corresponding to the standard length of 360. If the length of each historical ticket in the target number of consecutively printed tickets belongs to the candidate length range, it means that the length of the ticket printing paper has changed, that is, the user has changed to a different specification of ticket printing paper. In this case, the target length range can be replaced with the candidate length range [341, 380], and the standard length of 360 corresponding to the candidate length range can be determined as the target length of the second ticket to be printed. Conversely, if among the continuously printed target number of tickets, there are tickets whose length does not fall within the candidate length range, it can be assumed that the printer may be returning incorrect measured data. In this case, the standard length of 320 corresponding to the target length range [300, 340] can be determined as the target length for the second ticket to be printed. This allows for a more reasonable and accurate setting of the printing length for the next ticket in abnormal situations such as the user changing the paper size or the ticket printer returning incorrect measured length, reducing the occurrence of large areas of blank paper or overlapping printed content caused by abnormal situations. This reduces resource waste and improves the quality of ticket printing.

[0060] In some optional embodiments, the target length range has not yet been recorded, i.e., there is no predetermined target length range. In this case, the control device can construct the target length range based on historical tickets. Specifically, the control device can first select a candidate length range from a preset set of length ranges, to which the measured length of the first ticket printed previously belongs. If the selection is successful, it indicates that a candidate length range to which the measured length belongs exists in the set of length ranges, and also indicates that the measured length is applicable to a type of ticket printing paper. At this time, the number and / or percentage of historical tickets printed by the ticket printer that belong to the candidate length range can be determined. If the number and / or percentage of the number meets a preset condition, the candidate length range can be determined as the target length range. As an example, if the percentage of historical tickets printed by the ticket printer that belong to the candidate length range is greater than or equal to 75%, the candidate length range can be determined as the target length range. As another example, if the percentage of historical tickets printed by the ticket printer that belong to the candidate length range is greater than or equal to 75% and the number is greater than 10, the candidate length range can be determined as the target length range. Thus, a suitable target length range can be successfully constructed even when there is no predetermined target length range.

[0061] In some optional embodiments, if the candidate length interval to which the measured length of the first ticket belongs fails to be selected when there is no predetermined target length interval, it indicates that there is no candidate length interval to which the measured length belongs in the length interval set, that is, the measured length is too large or too small, and is abnormal data. In this case, the length intervals in the length interval set can be sorted based on the length of historical tickets printed by the ticket printer, and the target length interval can be selected from the length interval set based on the sorting result. As an example, the length intervals can be sorted according to the number of historical tickets whose lengths fall within each length interval, and the length interval with the highest sorting value can be selected as the target length interval. Thus, a suitable target length interval can be successfully constructed when there is no predetermined target length interval and when the measured length has the aforementioned candidate length interval.

[0062] In some optional embodiments, after determining the target length of the second ticket to be printed, the control device can also obtain additional information other than the ticket information based on the target length, thereby sending the ticket information and additional information to the ticket printer so that the ticket printer can print the ticket information and additional information on the second ticket. The control device can obtain the additional information in various ways. As an example, it can first determine the type of the second ticket to be printed based on the target length; then, it can obtain the additional information based on the type of the second ticket. For example, the type of ticket may include black and white tickets and color tickets, and different types of tickets can be divided according to length. Tickets with a length greater than a certain preset threshold can be color tickets, and tickets with a length less than or equal to the threshold can be black and white tickets. The type of additional information may include black and white additional information and color additional information. If the type of the second ticket is a black and white ticket, black and white additional information can be obtained. If the type of the second ticket is a color ticket, color additional information can be obtained. As another example, the control device may have built-in additional information applicable to different ticket sizes. The control device can first determine the size of the second ticket based on the target length, and then extract additional information applicable to that size. The additional information can be various information other than the ticket information. For example, it could be promotional information to enrich the information on the ticket and provide convenience for users.

[0063] In some optional embodiments, when the control device obtains additional information, it may first send a target length to the server, so that the server determines the ticket type based on the target length and selects the additional information to be printed into the second ticket based on the ticket type. Then, it can receive the additional information returned by the server. (See reference...) Figure 4 It illustrates a schematic diagram of the inter-device interaction process in this optional embodiment, including the following steps:

[0064] Step 401: The ticket printer sends the measured length of the first ticket printed previously to the control device.

[0065] Step 402: The control device determines the target length of the second ticket to be printed based on the measured length and the predetermined target length range.

[0066] In some optional implementations, if the measured length falls within the target length range, the control device can determine the standard length corresponding to the target length range as the target length of the second document to be printed.

[0067] In some optional implementations, if the measured length does not belong to the target length range, the control device can select a candidate length range from a preset set of length ranges. If the lengths of all historical tickets in the continuously printed target quantity belong to the candidate length range, the target length range is replaced by the candidate length range, and the standard length corresponding to the candidate length range is determined as the target length of the second ticket to be printed. If, in the continuously printed target quantity, there are tickets whose lengths do not belong to the candidate length range, the standard length corresponding to the target length range is determined as the target length of the second ticket to be printed. This allows for a more reasonable and accurate setting of the printing length for the next ticket in abnormal situations such as user changes to paper specifications or incorrect measured length returns from the ticket printer, reducing the occurrence of large blank areas on the printed paper or overlapping printed content caused by abnormal situations. This reduces resource waste and improves the quality of ticket printing.

[0068] In some optional implementations, if no predetermined target length range exists, the control device can select a candidate length range from a preset set of length ranges to which the measured length belongs. Upon successful selection, the number and / or percentage of historical receipts printed by the receipt printer that belong to the candidate length range can be determined. If the number and / or percentage meets preset conditions, the candidate length range can be determined as the target length range. Thus, a suitable target length range can be successfully constructed even when no predetermined target length range exists.

[0069] In some alternative implementations, when a predetermined target length interval does not exist, in response to the failure to select a candidate length interval to which the measured length belongs, the length intervals in the aforementioned length interval set can be sorted based on the lengths of historical tickets printed by the aforementioned ticket printer, and a target length interval can be selected from the aforementioned length interval set based on the sorting results. Thus, a suitable target length interval can be successfully constructed even when a predetermined target length interval does not exist and when the aforementioned candidate length intervals for the measured length are not available.

[0070] Step 403: The control device sends the target length to the ticket printer.

[0071] Step 404: The control device sends the target length to the server.

[0072] The execution order of steps 403 and 404 is not limited here; they can be executed simultaneously or sequentially.

[0073] Step 405: The server determines the ticket type based on the target length and selects additional information based on the ticket type.

[0074] Here, the type of ticket may include, but is not limited to, black-and-white tickets and color tickets, and different types of tickets may be classified according to their length. For example, tickets with a length greater than a certain preset threshold may be color tickets, and tickets with a length less than or equal to that threshold may be black-and-white tickets. The type of supplementary information may include, but is not limited to, black-and-white supplementary information and color supplementary information. If the second ticket is a black-and-white ticket, then black-and-white supplementary information can be obtained. If the second ticket is a color ticket, then color supplementary information can be obtained.

[0075] Step 406: The server returns additional information to the control device.

[0076] Step 407: The control device sends the ticket information and additional information to the ticket printer.

[0077] Step 408: The ticket printer prints the ticket information and additional information onto the second ticket based on the target length.

[0078] The steps in this embodiment are similar to those in the corresponding steps of the above embodiments, and can be found in the descriptions of the above embodiments for details. Because the server has strong storage and data processing capabilities, it can store a large amount of information and select additional information from it. Therefore, the richness of the information in the invoice can be further improved, providing convenience for users.

[0079] Further reference Figure 5 The document illustrates a flowchart of an embodiment of a ticket printing method. This ticket printing method can be applied to a ticket printer. The flowchart of the ticket printing method includes the following steps:

[0080] Step 501: Determine the measured length of the first ticket printed previously.

[0081] In this embodiment, the receipt printer can determine the measured length of the first receipt printed previously using its installed sensors or rollers. Taking a receipt printer equipped with rollers as an example, the number of rotations the rollers made during the previous printing can be obtained first; then, based on the number of rotations and the circumference of the rollers, the measured length of the first receipt printed previously can be determined. Here, the product of the number of rotations and the circumference of the rollers can be calculated, and this product can be converted into the number of pixel rows to obtain the measured length of the first receipt. This measured length can refer to the number of pixel rows.

[0082] Step 502: Send the measured length to the control device and receive the target length returned by the control device.

[0083] In this embodiment, after determining the measured length of the first previously printed ticket, the ticket printer can send the measured length to the control device and receive the target length returned by the control device. Here, the target length can be determined using any of the printing control methods described in the above embodiments, and will not be elaborated further.

[0084] Step 503: Print the second ticket according to the target length mentioned above.

[0085] In this embodiment, after receiving the target length, the ticket printer can print a second ticket according to the target length. It should be noted that due to printing deviations, the actual measured length of the second ticket printed by the ticket printer according to the target length is usually not equal to the target length. After the second ticket is printed, it can be used as the first ticket, and the above process can continue. Thus, for each ticket printed, the target length of the next ticket to be printed can be determined based on the actual measured length of that ticket and a pre-determined target length range, thereby continuously controlling the ticket printer to print the next ticket according to the target length.

[0086] In some optional implementations, before printing the second ticket according to the aforementioned target length, the ticket printer may also receive ticket information and additional information sent by the control device, the additional information being obtained based on the aforementioned target length. When printing the second ticket, the aforementioned ticket information and additional information can be used as the printing content of the second ticket, and the second ticket can be printed according to the aforementioned target length. This enriches the ticket content and makes it easier for users to obtain information beyond the ticket information itself.

[0087] The method provided in the above embodiments of this application, which prints a second document based on a target length, enables a more reasonable and accurate setting of the second document's length under abnormal circumstances, thereby reducing the occurrence of large areas of blank paper or overlapping printed content caused by abnormal situations. This reduces resource waste and improves the quality of document printing.

[0088] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of this application are not limited to the described order of actions, because according to the embodiments of this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of this application.

[0089] Further reference Figure 6 Based on the above embodiments, this application provides an embodiment of a printing control device, which can be specifically applied to a control device.

[0090] like Figure 6 As shown, the printing control device 600 of this embodiment includes: an acquisition unit 601, used to acquire the measured length of a first ticket previously printed by the ticket printer; a first determination unit 602, used to determine the target length of a second ticket to be printed based on the measured length and a predetermined target length range, wherein the target length range is determined based on the length of historical tickets printed by the ticket printer; and a first sending unit 603, used to send the target length to the ticket printer to control the ticket printer to print the second ticket according to the target length.

[0091] In some alternative implementations, the apparatus further includes a second transmitting unit, configured to acquire additional information based on the target length, wherein the additional information is information other than the ticket information; and to transmit the ticket information and the additional information to the ticket printer so that the ticket printer prints the ticket information and the additional information on the second ticket.

[0092] In some optional implementations, the second sending unit is further configured to send the target length to the server, so that the server determines the ticket type based on the target length and selects additional information to be printed into the second ticket based on the ticket type; and receives the additional information returned by the server.

[0093] In some optional implementations, the first determining unit 602 is further configured to determine the standard length corresponding to the target length range as the target length of the second document to be printed if the measured length belongs to the target length range.

[0094] In some optional implementations, the first determining unit 602 is further configured to: if the measured length does not belong to the target length range, select a candidate length range from a preset set of length ranges to which the measured length belongs; if the length of each historical ticket in the continuously printed target number of historical tickets belongs to the candidate length range, replace the target length range with the candidate length range, and determine the standard length corresponding to the candidate length range as the target length of the second ticket to be printed; if there are tickets in the continuously printed target number of tickets whose length does not belong to the candidate length range, determine the standard length corresponding to the target length range as the target length of the second ticket to be printed.

[0095] In some optional implementations, the above-mentioned device further includes a selection unit, used to select a candidate length interval to which the measured length belongs from a preset set of length intervals if no predetermined target length interval exists; and a second determination unit, used to determine, in response to successful selection, the number and / or percentage of the lengths belonging to the candidate length intervals in the historical tickets printed by the ticket printer, and if the number and / or percentage of the number meet preset conditions, the candidate length interval is determined as the target length interval.

[0096] In some alternative implementations, the method further includes a third determining unit, which, in response to a selection failure, sorts each length interval in the length interval set based on the length of the historical tickets printed by the ticket printer, and selects a target length interval from the length interval set based on the sorting result.

[0097] The apparatus provided in the above embodiments of this application obtains the measured length of a first ticket previously printed by the ticket printer, then determines the target length of a second ticket to be printed based on the measured length and a pre-determined target length range, and finally sends the target length to the ticket printer, thereby controlling the ticket printer to print the second ticket according to the target length. Since the target length range is determined based on the lengths of historical tickets printed by the ticket printer, the target length range can reflect whether the measured length is abnormal. Determining the target length of the second ticket to be printed based on this target length range allows for a more reasonable and accurate setting of the second ticket length in abnormal situations, reducing the occurrence of large areas of blank paper or overlapping printed content caused by abnormal situations. This reduces resource waste and improves the quality of ticket printing.

[0098] Further reference Figure 7 Based on the above embodiments, this application provides an embodiment of a ticket printing device, which can be specifically applied to a ticket printer.

[0099] like Figure 7 As shown, the printing control device 700 of this embodiment includes: a determining unit 701, used to determine the measured length of the first ticket printed previously; a first receiving unit 702, used to send the measured length to the control device and receive the target length returned by the control device, wherein the target length is determined by the printing control method in any of the above embodiments; and a printing unit 703, used to print a second ticket according to the target length.

[0100] In some alternative implementations, the aforementioned ticket printer is equipped with rollers; the determining unit 701 is further configured to obtain the number of rotations of the rollers during the previous printing; and based on the number of rotations and the circumference of the rollers, determine the measured length of the first ticket printed previously.

[0101] In some alternative implementations, the above-mentioned apparatus further includes a second receiving unit for receiving ticket information sent by the control device and additional information obtained based on the target length, and the printing unit 703 is further configured to: use the ticket information and the additional information as the printing content of the second ticket, and print the second ticket according to the target length.

[0102] The apparatus provided in the above embodiments of this application prints a second document based on a target length, which enables a more reasonable and accurate setting of the second document length under abnormal circumstances, thereby reducing the occurrence of large areas of blank paper or overlapping printed content caused by abnormal situations. This reduces resource waste and improves the quality of document printing.

[0103] This application also provides a non-volatile readable storage medium storing one or more modules (programs). When these modules are applied to a device, they enable the device to execute the instructions for the method steps in this application.

[0104] This application provides one or more machine-readable media storing instructions that, when executed by one or more processors, cause an electronic device to perform one or more of the methods described in the above embodiments. In this application, the electronic device includes various types of devices such as terminal devices and servers (clusters).

[0105] The embodiments of this disclosure can be implemented as an apparatus configured as desired using any suitable hardware, firmware, software, or any combination thereof, including electronic devices such as control devices, ticket printers, terminal devices, servers (clusters), etc. Figure 8 An exemplary apparatus 800 is schematically shown that can be used to implement the various embodiments described in this application.

[0106] In one embodiment, Figure 8An exemplary device 800 is shown, which includes one or more processors 802, a control module (chipset) 804 coupled to at least one of the processors 802, a memory 806 coupled to the control module 804, a non-volatile memory (NVM) / storage device 808 coupled to the control module 804, one or more input / output devices 810 coupled to the control module 804, and a network interface 812 coupled to the control module 804.

[0107] Processor 802 may include one or more single-core or multi-core processors, and processor 802 may include any combination of general-purpose processors or special-purpose processors (e.g., graphics processors, application processors, baseband processors, etc.). In some embodiments, device 800 can serve as a terminal device, server (cluster), or other device as described in the embodiments of this application.

[0108] In some embodiments, apparatus 800 may include one or more computer-readable media (e.g., memory 806 or NVM / storage device 808) having instructions 814 and one or more processors 802 that are combined with the one or more computer-readable media and configured to execute the instructions 814 to implement the module and thus perform the actions described in this disclosure.

[0109] In one embodiment, the control module 804 may include any suitable interface controller to provide any suitable interface to at least one of the processors 802 and / or any suitable device or component communicating with the control module 804.

[0110] The control module 804 may include a memory controller module to provide an interface to the memory 806. The memory controller module may be a hardware module, a software module, and / or a firmware module.

[0111] Memory 806 may be used, for example, to load and store data and / or instructions 814 for device 800. In one embodiment, memory 806 may include any suitable volatile memory, such as suitable DRAM. In some embodiments, memory 806 may include double data rate type quad synchronous dynamic random access memory (DDR4 SDRAM).

[0112] In one embodiment, the control module 804 may include one or more input / output controllers to provide an interface to the NVM / storage device 808 and (one or more) input / output devices 810.

[0113] For example, NVM / storage device 808 may be used to store data and / or instructions 814. NVM / storage device 808 may include any suitable non-volatile memory (e.g., flash memory) and / or may include any suitable (one or more) non-volatile storage devices (e.g., one or more hard disk drives (HDDs), one or more optical disc drives (CDs), and / or one or more digital universal optical disc (DVD) drives).

[0114] NVM / storage device 808 may include storage resources that are physically part of a device on which device 800 is mounted, or that are accessible to the device but do not necessarily have to be part of the device. For example, NVM / storage device 808 may be accessed via a network via one or more input / output devices 810.

[0115] One or more input / output devices 810 may provide an interface for device 800 to communicate with any other suitable device. Input / output devices 810 may include communication components, audio components, sensor components, etc. A network interface 812 may provide an interface for device 800 to communicate via one or more networks. Device 800 may wirelessly communicate with one or more components of a wireless network according to any of one or more wireless network standards and / or protocols, such as accessing a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G, 5G, etc., or a combination thereof.

[0116] In one embodiment, at least one of the processors 802 may be logically packaged with one or more controllers (e.g., memory controller modules) of the control module 804. In one embodiment, at least one of the processors 802 may be logically packaged with one or more controllers of the control module 804 to form a system-in-package (SiP). In one embodiment, at least one of the processors 802 may be integrated with the logic of one or more controllers of the control module 804 on the same die. In one embodiment, at least one of the processors 802 may be integrated with the logic of one or more controllers of the control module 804 on the same die to form a system-on-a-chip (SoC).

[0117] In various embodiments, device 800 may be, but is not limited to, a server, desktop computing device, or mobile computing device (e.g., laptop, handheld computing device, tablet, netbook, etc.). In various embodiments, device 800 may have more or fewer components and / or different architectures. For example, in some embodiments, device 800 includes one or more cameras, a keyboard, a liquid crystal display (LCD) screen (including a touchscreen display), a non-volatile memory port, multiple antennas, a graphics chip, an application-specific integrated circuit (ASIC), and a speaker.

[0118] The device can use a main control chip as a processor or control module, and sensor data, location information, etc. can be stored in a memory or NVM / storage device. The sensor group can be used as an input / output device, and the communication interface can include a network interface.

[0119] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.

[0120] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0121] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0122] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0123] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0124] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.

[0125] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0126] The printing control method, ticket printing method, apparatus, device, and readable medium provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A printing control method, characterized in that, Applied to control equipment, the method includes: Obtain the measured length of the first ticket previously printed by the ticket printer; Based on the measured length and the predetermined target length range, the target length of the second ticket to be printed is determined, wherein the target length range is determined based on the length of historical tickets printed by the ticket printer; Send the target length to the ticket printer to control the ticket printer to print the second ticket according to the target length; The step of determining the target length of the second document to be printed based on the measured length and the predetermined target length range includes: If the measured length does not belong to the target length range, then a candidate length range to which the measured length belongs is selected from the preset length range set; If the length of each historical ticket in the target number of consecutively printed tickets belongs to the candidate length range, then the target length range is replaced with the candidate length range, and the standard length corresponding to the candidate length range is determined as the target length of the second ticket to be printed. If, among the target number of tickets to be printed consecutively, there are tickets whose length does not belong to the candidate length range, then the standard length corresponding to the target length range is determined as the target length of the second ticket to be printed.

2. The method according to claim 1, characterized in that, The method further includes: Based on the target length, additional information is obtained, which is information other than the ticket information. The ticket information and the additional information are sent to the ticket printer so that the ticket printer prints the ticket information and the additional information on the second ticket.

3. The method according to claim 2, characterized in that, The step of obtaining additional information based on the target length includes: The target length is sent to the server so that the server can determine the ticket type based on the target length and select additional information to be printed into the second ticket based on the ticket type; Receive the additional information returned by the server.

4. The method according to claim 1, characterized in that, The step of determining the target length of the second document to be printed based on the measured length and the predetermined target length range includes: If the measured length falls within the target length range, then the standard length corresponding to the target length range is determined as the target length of the second document to be printed.

5. The method according to claim 1, characterized in that, The method further includes: If there is no predetermined target length interval, then the candidate length interval to which the measured length belongs is selected from the preset set of length intervals; In response to successful selection, the number and / or percentage of historical tickets printed by the ticket printer that belong to the candidate length range are determined. If the number and / or the percentage of the number meet a preset condition, the candidate length range is determined as the target length range.

6. The method according to claim 5, characterized in that, The method further includes: In response to a selection failure, the length intervals in the length interval set are sorted based on the length of the historical tickets printed by the ticket printer, and a target length interval is selected from the length interval set based on the sorting result.

7. A method for printing invoices, characterized in that, Applied to a receipt printer, the method includes: Determine the actual measured length of the first ticket printed previously; The measured length is sent to the control device, and the target length returned by the control device is received. The target length is determined using any of the printing control methods described in claims 1-6. Print the second ticket according to the target length.

8. The method according to claim 7, characterized in that, The receipt printer is equipped with rollers; determining the measured length of the first receipt printed previously includes: Obtain the number of rotations the roller made during the previous printing period; Based on the number of rolls and the circumference of the roller, the measured length of the first ticket printed previously is determined.

9. The method according to claim 7, characterized in that, Before printing the second ticket according to the target length, the method further includes: Receive ticket information and additional information obtained based on the target length sent by the control device; The step of printing the second ticket according to the target length includes: The ticket information and the additional information are used as the printing content of the second ticket, and the second ticket is printed according to the target length.

10. A printing control device, characterized in that, Applied to control equipment, the device includes: The acquisition unit is used to acquire the measured length of the first ticket previously printed by the ticket printer; The first determining unit is used to determine the target length of the second ticket to be printed based on the measured length and a predetermined target length range, wherein the target length range is determined based on the length of historical tickets printed by the ticket printer; The first sending unit is configured to send the target length to the ticket printer to control the ticket printer to print the second ticket according to the target length; The first determining unit is further configured to: if the measured length does not belong to the target length range, select a candidate length range to which the measured length belongs from a preset set of length ranges; if the length of each historical ticket in the continuously printed target number of historical tickets belongs to the candidate length range, replace the target length range with the candidate length range, and determine the standard length corresponding to the candidate length range as the target length of the second ticket to be printed; if there are tickets in the continuously printed target number of tickets whose length does not belong to the candidate length range, determine the standard length corresponding to the target length range as the target length of the second ticket to be printed.

11. A ticket printing device, characterized in that, The device, used in a receipt printer, includes: The determining unit is used to determine the measured length of the first ticket printed previously; The first receiving unit is configured to send the measured length to the control device and receive the target length returned by the control device, wherein the target length is determined by any of the printing control methods described in claims 1-6; A printing unit for printing a second ticket according to the target length.

12. An electronic device, characterized in that, include: processor; as well as A memory having executable code stored thereon, which, when executed, causes the processor to perform the method as described in any one of claims 1-9.

13. One or more machine-readable media having executable code stored thereon, which, when executed, causes a processor to perform the method as described in any one of claims 1-9.