Printer control method, printer and storage medium

By setting the target value of stop printing in the printer and comparing the number of unprinted labels, the problem that the printer cannot accurately stop printing when the printing medium cannot be detected, and the printing effect is improved.

CN119917033APending Publication Date: 2025-05-02JIANGMEN DASCOM COMP PERIPHERAL
View PDF 11 Cites 0 Cited by

Patent Information

Application Number
CN202411753040.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-02
Publication Date
2025-05-02

Smart Images

  • Figure CN119917033A_ABST
    Figure CN119917033A_ABST
Patent Text Reader

Abstract

The invention provides a control method of a printer, the printer and a storage medium, and the method comprises the steps: setting a printing stop target value when the printer stops printing, obtaining the current unprinted label number when a printing medium sensor cannot detect a printing medium, comparing the current unprinted label number with the printing stop target value, and obtaining a comparison result, and when the comparison result is that the current unprinted label number is equal to the printing stopping target value, the printer is controlled to stop printing, so that the printer can accurately determine the printing stopping time when the printing medium cannot be detected according to the comparison result between the current unprinted label number and the printing stopping target value, and the printing efficiency is improved. The printing content is prevented from being printed on a non-printing medium, and the printing effect of the printer is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of paper printing, and in particular to a printer control method, a printer and a storage medium. Background Art

[0002] In the prior art, the general paper out of print error reporting logic often requires that the end of the paper containing the print medium passes under the print head before the paper out of print error reporting is triggered. Based on this paper out of print error reporting logic, during the printing process, the end of the paper often cannot be printed on a complete print medium, and part of the content may be printed on a non-print medium when the last print medium is printed, thereby causing the last print medium to be unable to be used normally, reducing the printing effect of the printer. Summary of the invention

[0003] The main purpose of the embodiments of the present application is to propose a printer control method, a printer and a storage medium, which can enable the printer to accurately reserve non-printing print media between the print head and the print medium sensor, avoid the print content being printed on non-printing media, and improve the printing effect of the printer.

[0004] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application provides a method for controlling a printer, comprising: Set the stop printing target value when the printer stops printing; When the print medium sensor of the printer cannot detect the print medium, the number of currently unprinted labels is obtained; Compare the current number of unprinted labels with the stop printing target value to obtain a comparison result; When the comparison result is that the current number of unprinted labels is equal to the stop printing target value, the printer is controlled to stop printing.

[0005] Further, in one embodiment, setting a stop printing target value when the printer stops printing includes: Obtain the printing distance value between the printer's print head and the print medium sensor, and the printing length value required for the print head to complete a printing task on the print medium; According to the ratio between the printing distance value and the printing length value, the theoretical value of the task to be printed that can completely complete the printing task between the print head and the print medium sensor is confirmed, and the stop printing target value is set according to the theoretical value of the task to be printed.

[0006] Further, in one embodiment, according to the ratio between the printing distance value and the printing length value, determining the theoretical value of the task to be printed that can completely complete the printing task between the print head and the print medium sensor, and setting the stop printing target value according to the theoretical value of the task to be printed, includes: When the ratio of the printing distance value to the printing length value is greater than 0 and less than 1, it is confirmed that the theoretical value of the task to be printed is 0; According to the theoretical value of the task to be printed, the stop printing target value is set to 0.

[0007] Further, in one embodiment, according to the ratio between the printing distance value and the printing length value, determining the theoretical value of the task to be printed that can completely complete the printing task between the print head and the print medium sensor, and setting the stop printing target value according to the theoretical value of the task to be printed, includes: When the ratio of the printing distance value to the printing length value is equal to or greater than 1, it is confirmed that the theoretical value of the task to be printed is a positive integer obtained by rounding off the decimal point of the ratio; According to the theoretical value of the task to be printed, the stop printing target value is set to a value equal to the theoretical value of the task to be printed.

[0008] Further, in one embodiment, according to the ratio between the printing distance value and the printing length value, determining the theoretical value of the task to be printed that can completely complete the printing task between the print head and the print medium sensor, and setting the stop printing target value according to the theoretical value of the task to be printed, includes: When the ratio of the printing distance value to the printing length value is greater than 1, it is confirmed that the theoretical value of the task to be printed is a positive integer obtained by rounding off the decimal point of the ratio; According to the theoretical value of the task to be printed, the stop printing target value is set to any positive integer between 1 and the theoretical value of the task to be printed.

