A label printing method, device, terminal equipment and storage medium
By using preset label templates and property configuration and content filling of View controls in label printing technology, the problem of low label printing efficiency is solved, meeting the diverse needs of users and improving label printing efficiency.
Patent Information
- Application Number
- CN202111215915.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-19
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2041-10-19
AI Technical Summary
Existing label printing technology is inefficient and cannot effectively meet users' diverse needs for label forms.
Obtain product data through the View control in the preset label template, generate target labels, configure attributes and fill content in the label template according to the user's operating instructions and adjustment instructions, and finally print at the preset size.
It improves the efficiency of label printing, meets users' diverse needs for label forms, speeds up product data acquisition, and generates target labels required by users.
Smart Images

Figure CN113849140B
Abstract
Description
Technical Field
[0001] The present application belongs to the field of label printing technology, and in particular, relates to a label printing method, apparatus, terminal device and storage medium. Background Art
[0002] With the rapid development of Internet technology, more and more businesses need to print product labels. The existing label printing is to align the information in the label left and right or arrange it linearly from top to bottom before printing. However, due to the wide variety of user requirements for label formats, the existing label printing cannot meet user needs well. If it is readjusted during printing according to user needs, the efficiency of label printing will be low. Summary of the invention
[0003] The embodiments of the present application provide a label printing method, apparatus, terminal device and storage medium, which can solve the problem of low efficiency in label printing.
[0004] In a first aspect, an embodiment of the present application provides a label printing method, comprising:
[0005] Get product data based on each View control in the preset label template;
[0006] Fill the above View controls with content according to the above commodity data to generate target labels;
[0007] Print the above target labels in the preset size.
[0008] In one embodiment, before obtaining commodity data according to each View control in a preset label template, the following steps are included:
[0009] Obtain operation instructions, and generate a View control containing element types according to the above operation instructions;
[0010] Configure the properties of the above View control, and determine the label template according to the configured View control.
[0011] In one embodiment, the above-mentioned property configuration of the View control includes:
[0012] When there are at least two View controls whose properties are consistent, if there is a View control that has been configured among the at least two View controls, the properties of the View control that has been configured are copied to an unconfigured View control among the at least two View controls for configuration.
[0013] In one embodiment, after determining the label template according to the configured View control, the following steps are included:
[0014] Obtaining an adjustment instruction, and adjusting the properties of the target control corresponding to the adjustment instruction according to the adjustment instruction;
[0015] When the properties of the target control are adjusted, the label template is refreshed.
[0016] In one embodiment, filling each of the View controls with content according to the commodity data includes:
[0017] When the element type of the View control is a barcode type, obtaining the barcode character string in the commodity data, and filling the barcode character string into the first child control of the View control of the barcode type;
[0018] Generate barcode pixels according to the barcode character string, generate a barcode bitmap according to the barcode pixels, and fill the barcode bitmap into the second subcontrol of the barcode type View control.
[0019] In one embodiment, filling each of the View controls with content according to the commodity data includes:
[0020] When the element type of the View control is a QR code type, the QR code string in the commodity data is obtained, and QR code pixels are generated according to the QR code string;
[0021] Generate a QR code bitmap according to the QR code pixels, and fill the QR code bitmap into the View control of the QR code type.
[0022] In one embodiment, filling each of the View controls with content according to the commodity data includes:
[0023] When the element type of the View control is a text type, the text information of the product is obtained according to the QR code string;
[0024] Fill the above text information into the View control of the above text type.
[0025] In a second aspect, an embodiment of the present application provides a label printing device, comprising:
[0026] The acquisition module is used to obtain product data according to each View control in the preset label template;
[0027] A filling module is used to fill the contents of each of the above View controls according to the above commodity data and generate a target label;
[0028] The printing module is used to print the target label in a preset size.
[0029] In a third aspect, an embodiment of the present application provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the above-mentioned label printing methods when executing the computer program.
[0030] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned label printing methods are implemented.
[0031] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device executes any one of the label printing methods in the first aspect.
[0032] In the embodiment of the present application, product data is obtained according to each View control in a preset label template, so that the corresponding needs of the user are met by setting the View control, and the product data required by the user to print the label is obtained according to the preset label template, which can speed up the acquisition of product data when printing labels, and fill the content of each View control according to the product data to generate the target label required by the user, and print the target label in a preset size, thereby improving the label printing efficiency on the basis of meeting the user's needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0034] Figure 1 This is a first flow chart of the label printing method provided in the embodiment of the present application;
[0035] Figure 2 This is a label display effect diagram provided by an embodiment of the present application;
[0036] Figure 3 This is a second flow chart of the label printing method provided in the embodiment of the present application;
[0037] Figure 4 This is a third flow chart of the label printing method provided in the embodiment of the present application;
[0038] Figure 5It is a structural schematic diagram of a label printing device provided in an embodiment of the present application;
[0039] Figure 6 It is a schematic diagram of the structure of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0040] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0041] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0042] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0043] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0044] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0045] Figure 1 FIG. 1 is a flow chart of a label printing method in an embodiment of the present application. The execution subject of the method may be a terminal device, such as Figure 1 As shown, the above label printing method may include the following steps:
[0046] Step S101: Acquire product data according to each View control in a preset label template.
[0047] In this embodiment, when the terminal device prints a label, it can directly obtain the product data required for printing according to each View control in the label template that has been pre-stored in the terminal device, without obtaining product data in the product that is not related to printing, thereby speeding up the acquisition of product data. Among them, the above-mentioned label template is a template constructed by the official Android control group (View Group), and the template contains at least one View control, which is a view control. The above-mentioned View is the base class of all UI components and can be customized by the user, and the above-mentioned View Group is a container for accommodating View, and View Group is also derived from View. The above-mentioned labels can be applied to various products to display product information, such as labels set on cups, and can also include price tags placed on shelves.
[0048] It is understandable that because users' requirements for label formats vary greatly, in this embodiment, various View controls are set in a preset label template to meet user needs, thereby facilitating users to issue corresponding instructions through the display panel of a terminal device or a host computer, so that the label template generates corresponding View controls according to the instructions that express user needs, or makes corresponding changes to a certain View control.
[0049] By way of specific example and not limitation, when it is detected that the content to be displayed by the View control in the above label template is "product name", the product name corresponding to the product is obtained and set in the corresponding position of the View control, and the corresponding position is determined by the properties of the View control.
[0050] In one embodiment, before step S101, the following may be included: the terminal device obtains an operation instruction generated by a user operating on a display of the terminal device or a display panel of a host computer, and generates a View control including an element type according to the operation instruction. The element type includes, but is not limited to, a text type, a barcode type, and a QR code type. View controls of different element types display different contents when printing labels. For example, a View control of a text type displays text contents, such as Figure 2 As shown, Figure 2The text content in the includes the product name, product barcode, product abbreviation and the barcode string "0123456789123". Then configure the properties of the above View control, which include but are not limited to color, size, style, placement, etc. Through the property configuration, the display content of the View control is further adjusted to further meet user needs, and finally the label template is determined according to the configured View control. Among them, the above label template includes at least one View control, and the above at least one View control can be at least one of a text type, a barcode type, and a QR code type.
[0051] Optionally, the terminal device may preset configuration instructions, and when the product meets the preset product type, the properties of each View control are configured according to the configuration instructions corresponding to the preset product type, thereby configuring the color, size, style, placement and other parameters of the View control at the same time.
[0052] By way of specific example and not limitation, if the current product is banana, the configuration instruction corresponding to the fruit type is selected to perform attribute configuration on each View control in the label template of banana.
[0053] In one embodiment, when View controls of text type, barcode type, and QR code type all exist in the label template, at least one of them can be determined to be displayed according to the user's display instruction, so that the flexibility of the label template can be improved through different forms of display, and the labeling requirements of users when dealing with some special products can be met. For example, when the View control is a barcode type View control, the barcode type View control will include a graphic sub-control and a text sub-control, that is, the graphic sub-control displays the bitmap of the barcode, and the text sub-control displays the string of the barcode. The terminal device can call the setVisible method of the View control according to the user's display instruction to set at least one sub-control in the barcode type View control to be visible or invisible.
[0054] Optionally, when a View control including an element type is generated according to an operation instruction, display content that a user wants to display in the View control may be generated in the View control according to the operation instruction.
[0055] In one embodiment, the above-mentioned property configuration of the above-mentioned View control may include: when the terminal device detects that there are at least two View controls with consistent properties, if there is a configured View control among the at least two View controls, the properties of the configured View control can be copied to the unconfigured View control among the at least two View controls through the addView method for configuration, so as to reduce the number of times the user performs the same operation and improve the efficiency of template generation.
[0056] In one embodiment, when a user is dissatisfied with the display effect of a certain View control in a template, after determining a label template according to the configured View control, the terminal device can obtain an adjustment instruction issued by the user, and adjust the properties of the target control corresponding to the adjustment instruction according to the obtained adjustment instruction, so that the adjusted display effect of the target control that the user is dissatisfied with meets the user's needs. When the properties of the target control are adjusted according to the adjustment instruction, the target control redraws the content according to the adjusted properties, and the terminal device refreshes the label template by calling the invalidate function, so that the refreshed label template meets the user's needs. The adjustment instructions include but are not limited to adjusting the name of the View control, adjusting the font size of the View control, adjusting the font color of the View control, adjusting the font style of the View control, adjusting the field name of the View control, adjusting the bitmap size and position of the View control, deleting or adding certain content in the View control, etc.
[0057] As a specific example but not limitation, when the target control is a text-type View control, if the adjustment instruction is to adjust the name of the View control, the name of the View control can be adjusted according to a preset field list, which includes but is not limited to product barcode, product code, product name, product abbreviation, etc. If the adjustment instruction is to adjust the font size or style of the View control, the font size, font effect (style), etc. of the text content displayed by the View control can be adjusted according to the preset attribute basic settings.
[0058] As a specific example but not limitation, when the target control is of barcode type, if the adjustment instruction is to adjust the field name of the View control, the field name of the View control can be adjusted according to the preset field list. If the adjustment instruction is to adjust the size or style of the View control, the font size or style of the barcode string displayed by the View control can be adjusted according to the preset attribute basic settings. If the adjustment instruction is to adjust the bitmap size and position of the View control, the size and position of the bitmap displayed by the View control can be adjusted according to the preset operation mode, which includes but is not limited to the operation mode corresponding to zooming in or out of the bitmap, and the operation mode corresponding to moving the bitmap.
[0059] As a specific example but not limitation, when the target control is a QR code type, if the adjustment instruction is to adjust the field name of the View control, the field name of the View control can be adjusted according to the preset field list. If the adjustment instruction is to adjust the bitmap size and position of the View control, the size and position of the bitmap displayed by the View control can be adjusted according to the preset operation mode, which includes but is not limited to the operation mode corresponding to zooming in or out the bitmap, and the operation mode corresponding to moving the bitmap.
[0060] Optionally, after detecting the adjustment instruction, the terminal device may obtain the corresponding adjustment information in the adjustment instruction, the adjustment information including the adjusted attribute and the adjustment direction corresponding to the attribute, and then obtain the type of View control and the type of commodity. When the terminal device detects that the same adjustment attribute and the adjustment direction corresponding to the attribute for the same type of View control under the same commodity type are adjusted more than a preset number threshold, if the terminal device detects the same type of View control under the same commodity type again, the View control is configured according to the adjustment attribute and the adjustment direction corresponding to the attribute. For example, under the fruit type commodity, the adjustment attribute of the text type View control is the font size, and the adjustment direction is to adjust to size 4 font. After the same adjustment number is greater than the preset number threshold, if the terminal device detects that the View control under the banana type is a text type, the font size in the View control is configured to size 4 font.
[0061] Optionally, the terminal device can use the ViewDragHelper tool class in the Android system to create a callback function (Callback) interface instance of the ViewDragHelper in the View control, and perform mutual association to move the View control to the target position in the label template.
[0062] Optionally, the terminal device may use a custom animation function in the Android system to rotate the View control in accordance with user requirements.
[0063] Step S102: Fill the contents of each View control according to the commodity data to generate a target tag.
[0064] In this embodiment, the terminal device fills the corresponding position of each View control with content according to the acquired commodity data, thereby generating a target label that meets the user's needs.
[0065] In one embodiment, Figure 2 As shown, the above step S102 may include:
[0066] Step S201: When the element type of the View control is a barcode type, obtain the barcode string in the commodity data, and fill the barcode string into the first sub-control of the View control of the barcode type.
[0067] Step S202: Generate barcode pixels according to the barcode character string, generate a barcode bitmap according to the barcode pixels, and fill the barcode bitmap into the second subcontrol of the barcode type View control.
[0068] It can be understood that the barcode type View control includes a graphic sub-control (ImageView) and a text sub-control (TextView), wherein the graphic sub-control displays the bitmap of the barcode, and the text sub-control displays the string of the barcode. According to the different display contents of different sub-controls in the barcode type View control, the commodity data required for the corresponding sub-control to display is obtained respectively, that is, the barcode string in the commodity data is filled into the first sub-control of the above-mentioned barcode type View control, which is the above-mentioned text sub-control, and the barcode bitmap is filled into the second sub-control of the above-mentioned barcode type View control, which is the above-mentioned graphic sub-control. Before the bitmap is filled, the terminal device can use the Google Zxing library to draw the barcode pixels according to the barcode string, and create a barcode bitmap (Bitmap) through the barcode pixels.
[0069] In one embodiment, Figure 3 As shown, the above step S102 may include:
[0070] Step S301: When the element type of the View control is a QR code type, the QR code string in the product data is obtained, and QR code pixels are generated according to the QR code string.
[0071] Step S302: Generate a two-dimensional code bitmap according to the two-dimensional code pixels, and fill the two-dimensional code bitmap into the View control of the two-dimensional code type.
[0072] It can be understood that the above-mentioned QR code type View control is a graphic control (ImageView), which displays the bitmap of the QR code, and obtains the product data required for the corresponding sub-control to display according to the QR code type View control. That is, the terminal device can use the Google Zxing library to draw the QR code pixels according to the QR code string in the product data, and create a QR code bitmap (Bitmap) through the QR code pixels, and fill the QR code bitmap into the above-mentioned QR code type View control.
[0073] In one embodiment, since some text information of a product, such as the product name, can be obtained based on a character string, the product data can be obtained based on a barcode character string or a QR code character transmission. Specifically, when filling the content of each of the above-mentioned View controls according to the above-mentioned product data, it can include: when the element type of the above-mentioned View control is a text type, obtaining the text information of the above-mentioned product according to the above-mentioned QR code character string, and filling the above-mentioned text information into the above-mentioned text type View control, which is a text control (TextView).
[0074] Optionally, if part of the information in the text information of the product cannot be obtained from the character string, the product may be tested, or part of the information of the product that cannot be obtained from the character string may be obtained.
[0075] Step S103: Print the target label in a preset size.
[0076] In this embodiment, the terminal device can obtain the size of the actual printed label through a preset size conversion algorithm based on the template size of the target label when it is not printed, and the size is the preset size, and then print the target label with the preset size. The above size includes the length and width of the label.
[0077] In the embodiment of the present application, product data is obtained according to each View control in a preset label template, so that the corresponding needs of the user are met by setting the View control, and the product data required by the user to print the label is obtained according to the preset label template, which can speed up the acquisition of product data when printing labels, and fill the content of each View control according to the product data to generate the target label required by the user, and print the target label in a preset size, thereby improving the label printing efficiency on the basis of meeting the user's needs.
[0078] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0079] Corresponding to a label printing method described above, Figure 5 FIG. 1 is a schematic diagram of the structure of a label printing device in an embodiment of the present application. Figure 5 As shown, the label printing device may include:
[0080] The acquisition module 501 is used to acquire commodity data according to each View control in a preset label template.
[0081] The filling module 502 is used to fill the content of each of the above View controls according to the above commodity data to generate a target label.
[0082] The printing module 503 is used to print the target label in a preset size.
[0083] In one embodiment, the label printing device may further include:
[0084] The control generation module is used to obtain operation instructions and generate a View control containing element types according to the above operation instructions.
[0085] The property configuration module is used to configure the properties of the above View control and determine the label template according to the configured View control.
[0086] In one embodiment, the above-mentioned attribute configuration module may include:
[0087] The property copying unit is used for, when there are at least two View controls with consistent properties, if there is a View control that has been configured among the at least two View controls, copying the properties of the View control that has been configured to an unconfigured View control among the at least two View controls for configuration.
[0088] In one embodiment, the label printing device may further include:
[0089] The property adjustment module is used to obtain an adjustment instruction and adjust the property of the target control corresponding to the adjustment instruction according to the adjustment instruction.
[0090] The template refresh module is used to refresh the label template after the property adjustment of the target control is completed.
[0091] In one embodiment, the filling module 502 may include:
[0092] The string filling unit is used to obtain the barcode string in the above-mentioned commodity data when the element type of the above-mentioned View control is the barcode type, and fill the above-mentioned barcode string into the first sub-control of the above-mentioned barcode type View control.
[0093] The pixel generation unit is used to generate barcode pixels according to the barcode character string, generate a barcode bitmap according to the barcode pixels, and fill the barcode bitmap into the second subcontrol of the barcode type View control.
[0094] In one embodiment, the filling module 502 may further include:
[0095] The string acquisition unit is used to acquire the QR code string in the above-mentioned commodity data when the element type of the above-mentioned View control is a QR code type, and generate QR code pixels according to the above-mentioned QR code string.
[0096] The bitmap generation unit is used to generate a two-dimensional code bitmap according to the two-dimensional code pixels, and fill the two-dimensional code bitmap into the View control of the two-dimensional code type.
[0097] In one embodiment, the filling module 502 may further include:
[0098] The information acquisition unit is used to acquire the text information of the above-mentioned product according to the above-mentioned QR code character string when the element type of the above-mentioned View control is a text type.
[0099] The information filling unit is used to fill the above text information into the View control of the above text type.
[0100] In the embodiment of the present application, product data is obtained according to each View control in a preset label template, so that the corresponding needs of the user are met by setting the View control, and the product data required by the user to print the label is obtained according to the preset label template, which can speed up the acquisition of product data when printing labels, and fill the content of each View control according to the product data to generate the target label required by the user, and print the target label in a preset size, thereby improving the label printing efficiency on the basis of meeting the user's needs.
[0101] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned system embodiments and method embodiments, and will not be repeated here.
[0102] Figure 6 This is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0103] like Figure 6 As shown, the terminal device 6 of this embodiment includes: at least one processor 600 ( Figure 6 Only one is shown in the figure), a memory 601 connected to the processor 600, and a computer program 602 stored in the memory 601 and executable on the at least one processor 600, such as a label printing program. When the processor 600 executes the computer program 602, the steps in the above-mentioned label printing method embodiments are implemented, such as Figure 1Alternatively, when the processor 600 executes the computer program 602, the functions of the modules in the above-mentioned device embodiments are realized, for example, Figure 5 Functions of modules 501 to 503 are shown.
[0104] Exemplarily, the computer program 602 may be divided into one or more modules, which are stored in the memory 601 and executed by the processor 600 to complete the present application. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 602 in the terminal device 6. For example, the computer program 602 may be divided into an acquisition module 501, a filling module 502, and a printing module 503, and the specific functions of each module are as follows:
[0105] The acquisition module 501 is used to acquire product data according to each View control in the preset label template;
[0106] A filling module 502 is used to fill the content of each View control according to the commodity data to generate a target label;
[0107] The printing module 503 is used to print the target label in a preset size.
[0108] The terminal device 6 may include, but is not limited to, a processor 600 and a memory 601. Those skilled in the art will appreciate that Figure 6 It is only an example of the terminal device 6 and does not constitute a limitation on the terminal device 6. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, buses, etc.
[0109] The processor 600 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0110] In some embodiments, the memory 601 may be an internal storage unit of the terminal device 6, such as a hard disk or memory of the terminal device 6. In other embodiments, the memory 601 may also be an external storage device of the terminal device 6, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 6. Further, the memory 601 may also include both an internal storage unit and an external storage device of the terminal device 6. The memory 601 is used to store an operating system, an application program, a boot loader, data, and other programs, such as the program code of the computer program. The memory 601 may also be used to temporarily store data that has been output or is to be output.
[0111] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the above-mentioned device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0112] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0113] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0114] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the above modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0115] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0116] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0117] If the above-mentioned 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 present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The above-mentioned computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the above-mentioned computer program includes computer program code, and the above-mentioned computer program code can be in source code form, object code form, executable file or some intermediate form. The above-mentioned computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0118] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A label printing method, characterized in that: include: Get product data based on each View control in the preset label template; Fill each View control with content according to the product data to generate a target label; Printing the target label in a preset size; Before obtaining product data according to each View control in the preset label template, it includes: Obtaining an operation instruction, and generating a View control containing an element type according to the operation instruction; Performing attribute configuration on the View control, and determining a label template according to the configured View control; After determining the label template based on the configured View control, include: Acquire an adjustment instruction, and adjust the property of the target control corresponding to the adjustment instruction according to the adjustment instruction; wherein, adjusting the property of the target control corresponding to the adjustment instruction according to the adjustment instruction comprises: acquiring corresponding adjustment information in the adjustment instruction, wherein the adjustment information comprises the adjusted property and the adjustment direction corresponding to the property; acquiring the type of the View control and the type of the commodity, and when it is detected that the number of times of the same adjustment of the adjustment property of the same type of View control and the adjustment direction corresponding to the property under the same commodity type is greater than a preset number threshold, if the same type of View control under the same commodity type is detected again, the property of the View control is configured according to the adjustment property and the adjustment direction corresponding to the property; When the property adjustment of the target control is completed, the label template is refreshed.
2. The label printing method according to claim 1, characterized in that: The configuring the properties of the View control includes: When there are at least two View controls whose properties are consistent, if there is a View control that has been configured among the at least two View controls, the properties of the View control that has been configured are copied to an unconfigured View control among the at least two View controls for configuration.
3. The label printing method according to claim 1, characterized in that: The filling each View control with content according to the commodity data includes: When the element type of the View control is a barcode type, obtaining a barcode character string in the commodity data, and filling the barcode character string into a first sub-control of the barcode type View control; Generate barcode pixels according to the barcode character string, generate a barcode bitmap according to the barcode pixels, and fill the barcode bitmap into the second subcontrol of the barcode type View control.
4. The label printing method according to claim 1, characterized in that: The filling each View control with content according to the commodity data includes: When the element type of the View control is a QR code type, obtaining a QR code string in the commodity data, and generating QR code pixels according to the QR code string; A two-dimensional code bitmap is generated according to the two-dimensional code pixels, and the two-dimensional code bitmap is filled into a View control of the two-dimensional code type.
5. The label printing method according to claim 4, characterized in that: The filling each View control with content according to the commodity data comprises: When the element type of the View control is a text type, obtaining text information of the product according to the QR code string; Fill the text information into the View control of the text type.
6. A label printing device, characterized in that: include: The acquisition module is used to obtain product data according to each View control in the preset label template; A filling module, used to fill the contents of each View control according to the commodity data and generate a target label; A printing module, used for printing the target label in a preset size; A control generation module, used for obtaining an operation instruction and generating a View control containing an element type according to the operation instruction; An attribute configuration module, used to configure the attributes of the View control and determine a label template according to the configured View control; A property adjustment module, used for obtaining an adjustment instruction, and adjusting the property of a target control corresponding to the adjustment instruction according to the adjustment instruction; wherein the adjusting the property of the target control corresponding to the adjustment instruction according to the adjustment instruction comprises: obtaining corresponding adjustment information in the adjustment instruction, wherein the adjustment information comprises an adjusted property and an adjustment direction corresponding to the property; obtaining the type of the View control and the type of the commodity, and when it is detected that the number of times the adjustment property of the same type of View control and the adjustment direction corresponding to the property under the same commodity type are the same is greater than a preset number threshold, if the same type of View control under the same commodity type is detected again, the property of the View control is configured according to the adjustment property and the adjustment direction corresponding to the property; The template refresh module is used to refresh the label template after the property adjustment of the target control is completed.
7. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of a label printing method as described in any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of a label printing method as claimed in any one of claims 1 to 5 are implemented.
