Label printing processing method and device
The method and device generate universal label printing templates to enhance versatility and reduce integration costs by decoupling business systems, enabling flexible adaptation to various printers and reducing reliance on third-party software.
Patent Information
- Application Number
- CN202411229956.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2024-12-27
AI Technical Summary
Existing label printing systems suffer from poor versatility, high integration costs, and difficulty in adapting to various printing equipment due to tight coupling between template systems and business systems, leading to limited template analysis and increased implementation costs.
A method and device for generating universal label printing templates based on basic printing data, allowing decoupling from business systems, and enabling selection of target templates and printing instructions for specific products, independent of third-party software.
Improves label printing system versatility and reduces integration costs by allowing template reuse and adaptation to various printers, decoupling business systems, and standardizing label template design for flexible implementation.
Smart Images

Figure CN119204062A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of label printing, and in particular to a label printing processing method and device. Background Art
[0002] Label printing is widely used in various fields such as logistics, manufacturing, warehousing, etc. At present, higher requirements are put forward for the versatility, convenience and configuration flexibility of label printing systems, and a large number of application developments also put forward requirements for lower development costs.
[0003] In the prior art, there are problems such as poor versatility of template design, high coupling between template system and business system, and difficulty in adapting to various printing equipment manufacturers, which ultimately lead to poor implementation effect and high cost of business implementation. For example, in the prior art, business data is filled in through the template system based on configuration or interface, and then a third-party label printing software is used to drive the printer to print. There is also a method of generating web tags in the template system and filling in data using placeholders.
[0004] However, the template system and business system in the above method are integrated and rely on third-party label printing software. The printing device is restricted by the third-party software. In addition, web labels have poor versatility, and the placeholder data filling method is limited and prone to errors. There are many standard printing instructions, and the label parsing in this solution does not clarify the specific conversion details of the printing instructions, which is not feasible.
[0005] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0006] The embodiments of the present invention provide a method and device for printing and processing labels, so as to at least solve the technical problems in the related art that the label template and the business system cannot be decoupled and analyzed and the versatility is poor.
[0007] According to one aspect of an embodiment of the present invention, a method for printing and processing labels is provided, comprising: acquiring basic printing data, wherein the basic printing data is characteristic data of labels of various types of products, and the characteristic data is used to describe the labels of various types of products; generating a universal label printing template for the various types of products based on the basic printing data; upon receiving a label printing instruction, acquiring a target label printing template matching a target product from the universal label printing template according to the label printing instruction, wherein the label printing instruction is an instruction generated based on the label printing requirement of the target product; generating a printing instruction set based on the target label printing template; and controlling a target printer to execute a printing job based on the printing instruction set to obtain a target label corresponding to the label printing requirement.
[0008] Optionally, when a printing instruction is received, a target label printing template matching the target product is obtained from the universal label printing template according to the label printing instruction, including: retrieving list information of an application programming interface API module; and determining the target label printing template matching the target product based on the list information.
[0009] Optionally, generating a printing instruction set based on the target label printing template includes: obtaining pre-printed label information of the target product; comparing the label information of the target product with the target label printing template to obtain a comparison result; when it is determined based on the comparison result that the target label printing template needs to be filled with data, obtaining filling data that needs to be filled in the target label printing template through the API module; filling the target label printing template with data according to the filling data to obtain the target label printing template after the data is filled; and generating the printing instruction set based on the filled target label printing template.
[0010] Optionally, generating a printing instruction set based on the target label printing template includes: parsing the target label printing template to obtain an initial printing instruction set; obtaining the printing instruction type supported by the target printer; and formatting the initial printing instruction according to the printing instruction type to obtain the corresponding printing instruction set.
[0011] Optionally, after generating the universal label printing template for each type of product based on the basic printing data, the label printing processing method further includes: storing the generated universal label printing template to a target location according to a preset format.
[0012] Optionally, after generating the universal label printing template for each type of product based on the basic printing data, the label printing processing method further includes: saving the generated label printing template in the form of schema data to a target location.
[0013] Optionally, after controlling the target printer to execute a printing job based on the printing instruction set to obtain a target label corresponding to the label printing requirement, the label printing processing method further includes: generating a printing record after determining that the target printer completes the printing job; and storing the printing record.
[0014] According to another aspect of an embodiment of the present invention, a label printing processing device is also provided, including: a first acquisition unit, used to acquire basic printing data, wherein the basic printing data is characteristic data of labels of various types of products, and the characteristic data is used to describe the labels of various types of products; a first generation unit, used to generate a universal label printing template for the various types of products based on the basic printing data; a second acquisition unit, used to, upon receiving a label printing instruction, acquire a target label printing template matching the target product from the universal label printing template according to the label printing instruction, wherein the label printing instruction is an instruction generated based on the label printing requirement of the target product; a second generation unit, used to generate a printing instruction set based on the target label printing template; a control unit, used to control the target printer to execute a printing job based on the printing instruction set to obtain a target label corresponding to the label printing requirement.
[0015] Optionally, the second acquisition unit includes: a calling module for calling list information of an application program interface API module; and a determining module for determining the target label printing template that matches the target product based on the list information.
[0016] Optionally, the second generation unit includes: a first acquisition module, used to acquire the pre-printed label information of the target product; a comparison module, used to compare the label information of the target product with the target label printing template to obtain a comparison result; a second acquisition module, used to obtain the filling data required to fill the target label printing template through the API module when it is determined based on the comparison result that the target label printing template needs to be filled with data; a filling module, used to fill the target label printing template with data according to the filling data to obtain the target label printing template after the data is filled; the second acquisition module is used to generate the printing instruction set based on the filled target label printing template.
[0017] Optionally, the second generation unit includes: a parsing module, used to parse the target label printing template to obtain an initial printing instruction set; a third acquisition module, used to obtain the printing instruction type supported by the target printer; and a conversion module, used to convert the format of the initial printing instruction according to the printing instruction type to obtain the corresponding printing instruction set.
[0018] Optionally, the label printing processing device further includes: a first storage unit, for storing the generated universal label printing template to a target location in a preset format after generating the universal label printing template for each type of product based on the basic printing data.
[0019] Optionally, the label printing processing device further includes: a second storage unit, for saving the generated label printing template in the form of schema data to a target location after generating a universal label printing template for each type of product based on the basic printing data.
[0020] Optionally, the label printing processing device also includes: a third generation unit, which is used to control the target printer to execute a printing job based on the printing instruction set to obtain a target label corresponding to the label printing requirement, and after determining that the target printer has completed the printing job, generate a printing record; a third storage unit, which is used to store the printing record.
[0021] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein the program executes any one of the above-mentioned label printing processing methods.
[0022] According to another aspect of an embodiment of the present invention, a processor is further provided, wherein the processor is used to run a program, wherein the program executes any one of the above-mentioned label printing processing methods when running.
[0023] According to another aspect of an embodiment of the present invention, a computer program product is provided, comprising computer instructions, wherein when the computer instructions are executed by a processor, any one of the above-mentioned label printing processing methods is executed.
[0024] In an embodiment of the present invention, basic printing data is obtained, wherein the basic printing data is characteristic data of labels of various types of products, and the characteristic data is used to describe labels of various types of products; a universal label printing template for various types of products is generated based on the basic printing data; when a label printing instruction is received, a target label printing template matching the target product is obtained from the universal label printing template according to the label printing instruction, wherein the label printing instruction is an instruction generated based on the label printing requirement of the target product; a printing instruction set is generated based on the target label printing template; and a target printer is controlled to execute a printing job based on the printing instruction set to obtain a target label corresponding to the label printing requirement. Through the above technical solution provided by the present invention, the purpose of generating a universal label template according to the basic printing data of various products in advance is achieved, and then when label printing is required, a label template can be directly selected from the universal label template according to the product type to be printed for label printing, thereby improving the universality of the label printing system, and also decoupling and separating the label template from the business system, improving the reusability of the label template, thereby solving the technical problem that the label template and the business system cannot be decoupled and analyzed in the related art, and the universality is poor. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0026] Figure 1 It is a hardware structure block diagram of a mobile terminal of a label printing processing method according to an embodiment of the present invention;
[0027] Figure 2 is a flowchart of a label printing method according to an embodiment of the present invention;
[0028] Figure 3 is a flow chart of an optional label printing processing method according to an embodiment of the present invention;
[0029] Figure 4 is an interaction diagram of a label printing system according to an embodiment of the present invention;
[0030] Figure 5 FIG. 4 is a schematic diagram of a label printing processing apparatus according to an embodiment of the present invention. DETAILED DESCRIPTION
[0031] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof 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 necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0033] As described in the background technology, the related art cannot decouple the label template and the business system for analysis, and the versatility is poor. In view of the above defects, a label printing processing method and device, a computer-readable storage medium, a processor and a computer program product are provided in the embodiments of the present invention.
[0034] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0035] The method embodiments provided in the embodiments of the present invention can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of a label printing processing method according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0036] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the label printing processing method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above method is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network and a combination thereof. The transmission device 106 is used to receive or send data via a network. The above-mentioned specific examples of the network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0037] According to an embodiment of the present invention, a method embodiment of a label printing processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0038] Figure 2 is a flow chart of a method for printing a label according to an embodiment of the present invention. Figure 2 As shown, the label printing method includes the following steps:
[0039] Step S202, obtaining basic printing data, wherein the basic printing data is feature data of each type of product label, and the feature data is used to describe each type of product label.
[0040] Optionally, the basic printing data may include but is not limited to: page size, page spacing, page element types (text, QR code, one-dimensional code, picture, geometric figure, original instructions, etc.), element size, element coordinates, element style (such as text font, whether italic, etc.), element default value, element order and other information.
[0041] Step S204: Generate a universal label printing template for each type of product based on the basic printing data.
[0042] Figure 3 is a flow chart of an optional label printing processing method according to an embodiment of the present invention, such as Figure 3 As shown, in this embodiment, a general label template schema (i.e., the above-mentioned general label printing template) can be defined, and the schema can be used to describe all the features of the label template, for example, the above-mentioned basic printing data, i.e., page size, page spacing, page element type (text, QR code, one-dimensional code, picture, geometric figure, original instruction, etc.), element size, element coordinates, element style (such as text font, whether it is italic, etc.), element default value, element order and other information.
[0043] The schema definition information may include: label paper description information (template name, width, height, top margin, bottom margin and label paper spacing), element information array (element unique ID, element name, element title, text layout information, font, font size, font style, default value, level, element width, element height, left coordinate value, top coordinate value and bound business attributes).
[0044] Step S206, when a label printing instruction is received, a target label printing template matching the target product is obtained from the universal label printing template according to the label printing instruction, wherein the label printing instruction is an instruction generated based on the label printing requirement of the target product.
[0045] In this embodiment, if a label printing instruction is received, a target label printing template corresponding to the target product to be labeled can be selected from the above-generated universal label printing templates based on the information contained in the label printing instruction (for example, product type).
[0046] The label printing instruction is generated according to the label printing requirement of the target product.
[0047] The above label printing requirements are what type of label printing is required for what type of product.
[0048] Step S208: Generate a printing instruction set based on the target label printing template.
[0049] In this embodiment, a printing instruction may be generated according to the label printing information included in the target label printing target to obtain a printing instruction set.
[0050] Step S210, controlling the target printer to execute the printing job based on the printing instruction set to obtain a target label corresponding to the label printing requirement.
[0051] In this embodiment, the target printer can be controlled to execute the printing job according to the above-generated printing instruction set to obtain the target label corresponding to the label printing requirement.
[0052] As can be seen from the above, in an embodiment of the present invention, basic printing data can be obtained, wherein the basic printing data is characteristic data of labels of various types of products, and the characteristic data is used to describe labels of various types of products; a universal label printing template for various types of products is generated based on the basic printing data; when a label printing instruction is received, a target label printing template matching the target product is obtained from the universal label printing template according to the label printing instruction, wherein the label printing instruction is an instruction generated based on the label printing requirement of the target product; a printing instruction set is generated based on the target label printing template; based on the printing instruction set, the target printer is controlled to execute a printing job to obtain a target label corresponding to the label printing requirement, thereby achieving the purpose of generating a universal label template according to the basic printing data of various products in advance, and then directly selecting a label template from the universal label template according to the product type that needs to be printed when label printing is required, thereby improving the versatility of the label printing system, and also decoupling and separating the label template from the business system, thereby improving the reusability of the label template.
[0053] Therefore, the above technical solution provided by the embodiment of the present invention solves the technical problem in the related art that the label template and the business system cannot be decoupled and analyzed and the versatility is poor.
[0054] According to the above embodiment of the present invention, when a printing instruction is received, a target label printing template matching the target product is obtained from the universal label printing template according to the label printing instruction, including: calling the list information of the application program interface API module; and determining the target label printing template matching the target product based on the list information.
[0055] In this embodiment, in the label printing business system, when a label needs to be printed, the template list can be queried through the API provided by the template system to select the template required for the business process.
[0056] That is, in this embodiment, the target label printing template matching the target product can be selected from the label templates by calling the API interface. Figure 3 As shown, the business system can obtain the schema data corresponding to the template through the API and fill it with business data.
[0057] According to the above-mentioned embodiment of the present invention, generating a printing instruction set based on a target label printing template may include: obtaining label information of a pre-printed target product; comparing the label information of the target product with the target label printing template to obtain a comparison result; in a case where it is determined based on the comparison result that the target label printing template needs to be filled with data, obtaining the filling data that needs to be filled in the target label printing template through an API module; filling the target label printing template with data according to the filling data to obtain the target label printing template after the data is filled; and generating a printing instruction set based on the filled target label printing template.
[0058] In this embodiment, the label information of the target product to be printed can be obtained first, and the label information can be compared with the target label printing template. When it is determined that the target label printing module needs to be filled, the filling data required to fill the target label printing template can be obtained through the API module, and then the target label printing target can be filled with data according to the filling data to obtain a complete target label printing target corresponding to the label printing requirements.
[0059] For example, in a business system, the schema is implemented as a specific data object using the programming language used by the business system. The object exposes the read and write operation APIs for each attribute. Use the API to fill the template data with business data. If the element sets bindAttr (the attribute is a bound business attribute), the business data corresponding to the field needs to be used to replace the original content.
[0060] According to the above embodiment of the present invention, a printing instruction set is generated based on a target label printing template, including: parsing the target label printing template to obtain an initial printing instruction set; obtaining the printing instruction type supported by the target printer; and formatting the initial printing instruction according to the printing instruction type to obtain the corresponding printing instruction set.
[0061] In this embodiment, the business system can connect to the target printing device to obtain a list of instruction types supported by the target printing device, or obtain the list through business system configuration and select a specific instruction type (such as selecting CPCL).
[0062] like Figure 3 As shown, the business system can obtain the instruction set types that the printer can support through the API interface.
[0063] For example, the label template schema data filled with business data is parsed and converted into printing instructions according to the required printing instruction type. Different parsing conversions are required here according to different printing instruction types, because standard instruction sets such as ESC / POS, CPCL, TSPL, and ZPL have different descriptions of the same printing behavior.
[0064] The specific printing instruction conversion process can be explained by taking the TSPL instruction as an example:
[0065] 1) Parse the pageData in the schema to obtain the page layout information. Convert it to TSPL instructions:
[0066] SIZE 560dot,600dot;
[0067] GAP 16dot.
[0068] 2) Parse the tag element TextItem and convert it into TSPL instructions:
[0069] TEXT 50,25,"Bold",0,1,1,"Sheet Metal Receipt Ticket (HSF)".
[0070] 3) Parse the tag element LineItem. Convert it into TSPL instructions:
[0071] BAR 0,146,560,3.
[0072] 4) Parse the label element BarcodeItem. Convert it into TSPL instructions:
[0073] BARCODE 76,81,"128",45,0,0,1,1,"0123456789";
[0074] 5) Parse the tag element QRcodeItem. Convert it into TSPL instructions:
[0075] QRCODE 400,14,L,4,M,0,M1,S1,"0123456789".
[0076] 6) Then add the print instructions, and finally get the complete instruction set:
[0077] SIZE 560dot,600dot;
[0078] GAP 16dot;
[0079] TEXT 50,25,"Bold",0,1,1,"Sheet Metal Sourcing Ticket (HSF)";
[0080] BAR 0,146,560,3;
[0081] BARCODE 76,81,"128",45,0,0,1,1,"0123456789";
[0082] QRCODE 400,14,L,4,M,0,M1,S1,"0123456789";
[0083] PRINT 1,1.
[0084] According to the above embodiment of the present invention, after generating universal label printing templates for various types of products based on basic printing data, the label printing processing method further includes: storing the generated universal label printing templates to a target location according to a preset format.
[0085] In this embodiment, the label template design work is completed in this label printing system and saved as standard schema data, and an interface is provided externally for querying template query details.
[0086] That is, in the label template management system, design the label template (including setting the page width, height, blank space and other information, adding elements required for the label such as barcodes, setting the element width and height, coordinates, text information, content value, etc.), and save the template according to the schema standard. It can be saved as a json string or standard relational database data.
[0087] According to the above embodiment of the present invention, after generating a universal label printing template for each type of product based on basic printing data, the label printing processing method further includes: saving the generated label printing template in the form of schema data to a target location.
[0088] In this embodiment, if Figure 3 As shown, template design can be performed in the target design system and saved as schema data.
[0089] According to the above embodiment of the present invention, after controlling the target printer to execute a printing job based on a printing instruction set to obtain a target label corresponding to the label printing requirement, the label printing processing method also includes: generating a printing record after determining that the target printer has completed the printing job; and storing the printing record.
[0090] In this embodiment, after the target printer completes the printing task, a printing record is generated, and then the printing record is stored to facilitate the recording and tracing of subsequent printing jobs of the target printer.
[0091] In addition, in the embodiment of the present invention, printing auxiliary information, such as the number of copies and counters, can also be filled in to obtain a complete label printing instruction set, such as (PRINT 1, 1); the business system converts the obtained printing instruction set into byte binary data and sends it to the mobile printing device. After receiving the command, the printing device executes the printing action and prints out a complete physical label. Finally, the business system records the printing records and key data when printing the label to help the business system realize the review of printing behavior and other gain-making things in the business system.
[0092] Figure 4 is an interaction diagram of a label printing system according to an embodiment of the present invention, such as Figure 4 As shown, the user can send a label printing instruction through a computer (e.g., PC); then, the computer can send the label printing instruction to the template system, and the template system will call the template system database to obtain the target label printing template; in addition, the user can also send a label printing instruction to the template system through a mobile terminal, and then call the template system data through the template system to obtain the target label printing template. Then, the printing instruction set corresponding to the target label template is sent to the wireless printer to execute the printing job. Among them, Figure 4 As shown, the mobile terminal can be connected to the business system for communication so as to retrieve the target label printing template from the business system database through the business system.
[0093] As can be seen from the above, in the embodiment of the present invention, the system is divided into a label template management system, a business system, and a mobile printing device. The label template management system includes: template design, template management, version control and other modules.
[0094] Label template design is completed in this system and saved as standard schema data, providing an interface for querying templates and querying template details. The business system includes modules such as specific business operations, label template query, business data filling, instruction parsing, and printing device connection management. Mobile printing devices include wireless wifi printers and Bluetooth printers.
[0095] Therefore, through the technical solution provided by the embodiment of the present invention, the label template is defined and described by standardizing the schema, and the label template is described as reusable, modifiable and portable standard data, which realizes the free design, storage and sharing of the label template, and decouples the template system from the business system. The same set of template data defined by the schema is used between the label design system and the business system, which reduces the integration cost and difficulty between the two systems. The business system is responsible for filling the business data of the label and converting it into a standard printing instruction set, and then sending it to the printer for printing via Bluetooth or wireless network connection, so that the label template is filled with business data, and the schema data can be modified arbitrarily. The general label schema can be parsed into different printer instruction sets, such as ESC / POS, CPCL, TSPL, ZPL and other standard instruction sets, without relying on third-party software or manufacturer SDK. This solution does not rely on third-party software or the development SDK provided by various printer manufacturers, and can seamlessly connect to printers of various types from various manufacturers, greatly reducing the adaptation and use costs of the printer, as well as the system development costs. At the same time, the following problems are solved: 1) It is impossible to decouple the label template system and the business system; 2) The traditional solution relies on third-party software and printer manufacturer SDK to parse printing instructions, which limits the ability to adapt to printers.
[0096] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0097] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0098] According to an embodiment of the present invention, there is also provided a label printing and processing device for implementing the label printing and processing method. Figure 5Schematic diagram of a label printing and processing device according to an embodiment of the present invention. Figure 5 As shown, the label printing processing device includes: a first acquisition unit 501, a first generation unit 503, a second acquisition unit 505, a second generation unit 507 and a control unit 509. The label printing processing device is described below.
[0099] The first acquisition unit 501 is used to acquire basic printing data, wherein the basic printing data is feature data of each type of product label, and the feature data is used to describe each type of product label.
[0100] The first generating unit 503 is used to generate a universal label printing template for each type of product based on the basic printing data.
[0101] The second acquisition unit 505 is used to acquire a target label printing template matching the target product from the universal label printing template according to the label printing instruction when a label printing instruction is received, wherein the label printing instruction is an instruction generated based on the label printing requirement of the target product.
[0102] The second generating unit 507 is used to generate a printing instruction set based on the target label printing template.
[0103] The control unit 509 is used to control the target printer to execute the printing job based on the printing instruction set to obtain the target label corresponding to the label printing requirement.
[0104] It should be noted here that the above-mentioned first acquisition unit 501, first generation unit 503, second acquisition unit 505, second generation unit 507 and control unit 509 correspond to steps S202 to S208 in the above-mentioned embodiments, and the four units are the same as the instances and application scenarios implemented by the corresponding steps, but are not limited to the contents disclosed in the above-mentioned embodiments.
[0105] As can be seen from the above, in the scheme recorded in the above-mentioned embodiment of the present invention, the first acquisition unit can be used to acquire basic printing data, wherein the basic printing data is the characteristic data of each type of product label, and the characteristic data is used to describe each type of product label; the first generation unit is used to generate a universal label printing template for each type of product based on the basic printing data; the second acquisition unit is used to acquire a target label printing template matching the target product from the universal label printing template according to the label printing instruction when receiving the label printing instruction, wherein the label printing instruction is an instruction generated based on the label printing requirement of the target product; the second generation unit is used to generate a printing instruction set based on the target label printing template; the control unit is used to control the target printer to execute the printing job based on the printing instruction set to obtain the target label corresponding to the label printing requirement, thereby achieving the purpose of generating a universal label template according to the basic printing data of each type of product in advance, and then when label printing is required, the label template can be directly selected from the universal label template according to the product type that needs to be printed, thereby improving the versatility of the label printing system, and also decoupling and separating the label template from the business system, thereby improving the reusability of the label template.
[0106] Therefore, the above technical solution provided by the embodiment of the present invention solves the technical problem in the related art that the label template and the business system cannot be decoupled and analyzed and the versatility is poor.
[0107] Optionally, the second acquisition unit includes: a calling module for calling the list information of the application program interface API module; and a determining module for determining the target label printing template matching the target product based on the list information.
[0108] Optionally, the second generation unit includes: a first acquisition module, used to acquire label information of a pre-printed target product; a comparison module, used to compare the label information of the target product with the target label printing template to obtain a comparison result; a second acquisition module, used to acquire filling data required to be filled in the target label printing template through an API module when it is determined based on the comparison result that the target label printing template needs to be filled with data; a filling module, used to fill the target label printing template with data according to the filling data to obtain the target label printing template after the data is filled; the second acquisition module, used to generate a printing instruction set based on the filled target label printing template.
[0109] Optionally, the second generation unit includes: a parsing module, used to parse the target label printing template to obtain an initial printing instruction set; a third acquisition module, used to obtain the printing instruction type supported by the target printer; and a conversion module, used to convert the format of the initial printing instruction according to the printing instruction type to obtain the corresponding printing instruction set.
[0110] Optionally, the label printing processing device further includes: a first storage unit, which is used to store the generated universal label printing template to a target location in a preset format after generating the universal label printing template for each type of product based on the basic printing data.
[0111] Optionally, the label printing processing device further includes: a second storage unit, which is used to save the generated label printing template in the form of schema data to a target location after generating a universal label printing template for each type of product based on the basic printing data.
[0112] Optionally, the label printing processing device also includes: a third generation unit, which is used to control the target printer to execute the printing job based on the printing instruction set to obtain the target label corresponding to the label printing requirement, and generate a printing record after determining that the target printer has completed the printing job; a third storage unit, which is used to store the printing record.
[0113] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium comprising a stored program, wherein the program executes any one of the above-mentioned label printing processing methods.
[0114] According to another aspect of an embodiment of the present invention, a processor is further provided, and the processor is used to run a program, wherein when the program is run, any one of the above-mentioned label printing processing methods is executed.
[0115] According to another aspect of an embodiment of the present invention, there is further provided a computer program product, comprising computer instructions, wherein when the computer instructions are executed by a processor, any one of the above-mentioned label printing processing methods is executed.
[0116] Optionally, in this embodiment, the computer-readable storage medium may be located in any one of the computer terminals in a computer terminal group in a computer network, or in any one of the communication devices in a communication device group.
[0117] Optionally, in this embodiment, a computer-readable storage medium is configured to store program code for performing the following steps: obtaining basic printing data, wherein the basic printing data is characteristic data of each type of product label, and the characteristic data is used to describe each type of product label; generating a universal label printing template for each type of product based on the basic printing data; upon receiving a label printing instruction, obtaining a target label printing template that matches the target product from the universal label printing template according to the label printing instruction, wherein the label printing instruction is an instruction generated based on the label printing requirement of the target product; generating a printing instruction set based on the target label printing template; and controlling the target printer to execute a printing job based on the printing instruction set to obtain a target label corresponding to the label printing requirement.
[0118] Optionally, in this embodiment, the computer-readable storage medium is configured to store program codes for executing the following steps: retrieving list information of an application program interface API module; and determining a target label printing template that matches the target product based on the list information.
[0119] Optionally, in this embodiment, the computer-readable storage medium is configured to store program codes for executing the following steps: obtaining pre-printed label information of a target product; comparing the label information of the target product with a target label printing template to obtain a comparison result; in a case where it is determined based on the comparison result that the target label printing template needs to be filled with data, obtaining the filling data that needs to be filled in the target label printing template through an API module; filling the target label printing template with data according to the filling data to obtain a target label printing template after the data is filled; and generating a printing instruction set based on the filled target label printing template.
[0120] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for executing the following steps: parsing the target label printing template to obtain an initial printing instruction set; obtaining the printing instruction types supported by the target printer; and formatting the initial printing instructions according to the printing instruction type to obtain the corresponding printing instruction set.
[0121] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for executing the following steps: after generating a universal label printing template for each type of product based on basic printing data, storing the generated universal label printing template to a target location in a preset format.
[0122] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for executing the following steps: after generating a universal label printing template for each type of product based on basic printing data, saving the generated label printing template to a target location in the form of schema data.
[0123] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: after controlling the target printer to execute a print job based on a print instruction set to obtain a target label corresponding to the label printing requirement, after determining that the target printer has completed the print job, generating a print record; and storing the print record.
[0124] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0125] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0126] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0127] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0128] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0129] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0130] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A label printing method, characterized in that: include: Acquire basic printing data, wherein the basic printing data is characteristic data of each type of product label, and the characteristic data is used to describe each type of product label; Generate a universal label printing template for each type of product based on the basic printing data; When a label printing instruction is received, a target label printing template matching the target product is obtained from the universal label printing template according to the label printing instruction, wherein the label printing instruction is an instruction generated based on the label printing requirement of the target product; Generate a printing instruction set based on the target label printing template; Based on the printing instruction set, the target printer is controlled to execute a printing job to obtain a target label corresponding to the label printing requirement.
2. The label printing method according to claim 1, characterized in that: When a printing instruction is received, a target label printing template matching the target product is obtained from the universal label printing template according to the label printing instruction, including: Retrieve the list information of the application program interface API module; The target label printing template matching the target product is determined based on the list information.
3. The label printing method according to claim 2, characterized in that: Generating a printing instruction set based on the target label printing template includes: Obtaining pre-printed label information of the target product; Comparing the label information of the target product with the target label printing template to obtain a comparison result; In the case where it is determined based on the comparison result that the target label printing template needs to be filled with data, the filling data required to be filled in the target label printing template is obtained through the API module; Filling the target label printing template with data according to the filling data to obtain the target label printing template after the data is filled; The printing instruction set is generated based on the filled target label printing template.
4. The label printing method according to claim 1, characterized in that: Generating a printing instruction set based on the target label printing template includes: Parsing the target label printing template to obtain an initial printing instruction set; Obtain the printing instruction types supported by the target printer; The initial printing instruction is formatted according to the printing instruction type to obtain a corresponding printing instruction set.
5. The label printing method according to any one of claims 1 to 3, characterized in that: After generating the universal label printing template for each type of product based on the basic printing data, the method further includes: The generated universal label printing template is stored in a target location according to a preset format.
6. The label printing method according to claim 1, characterized in that: After generating the universal label printing template for each type of product based on the basic printing data, the method further includes: The generated label printing template is saved to the target location in the form of schema data.
7. The label printing method according to claim 1, characterized in that: After controlling the target printer to execute the printing job based on the printing instruction set to obtain the target label corresponding to the label printing requirement, the method further includes: After determining that the target printer completes the printing job, generating a printing record; The printing record is stored.
8. A label printing and processing device, characterized in that: include: A first acquisition unit, configured to acquire basic printing data, wherein the basic printing data is feature data of various types of product labels, and the feature data is used to describe the various types of product labels; A first generating unit, configured to generate a universal label printing template for each type of product based on the basic printing data; A second acquisition unit is used to acquire a target label printing template matching the target product from the universal label printing template according to the label printing instruction when a label printing instruction is received, wherein the label printing instruction is an instruction generated based on the label printing requirement of the target product; A second generating unit, configured to generate a printing instruction set based on the target label printing template; A control unit is used to control the target printer to execute a printing job based on the printing instruction set to obtain a target label corresponding to the label printing requirement.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the label printing processing method according to any one of claims 1 to 7.
10. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the label printing processing method according to any one of claims 1 to 7 is performed.
Citation Information
Cited By
Heterogeneous instruction dynamic adaptation remote label printing method and system, terminal and medium
CN120215853A
Printing method and device, printing equipment, readable storage medium and program product
CN120762609A