[0009] Furthermore, in one embodiment, the control method further includes: When the comparison result is that the current number of unprinted labels is greater than the stop printing target value, the printer is controlled to continue printing until the current number of unprinted labels is equal to the stop printing target value, and the printer is controlled to stop printing.

[0010] Furthermore, in one embodiment, the control method further includes: When the comparison result is that the current number of unprinted labels is less than the stop printing target value, the stop printing target value is adjusted to the current number of unprinted labels, and when it is determined that the adjusted stop printing target value is equal to the current number of unprinted labels, the printer is controlled to stop printing.

[0011] Furthermore, after controlling the printer to stop printing, the control method further includes: controlling the printer to display information for prompting to replace the printing medium.

[0012] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides a printer, characterized in that it includes: A print medium sensor, the print medium sensor is used to detect the position of the print medium; A print processor, the print processor being communicatively connected to the print medium sensor; Wherein, the print processor is used to set a stop printing target value when the printer stops printing; The print processor is also used to obtain the current number of unprinted labels when the print medium sensor detects no print medium; The print processor is also used to compare the current number of unprinted labels with the stop printing target value to obtain a comparison result; The print processor is also used to control the printer to stop printing when the comparison result is that the current number of unprinted labels is equal to the stop printing target value.

[0013] To achieve the above-mentioned purpose, the third aspect of the embodiments of the present application proposes a storage medium, which is a computer-readable storage medium. The storage medium stores a computer program, and when the computer program is executed by a processor, the control method of the printer of the first aspect of the embodiment is implemented.

[0014] The embodiments of the present application have the following beneficial effects: by setting a stop printing target value when the printer stops printing, when the print medium sensor cannot detect the print medium, the current number of unprinted labels is obtained, and the current number of unprinted labels is compared with the stop printing target value to obtain a comparison result; when the comparison result is that the current number of unprinted labels is equal to the stop printing target value, the printer is controlled to stop printing; and then, through the comparison result between the current number of unprinted labels and the stop printing target value, the printer can accurately determine the timing to stop printing when the print medium cannot be detected, thereby avoiding the print content being printed on non-printing media, thereby improving the printing effect of the printer. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 is a flow chart of a method for controlling a printer provided by an embodiment of the present application; Figure 2 This is an embodiment of the present application. Figure 1 Flow chart of step S120; Figure 3 This is an embodiment of the present application. Figure 2 Flow chart of step S220; Figure 4 Another embodiment of the present application provides Figure 2 Flow chart of step S220; Figure 5 Another embodiment of the present application provides Figure 2 Flow chart of step S220; Figure 6 A flowchart of controlling a printer to stop printing according to the current number of unprinted labels and a stop printing target value provided by an embodiment of the present application; Figure 7 is a flowchart of a method for controlling a printer provided by another embodiment of the present application; Figure 8 A flowchart of a method for controlling a printer provided by another embodiment of the present application; Fig. 9 It is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0016] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0017] In the description of the present application, it should be understood that descriptions involving orientation, such as up, down, front, back, left, right, etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present application.

[0018] It should also be noted that in the description of this application, "several" means more than one, "more" means more than two, "greater than", "less than", "exceed", etc. are understood to exclude the number itself, and "above", "below", "within", etc. are understood to include the number itself. If there is a description of "first" or "second", it is only used to distinguish the technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.

[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0020] In the description of the present application, the description with reference to the terms "one embodiment", "an embodiment", "illustrative embodiment", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0021] In the prior art, the general label paper shortage printing error logic often requires that the paper shortage error is triggered only when the end of the paper passes under the print head. Based on this label paper shortage printing error, during the label manufacturing process, a complete label often cannot be printed at the end of the paper. When printing the last label, part of the label may be printed above the tape between the end of the paper and the paper roll core, thereby causing the last printed label to be unable to be used normally, reducing the integrity of the label printed by the printer.

[0022] Based on this, an embodiment of the present application provides a printer control method, a printer and a storage medium. By setting a stop printing target value when the printer stops printing, when the print medium sensor cannot detect the print medium, the current number of unprinted labels is obtained, and the current number of unprinted labels is compared with the stop printing target value to obtain a comparison result; when the comparison result is that the current number of unprinted labels is equal to the stop printing target value, the printer is controlled to stop printing, and then through the comparison result between the current number of unprinted labels and the stop printing target value, the printer can accurately determine the time to stop printing when the print medium cannot be detected, thereby avoiding the print content from being printed on non-printing media, thereby improving the printing effect of the printer.

