Label information identification and label printing method and device, equipment and medium

The integration of deep learning for label printing enhances efficiency and accuracy by automating the printing process through integrated image and text recognition, addressing inefficiencies and errors in traditional methods.

CN119105712APending Publication Date: 2024-12-10CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202411258048.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-09
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

Traditional label printing processes are inefficient, labor-intensive, and prone to errors due to their reliance on manual or semi-automated steps, especially when dealing with large-scale or personalized printing tasks, leading to reduced printing quality and user satisfaction.

Method used

A method and device that utilize deep learning techniques for integrated image and text recognition, dividing the printing area into sub-areas with specific layout conditions, and generating intelligent printing control instructions to automate the printing process, reducing human intervention and enhancing accuracy and efficiency.

Benefits of technology

The method significantly improves printing accuracy and efficiency by minimizing errors and reducing manual labor, enabling flexible and high-quality label printing for various scenarios, including large-scale and personalized tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119105712A_ABST
    Figure CN119105712A_ABST
Patent Text Reader

Abstract

The invention provides a label information identification and label printing method and device, equipment and a medium, and the method comprises the steps: obtaining the initial information of a to-be-printed object and the printing layout management parameters of blank label paper, carrying out the feature identification of the initial information, obtaining a fusion feature vector, obtaining the label information according to the fusion feature vector, and carrying out the printing layout management of the blank label paper; a printing area is determined according to the printing layout management parameters and the label information, the printing area is divided into a plurality of sub-areas, each sub-area is configured to be used for bearing capacity vectors of different dimension layout conditions in the corresponding area, and a printing control instruction is generated according to the capacity vectors of all the areas so as to control the target printer to execute a printing action; the initial information of the to-be-printed object is intelligently identified, the fusion feature vector is generated to obtain the label information, and the printing control instruction is generated based on the capacity vector of the printing area, so that the target printer is controlled to print the label, and the accuracy of information identification and the intelligent degree of the printing process are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of intelligent control technology, and specifically to a label information recognition and label printing method, device, equipment and medium. Background Art

[0002] The traditional label printing process is cumbersome and inefficient, usually involving multiple independent manual steps, including designing templates, image preprocessing, text recognition, and writing or adjusting print control instructions. This series of steps is not only time-consuming and labor-intensive, but also prone to human errors during execution, especially when faced with frequently changing label design requirements or large-scale personalized printing tasks. The limitations of traditional methods are particularly prominent. Although there are some solutions on the market that attempt to integrate a single technology module, such as template design tools based on specific software or image recognition systems with a single function, these solutions still fail to provide a comprehensive solution that fully integrates deep learning recognition capabilities and automatic generation of printer instructions.

[0003] At present, the main technical problem facing label printing technology is its over-reliance on manual or semi-automated processes. Given that the traditional label printing process requires multiple manual steps, the entire process becomes lengthy and inefficient, making it difficult to meet the needs of large-scale or personalized printing; and because errors may be introduced in every link of human involvement, especially when dealing with large amounts of data or complex designs, the possibility of error accumulation increases significantly, often resulting in printing results that do not meet expectations, reducing printing quality and user satisfaction. Therefore, the current commonly used printing technologies are usually inefficient and have high error rates. Summary of the invention

[0004] In view of the above-mentioned shortcomings of the prior art, the present application provides a label information identification and label printing method, device, equipment and medium to solve the above-mentioned technical problems.

[0005] The present application provides a label information recognition and label printing method, the method comprising: obtaining initial information of an object to be printed and printing layout management parameters of a blank label paper, the initial information comprising at least image features and text features; performing feature recognition on the initial information to obtain a fused feature vector corresponding to the initial information, so as to obtain label information of the object to be printed based on the fused feature vector; determining a printing area according to the printing layout management parameters and the label information, dividing the printing area into a plurality of sub-areas, configuring each sub-area to carry a capacity vector of layout conditions of different dimensions in the corresponding area, and generating a printing control instruction according to the capacity vector of each area; and controlling a target printer to perform a printing action based on the printing control instruction to obtain a label corresponding to the object to be printed.

[0006] In one embodiment of the present application, feature recognition is performed on the initial information to obtain a fused feature vector corresponding to the initial information, including: identifying image features of the initial information, and generating an image feature vector of the initial information based on the identified image features; identifying text features of the initial information, and generating a text feature vector of the initial information based on the identified text features; concatenating the image feature vector and the text feature vector to obtain a joint feature vector, and performing a nonlinear transformation on the joint feature vector to obtain a fused feature vector corresponding to the initial information.

[0007] In one embodiment of the present application, label information of the object to be printed is obtained based on the fused feature vector, including: converting the format of the fused feature vector to obtain an intelligent recognition result adapted to the printing control instruction; determining the element information represented by the intelligent recognition result as label information, the label information at least including content information and format information, the format information including printing element type, printing position coordinates, label size, and the content information label content data.

