Positioning threshold calculation method and related equipment
By collecting and comparing the light sensing data of the printer on the label paper and calculating the positioning threshold, the problem of positioning the printer in the face paper and gap areas is solved, and the printing quality and efficiency are improved.
Patent Information
- Application Number
- CN202510078858.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-17
- Publication Date
- 2025-05-02
AI Technical Summary
When printing wrapped labels, it is difficult for existing printers to accurately determine the area of the surface paper and gap areas, resulting in reduced printing quality and waste of label paper.
By collecting the first light sensing data and the second light sensing data, detecting whether the difference meets the preset segmentation conditions, obtaining the corresponding threshold calculation method, and calculating the positioning threshold to determine the position of the printer on the label paper.
Improves print quality, prevents overlap, blur or misalignment of different colors or image elements, reduces label paper waste, and avoids printing failures due to offset or position errors.
Smart Images

Figure CN119911013A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of printer control, and in particular to a method for calculating a positioning threshold and related equipment. Background Art
[0002] Printer-printed labels come in a variety of styles, among which wrap-around labels are widely used in daily life because of their aesthetics and convenience. Wrap-around labels refer to a special type of transparent paper, the surface of which is not completely transparent, but has special colored ink printed between the gap and the transparent surface. The ink absorbs part of the light signal like the material in the gap, resulting in lower light sensing data than that of ordinary transparent paper.
[0003] In order to distinguish between the face paper and the gap during printing, the printer needs a standard to determine the current position of the sensor on the label. Generally, the printer will calculate the threshold between the face paper and the gap. This process is called threshold calibration.
[0004] The threshold calibration process of the printer is generally divided into three parts, namely, paper detection, gap detection and threshold calculation. Paper detection and gap detection are to collect stable paper and gap data of the label paper during the paper feeding process to obtain a unified value, while the threshold calculation is to calculate the average value of the unified paper and gap values as the threshold. The role of the threshold is to distinguish whether it is paper or gap based on the size relationship between the current light-sensitive ADC and the threshold.
[0005] As printing labels is now complex and diverse, layering often occurs on the surface paper. How to accurately locate the position of the label printer during the printing process, whether it is the surface paper area or the gap area, has become an urgent problem to be solved. Summary of the invention
[0006] The embodiment of the present application provides a method for calculating a positioning threshold and related devices, which can solve the above problems. The technical solution is as follows:
[0007] In a first aspect, an embodiment of the present application provides a method for calculating a positioning threshold, the method comprising:
[0008] In response to the threshold calculation instruction, sequentially collecting the first light sensing data and the second light sensing data;
[0009] Detecting whether a difference between the first light sensing data and the second light sensing data satisfies a target segmentation condition among a plurality of preset segmentation conditions;
[0010] When it is determined that the difference between the first light sensing data and the second light sensing data satisfies the target segmentation condition, obtaining a threshold calculation method corresponding to the target segmentation condition;
[0011] The first light sensing data and the second light sensing data are calculated based on the threshold value calculation method to obtain a positioning threshold value, and the positioning threshold value is used to determine the position on the label paper during the printing process.
[0012] In a second aspect, an embodiment of the present application provides a device for calculating a positioning threshold, the device comprising:
[0013] A light sensing data acquisition module, used for sequentially acquiring first light sensing data and second light sensing data in response to a threshold value calculation instruction;
[0014] A segmentation detection module, used to detect whether the difference between the first light sensing data and the second light sensing data satisfies a target segmentation condition among a plurality of preset segmentation conditions;
[0015] a calculation and determination module, configured to obtain a threshold calculation method corresponding to the target segmentation condition when it is determined that the difference between the first light sensing data and the second light sensing data meets the target segmentation condition;
[0016] The result obtaining module is used to calculate the first light sensing data and the second light sensing data based on the threshold calculation method to obtain a positioning threshold, and the positioning threshold is used to determine the position on the label paper during the printing process.
[0017] In a third aspect, an embodiment of the present application provides a computer storage medium, wherein the computer storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the above-mentioned method steps.
[0018] In a fourth aspect, an embodiment of the present application provides a computer program product, which stores a plurality of instructions suitable for being loaded by a processor and executing the above-mentioned method steps.
[0019] In a fifth aspect, an embodiment of the present application provides a label printer, which may include: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the above-mentioned method steps.
[0020] The beneficial effects brought about by the technical solutions provided by some embodiments of the present application include at least:
[0021] In the embodiment of the present application, in response to the threshold calculation instruction, the light sensor collects the first light sensing data and the second light sensing data on the label paper in sequence, the first light sensing data and the second light sensing data are respectively obtained according to the areas of different materials on the label paper, and the difference between the first light sensing data and the second light sensing data is further used to obtain a threshold calculation method that matches the first light sensing data and the second light sensing data, and the threshold calculation method is used to calculate the first light sensing data and the second light sensing data to obtain a positioning threshold. Based on the positioning threshold, the label printer collects light sensing data in real time during the subsequent printing process, and compares the light sensing data with the positioning threshold to determine whether the area on the label paper at this time is a surface paper area, a gap area, or other custom area.
[0022] Since there are unique elements in the face paper area of the label paper, the face paper area will be delaminated. The face paper area corresponds to at least two photosensitive data, and multiple photosensitive data will affect the calculation of the positioning threshold. The present application determines the segmentation conditions and the preset threshold calculation method matching the segmentation conditions based on at least one photosensitive data corresponding to different areas on the label paper through multiple differences between the multiple photosensitive data, so that accurate positioning thresholds can be obtained through multiple threshold calculation methods during printing. Only by using accurate positioning thresholds can the accurate positioning of the print head of the label printer on the label paper be guaranteed, the printing quality can be improved, and problems such as overlapping, blurring or misalignment of different colors or image elements can be prevented, as well as reducing label paper waste and avoiding printing failures due to offset or position errors. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0024] Figure 1 is a schematic diagram of a label paper provided in an embodiment of the present application;
[0025] Figure 2 It is a flowchart of a method for calculating a positioning threshold provided in an embodiment of the present application;
[0026] Figure 3 is a waveform diagram of multiple light sensing data provided by an embodiment of the present application;
[0027] Figure 4 It is a flowchart of a method for calculating a positioning threshold provided in an embodiment of the present application;
[0028] Figure 5It is a flowchart of a method for calculating a positioning threshold provided in an embodiment of the present application;
[0029] Figure 6 is a structural schematic diagram of a positioning threshold calculation device provided in an embodiment of the present application;
[0030] Figure 7 It is a structural schematic diagram of a label printer provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0032] In the description of the present application, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In the description of the present application, it should be noted that, unless otherwise clearly specified and limited, "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood in specific circumstances. In addition, in the description of the present application, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B, which can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are an "or" relationship.
[0033] The present application is described in detail below with reference to specific embodiments.
[0034] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in the embodiments of this specification are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions. For example, the features, information and data involved in this specification are all obtained with full authorization.
[0035] A label printer is a device specifically used to print various labels, barcodes, QR codes, RFID tags, etc. It is widely used in retail, warehousing, logistics, manufacturing, medical and other fields, mainly used to mark goods, items, documents and other contents for easy management, tracking and identification.
[0036] Printer-printed labels come in a variety of styles, among which wrap-around labels are widely used in daily life because of their aesthetics and convenience. Wrap-around labels refer to a special type of transparent paper, the surface of which is not completely transparent, but has special colored ink printed between the gap and the transparent surface. The ink absorbs part of the light signal like the material in the gap, resulting in lower light sensing data than that of ordinary transparent paper.
[0037] like Figure 1 As shown, Figure 1 Schematic diagram of a label paper provided in an embodiment of the present application, the label paper includes three surface paper areas and two gap areas. The three surface paper areas include a surface paper area 101, a white ink area 1012 and a transparent paper area 1011 included in the surface paper area, and the gap area includes a gap area 102 between two surface paper areas.
[0038] In order to distinguish the surface paper area and the gap area during printing, the printer needs a standard to determine the current position of the sensor on the label. Generally, the printer will calculate the threshold between the surface paper and the gap. This process is called threshold calibration.
[0039] The threshold calibration process of the printer is generally divided into three parts, namely, paper detection, gap detection and threshold calculation. Paper detection and gap detection are to collect stable paper and gap data of the label paper during the paper feeding process to obtain a unified value, while the threshold calculation is to calculate the average value of the unified paper and gap values as the threshold. The role of the threshold is to distinguish whether it is paper or gap based on the size relationship between the current light-sensitive ADC and the threshold.
[0040] As printed labels are now complex and diverse, layering often occurs on the surface paper. How can we determine whether the printer is in the surface paper area or the gap area during the printing process?
[0041] In one embodiment, Figure 2 As shown, it is a flowchart of a method for calculating a positioning threshold provided in an embodiment of the present application. The method can be implemented by a computer program and can be run on a positioning threshold calculation device based on the von Neumann system. The computer program can be integrated into an application or run as an independent tool application.
[0042] Specifically, the calculation method of the positioning threshold includes:
[0043] S101 , in response to a threshold calculation instruction, sequentially collecting first light sensing data and second light sensing data.
[0044] The user interacts with the communication interface of the label printer by direct touch or remote control, so that the label printer obtains the threshold calculation instruction for instructing the label printer to start calculating the positioning threshold. For example, the label printer receives the threshold calculation instruction sent by the user through wireless technology, and the wireless technology can be any wireless technology such as infrared remote control, Bluetooth, Wi-Fi, Zigbee, NFC, etc. For another example, the label printer obtains the threshold calculation instruction through the trigger instruction on the touch screen or button. In another embodiment, the label printer obtains the threshold calculation instruction when a specific condition is detected.
[0045] Light-sensitive data can be collected through optical sensors, such as light-dependent resistors (LDRs), photodiodes, photocells, fiber optic sensors, etc., which can be selected according to the application scenarios and needs of the label printer.
[0046] The difference between the first light-sensitive data and the second light-sensitive data is that the collection point of the first light-sensitive data and the collection point of the second light-sensitive data are located in different areas on the label paper according to the time sequence of collection and the paper feeding operation of the label printer. It is understandable that the type of the location where the collection point of the first light-sensitive data is located and the type of the location where the collection point of the second light-sensitive data is located may be the same. For example, the types of the locations where the collection point of the first light-sensitive data and the collection point of the second light-sensitive data are located are both surface paper areas or both are gap areas. By comparing the difference between the first light-sensitive data and the second light-sensitive data, a judgment can be made, and the light-sensitive data can be collected again to calculate the positioning threshold.
[0047] S102: Detect whether a difference between the first light sensing data and the second light sensing data satisfies a target segmentation condition among a plurality of preset segmentation conditions.
[0048] Multiple segmentation conditions are distinguished based on differences, and different segmentation conditions correspond to different difference ranges. For example, the difference range corresponding to a certain segmentation condition is [N1, N2), and the difference range corresponding to another segmentation condition is (N2, N3). Detect whether the absolute value of the difference between the first light sensing data and the second light sensing data is within the above-mentioned multiple difference ranges. If it is within one of the above-mentioned difference ranges, it indicates that the difference between the first light sensing data and the second light sensing data meets the target segmentation condition corresponding to the difference range.
[0049] In one embodiment, based on the comparison results of comparing the difference between the first light sensing data and the second light sensing data with at least one segmentation standard value, it is detected whether the difference between the first light sensing data and the second light sensing data meets the target segmentation condition among multiple preset segmentation conditions.
[0050] The segmentation standard value can be understood as a value used to distinguish the difference ranges corresponding to different segmentation conditions. For example, if the difference range corresponding to a segmentation condition is [N1, N2), and the difference range corresponding to another segmentation condition is (N2, N3), then the segmentation standard values are N1, N2, and N3. According to the comparison results of the difference X between the first light sensing data and the second light sensing data and the segmentation standard values N1, N2, and N3, respectively, the target segmentation condition satisfied by the difference between the first light sensing data and the second light sensing data is determined.
[0051] In one embodiment, at least one segment standard value may be determined based on expert experience or user settings.
[0052] In another embodiment, the label paper includes at least two surface paper areas and a gap area between the two surface paper areas, the surface paper area includes at least a first sub-area and a second sub-area, and the step of determining the segmentation standard value may be: obtaining light sensitivity data of the first sub-area, light sensitivity data of the second sub-area, and light sensitivity data of the gap area; wherein the light sensitivity data of the first sub-area is less than the light sensitivity data of the second sub-area; and determining the segmentation standard value based on the difference between the light sensitivity data of the second sub-area and the light sensitivity data of the gap area and the light sensitivity data of the first sub-area.
[0053] like Figure 3 As shown, Figure 3 This is a waveform diagram of multiple light-sensing data provided in an embodiment of the present application. The area indicated by A is the gap part of the label paper, B is the white ink part of the surface paper, that is, the first sub-area, C is the ordinary transparent paper part, that is, the second sub-area, and D is the gap part of the next label paper.
[0054] Ideally, when the label printer is performing a printing task, it should detect area B as the surface paper area and area D as the gap area. Therefore, before starting printing, the light data of area B and area D are collected, and the average value of the two is calculated as the positioning threshold. When printing, the actual collected light data is compared with the above positioning threshold to determine the current position of the label printer.
[0055] However, in actual situations, there may be scenarios where the light data collected from area C is used as the light data of the surface paper area, and the light data collected from area D is used as the light data of the gap area. The average value of the light data of area C and area D is obviously larger than the above average value, and the positioning threshold using the average value will be close to the light data of area B, which will cause the problem that area B is mistakenly judged as the gap area when the light data of area B is collected during printing, but in fact area B is the surface paper area.
[0056] In this regard, the present application performs segmentation processing on the two types of paper data in the calculation of the positioning threshold value to obtain a segmentation standard value for determining the two segmentation conditions. It is understandable that the two types of paper areas including the first sub-area and the second sub-area are used as an example for explanation here, and the present application can also include the case where the paper area includes a larger number of sub-areas, and segmentation calculation is performed based on more than two sub-areas and gap areas to obtain multiple segmentation standard values, as well as multiple segmentation conditions and the positioning threshold calculation method corresponding to each segmentation condition.
[0057] Specifically, before printing starts, the light data of area B as the first sub-area is collected as data1, and the light data of area D as the gap area is collected as data3, wherein the difference between data1 and data3 (i.e., data1-data3) is obviously too small. At this time, a segmented standard value diff is formulated, and a threshold calculation method corresponding to the case where the difference between the first light data and the second light data collected in response to the threshold calculation instruction is less than the segmented standard value diff is formulated.
[0058] The light sensing data of area C as the second sub-area is collected as date2, and the light sensing data of area D as the gap area is collected as data3. The difference between data2 and data3 (i.e., data2-data3) is obviously too large. Based on the above segmented standard value diff, a threshold calculation method corresponding to when the difference between the first light sensing data and the second light sensing data collected in response to the threshold calculation instruction is greater than the segmented standard value diff is formulated.
[0059] S103: When it is determined that the difference between the first light sensing data and the second light sensing data meets the target segmentation condition, a threshold calculation method corresponding to the target segmentation condition is obtained.
[0060] In this embodiment, a threshold calculation method corresponding to each target segmentation condition is preset, and each threshold calculation method is used to calculate according to a certain calculation rule based on the first light sensing data and the second light sensing data to obtain a positioning threshold.
[0061] For example, when a layered wrapping label of a certain facial paper is detected, the light sensing data corresponding to the facial paper area is 2600 and 3000, and the light sensing data of the gap area is 1800. When the label printer performs a printing task, considering the jitter of the facial paper and the error of the light sensor, the first light sensing data collected in response to the threshold calculation instruction is 3000+X, and the second light sensing data collected is 1800+X. Based on the prior art, the first light sensing data and the second light sensing data are averaged to obtain a positioning threshold of 2400+X. When the printing task is further performed based on the positioning threshold, the collected light sensing data 2600+X1 is compared with the positioning threshold of 2400+X. Since the two are too close, the accuracy of judging whether the area corresponding to the light sensing data 2600+X1 is the facial paper area or the gap area is low, which is very likely to cause abnormal printer positioning.
[0062] Therefore, in this embodiment, at least two segmentation conditions are preset, and the segmentation standard value is 800. In response to the threshold calculation instruction, the first light perception data is collected as 3000+X, and the second light perception data is collected as 1800+X, and it is determined that the difference between the first light perception data and the second light perception data meets the target segmentation condition of being greater than 800, and the corresponding threshold calculation method is determined. The first light perception data and the second light perception data are calculated by the threshold calculation method to obtain a positioning threshold threshold of 2200+X. In response to the threshold calculation instruction, the first light perception data is collected as 2600+X, and the second light perception data is collected as 1800+X, and it is determined that the difference between the first light perception data and the second light perception data meets the target segmentation condition of being less than 800, and the corresponding threshold calculation method is determined. The first light perception data and the second light perception data are calculated by the threshold calculation method to obtain a positioning threshold threshold of 2200+X.
[0063] According to the calculation results, the previous threshold has a greater positioning risk when the unsampled segmented processing scheme is used. After adopting the threshold calculation method provided in this application, the positioning threshold is very close to the ideal threshold, avoiding the problem of positioning part of the surface paper area as a gap area.
[0064] S104 calculates the first light sensing data and the second light sensing data based on a threshold value calculation method to obtain a positioning threshold value. The positioning threshold value is used to determine the position on the label paper during the printing process.
[0065] The first light sensing data and the second light sensing data are calculated based on the threshold value calculation method corresponding to the target segmentation condition satisfied by the first light sensing data and the second light sensing data to obtain a positioning threshold value. The positioning threshold value is used to determine the position on the label paper during the printing process.
[0066] In the embodiment of the present application, in response to the threshold calculation instruction, the light sensor collects the first light sensing data and the second light sensing data on the label paper in sequence, the first light sensing data and the second light sensing data are respectively obtained according to the areas of different materials on the label paper, and the difference between the first light sensing data and the second light sensing data is further used to obtain a threshold calculation method that matches the first light sensing data and the second light sensing data, and the threshold calculation method is used to calculate the first light sensing data and the second light sensing data to obtain a positioning threshold. Based on the positioning threshold, the label printer collects light sensing data in real time during the subsequent printing process, and compares the light sensing data with the positioning threshold to determine whether the area on the label paper at this time is a surface paper area, a gap area, or other custom area.
[0067] Since there are unique elements in the face paper area of the label paper, the face paper area will be delaminated. The face paper area corresponds to at least two photosensitive data, and multiple photosensitive data will affect the calculation of the positioning threshold. The present application determines the segmentation conditions and the preset threshold calculation method matching the segmentation conditions based on at least one photosensitive data corresponding to different areas on the label paper through multiple differences between the multiple photosensitive data, so that accurate positioning thresholds can be obtained through multiple threshold calculation methods during printing. Only by using accurate positioning thresholds can the accurate positioning of the print head of the label printer on the label paper be guaranteed, the printing quality can be improved, and problems such as overlapping, blurring or misalignment of different colors or image elements can be prevented, as well as reducing label paper waste and avoiding printing failures due to offset or position errors.
[0068] based on Figure 2 As shown, in one embodiment, the plurality of preset segmentation conditions include a first segmentation condition, and the first segmentation condition is that the difference between the first light sensing data and the second light sensing data is less than the segmentation standard value. S102 includes the steps of: when it is determined that the difference between the first light sensing data and the second light sensing data meets the first segmentation condition, obtaining a first threshold calculation method corresponding to the first segmentation condition; wherein the threshold calculation method includes a first threshold calculation method.
[0069] Specifically, according to the comparison result of comparing the difference between the first light sensing data and the second light sensing data with at least one segment standard value, it is determined that the first light sensing data and the second light sensing data meet the first segment condition that the difference is less than the segment standard value.
[0070] In other words, the difference between the first photosensitive data and the second photosensitive data is small, and the surface paper area corresponding to the first photosensitive data is the transparent paper area. There will be no problem of failure in positioning the white ink area included in the surface paper area due to the positioning threshold calculated based on the first photosensitive data and the second photosensitive data during printing.
[0071] In this embodiment, the first light perception data and the second light perception data are calculated based on the threshold calculation method to obtain the positioning threshold, including: based on the first threshold calculation method, the first light perception data and the second light perception data are calculated to obtain the first positioning threshold; wherein the positioning threshold includes the first positioning threshold.
[0072] For example, when a wrapping label with a layer of tissue paper is detected, the photosensitive data corresponding to the tissue paper area is 2600 and 3000, the photosensitive data of the gap area is 1800, and the segmentation standard value is 800. In response to the threshold calculation instruction, the first photosensitive data collected is 2600+X, and the second photosensitive data collected is 1800+X. At this time, the first photosensitive data and the second photosensitive data meet the first segmentation condition that is less than the segmentation standard value, and the first threshold calculation method corresponding to the first segmentation condition is determined to be average value calculation, that is, the positioning threshold threshold1=(first photosensitive data+second photosensitive data) / 2=2400+X.
[0073] based on Figure 2 As shown, in one embodiment, the plurality of preset segmentation conditions include a second segmentation condition, and the second segmentation condition is that the difference between the first light sensing data and the second light sensing data is greater than or equal to the segmentation standard value. S102 includes the steps of: when it is determined that the difference between the first light sensing data and the second light sensing data meets the second segmentation condition, obtaining a second threshold calculation method corresponding to the second segmentation condition; wherein the threshold calculation method includes a second threshold calculation method.
[0074] Specifically, according to the comparison result of comparing the difference between the first light sensing data and the second light sensing data with at least one segment standard value, it is determined that the first light sensing data and the second light sensing data meet the second segment condition that the difference is greater than or equal to the segment standard value.
[0075] In other words, the difference between the first photosensitive data and the second photosensitive data is large, and the surface paper area corresponding to the first photosensitive data is the white ink area. The positioning threshold calculated based on the first photosensitive data and the second photosensitive data will cause the problem of failure in positioning the surface paper area including the transparent paper area during printing.
[0076] In this embodiment, the first light sensing data and the second light sensing data are calculated based on a threshold calculation method to obtain a positioning threshold, including: based on a second threshold calculation method, obtaining the absolute value of the difference between the first light sensing data and the second light sensing data as an intermediate value, and obtaining a second positioning threshold according to the intermediate value and the target light sensing data; wherein the target light sensing data is the smaller value of the first light sensing data and the second light sensing data, and the positioning threshold includes the second positioning threshold.
[0077] For example, when a wrapping label with a layer of tissue paper is detected, the photosensitive data corresponding to the tissue paper area is 2600 and 3000, the photosensitive data of the gap area is 1800, and the segmentation standard value is 800. In response to the threshold calculation instruction, the first photosensitive data collected is 2600+X, and the second photosensitive data collected is 1800+X. At this time, the first photosensitive data and the second photosensitive data meet the second segmentation condition that is greater than or equal to the segmentation standard value, and the second threshold calculation method corresponding to the second segmentation condition is determined to be average value calculation.
[0078] The absolute value of the difference between the first light sensing data and the second light sensing data is obtained as the intermediate value, and the second positioning threshold is obtained according to the intermediate value and the target light sensing data, that is, positioning threshold threshold2 = (|first light sensing data - second light sensing data| + min (second light sensing data, first light sensing data)) / 2 = 2400 + X.
[0079] In another embodiment, the first light perception data and the second light perception data are calculated based on a threshold calculation method to obtain a positioning threshold, including: based on the second threshold calculation method, obtaining the absolute value of the difference between the first light perception data and the second light perception data as an intermediate value, and summing the target light perception data and the intermediate value of the configured calculation coefficient to obtain a second positioning threshold; wherein the calculation coefficient is less than 1 and greater than 0, the target light perception data is the smaller value of the first light perception data and the second light perception data, and the positioning threshold includes the second positioning threshold.
[0080] The calculation coefficient can be an arbitrary coefficient. For example, if the calculation coefficient is 1 / 3, then when calculating the threshold, take 1 / 3 of the difference and be as close to the trough position as possible, that is, the positioning threshold threshold = (|first light sensing data - second light sensing data| / 3 + min (second light sensing data, first light sensing data)) / 2 = 2400 + X.
[0081] The present application determines the segmentation conditions and the preset threshold calculation method that matches the segmentation conditions based on at least one photosensitive data corresponding to different areas on the label paper through multiple differences between multiple photosensitive data, so that accurate positioning thresholds can be obtained through multiple threshold calculation methods during printing. Only based on the accurate positioning threshold can the accurate positioning of the print head of the label printer on the label paper be guaranteed, the printing quality can be improved, and problems such as overlapping, blurring or misalignment of different colors or image elements can be prevented, as well as the waste of label paper can be reduced, and printing failures due to offset or position errors can be avoided.
[0082] In one embodiment, Figure 4As shown, it is a flowchart of a method for calculating a positioning threshold provided in an embodiment of the present application. The method can be implemented by a computer program and can be run on a positioning threshold calculation device based on the von Neumann system. The computer program can be integrated into an application or run as an independent tool application.
[0083] Specifically, the calculation method of the positioning threshold includes:
[0084] S201 . In response to a threshold calculation instruction, first light sensing data and second light sensing data are collected in sequence.
[0085] See S101 above, which will not be repeated here.
[0086] S202: Detect whether the difference between the first light sensing data and the second light sensing data is smaller than the segment standard value?
[0087] According to the comparison results of comparing the difference between the first light sensing data and the second light sensing data with the segmentation standard value, it is detected whether the difference between the first light sensing data and the second light sensing data meets the first segmentation condition and the second segmentation condition. For example, specifically, the difference range corresponding to the first segmentation condition is [N1, N2), and the difference range corresponding to the other segmentation condition is (N2, N3], where the segmentation standard value is N2.
[0088] S203: When it is detected that the difference between the first light sensing data and the second light sensing data is less than the segmentation standard value, determine that the difference between the first light sensing data and the second light sensing data meets the first segmentation condition, and obtain a first threshold calculation method corresponding to the first segmentation condition.
[0089] The difference between the first light-sensing data and the second light-sensing data satisfies the first segmentation condition, indicating that the difference between the first light-sensing data and the second light-sensing data is small, and the surface paper area corresponding to the first light-sensing data is a transparent paper area.
[0090] S204: Calculate the first light sensing data and the second light sensing data based on a first threshold calculation method to obtain a positioning threshold.
[0091] Based on the first threshold calculation method, an average value of the first light sensing data and the second light sensing data is calculated to obtain a first positioning threshold, and the positioning threshold includes the first positioning threshold.
[0092] S205. When it is detected that the difference between the first light sensing data and the second light sensing data is greater than or equal to the segmentation standard value, and when it is determined that the difference between the first light sensing data and the second light sensing data meets the second segmentation condition, a second threshold calculation method corresponding to the second segmentation condition is obtained.
[0093] The difference between the first light-sensing data and the second light-sensing data satisfies the second segmentation condition, indicating that the difference between the first light-sensing data and the second light-sensing data is large, and the surface paper area corresponding to the first light-sensing data is a white ink area.
[0094] S206: Calculate the first light sensing data and the second light sensing data based on a second threshold calculation method to obtain a positioning threshold.
[0095] Based on the second threshold calculation method, the absolute value of the difference between the first light perception data and the second light perception data is obtained as the intermediate value, and the target light perception data and the intermediate value of the configured calculation coefficient are summed to obtain the second positioning threshold. The calculation coefficient is less than 1 and greater than 0, the target light perception data is the smaller value of the first light perception data and the second light perception data, and the positioning threshold includes the second positioning threshold.
[0096] Since there are unique elements in the face paper area of the label paper, the face paper area will be delaminated. The face paper area corresponds to at least two photosensitive data, and multiple photosensitive data will affect the calculation of the positioning threshold. The present application determines the segmentation conditions and the preset threshold calculation method matching the segmentation conditions based on at least one photosensitive data corresponding to different areas on the label paper through multiple differences between the multiple photosensitive data, so that accurate positioning thresholds can be obtained through multiple threshold calculation methods during printing. Only by using accurate positioning thresholds can the accurate positioning of the print head of the label printer on the label paper be guaranteed, the printing quality can be improved, and problems such as overlapping, blurring or misalignment of different colors or image elements can be prevented, as well as reducing label paper waste and avoiding printing failures due to offset or position errors.
[0097] In one embodiment, Figure 5 As shown, it is a flowchart of a method for calculating a positioning threshold provided in an embodiment of the present application. The method can be implemented by a computer program and can be run on a positioning threshold calculation device based on the von Neumann system. The computer program can be integrated into an application or run as an independent tool application.
[0098] Specifically, the calculation method of the positioning threshold includes:
[0099] S301. When it is detected that the box cover of the printer is switched from a closed state to an open state, a threshold calculation instruction is obtained.
[0100] When the lid of the label printer is opened, the internal light sensing data may change due to changes in lighting conditions, temperature changes, etc. This requires the label printer to recalculate and update the positioning threshold to adapt to the new environmental conditions and ensure positioning accuracy and normal operation during printing. Lighting changes: When the lid is opened, the lighting conditions inside the printer change, and the light intensity received by the sensor will change.
[0101] When the label printer detects that the box cover is switched from a closed state to an open state through a sensor of the box cover, it determines an acquisition instruction that satisfies the threshold calculation instruction and acquires the threshold calculation instruction.
[0102] S302 , in response to a threshold calculation instruction, sequentially collecting first light sensing data and second light sensing data.
[0103] See S101, which will not be repeated here.
[0104] S303: Detect whether the difference between the first light sensing data and the second light sensing data satisfies a target segmentation condition among a plurality of preset segmentation conditions.
[0105] See S102, which will not be described in detail here.
[0106] S304: When it is determined that the difference between the first light sensing data and the second light sensing data meets the target segmentation condition, a threshold calculation method corresponding to the target segmentation condition is obtained.
[0107] See S103, which will not be repeated here.
[0108] S305 , calculating the first light sensing data and the second light sensing data based on a threshold calculation method to obtain a positioning threshold.
[0109] See S104, which will not be described in detail here.
[0110] In one embodiment, the third light sensing data is collected; it is detected whether the difference between the second light sensing data and the third light sensing data meets the target segmentation condition; when it is determined that the difference between the second light sensing data and the third light sensing data does not meet the target segmentation condition, a threshold calculation method corresponding to the segmentation condition matching the difference between the second light sensing data and the third light sensing data is obtained; the second light sensing data and the third light sensing data are calculated according to the threshold calculation method corresponding to the segmentation condition matching the difference between the second light sensing data and the third light sensing data to obtain a positioning threshold to be calculated; the positioning threshold to be calculated and the positioning threshold are calculated to obtain a target positioning threshold; wherein the target positioning threshold is used to replace the positioning threshold to determine the position on the label paper during the printing process.
[0111] In other words, in this embodiment, the first light sensing data, the second light sensing data and the third light sensing data can be collected and calculated to obtain the target positioning threshold used for positioning. When the difference between the first light sensing data and the second light sensing data meets the target segmentation condition and the positioning threshold is obtained based on the threshold calculation method of the target segmentation condition, the positioning threshold threshold3 is calculated.
[0112] Further, the second light sensing data and the third light sensing data are calculated according to the threshold calculation method corresponding to the segmentation condition of the difference matching between the second light sensing data and the third light sensing data to obtain the positioning threshold threshold 4 to be calculated. The threshold calculation method for calculating the second light sensing data and the third light sensing data may be the same as or different from the threshold calculation method for the target segmentation condition.
[0113] The positioning threshold threshold 4 to be calculated and the positioning threshold threshold 3 to be calculated are calculated to obtain the target positioning threshold. For example, the positioning threshold threshold 4 to be calculated and the positioning threshold threshold 3 are averaged or weighted averaged to obtain the target threshold that is ultimately used for positioning in executing the positioning task.
[0114] In this embodiment, the positioning threshold is calculated through multiple photosensitive data. Specifically, the difference between two successively collected photosensitive data is used to determine the satisfied segmentation condition and the corresponding threshold calculation method, thereby obtaining at least two positioning thresholds. The target positioning threshold is further calculated through at least two positioning thresholds, which can effectively improve the accuracy of the obtained target positioning threshold and improve the positioning accuracy of the label printer when performing printing tasks.
[0115] S306, during the printing process, collecting and detecting light sensing data;
[0116] During the printing process, the label printer collects and detects light-sensitive data in real time through optical sensors such as light-dependent resistors (LDRs), photodiodes, photocells, and fiber optic sensors.
[0117] S307: Determine the position on the label paper according to the comparison result between the detected light sensing data and the positioning threshold.
[0118] Specifically, the label paper includes at least two surface paper areas and a gap area between the two surface paper areas; it is determined whether the detected light sensing data is less than or equal to the positioning threshold. When it is determined that the detected light sensing data is less than or equal to the positioning threshold, it is determined to be in the gap area; when the detected light sensing data is greater than the positioning threshold, it is determined to be in the surface paper area.
[0119] For example, the positioning threshold threshold is calculated as 2200 for the first light sensing data and the second light sensing data through the threshold calculation method. When executing a printing task, the detected light sensing data collected is 2500, then the position of the detected light sensing data is determined to be the surface paper area. The detected light sensing data collected is 1600, then the position of the detected light sensing data is determined to be the gap area.
[0120] Since there are unique elements in the face paper area of the label paper, the face paper area will be delaminated. The face paper area corresponds to at least two photosensitive data, and multiple photosensitive data will affect the calculation of the positioning threshold. The present application determines the segmentation conditions and the preset threshold calculation method matching the segmentation conditions based on at least one photosensitive data corresponding to different areas on the label paper through multiple differences between the multiple photosensitive data, so that accurate positioning thresholds can be obtained through multiple threshold calculation methods during printing. Only by using accurate positioning thresholds can the accurate positioning of the print head of the label printer on the label paper be guaranteed, the printing quality can be improved, and problems such as overlapping, blurring or misalignment of different colors or image elements can be prevented, as well as reducing label paper waste and avoiding printing failures due to offset or position errors.
[0121] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0122] See also Figure 6 , which shows a schematic diagram of the structure of a positioning threshold calculation device provided by an exemplary embodiment of the present application. The positioning threshold calculation device can be implemented as all or part of the device through software, hardware or a combination of both. The device includes a light sensing data acquisition module 401, a segmented detection module 402, a calculation and determination module 403, and a result acquisition module 404.
[0123] The light sensing data collection module 401 is used to collect the first light sensing data and the second light sensing data in sequence in response to the threshold calculation instruction;
[0124] A segmentation detection module 402, used to detect whether the difference between the first light sensing data and the second light sensing data satisfies a target segmentation condition among a plurality of preset segmentation conditions;
[0125] A calculation and determination module 403, configured to obtain a threshold calculation method corresponding to the target segmentation condition when it is determined that the difference between the first light sensing data and the second light sensing data meets the target segmentation condition;
[0126] The result obtaining module 404 is used to calculate the first light sensing data and the second light sensing data based on the threshold value calculation method to obtain a positioning threshold value, and the positioning threshold value is used to determine the position on the label paper during the printing process.
[0127] In one embodiment, the plurality of preset segmentation conditions include a first segmentation condition, wherein the first segmentation condition is that a difference between the first light sensing data and the second light sensing data is less than a segmentation standard value;
[0128] The calculation and determination module 403 includes:
[0129] A first determination unit is used to obtain a first threshold calculation method corresponding to the first segmentation condition when it is determined that the difference between the first light perception data and the second light perception data meets the first segmentation condition; wherein the threshold calculation method includes the first threshold calculation method.
[0130] In one embodiment, the first determining unit includes:
[0131] The first determination subunit is used to calculate the average value of the first light sensing data and the second light sensing data based on the first threshold calculation method to obtain a first positioning threshold; wherein the positioning threshold includes the first positioning threshold.
[0132] In one embodiment, the plurality of preset segmentation conditions include a second segmentation condition, and the second segmentation condition is that a difference between the first light sensing data and the second light sensing data is greater than or equal to a segmentation standard value;
[0133] The calculation and determination module 403 includes:
[0134] A second determination unit is used to obtain a second threshold calculation method corresponding to the second segmentation condition when it is determined that the difference between the first light perception data and the second light perception data meets the second segmentation condition; wherein the threshold calculation method includes the second threshold calculation method.
[0135] In one embodiment, the second determining unit includes:
[0136] The second determination subunit is used to obtain the absolute value of the difference between the first light perception data and the second light perception data as an intermediate value based on the second threshold calculation method, and obtain a second positioning threshold according to the intermediate value and the target light perception data; wherein, the target light perception data is the smaller value between the first light perception data and the second light perception data, and the positioning threshold includes the second positioning threshold.
[0137] In one embodiment, the second determining unit includes:
[0138] The third determination subunit is used to obtain the absolute value of the difference between the first light perception data and the second light perception data as an intermediate value based on the second threshold calculation method, and sum the target light perception data with the intermediate value of the configured calculation coefficient to obtain a second positioning threshold; wherein, the calculation coefficient is less than 1 and greater than 0, the target light perception data is the smaller value between the first light perception data and the second light perception data, and the positioning threshold includes the second positioning threshold.
[0139] In one embodiment, the segment detection module 402 includes:
[0140] A comparison detection unit is used to detect whether the difference between the first light sensing data and the second light sensing data meets a target segmentation condition among multiple preset segmentation conditions based on the comparison result of comparing the difference between the first light sensing data and the second light sensing data with at least one segmentation standard value.
[0141] In one embodiment, the label paper includes at least two surface paper areas and a gap area between the two surface paper areas, and the surface paper area includes at least a first sub-area and a second sub-area;
[0142] The segment detection module 402 further includes:
[0143] A first detection unit, used to obtain light sensing data of the first sub-area, light sensing data of the second sub-area, and light sensing data of the gap area; wherein the light sensing data of the first sub-area is smaller than the light sensing data of the second sub-area;
[0144] The second detection unit is used to determine the segment standard value according to the difference between the light sensing data of the second sub-area and the light sensing data of the gap area and the light sensing data of the first sub-area.
[0145] In one embodiment, a calculation module for positioning a threshold includes:
[0146] The instruction acquisition module is used to acquire the threshold calculation instruction when it is detected that the box cover of the printer is switched from a closed state to an open state.
[0147] In one embodiment, a calculation module for positioning a threshold includes:
[0148] A data acquisition module, used for acquiring third light sensing data;
[0149] A condition judgment module, used for detecting whether the difference between the second light sensing data and the third light sensing data satisfies the target segmentation condition;
[0150] a second matching module, configured to obtain a threshold value calculation method corresponding to a segmentation condition matching the difference between the second light sensing data and the third light sensing data when it is determined that the difference between the second light sensing data and the third light sensing data does not meet the target segmentation condition;
[0151] A threshold value acquisition module to be calculated, used to calculate the second light sensing data and the third light sensing data according to a threshold value calculation method corresponding to a segmentation condition of a difference match between the second light sensing data and the third light sensing data, to obtain a positioning threshold value to be calculated;
[0152] The target threshold value acquisition module is used to calculate the positioning threshold to be calculated and the positioning threshold to obtain a target positioning threshold; wherein the target positioning threshold is used to replace the positioning threshold to determine the position on the label paper during the printing process.
[0153] In one embodiment, the calculation module of the positioning threshold further includes:
[0154] The detection and acquisition module is used to collect and detect light sensing data during the printing process;
[0155] A comparison module is used to determine the position on the label paper according to a comparison result of the detected light sensing data and the positioning threshold.
[0156] In one embodiment, the label paper comprises at least two surface paper areas and a gap area between the two surface paper areas;
[0157] Comparison modules, including:
[0158] A first judging unit, used to judge whether the detected light sensing data is less than or equal to the positioning threshold;
[0159] The second judgment unit is used to determine that it is in the gap area when it is determined that the detected light sensing data is less than or equal to the positioning threshold.
[0160] Since there are unique elements in the face paper area of the label paper, the face paper area will be delaminated. The face paper area corresponds to at least two photosensitive data, and multiple photosensitive data will affect the calculation of the positioning threshold. The present application determines the segmentation conditions and the preset threshold calculation method matching the segmentation conditions based on at least one photosensitive data corresponding to different areas on the label paper through multiple differences between the multiple photosensitive data, so that accurate positioning thresholds can be obtained through multiple threshold calculation methods during printing. Only by using accurate positioning thresholds can the accurate positioning of the print head of the label printer on the label paper be guaranteed, the printing quality can be improved, and problems such as overlapping, blurring or misalignment of different colors or image elements can be prevented, as well as reducing label paper waste and avoiding printing failures due to offset or position errors.
[0161] It should be noted that the positioning threshold calculation device provided in the above embodiment only uses the division of the above functional modules as an example when executing the positioning threshold calculation method. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the positioning threshold calculation device provided in the above embodiment and the positioning threshold calculation method embodiment belong to the same concept, and the implementation process thereof is detailed in the method embodiment, which will not be repeated here.
[0162] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0163] The present application also provides a computer storage medium that can store multiple instructions, which are suitable for being loaded and executed by a processor as described above. Figure 1 - Figure 5 The calculation method of the positioning threshold in the embodiment shown in the figure can be found in the specific execution process. Figure 1 - Figure 5 The specific description of the illustrated embodiment will not be repeated here.
[0164] The present application also provides a computer program product, which stores at least one instruction, and the at least one instruction is loaded and executed by a processor as described above. Figure 1 - Figure 5 The calculation method of the positioning threshold in the embodiment shown in the figure can be found in the specific execution process. Figure 1 - Figure 5 The specific description of the illustrated embodiment will not be repeated here.
[0165] See also Figure 7 , is a schematic diagram of the structure of a label printer provided in an embodiment of the present application. Figure 7 As shown, the electronic device 500 may include: at least one processor 501 , at least one network interface 504 , a user interface 503 , a memory 505 , and at least one communication bus 502 .
[0166] The communication bus 502 is used to realize the connection and communication between these components.
[0167] The user interface 503 may include a display screen (Display) and a camera (Camera), and the optional user interface 503 may also include a standard wired interface and a wireless interface.
[0168] The network interface 504 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0169] Among them, the processor 501 may include one or more processing cores. The processor 501 uses various interfaces and lines to connect various parts within the entire server 500, and executes various functions and processes data of the server 500 by running or executing instructions, programs, code sets or instruction sets stored in the memory 505, and calling data stored in the memory 505. Optionally, the processor 501 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 501 can integrate one or more combinations of a processor (Central Processing Unit, CPU), an image processor (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 501, and it can be implemented separately through a chip.
[0170] Among them, the memory 505 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 505 includes a non-transitory computer-readable storage medium. The memory 505 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 505 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 505 may also be optionally at least one storage device located away from the aforementioned processor 501. As Figure 7 As shown, the memory 505 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a calculation application for positioning thresholds.
[0171] exist Figure 7In the electronic device 500 shown, the user interface 503 is mainly used to provide an input interface for the user and obtain data input by the user; and the processor 501 can be used to call the calculation application of the positioning threshold stored in the memory 505, and specifically perform the following operations:
[0172] In response to the threshold calculation instruction, sequentially collecting the first light sensing data and the second light sensing data;
[0173] Detecting whether a difference between the first light sensing data and the second light sensing data satisfies a target segmentation condition among a plurality of preset segmentation conditions;
[0174] When it is determined that the difference between the first light sensing data and the second light sensing data satisfies the target segmentation condition, obtaining a threshold calculation method corresponding to the target segmentation condition;
[0175] The first light sensing data and the second light sensing data are calculated based on the threshold value calculation method to obtain a positioning threshold value, and the positioning threshold value is used to determine the position on the label paper during the printing process.
[0176] In one embodiment, the plurality of preset segmentation conditions include a first segmentation condition, wherein the first segmentation condition is that a difference between the first light sensing data and the second light sensing data is less than a segmentation standard value;
[0177] The processor 501 executes the method of obtaining the threshold value calculation method corresponding to the target segmentation condition when determining that the difference between the first light sensing data and the second light sensing data meets the target segmentation condition, specifically performing:
[0178] When it is determined that the difference between the first light sensing data and the second light sensing data satisfies the first segmentation condition, a first threshold calculation method corresponding to the first segmentation condition is obtained; wherein the threshold calculation method includes the first threshold calculation method.
[0179] In one embodiment, the processor 501 performs the calculation based on the threshold calculation method on the first light sensing data and the second light sensing data to obtain the positioning threshold, specifically performing:
[0180] Based on the first threshold calculation method, an average value of the first light sensing data and the second light sensing data is calculated to obtain a first positioning threshold; wherein the positioning threshold includes the first positioning threshold.
[0181] In one embodiment, the plurality of preset segmentation conditions include a second segmentation condition, and the second segmentation condition is that a difference between the first light sensing data and the second light sensing data is greater than or equal to a segmentation standard value;
[0182] The processor 501 executes the method of obtaining the threshold value calculation method corresponding to the target segmentation condition when determining that the difference between the first light sensing data and the second light sensing data meets the target segmentation condition, specifically performing:
[0183] When it is determined that the difference between the first light sensing data and the second light sensing data satisfies the second segmentation condition, a second threshold calculation method corresponding to the second segmentation condition is obtained; wherein the threshold calculation method includes the second threshold calculation method.
[0184] In one embodiment, the processor 501 calculates the first light sensing data and the second light sensing data based on the threshold calculation method to obtain a positioning threshold, specifically performing:
[0185] Based on the second threshold calculation method, the absolute value of the difference between the first light perception data and the second light perception data is obtained as an intermediate value, and the second positioning threshold is obtained according to the intermediate value and the target light perception data; wherein, the target light perception data is the smaller value between the first light perception data and the second light perception data, and the positioning threshold includes the second positioning threshold.
[0186] In one embodiment, the processor 501 performs the calculation based on the threshold calculation method on the first light sensing data and the second light sensing data to obtain the positioning threshold, specifically performing:
[0187] Based on the second threshold calculation method, the absolute value of the difference between the first light perception data and the second light perception data is obtained as an intermediate value, and the target light perception data and the intermediate value of the configured calculation coefficient are summed to obtain a second positioning threshold; wherein, the calculation coefficient is less than 1 and greater than 0, the target light perception data is the smaller value between the first light perception data and the second light perception data, and the positioning threshold includes the second positioning threshold.
[0188] In one embodiment, the processor 501 performs the step of detecting whether the difference between the first light sensing data and the second light sensing data satisfies a target segmentation condition among a plurality of preset segmentation conditions, specifically performing:
[0189] According to the comparison results of comparing the difference between the first light sensing data and the second light sensing data with at least one segmentation standard value, it is detected whether the difference between the first light sensing data and the second light sensing data meets the target segmentation condition among multiple preset segmentation conditions.
[0190] In one embodiment, the label paper includes at least two surface paper areas and a gap area between the two surface paper areas, and the surface paper area includes at least a first sub-area and a second sub-area;
[0191] Before the processor 501 executes the step of detecting whether the difference between the first light sensing data and the second light sensing data satisfies a target segmentation condition among a plurality of preset segmentation conditions, the processor 501 further executes:
[0192] Acquire light sensing data of the first sub-area, light sensing data of the second sub-area, and light sensing data of the gap area; wherein the light sensing data of the first sub-area is smaller than the light sensing data of the second sub-area;
[0193] The segment standard value is determined according to the difference between the light sensing data of the second sub-area and the light sensing data of the gap area and the light sensing data of the first sub-area.
[0194] In one embodiment, before the processor 501 executes the instruction to calculate the threshold value and sequentially collects the first light sensing data and the second light sensing data, it further executes:
[0195] When it is detected that the box cover of the printer is switched from a closed state to an open state, the threshold calculation instruction is obtained.
[0196] In one embodiment, after the processor 501 calculates the first light sensing data and the second light sensing data based on the threshold calculation method to obtain the positioning threshold, it further executes:
[0197] collecting third light sensing data;
[0198] Detecting whether a difference between the second light sensing data and the third light sensing data satisfies the target segmentation condition;
[0199] When it is determined that the difference between the second light sensing data and the third light sensing data does not meet the target segmentation condition, a threshold calculation method corresponding to the segmentation condition matching the difference between the second light sensing data and the third light sensing data is obtained;
[0200] Calculate the second light sensing data and the third light sensing data according to a threshold value calculation method corresponding to a segmentation condition of a difference match between the second light sensing data and the third light sensing data to obtain a positioning threshold to be calculated;
[0201] The positioning threshold to be calculated and the positioning threshold are calculated to obtain a target positioning threshold; wherein the target positioning threshold is used to replace the positioning threshold to determine the position on the label paper during the printing process.
[0202] In one embodiment, the processor 501 calculates the first light sensing data and the second light sensing data based on the threshold calculation method to obtain the positioning threshold, and further executes:
[0203] During the printing process, light sensing data is collected and detected;
[0204] The position on the label paper is determined according to a comparison result between the detected light sensing data and the positioning threshold.
[0205] In one embodiment, the label paper comprises at least two surface paper areas and a gap area between the two surface paper areas;
[0206] The processor 501 executes the comparison result based on the detected light sensing data and the positioning threshold to determine the position on the label paper, specifically performing:
[0207] Determining whether the detected light sensing data is less than or equal to the positioning threshold;
[0208] When it is determined that the detected light sensing data is less than or equal to the positioning threshold, it is determined to be in the gap area.
[0209] Since there are unique elements in the face paper area of the label paper, the face paper area will be delaminated. The face paper area corresponds to at least two photosensitive data, and multiple photosensitive data will affect the calculation of the positioning threshold. The present application determines the segmentation conditions and the preset threshold calculation method matching the segmentation conditions based on at least one photosensitive data corresponding to different areas on the label paper through multiple differences between the multiple photosensitive data, so that accurate positioning thresholds can be obtained through multiple threshold calculation methods during printing. Only by using accurate positioning thresholds can the accurate positioning of the print head of the label printer on the label paper be guaranteed, the printing quality can be improved, and problems such as overlapping, blurring or misalignment of different colors or image elements can be prevented, as well as reducing label paper waste and avoiding printing failures due to offset or position errors.
[0210] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0211] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0212] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A method for calculating a positioning threshold, characterized in that: The method comprises: In response to the threshold calculation instruction, sequentially collecting the first light sensing data and the second light sensing data; Detecting whether a difference between the first light sensing data and the second light sensing data satisfies a target segmentation condition among a plurality of preset segmentation conditions; When it is determined that the difference between the first light sensing data and the second light sensing data satisfies the target segmentation condition, obtaining a threshold calculation method corresponding to the target segmentation condition; The first light sensing data and the second light sensing data are calculated based on the threshold value calculation method to obtain a positioning threshold value, and the positioning threshold value is used to determine the position on the label paper during the printing process.
2. The method for calculating the positioning threshold according to claim 1, characterized in that: The plurality of preset segmentation conditions include a first segmentation condition, wherein the first segmentation condition is that a difference between the first light sensing data and the second light sensing data is less than a segmentation standard value; The method of obtaining a threshold value calculation method corresponding to the target segmentation condition when determining that the difference between the first light sensing data and the second light sensing data meets the target segmentation condition includes: When it is determined that the difference between the first light sensing data and the second light sensing data satisfies the first segmentation condition, a first threshold calculation method corresponding to the first segmentation condition is obtained; wherein the threshold calculation method includes the first threshold calculation method.
3. The method for calculating the positioning threshold according to claim 2, characterized in that: The calculating the first light sensing data and the second light sensing data based on the threshold calculation method to obtain a positioning threshold includes: Based on the first threshold calculation method, an average value of the first light sensing data and the second light sensing data is calculated to obtain a first positioning threshold; wherein the positioning threshold includes the first positioning threshold.
4. The method for calculating the positioning threshold according to claim 1, characterized in that: The plurality of preset segmentation conditions include a second segmentation condition, wherein the second segmentation condition is that a difference between the first light sensing data and the second light sensing data is greater than or equal to a segmentation standard value; The method of obtaining a threshold value calculation method corresponding to the target segmentation condition when determining that the difference between the first light sensing data and the second light sensing data meets the target segmentation condition includes: When it is determined that the difference between the first light sensing data and the second light sensing data satisfies the second segmentation condition, a second threshold calculation method corresponding to the second segmentation condition is obtained; wherein the threshold calculation method includes the second threshold calculation method.
5. The method for calculating the positioning threshold according to claim 4, characterized in that: Calculating the first light sensing data and the second light sensing data based on the threshold calculation method to obtain a positioning threshold includes: Based on the second threshold calculation method, the absolute value of the difference between the first light perception data and the second light perception data is obtained as an intermediate value, and the second positioning threshold is obtained according to the intermediate value and the target light perception data; wherein, the target light perception data is the smaller value between the first light perception data and the second light perception data, and the positioning threshold includes the second positioning threshold.
6. The method for calculating the positioning threshold according to claim 4, characterized in that: The calculating the first light sensing data and the second light sensing data based on the threshold calculation method to obtain a positioning threshold includes: Based on the second threshold calculation method, the absolute value of the difference between the first light perception data and the second light perception data is obtained as an intermediate value, and the target light perception data and the intermediate value of the configured calculation coefficient are summed to obtain a second positioning threshold; wherein, the calculation coefficient is less than 1 and greater than 0, the target light perception data is the smaller value between the first light perception data and the second light perception data, and the positioning threshold includes the second positioning threshold.
7. The method for calculating the positioning threshold according to claim 1, characterized in that: The detecting whether the difference between the first light sensing data and the second light sensing data satisfies a target segmentation condition among a plurality of preset segmentation conditions includes: According to the comparison results of comparing the difference between the first light sensing data and the second light sensing data with at least one segmentation standard value, it is detected whether the difference between the first light sensing data and the second light sensing data meets the target segmentation condition among multiple preset segmentation conditions.
8. The method for calculating the positioning threshold according to claim 7, characterized in that: The label paper comprises at least two surface paper areas and a gap area between the two surface paper areas, and the surface paper area comprises at least a first sub-area and a second sub-area; Before detecting whether the difference between the first light sensing data and the second light sensing data satisfies a target segmentation condition among a plurality of preset segmentation conditions, the method further includes: Acquire light sensing data of the first sub-area, light sensing data of the second sub-area, and light sensing data of the gap area; wherein the light sensing data of the first sub-area is smaller than the light sensing data of the second sub-area; The segment standard value is determined according to the difference between the light sensing data of the second sub-area and the light sensing data of the gap area and the light sensing data of the first sub-area.
9. The method for calculating the positioning threshold according to claim 1, characterized in that: Before the step of sequentially collecting the first light sensing data and the second light sensing data in response to the threshold value calculation instruction, the method further includes: When it is detected that the box cover of the printer is switched from a closed state to an open state, the threshold calculation instruction is obtained.
10. The method for calculating the positioning threshold according to claim 1, characterized in that: After calculating the first light sensing data and the second light sensing data based on the threshold value calculation method to obtain the positioning threshold, the method further includes: collecting third light sensing data; Detecting whether a difference between the second light sensing data and the third light sensing data satisfies the target segmentation condition; When it is determined that the difference between the second light sensing data and the third light sensing data does not meet the target segmentation condition, a threshold calculation method corresponding to the segmentation condition matching the difference between the second light sensing data and the third light sensing data is obtained; Calculate the second light sensing data and the third light sensing data according to a threshold value calculation method corresponding to a segmentation condition of a difference match between the second light sensing data and the third light sensing data to obtain a positioning threshold to be calculated; The positioning threshold to be calculated and the positioning threshold are calculated to obtain a target positioning threshold; wherein the target positioning threshold is used to replace the positioning threshold to determine the position on the label paper during the printing process.
11. The method for calculating the positioning threshold according to claim 1, characterized in that: After calculating the first light sensing data and the second light sensing data based on the threshold value calculation method to obtain the positioning threshold, the method further includes: During the printing process, light sensing data is collected and detected; The position on the label paper is determined according to a comparison result between the detected light sensing data and the positioning threshold.
12. The method for calculating the positioning threshold according to claim 11, characterized in that: The label paper at least comprises two surface paper areas and a gap area between the two surface paper areas; The step of determining the position on the label paper according to a comparison result of the detected light sensing data and the positioning threshold comprises: Determining whether the detected light sensing data is less than or equal to the positioning threshold; When it is determined that the detected light sensing data is less than or equal to the positioning threshold, it is determined to be in the gap area.
13. A device for calculating a positioning threshold, characterized in that: The device comprises: A light sensing data acquisition module, used for sequentially acquiring first light sensing data and second light sensing data in response to a threshold value calculation instruction; A segmentation detection module, used to detect whether the difference between the first light sensing data and the second light sensing data satisfies a target segmentation condition among a plurality of preset segmentation conditions; a calculation and determination module, configured to obtain a threshold calculation method corresponding to the target segmentation condition when it is determined that the difference between the first light sensing data and the second light sensing data meets the target segmentation condition; The result obtaining module is used to calculate the first light sensing data and the second light sensing data based on the threshold calculation method to obtain a positioning threshold, and the positioning threshold is used to determine the position on the label paper during the printing process.
14. A computer storage medium, characterized in that: The computer storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the method steps according to any one of claims 1 to 12.
15. A computer program product, characterized in that The computer program product stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the method steps according to any one of claims 1 to 12.
16. A label printer, characterized in that: include: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the method steps as claimed in any one of claims 1 to 12.
Citation Information
Patent Citations
Label printer and operation method thereof
CN113580784A
Label paper printing method and label printer applied to label paper printing method
CN115157886A
Label printer and sensor calibration method and system thereof
CN116330854A
Cigarette porosity detection method, device and equipment and storage medium
CN117197094A
Label detection method based on millimeter wave radar and related equipment
CN118425946A
Cited By
Positioning correction method, device and equipment based on label printer and medium
CN121212176A
Automatic calibration method and system for photoelectric threshold value of die cutting label, medium and electronic equipment
CN121677561A
Die-cut label photoelectric threshold automatic calibration method, system, medium and electronic device
CN121677561B
Positioning threshold calculation method and related device
WO2026153304A1