[0023] A control method for a printer, a printer, and a storage medium provided in an embodiment of the present application are specifically described through the following embodiments. First, a control method for a printer in an embodiment of the present application is described.

[0024] It should be noted that the control method of the printer is applied to a printer, the printer includes a print processor and a print medium sensor, the print medium sensor is used to detect the position of the print medium, and the print processor is respectively connected to the print head and the print medium sensor for communication.

[0025] Reference Figure 1 As shown, Figure 1 It is a flowchart of a printer control method provided by an embodiment of the present application. The printer control method may include but is not limited to steps S110 to S120.

[0026] Step S110: Setting a stop printing target value when the printer stops printing.

[0027] The stop printing target value is a value of Z print media to be printed that are reserved by the printer when the printer stops printing.

[0028] Step S120: when the print medium sensor cannot detect the print medium, the number of currently unprinted labels is obtained.

[0029] The current number of unprinted labels is the value of the distance between the print head and the print medium sensor that actually needs to print X print media.

[0030] Specifically, the print processor first controls the rotation of the printer's print roller to take the paper containing the print medium out of the paper roll core and accurately transport it to the printer's print path. After the paper reaches the printable position of the print head, the print processor controls the print head to print content on the print medium of the paper according to a preset print task; then, the print medium sensor installed on the printer's paper feed path continuously detects whether there is print medium on the printer's print path. When the print medium sensor continues to fail to detect print medium on the printer's print path, the print processor obtains the current number X of unprinted labels.

[0031] Step S130: Compare the current number of unprinted labels with the stop printing target value to obtain a comparison result.

[0032] Specifically, the current number of unprinted labels X is compared with the stop printing target value Z to obtain a comparison result.

[0033] Step S140: When the comparison result is that the current number of unprinted labels is equal to the stop printing target value, the printer is controlled to stop printing.

[0034] When the comparison result is that the current number of unprinted labels is equal to the stop printing target value (ie X=Z), the printer is controlled to stop printing.

[0035] Further, refer to Figure 2 As shown, Figure 2 This is an embodiment of the present application. Figure 1 In the flowchart of step S120, the control method of the printer may include but is not limited to steps S210 to S230.

[0036] Step S210: Obtain the printing distance value between the print head of the printer and the print medium sensor, and the printing length value required for the print head to complete a printing task on the print medium.

[0037] In some possible implementation examples, the print processor obtains a printing distance value of 105 mm from the print head of the printer to the print medium sensor of the printer, and a printing length value of 25 mm required for the printer to complete a printing task on a print medium.

[0038] In some possible implementation examples, the print processor obtains a printing distance value of 105 mm from the print head of the printer to the print medium sensor of the printer, and a printing length value of 35 mm required for the printer to complete a printing task on a print medium.

[0039] In some possible implementation examples, the print processor obtains a printing distance value of 105 mm from the print head of the printer to the print medium sensor of the printer, and a printing length value of 110 mm required for the printer to complete a printing task on a print medium.

[0040] It should be noted that the printer needs to calibrate the length of the print medium before each printing to obtain the corresponding print medium length and medium gap length, wherein the print medium length is the length of one print medium, and the medium gap length is the gap length between each print medium, and then the print medium length and the medium gap length are summed to obtain the print length value. For example: the print medium is calibrated in length to obtain the corresponding print medium length of 15 mm and the medium gap length of 5 mm, and then the print medium length of 15 mm and the medium gap length of 5 mm are summed to obtain a print length value of 20 mm. Therefore, the print length value required to complete a printing task is the distance value of the current print medium length plus the medium gap length. Preferably, if the current printing medium is a label, the print length value required to complete a printing task on a label is the distance value of the current label length plus the gap value between labels.

[0041] Step S220: According to the ratio between the printing distance value and the printing length value, confirm the theoretical value of the task to be printed that can fully complete the printing task between the print head and the print medium sensor, and set the stop printing target value according to the theoretical value of the task to be printed.

[0042] The theoretical value of the task to be printed is the value of the distance between the print head and the print medium sensor that can completely print Y pieces of media.