[0008] In one embodiment of the present application, after configuring a sub-area for carrying the capacity vectors of layout conditions of different dimensions in the corresponding area, it also includes: determining the label size and label content data of the label to be printed based on the label information; allocating the label content information to each sub-area, and constructing an objective function based on the capacity vector of each sub-area, and the objective function is used to determine whether each allocation scheme is feasible; constructing a scoring function based on preset scoring rules and the printing constraints to determine the optimal printing layout scheme based on the output result of the scoring function.

[0009] In one embodiment of the present application, the label information identification and label printing method also includes: obtaining multiple initial matching schemes, and generating an initial layout based on the initial matching schemes, and using it as the initial population; determining the probability according to the fitness of the initial population, and performing population iteration processing according to the probability; after each iteration, performing local optimization on each individual in the current population to obtain multiple optimized label layout schemes, and the local optimization includes cooling based on the initial temperature and cooling rate of the current population until the current temperature reaches a preset temperature threshold.

[0010] In one embodiment of the present application, the target printer is controlled to perform a printing action based on the printing control instruction, including: converting the printing control instruction into binary data and adding a checksum field, performing buffering processing and controlling the instruction sending rate; periodically querying the printer status in a polling manner, issuing an alarm if an abnormal state exists, and executing corresponding error handling logic for a preset specific error code to implement an automatic retry mechanism; encrypting the printing control instruction, and performing a checksum check on the sent binary data, and performing a printing action based on the printing control instruction when the verification is passed.

[0011] In one embodiment of the present application, after controlling the target printer to execute the printing action based on the printing control instruction, it also includes: collecting feedback data of the printing task, the feedback data including at least one of printing quality, printing speed, and consumables usage; analyzing the feedback data, and optimizing the process of determining label information and label information printing layout based on the analysis results.

[0012] The present application provides a label information recognition and label printing device, the device comprising: an intelligent recognition module, used to obtain initial information of an object to be printed and print layout management parameters of a blank label paper, the initial information at least comprising image features and text features; feature recognition is performed on the initial information to obtain a fused feature vector corresponding to the initial information, so as to obtain label information of the object to be printed based on the fused feature vector; a print control instruction generation module, used to determine a print area according to the print layout management parameters and the label information, and divide the print area into a plurality of sub-areas, configure each sub-area to carry a capacity vector of layout conditions of different dimensions in the corresponding area, and generate a print control instruction according to the capacity vector of each area; a print execution module, used to control a target printer to execute a print action based on the print control instruction, so as to obtain a label corresponding to the object to be printed.

[0013] The present application provides an electronic device, including a processor, a memory and a communication bus; the communication bus is used to connect the processor and the memory; the processor is used to execute a computer program stored in the memory to implement the label information recognition and label printing method as described above.

[0014] The present application provides a computer-readable storage medium, characterized in that a computer program is stored thereon, and the computer program is used to enable a computer to execute the label information recognition and label printing method as described above.

[0015] Beneficial effects of the present application: The label information recognition and label printing method proposed in the present application first obtains the initial information of the object to be printed and the printing layout management parameters of the blank label paper. By performing deep feature recognition on these initial information to extract the fused feature vector, the intelligent recognition technology is fully utilized to ensure the accuracy and efficiency of information processing; then the required label information is obtained according to the fused feature vector, and the printing area is determined according to the label information and the printing layout management parameters, so that the printing area is divided into multiple sub-areas, and the capacity vectors for carrying the layout conditions of different dimensions in the corresponding area are configured; finally, the printing control instructions are generated according to the capacity vectors of each area to control the target printer to print the label. Through this series of intelligent processing processes, not only the accuracy of information recognition is significantly improved, but also the intelligence level of the printing process is greatly improved, so that the printing task can be completed more efficiently and accurately.

[0016] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0018] Figure 1 It is a schematic diagram of an implementation environment of a label information identification and label printing method shown in an exemplary embodiment of the present application;

[0019] Figure 2 It is a flowchart of a label information identification and label printing method shown in an exemplary embodiment of the present application;

[0020] Figure 3 is a schematic diagram of a feature recognition process shown in an exemplary embodiment of the present application;

[0021] Figure 4 is a schematic diagram of a printer control flow chart showing an exemplary embodiment of the present application;

[0022] Figure 5 is a block diagram of a label information recognition and label printing device shown in an exemplary embodiment of the present application;

[0023] Figure 6 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION

[0024] The following will describe the implementation methods of the present application with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific implementation methods, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be understood that the preferred embodiments are only for illustrating the present application, not for limiting the scope of protection of the present application.

[0025] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.

[0026] In the following description, a large number of details are discussed to provide a more thorough explanation of the embodiments of the present application. However, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present application difficult to understand.