[0043] In some possible implementation examples, the ratio between the printing distance value of 105mm and the printing length value of 25mm confirms that the theoretical value of the task to be printed Y=4 between the print head and the print medium sensor can fully complete the printing task, and sets the stop printing target value based on the theoretical value of the task to be printed Y=4.

[0044] In some possible implementation examples, the ratio between the printing distance value of 105mm and the printing length value of 110mm confirms that the theoretical value of the task to be printed Y=0 between the print head and the print medium sensor can fully complete the printing task, and sets the stop printing target value based on the theoretical value of the task to be printed Y=0.

[0045] Further, refer to Figure 3 As shown, Figure 3 This is an embodiment of the present application. Figure 2 In the flowchart of step S220, the control method of the printer may include but is not limited to steps S310 to S320.

[0046] Step S310: When the ratio of the printing distance value to the printing length value is greater than 0 and less than 1, it is confirmed that the theoretical value of the task to be printed is 0.

[0047] In some possible implementation examples, the printing distance value is 105 mm and the printing length value is 110 mm, then the ratio of the printing distance value to the printing length value is 0.9545, and the ratio 0.9545 is greater than 0 and less than 1, confirming that the theoretical value of the task to be printed Y=0.

[0048] Step S320: according to the theoretical value of the task to be printed, the stop printing target value is set to 0.

[0049] Specifically, according to the theoretical value of the task to be printed being Y=0, the target value for stopping printing is set to Z=0.

[0050] It should be noted that when the stop printing target value is set to 0, the menu option parameter value currently displayed by the printer can also be changed to a parameter value of "automatic" or "Auto", wherein the parameter value of "automatic" or "Auto" indicates that the current printer is in automatic printing mode.

[0051] Reference Figure 4 As shown, Figure 4 Another embodiment of the present application provides Figure 2 In the flowchart of step S220, the control method of the printer may include but is not limited to steps S410 to S420.

[0052] Step S410: When the ratio of the printing distance value to the printing length value is equal to or greater than 1, confirm that the theoretical value of the task to be printed is a positive integer obtained by rounding off the decimal point of the ratio.

[0053] In some possible implementation examples, the printing distance value is 105 mm and the printing length value is 25 mm, then the ratio of the printing distance value to the printing length value is 4.2, and the ratio 4.2 is greater than 1, then it is confirmed that the theoretical value of the task to be printed is the positive integer 4 obtained by rounding down the decimal point of the ratio 4.2 (ie, Y=4).

[0054] Step S420: according to the theoretical value of the task to be printed, the stop printing target value is set to a value equal to the theoretical value of the task to be printed.

[0055] Specifically, according to the theoretical value of the task to be printed being Y=4, the stop printing target value is set to a value equal to the theoretical value of the task to be printed (ie, Z=4).

[0056] Reference Figure 5 As shown, Figure 5 Another embodiment of the present application provides Figure 2In the flowchart of step S220, the control method of the printer may include but is not limited to steps S510 to S520.

[0057] Step S510: When the ratio of the printing distance value to the printing length value is greater than 1, confirm that the theoretical value of the task to be printed is a positive integer obtained by rounding off the decimal point of the ratio.

[0058] In some possible implementation examples, the printing distance value is 105mm and the printing length value is 35mm, then the ratio of the printing distance value to the printing length value is 3, and the ratio 3 is greater than 1, then it is confirmed that the theoretical value of the task to be printed is the positive integer 3 obtained by rounding off the decimal point of the ratio 3 (ie, Y=3).

[0059] Step S520: according to the theoretical value of the task to be printed, the stop printing target value is set to any positive integer between 1 and the theoretical value of the task to be printed.

[0060] In some possible implementation examples, according to the theoretical value of the task to be printed Y=3, the stop printing target value is set to any positive integer between 1 and the theoretical value of the task to be printed Y=3 (for example, the stop printing target value is set to X=3).

[0061] In some possible implementation examples, according to the theoretical value of the task to be printed Y=3, the stop printing target value is set to any positive integer between 1 and the theoretical value of the task to be printed Y=3 (for example, the stop printing target value is set to X=2).

[0062] In some possible implementation examples, according to the theoretical value of the task to be printed Y=3, the stop printing target value is set to any positive integer between 1 and the theoretical value of the task to be printed Y=3 (for example, the stop printing target value is set to X=1).

[0063] It should be noted that the printing mode of the printer can be divided into an automatic printing mode and a custom printing mode. When the printer is in the custom printing mode, the above step S520 is executed; when the printer is in the automatic printing mode, the above step S320 or step S420 is executed.

[0064] Further, refer to Figure 6 As shown, Figure 6 It is a flowchart of a printer control method provided by another embodiment of the present application. The printer control method may include but is not limited to steps S610 to S620.

[0065] Step S620: When the comparison result is that the current number of unprinted labels is greater than the stop printing target value, the printer is controlled to continue printing until the current number of unprinted labels is equal to the stop printing target value, and the printer is controlled to stop printing.

[0066] In some possible implementation examples, when the comparison result is that the current number of unprinted labels X=5 is greater than the stop printing target value Z=4, the printer is controlled to continue printing so that the current number of unprinted labels X decreases by one after each printing medium is printed, until the current number of unprinted labels X=4 is equal to the stop printing target value Z=4, and the printer is controlled to stop printing.

[0067] Further, refer to Figure 7 As shown, Figure 7 It is a flowchart of a printer control method provided by another embodiment of the present application. The printer control method may include but is not limited to step S710.

[0068] Step S710: When the comparison result is that the current number of unprinted labels is less than the stop printing target value, the stop printing target value is adjusted to the current number of unprinted labels, and when it is determined that the adjusted stop printing target value is equal to the current number of unprinted labels, the printer is controlled to stop printing.

[0069] In some possible implementation examples, when the comparison result is that the current number of unprinted labels X=3 is less than the stop printing target value Z=4, the stop printing target value is adjusted to the current number of unprinted labels (i.e. Z=3), and when it is determined that the adjusted stop printing target value Z=3 is equal to the current number of unprinted labels X=3, the printer is controlled to stop printing.

[0070] It should be noted that, after controlling the printer to stop printing, the printer control method may further include: controlling the printer to display information for prompting to replace the printing medium.

[0071] In a second aspect, the present application also provides a printer, referring to Figure 8 , Figure 8 A schematic diagram of a printer according to an embodiment of the present application is provided, wherein the printer 800 includes: The print medium sensor 801 is used to detect the position of the print medium; A print processor 802, the print processor 802 is in communication with the print medium sensor 801; The print processor 802 is used to set a stop printing target value when the printer stops printing; The print processor 802 is also used to obtain the current number of unprinted labels when the print medium sensor cannot detect the print medium; The print processor 802 is further used to compare the current number of unprinted labels with the stop printing target value to obtain a comparison result; The print processor 802 is further configured to control the printer to stop printing when the comparison result shows that the current number of unprinted labels is equal to the stop printing target value.

[0072] The above-mentioned printer 800 and the control method of the above-mentioned printer are based on the same inventive concept. The above-mentioned process describes the specific implementation method of the printer 800 of the embodiment of the present application. By setting the stop printing target value when the printer stops printing, when the print medium sensor cannot detect the print medium, the current number of unprinted labels is obtained, and the current number of unprinted labels is compared with the stop printing target value to obtain a comparison result; when the comparison result is that the current number of unprinted labels is equal to the stop printing target value, the printer is controlled to stop printing, and then through the comparison result between the current number of unprinted labels and the stop printing target value, the printer can accurately determine the timing to stop printing when the print medium cannot be detected, thereby avoiding the print content from being printed on non-printing media, thereby improving the printing effect of the printer.

[0073] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the control method of the above printer when executing the computer program. The electronic device can be any smart terminal including a mobile phone, a tablet computer, a car computer, etc.

[0074] See also Fig. 9 , Fig. 9 : is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application, and the electronic device includes: The processor 901 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the control method of the printer provided in the embodiment of the present application; The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other application programs. When the technical solution provided in the embodiments of this specification is implemented by software or firmware, the relevant program code is stored in the memory 902, and the processor 901 calls and executes the control method of the printer provided in the embodiments of this application; Input / output interface 903, used to implement information input and output; Communication interface 904, used to realize communication interaction between the device and other devices, which can be realized through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.); A bus 905 that transmits information between various components of the device (e.g., the processor 901, the memory 902, the input / output interface 903, and the communication interface 904); The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .

[0075] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the control method of the printer provided in the embodiment of the present application is implemented.

[0076] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0077] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0078] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0079] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0080] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0081] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0082] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0083] In the several embodiments provided in the present application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0084] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0085] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0086] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.