[0027] First of all, it should be noted that Mask R-CNN (Mask Region-based Convolutional Neural Network) is a deep learning algorithm for instance segmentation. By adding a branch network based on Faster R-CNN, it can not only detect targets, but also accurately segment target pixels.

[0028] CRNN (Convolutional Recurrent Neural Network) is a deep learning model for optical character recognition (OCR) that combines the advantages of convolutional neural networks (CNN) and recurrent neural networks (RNN) and can recognize text sequences of indefinite length in images.

[0029] Multimodal fusion refers to a technical method that combines data from different modalities (such as vision, hearing, text, etc.) to improve information processing and comprehension capabilities. By fusing multimodal information, a more comprehensive and accurate understanding can be obtained.

[0030] ZPL (Zebra Programming Language) is a unique print command language for Zebra printers. It provides a rich set of instructions for defining the layout, style, barcode, text, graphics and other elements of the printed content. Through ZPL instructions, users can precisely control every detail of the print output and achieve highly customized printing effects.

[0031] Figure 1 It is a schematic diagram of an implementation environment of a label information recognition and label printing method shown in an exemplary embodiment of the present application.

[0032] like Figure 1 As shown, the implementation environment of the label information recognition and label printing method includes an image acquisition device 101 and a computer device 102, wherein the data acquisition device 101 is used to collect the initial information to be printed and the printing layout management parameters of the blank label, and send the collected initial information and printing layout management parameters to the computer device 102, and the data acquisition device can be any device or device that can be used for image information or text information collection, such as a camera, a camera, an infrared sensor, etc., and this application does not impose any restrictions on this; the computer device 102 is used to perform feature recognition on the collected initial information to obtain the label information to be printed, and layout the blank label paper based on the label information and the printing layout management parameters, and then generate a control instruction based on the complete printing information after layout, so as to control the target printer to execute the printing action corresponding to the control instruction to complete the label printing of the specified information. Among them, the computer device 102 can be at least one of a desktop graphics processing unit (GPU) computer, a GPU computing cluster, a neural network computer, etc., or it can be an intelligent processor integrated in the current vehicle, and this application does not impose any restrictions on this.

[0033] Figure 2 It is a flowchart of a label information identification and label printing method shown in an exemplary embodiment of the present application.

[0034] like Figure 2 As shown, in an exemplary embodiment, the label information recognition and label printing method at least includes steps S210 to S240, which are described in detail as follows:

[0035] Step S210, obtaining initial information of the object to be printed and printing layout management parameters of the blank label paper, wherein the initial information at least includes image features and text features.

[0036] In one embodiment of the present application, the initial information of the object to be printed is first obtained, and the initial information includes but is not limited to text content, images, barcodes or QR codes. Taking the need to print a product label as an example, the initial information may include the name of the product, production date, expiration date, price and barcode of the product. Then, it is also necessary to obtain the print layout management parameters of the blank label paper, which defines the size, shape, margins, printable area, etc. of the label paper. For example, for A4-sized label paper, the system needs to know its specific size, margins and how many labels can be printed on each sheet of paper.

[0037] Step S220 , performing feature recognition on the initial information to obtain a fused feature vector corresponding to the initial information, so as to obtain label information of the object to be printed based on the fused feature vector.

[0038] In one embodiment of the present application, feature recognition is performed on initial information to obtain a fused feature vector corresponding to the initial information, including: identifying image features of the initial information, and generating an image feature vector of the initial information based on the identified image features; identifying text features of the initial information, and generating a text feature vector of the initial information based on the identified text features; concatenating the image feature vector and the text feature vector to obtain a joint feature vector, and performing a nonlinear transformation on the joint feature vector to obtain a fused feature vector corresponding to the initial information.

[0039] In one embodiment of the present application, first, the initial information of the object to be printed is obtained, and the initial information includes the image, name, production date, expiration date, price, and barcode of the product. Then, feature recognition is performed on the initial information, including image feature recognition and text feature recognition. For image feature recognition, image recognition technology is used to recognize the image content in the initial information, such as the photo or icon of the product, and after the recognition is completed, an image feature vector is generated based on these image features, and the vector is used to characterize the main features and attributes of the image. For text feature recognition, text recognition technology is used to extract the text content in the initial information, such as the name of the product, production date, etc. After the recognition is completed, a text feature vector is generated based on these text features, and the vector is used to characterize the main features and attributes of the text. Finally, after completing the feature recognition of the image and text, the image feature vector and the text feature vector are spliced ​​to obtain a joint feature vector, and the joint feature vector is further processed to obtain a fused feature vector, which contains both image and text information.

[0040] In a specific embodiment of the present application, taking the information to be printed as a product label as an example, the information to be printed is first obtained. In this embodiment, it is assumed that the initial information includes the product image (such as a product photo), name ("XX brand beverage"), production date ("May 1, 2023"), validity period ("12 months"), price ("10 yuan") and barcode. Then, feature recognition is performed based on the obtained initial information, and the feature recognition specifically includes the following steps:

[0041] Step 1: Image feature recognition. First, the system preprocesses the product image and then inputs it into the MASK-RCNN model, which performs in-depth analysis on the image, identifies key features in the product photo, such as color, shape, texture, etc., and generates an image feature vector containing these features.

[0042] Step 2: Text feature recognition. After extracting the text content to be printed from the initial information, such as product name, production date, etc., these texts are input into the CRNN model, which uses the convolutional network to extract text features and processes the time series information through the recurrent network, and finally generates a text feature vector containing the main features and attributes of the text.

[0043] Step 3: Generate a joint feature vector. After completing the feature recognition of the image and text, use the multimodal fusion algorithm of the multi-layer perceptron (MLP) to concatenate the image feature vector and the text feature vector to obtain a joint feature vector, which contains both image and text information and provides a basis for the subsequent generation of a fused feature vector.

[0044] Specifically, first obtain the feature vector V of the respective processing results from MASK-RCNN and CRNN img and V txt , and then concatenate the two sets of eigenvectors into a joint eigenvector V fusion1 , as follows:

[0045] V fusion1 =[V img ; V txt Formula (1)

[0046] Among them, V fusion1 represents the joint eigenvector, V img represents the image feature vector, V txt Represents a text feature vector.

[0047] Step 4: Generate a fused feature vector. In order to obtain a more compact and effective feature representation, a series of fully connected layers are used to perform nonlinear transformations on the joint features, and the information in the joint feature vector is fused and optimized. Finally, a fused feature vector is obtained, which contains all the key features and attributes of the information to be printed. The transformation process is as follows:

[0048] V fusion2 =σ(w2·σ(w1·[V img ; V txt ]+b1)+b2) Formula (2)

[0049] Among them, V fusion2 represents the fused feature vector, w1 and w2 represent two different weight matrices, b1 and b2 represent two different bias terms, σ is the activation function, V img represents the image feature vector, V txt Represents a text feature vector.

[0050] It should be noted that the present embodiment uses a multimodal recognition method of image recognition and text recognition to extract features of the information to be printed, obtains more comprehensive information to be printed by integrating text and image data, and effectively reduces the information deviation caused by the uncertainty of single information of text or image, so that the recognition result of the information to be printed is more accurate, which provides more accurate information for subsequent label printing and improves the accuracy of printing.

[0051] In one embodiment of the present application, label information of the object to be printed is obtained based on the fused feature vector, including: converting the format of the fused feature vector to obtain an intelligent recognition result adapted to the printing control instruction; determining the element information represented by the intelligent recognition result as label information, the label information at least including content information and format information, the format information including printing element type, printing position coordinates, label size, and the content information label content data.

[0052] In one embodiment of the present application, the information in the fused feature vector is parsed and organized so as to be presented in a structured manner. The structured expression includes all key elements of the label to be printed, such as the type of printing element (such as text, image, barcode, etc.), printing position coordinates, label size, and label content data, and the structured expression is determined as the intelligent recognition result. It should be noted that the result accurately reflects all necessary information of the label to be printed, providing a solid foundation for the subsequent printing process.

[0053] Step S230, determining the printing area according to the printing layout management parameters and the label information, and dividing the printing area into several sub-areas, configuring each sub-area to carry the capacity vector of the layout conditions of different dimensions in the corresponding area, and generating printing control instructions according to the capacity vectors of each area.

[0054] In one embodiment of the present application, after configuring a sub-area for carrying the capacity vectors of layout conditions of different dimensions in the corresponding area, it also includes: determining the label size and label content data of the label to be printed according to the label information; allocating the label content information to each sub-area, and constructing an objective function based on the capacity vector of each sub-area, the objective function being used to determine whether each allocation scheme is feasible; constructing a scoring function based on preset scoring rules and the printing constraints to determine the optimal printing layout scheme according to the output result of the scoring function.

[0055] In a specific embodiment of the present application, the total area of ​​the printed label is first defined as a large layout area L, which needs to be divided into multiple sub-areas L=l1,l2,...l according to the actual size and content requirements of the label. k Each sub-area has its size and suitable content type. And introduce a capacity vector C for each sub-area j , C j =(c j1 ,c j2 ,...c jm ), where c jl Represents sub-region l j The capacity of the corresponding attribute l (such as space compatible element type, etc.). The definition and function of the capacity vector are described in detail as follows:

[0056] a. Space carrying capacity c j1

[0057] Represents sub-region l j The maximum area or volume that can be accommodated, which is determined by the size of the subregion (width and height). This vector ensures that the placed elements do not exceed the physical boundaries of the subregion, avoiding overlapping or missing printed content.

[0058] b. Compatible element type c j2

[0059] List sub-areas j A list of acceptable element types, such as text, barcode, QR code, image, etc. This vector ensures that only elements that match the sub-area type are placed there, avoiding printing errors caused by incompatible types.

[0060] c. Visual clarity requirements j3

[0061] Describe sub-region l j For elements with a minimum readable size or resolution requirement, the vector ensures that the content remains legible even in small sizes or high-density printing environments.

[0062] d. Position constraint c j4

[0063] Specifies that the element is in subregion l j The vector determines the position rules within the page, such as whether it needs to be centered, aligned to the edge, or maintain a certain margin. This vector maintains the neatness and beauty of the printed content and improves the professionalism of the printed result.

[0064] e. Rotation angle limit c j5

[0065] Set the angle range within which the element can be rotated to adapt to specific layout requirements. This vector allows the direction of the element to be adjusted when necessary, increasing the flexibility of the layout.

[0066] f. Color and contrast requirements c. j6

[0067] Specify sub-area l j The color scheme and contrast standards of internal elements ensure good readability and visual effects. This vector acts on multi-color printing or scenes requiring high contrast to ensure the visual effects of the content and the effectiveness of information transmission.

[0068] g. Additional constraints (c j7 ,...,c jm )

[0069] Other application-specific constraints may also be included, such as security requirements (encrypted barcodes), environmental adaptability (waterproof, scratch-resistant), special material compatibility, etc., to ensure that the printed content meets the needs of specific industries or customers and enhance the applicability and reliability of the printing solution.

[0070] Then, in order to comprehensively consider the various dimensions in these capacity vectors, in order to manage the printing layout more intelligently and flexibly, and to ensure that each sub-area l j In order to reasonably utilize resources and meet the high standards of printing quality and functionality, efficient and high-quality automated printing can be achieved through refined management. An optimization objective function is designed to guide layout allocation. The optimization objective function is as follows:

[0071]

[0072] Among them, α i is the priority of the i-th recognition result, S(l j ,di ) indicates content d i Place in area l j The degree of suitability, I ij represents an indicator variable, when d i Assign to l j 1 if the value is 0, otherwise it is 0.

[0073] Then, the rationality of each matching scheme can be calculated by defining a scoring function. Taking the size, type matching and other possible factors into consideration as an example, the expression of the appropriateness is as follows:

[0074] S(l j ,d i )=w size ·f size (l j ,d i )+w type ·f type (l j ,d i )+w other ·f other (l j ,d i ) Formula (4)

[0075] Among them, w size 、w type 、w other Respectively represent the weight coefficients of size, type, and other factors on the matching suitability index; f size 、f type 、f type Then they represent the corresponding matching function respectively.

[0076] Taking the matching function of size and type as an example, the calculation method is as follows:

[0077]

[0078] Among them, f size is the size fitness based on the Gaussian function, w maxj Yes j The maximum width limit, h maxj Yes j The maximum height limit of , σ represents the decay speed of the control matching degree with the size deviation, f type This means a simple check d i Is the type consistent with l j The set of accepted types T j .

[0079] In addition, the solution proposed in this application also includes obtaining multiple initial matching schemes, generating an initial layout based on the initial matching scheme, and using it as the initial population; determining a probability based on the fitness of the initial population, and performing population iteration processing based on the probability; after each iteration, performing local optimization on each individual in the current population to obtain multiple optimized label layout schemes, wherein the local optimization includes cooling based on the initial temperature and cooling rate of the current population until the current temperature reaches a preset temperature threshold

[0080] In a specific embodiment of the present application, considering that the printing control instruction generation problem is essentially a discrete optimization problem, direct solution may face combinatorial explosion problem. In the process of generating printing control instructions, a hybrid strategy combining genetic algorithm (GA) and simulated annealing (SA) can effectively solve the layout optimization problem under complex decision space and constraints. The implementation process of the hybrid strategy is as follows:

[0081] First, initialize and encode. Randomly generate an initial population of size N P0 = E1, E2, ..., E N , where each individual E i Represents a specific layout configuration encoding; and defines the fitness function F(E i ) is used as a criterion for evaluating layout quality, F(E i )=-F(L,D) is used in genetic algorithm, where F(L,D) is the original objective function.

[0082] Secondly, genetic algorithm and local optimization. Roulette selection is adopted, and the fitness F(E i ) to determine the selection probability P(i)

[0083]

[0084] Among them, P(i) represents the probability of choosing i, F(E i ) represents the fitness of choice i.

[0085] According to the crossover probability p c Perform a crossover operation according to the mutation probability p m Perform mutation operation to generate the next generation population p t+1 .

[0086] After each iteration of the genetic algorithm, each individual E in the current population i Simulated annealing is applied for local optimization: the initial temperature T0 and the cooling rate α are determined.

[0087] For each E i , simulated annealing starts from the current layout configuration and explores the neighborhood solution E′i according to the following acceptance criteria, as follows:

[0088]

[0089] Among them, T gradually decreases to T = α·T until the lowest temperature. If paccept is greater than a randomly generated number between [0,1], E′i is accepted.

[0090] Then, simulated annealing and global exploration. Select the preset number of top individuals, run the simulated annealing algorithm independently, try to explore a longer range, prevent the population from converging to the local optimum too early, and enhance the global optimization ability of the algorithm by conducting in-depth exploration of the top individuals in the population.

[0091] Then, iteration and convergence: Genetic operations and local searches are repeated until the predetermined number of iterations or convergence conditions are reached.

[0092] Finally, decoding and outputting: The optimal layout configuration finally found is encoded and decoded into a specific print control instruction sequence, and sent to the target printer to complete the automated label layout generation task.

[0093] It should be noted that the hybrid strategy makes full use of the global exploration capability of the genetic algorithm and the local search capability of simulated annealing. By dynamically adjusting the search strategy, it can not only search the solution space extensively, but also carefully optimize the quality of the solution, thereby improving the solution efficiency and the global optimality of the solution in complex layout optimization problems.

[0094] Step S250, controlling the target printer to execute a printing action based on the printing control instruction to obtain a label corresponding to the object to be printed.

[0095] In one embodiment of the present application, the target printer is controlled to perform a printing action based on a print control instruction, including: initializing the target printer to put the target printer in a working state; converting the print control instruction into binary data and adding a checksum field, performing buffering and controlling the instruction sending rate; periodically querying the printer status in a polling manner, issuing an alarm if an abnormal state exists, and executing corresponding error handling logic for a preset specific error code to implement an automatic retry mechanism; encrypting the print control instruction, and performing a checksum check on the sent binary data, and performing a printing action based on the print control instruction when the verification is passed.

[0096] In a specific embodiment of the present application, first ensure that the connection with the target printer is unimpeded before controlling the printer, specifically confirm the physical connection information of the printer by identifying hardware resources, such as serial port number (may be COM1, COM2, etc. under Windows, may be / dev / ttyUSB0 / dev / ttyS0, etc. under Linux), set serial port communication parameters, including baud rate, data bit, stop bit, parity check, etc., to ensure that the configuration with the printer is matched. Finally, use the pySerial library, create a serial port object according to the above parameters and try to open the connection to establish the connection between the output end of the print control instruction and the target printer. Secondly, the instruction sequence generated by the print control instruction generation module is converted into binary data to ensure that the instruction can be correctly identified by the printer, and add a checksum field to the binary data, and also need to do buffering in the continuous printing task, reasonably control the instruction sending rate, and avoid the packet loss caused by buffer overflow. Then, adopt the polling monitoring mode, regularly query the status of the printer, such as querying the current task status, error code, etc., and parse the received status report to identify whether there is an abnormal situation such as lack of paper, insufficient ink, overheating of the printer, so as to respond in time. Then, for specific error codes, the corresponding error handling logic is executed, such as timeout reconnection and task rescheduling. For temporary errors (such as instantaneous network fluctuations), an automatic retry mechanism is implemented to specify the number of retries and the retry interval. Finally, a combination of data encryption and verification is used to ensure the security of the transmission process of printing data instructions. First, the AES algorithm is used to encrypt the instructions before the printing control instructions are sent, and the receiving end decrypts them before processing. Secondly, the checksum field of the binary data when the printing control instructions are sent is verified to ensure the integrity and consistency of the data.

[0097] It should be noted that the target printer mentioned in the embodiment of the present application has a wide range of applicability. It can be a Zebra printer or any other brand and model of printers on the market that can realize intelligent control. When the target printer specifically refers to a Zebra printer, its corresponding print control instruction is a ZPL (Zebra Programming Language) instruction. When the control system in the embodiment of the present application is connected to the Zebra printer, it will convert the print task into a corresponding ZPL instruction set, which is then sent to the print control board of the Zebra printer, parsed and executed by the print control board, and finally drives the print head of the printer to print out the content on the paper according to the instruction requirements.

[0098] It should also be noted that the label information identification and label printing method proposed in this application shows significant advantages in many aspects. First, the method realizes automated processing through deep learning technology. From image recognition, text recognition to printing control instruction generation, the entire process does not require manual intervention, thereby greatly shortening the printing preparation time and significantly improving printing efficiency. Secondly, the use of deep learning models for high-precision recognition of images and texts effectively reduces the common recognition errors in traditional methods, ensures the accuracy of the printed content, and thus reduces the cost and time waste caused by erroneous reprinting. In addition, the technical solution also shows strong flexibility, and can flexibly handle various types of inputs including images, texts and complex data structures, meet personalized printing needs in different scenarios, and significantly enhance the adaptability and flexibility of the printing system. At the same time, the automated process simplifies the cumbersome manual steps in traditional printing, reduces the difficulty of operation, and enables non-professionals to easily complete high-quality printing tasks, greatly improving user-friendliness. In terms of operating costs, the method reduces the need for manual operation and error correction through automation and high precision, effectively reduces labor costs and material waste, thereby reducing overall operating costs and improving economic benefits. It is worth mentioning that this technology also deeply integrates deep learning technology with the printer's print control instruction set, promoting the innovation of printing technology and opening up new directions for future technological development and application. Ultimately, the implementation of this technical solution will enable enterprises to have stronger competitiveness in large-scale personalized printing services, respond to market changes more quickly, and meet the diverse needs of customers.

[0099] In one embodiment of the present application, after controlling the target printer to execute the printing action based on the printing control instruction, it also includes: collecting feedback data of the printing task, the feedback data including at least one of the printing quality, printing speed, and consumables usage; analyzing the feedback data, and optimizing the process of determining the label information and the label information printing layout based on the analysis results.

[0100] In a specific embodiment of the present application, after the print task is completed, the system collects feedback data of the print task. These data include key indicators such as print quality, print speed, and consumables usage. Including print quality, print speed, and consumables usage. Among them, the print quality is obtained through the built-in sensor of the printer or the external quality detection equipment, such as print clarity, color accuracy, etc.; the print speed is calculated by recording the time from the start to the end of the print task; the consumables usage is obtained by monitoring the usage and remaining amount of consumables such as ink cartridges and paper. Then the collected feedback data is analyzed, and the process of determining the label information and the label information printing layout is optimized according to the analysis results. If the print quality does not meet the standard, the system may adjust the printing parameters, such as increasing the print resolution, optimizing color management, etc.; if the print speed is too slow, the system may optimize the print path, reduce unnecessary printing actions, etc.; if the consumables are used too much, the system may adjust the print layout to reduce consumable waste, or remind the user to replace the consumables.

[0101] It should be noted that this embodiment implements a printer control system based on print control instructions through modules such as initialization processing, instruction processing, status monitoring, error handling, print execution, and feedback data collection and analysis, and can collect feedback data for optimization after the print task is executed. The system can ensure the stability and reliability of the printing process, improve printing efficiency and quality, reduce waste of consumables, and enhance user experience.

[0102] Figure 5 is a block diagram of a label information recognition and label printing device shown in an exemplary embodiment of the present application. The device can be applied to Figure 1 The device may also be applicable to other exemplary implementation environments and specifically configured in other devices, and this embodiment does not limit the implementation environment to which the device is applicable.

[0103] like Figure 5 As shown, the exemplary label information recognition and label printing device includes: an intelligent recognition module 510, a printing control instruction generation module 520, and a printing execution module 530.

[0104] Among them, the intelligent recognition module 510 is used to obtain the initial information of the object to be printed and the printing layout management parameters of the blank label paper, the initial information at least including image features and text features; perform feature recognition on the initial information to obtain the fused feature vector corresponding to the initial information, so as to obtain the label information of the object to be printed based on the fused feature vector; the printing control instruction generation module 520 is used to determine the printing area according to the printing layout management parameters and the label information, and divide the printing area into a plurality of sub-areas, configure each sub-area to carry the capacity vector of the layout conditions of different dimensions in the corresponding area, and generate printing control instructions according to the capacity vectors of each area; the printing execution module 530 is used to control the target printer to perform the printing action based on the printing control instruction to obtain the label corresponding to the object to be printed.

[0105] It should be noted that the label information identification and label printing device provided in the above embodiment and the label information identification and label printing method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment and will not be repeated here. In actual application, the label information identification and label printing device provided in the above embodiment can distribute the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.

[0106] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the electronic device implements the label information recognition and label printing methods provided in the above-mentioned embodiments.

[0107] Figure 6 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Figure 6 The computer system 600 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0108] like Figure 6As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 602 or the program loaded from the storage part 608 to the random access memory (RAM) 603, such as executing the method described in the above embodiment. In the RAM 603, various programs and data required for system operation are also stored. The CPU 601, ROM 602 and RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0109] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed so that a computer program read therefrom is installed into the storage section 608 as needed.

[0110] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 609, and / or installed from a removable medium 611. When the computer program is executed by a central processing unit (CPU) 601, various functions defined in the system of the present application are executed.

[0111] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0112] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0113] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0114] Another aspect of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor of a computer, the computer executes the label information recognition and label printing method as described above. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.

[0115] Another aspect of the present application also provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the label information identification and label printing methods provided in the above-mentioned embodiments.

[0116] The above embodiments are merely illustrative of the principles and effects of the present application, and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.

Claims

1. A label information recognition and label printing method, characterized in that: The method comprises: Acquire initial information of the object to be printed and print layout management parameters of the blank label paper, wherein the initial information includes at least image features and text features; Performing feature recognition on the initial information to obtain a fused feature vector corresponding to the initial information, so as to obtain label information of the object to be printed based on the fused feature vector; Determine a printing area according to the printing layout management parameters and the label information, divide the printing area into a plurality of sub-areas, configure each sub-area to carry a capacity vector of layout conditions of different dimensions in the corresponding area, and generate a printing control instruction according to the capacity vector of each area; The target printer is controlled to execute a printing action based on the printing control instruction to obtain a label corresponding to the object to be printed.

2. The label information recognition and label printing method according to claim 1, characterized in that: Performing feature recognition on the initial information to obtain a fused feature vector corresponding to the initial information includes: Identifying image features of the initial information, and generating an image feature vector of the initial information based on the identified image features; Identifying text features of the initial information, and generating a text feature vector of the initial information based on the identified text features; The image feature vector and the text feature vector are concatenated to obtain a joint feature vector, and a nonlinear transformation is performed on the joint feature vector to obtain a fused feature vector corresponding to the initial information.