[0087] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.

Claims

1. A method for controlling a printer, characterized in that: include: Setting a stop printing target value when the printer stops printing; When the print medium sensor of the printer cannot detect the print medium, obtaining the number of currently unprinted labels; Compare the current number of unprinted labels with the stop printing target value to obtain a comparison result; When the comparison result is that the current number of unprinted labels is equal to the stop printing target value, the printer is controlled to stop printing.

2. The control method according to claim 1, characterized in that: The step of setting a stop printing target value when the printer stops printing comprises: Acquire a printing distance value between a print head of the printer and the print medium sensor, and a printing length value required for the print head to complete a printing task on the print medium; According to the ratio between the printing distance value and the printing length value, the theoretical value of the task to be printed that can fully complete the printing task between the print head and the print medium sensor is confirmed, and the stop printing target value is set according to the theoretical value of the task to be printed.

3. The control method according to claim 2, characterized in that: The method of determining a theoretical value of a task to be printed that can completely complete a printing task between the print head and the print medium sensor according to the ratio between the print distance value and the print length value, and setting the stop printing target value according to the theoretical value of the task to be printed includes: When the ratio of the printing distance value to the printing length value is greater than 0 and less than 1, confirming that the theoretical value of the task to be printed is 0; The stop printing target value is set to 0 according to the theoretical value of the task to be printed.

4. The control method according to claim 2, characterized in that: The method of determining a theoretical value of a task to be printed that can completely complete a printing task between the print head and the print medium sensor according to the ratio between the print distance value and the print length value, and setting the stop printing target value according to the theoretical value of the task to be printed includes: When the ratio of the printing distance value to the printing length value is equal to or greater than 1, confirming that the theoretical value of the task to be printed is a positive integer obtained by rounding off the decimal point of the ratio; According to the theoretical value of the task to be printed, the stop printing target value is set to a value equal to the theoretical value of the task to be printed.

5. The control method according to claim 2, characterized in that: The method of determining a theoretical value of a task to be printed that can completely complete a printing task between the print head and the print medium sensor according to the ratio between the print distance value and the print length value, and setting the stop printing target value according to the theoretical value of the task to be printed includes: When the ratio of the printing distance value to the printing length value is greater than 1, confirming that the theoretical value of the task to be printed is a positive integer obtained by rounding off the decimal point of the ratio; According to the theoretical value of the task to be printed, the stop printing target value is set to any positive integer between 1 and the theoretical value of the task to be printed.

6. The control method according to claim 1, characterized in that: The control method further comprises: When the comparison result is that the current number of unprinted labels is greater than the stop printing target value, the printer is controlled to continue printing until the current number of unprinted labels is equal to the stop printing target value, and the printer is controlled to stop printing.

7. The control method according to claim 1, characterized in that: The control method further comprises: When the comparison result is that the current number of unprinted labels is less than the stop printing target value, the stop printing target value is adjusted to the current number of unprinted labels, and when it is determined that the adjusted stop printing target value is equal to the current number of unprinted labels, the printer is controlled to stop printing.

8. The control method according to any one of claims 1 to 7, characterized in that: After controlling the printer to stop printing, the control method further includes: The printer is controlled to display information for prompting to replace the printing medium.

9. A printer, characterized in that: include: A print medium sensor, the print medium sensor is used to detect the position of the print medium; a print processor, the print processor being communicatively connected to the print medium sensor; Wherein, the printing processor is used to set a stop printing target value when the printer stops printing; The print processor is also used to obtain the current number of unprinted labels when the print medium sensor cannot detect the print medium; The printing processor is also used to compare the current number of unprinted labels with the stop printing target value to obtain a comparison result; The print processor is further configured to control the printer to stop printing when the comparison result is that the current number of unprinted labels is equal to the stop printing target value.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program executable by a processor, and when the program executable by the processor is executed by the processor, the method for controlling a printer according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Printer and control method of printer

    CN104512107A

  • Printing control method of printer, related equipment and storage medium

    CN112612430A

  • Information processing apparatus, tape printing apparatus, tape printing system, method for controlling information processing apparatus, and recording medium

    CN115139667A

  • Mileage determination method and device for printing paper, electronic equipment and storage medium

    CN116974494A

  • Information processing method and device, information playing method and device, electronic equipment and computer storage medium

    CN117289882A