3. The label information recognition and label printing method according to claim 1, characterized in that: Obtaining label information of the object to be printed based on the fused feature vector includes: Converting the fused feature vector into a format to obtain an intelligent recognition result adapted to the printing control instruction; The element information represented by the intelligent recognition result is determined as label information, the label information at least includes content information and format information, the format information includes printing element type, printing position coordinates, label size, and the content information is label content data.

4. The label information recognition and label printing method according to claim 3, characterized in that: After configuring a sub-area for carrying capacity vectors of layout conditions of different dimensions in the corresponding area, the method further includes: Determine the label size and label content data of the label to be printed according to the label information; Allocate the label content information to each sub-region, and construct an objective function based on the capacity vector of each sub-region, wherein the objective function is used to determine whether each allocation scheme is feasible; A scoring function is constructed based on preset scoring rules and the printing constraint conditions to determine an optimal printing layout solution according to an output result of the scoring function.

5. The label information recognition and label printing method according to claim 4, characterized in that: The method further comprises: Acquire multiple initial matching schemes, and generate an initial layout based on the initial matching schemes, and use the initial layout as an initial population; Determining a probability according to the fitness of the initial population, so as to perform population iterative processing according to the probability; After each iteration, each individual in the current population is locally optimized to obtain a plurality of optimized label layout schemes, wherein the local optimization includes cooling based on the initial temperature and cooling rate of the current population until the current temperature reaches a preset temperature threshold.

6. The label information recognition and label printing method according to claim 1, characterized in that: Controlling the target printer to execute a printing action based on the printing control instruction includes: Convert the print control instruction into binary data and add a checksum field, perform buffering and control the instruction sending rate; The printer status is queried periodically by polling. If an abnormal status occurs, an alarm is issued and the corresponding error handling logic is executed for the preset specific error code to realize an automatic retry mechanism. The printing control instruction is encrypted, and the sent binary data is verified and checked. When the verification is passed, the printing action is executed based on the printing control instruction.

7. The label information identification and label printing method according to any one of claims 1 to 6, characterized in that: After controlling the target printer to execute the printing action based on the printing control instruction, the method further includes: Collecting feedback data of the printing task, wherein the feedback data includes at least one of printing quality, printing speed, and consumables usage; The feedback data is analyzed, and the process of determining the label information and the label information printing layout is optimized according to the analysis results.

8. A label information recognition and label printing device, characterized in that: The device comprises: An intelligent recognition module is used to obtain initial information of the object to be printed and printing layout management parameters of the blank label paper, wherein the initial information includes at least image features and text features; perform feature recognition on the initial information to obtain a fused feature vector corresponding to the initial information, so as to obtain label information of the object to be printed based on the fused feature vector; a print control instruction generation module, configured to determine a print area according to the print layout management parameters and the label information, divide the print area into a plurality of sub-areas, configure each sub-area to carry a capacity vector of layout conditions of different dimensions in the corresponding area, and generate a print control instruction according to the capacity vector of each area; The printing execution module is used to control the target printer to execute the printing action based on the printing control instruction to obtain the label corresponding to the object to be printed.

9. An electronic device, characterized in that: It comprises a processor, a memory and a communication bus; the communication bus is used to connect the processor and the memory; the processor is used to execute the computer program stored in the memory to implement the label information recognition and label printing method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is used to enable a computer to execute the label information recognition and label printing method as described in any one of claims 1 to 7.

Citation Information

Cited By

  • Intelligent label printing optimization system, method and device based on image recognition

    CN120029570A

  • Intelligent Label Printing Optimization System, Method and Device Based on Image Recognition

    CN120029570B

  • Special-shaped label printing management method, management system, medium and program product

    CN121050666A

  • A method, system, medium, and program product for printing management of a special-shaped label

    CN121050666B