Label printing method and device, computer equipment and computer readable storage medium
By obtaining and analyzing unit information and historical label data, using machine learning algorithms to determine the label format template, and generating and printing customized labels, the problem that traditional label printing methods cannot meet complex business needs is solved, and flexible and efficient label printing is achieved.
Patent Information
- Application Number
- CN202411862178.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-04-11
AI Technical Summary
The traditional label printing method is relatively fixed and it is difficult to meet complex and changeable business needs. Especially in scenarios such as logistics tracking and product management, there are various requirements for the style, content and size of the label and need to be updated frequently.
By obtaining the unit information and multiple dynamic data of the currently logged in user, when the historical label data corresponding to the unit information is obtained, the machine learning algorithm is used to analyze the historical label data, determine the label format template corresponding to the unit information, and generate the label to be printed based on the label format template and dynamic data, and finally print it.
It has realized the customized label printing solution for different units. Each unit can have exclusive label format templates based on its own business needs and historical usage habits, and accurately adapt to complex and changeable business scenarios.
Smart Images

Figure CN119806439A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of label printing, and in particular to a label printing method, apparatus, computer device and computer-readable storage medium. Background Art
[0002] With the rapid development of information technology, label printing is increasingly used in various industries. However, in scenarios such as logistics tracking and product management, the requirements for label style, content, size, etc. vary and need to be updated frequently.
[0003] However, the traditional label printing method is relatively fixed and cannot meet the complex and changing business needs. Summary of the invention
[0004] Based on this, it is necessary to provide a label printing method, device, computer equipment and computer-readable storage medium that can solve the above-mentioned technical problems.
[0005] In a first aspect, the present application provides a label printing method, the method comprising:
[0006] Get the unit information and multiple dynamic data of the currently logged-in user;
[0007] In the case where historical label data corresponding to the unit information is obtained, a label format template is determined according to the unit information and the historical label data;
[0008] Generate labels to be printed according to label format templates and dynamic data;
[0009] The labels to be printed are processed for printing to obtain printing results.
[0010] In one embodiment, the step of determining the label format template according to the unit information and the historical label data includes:
[0011] Analyze and process historical label data using machine learning algorithms to obtain analysis results; the analysis results include label formats and content preferences corresponding to unit information;
[0012] Determine the label format template based on the label format and content preferences corresponding to the unit information.
[0013] In one embodiment, the method further comprises:
[0014] In the case where the historical label data corresponding to the unit information is not obtained, a system default template is obtained and the system default template is determined as the label format template.
[0015] In one embodiment, the step of generating a label to be printed according to the label format template and the dynamic data includes:
[0016] Parsing the label format template to obtain multiple fixed elements of the label format template;
[0017] According to the data type of each dynamic data, each dynamic data is filled into the corresponding fixed element to obtain a label to be printed.
[0018] In one embodiment, the printing process of the label to be printed to obtain the printing result includes:
[0019] Get custom configuration data;
[0020] The label to be printed is updated according to the custom configuration data to obtain an updated label to be printed;
[0021] The updated label to be printed is sent to the target printer for printing processing to obtain the printing result.
[0022] In one embodiment, the updating process of the label to be printed according to the custom configuration data to obtain the updated label to be printed includes:
[0023] Determine the elements to be updated according to the custom configuration data;
[0024] Modify the content of the label to be printed according to the element to be updated to obtain a modified label to be printed;
[0025] The page layout of the modified label to be printed is adjusted to obtain an updated label to be printed.
[0026] In one embodiment, the method further comprises:
[0027] Perform label integrity check and consistency check on the updated labels to be printed, and obtain the check results;
[0028] Correction processing is performed on the updated label to be printed according to the inspection result to obtain a corrected label to be printed.
[0029] In a second aspect, the present application also provides a label printing device. The device comprises:
[0030] The data acquisition module is used to obtain the unit information and multiple dynamic data of the currently logged-in user;
[0031] A template determination module, for determining a label format template according to the unit information and the historical label data when the historical label data corresponding to the unit information is acquired;
[0032] The label generation module is used to generate the label to be printed according to the label format template and various dynamic data;
[0033] The label printing module is used to print the labels to be printed and obtain the printing results.
[0034] In a third aspect, the present application further provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method in the first aspect when executing the computer program.
[0035] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the method in the first aspect when executed by a processor.
[0036] In a fifth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the method in the first aspect are implemented.
[0037] The above-mentioned label printing method, device, computer equipment and computer-readable storage medium obtain the unit information and multiple dynamic data of the currently logged-in user; when the historical label data corresponding to the unit information is obtained, the label format template is determined according to the unit information and the historical label data; the label to be printed is generated according to the label format template and the dynamic data; the label to be printed is processed to obtain the printing result. The present application can provide customized label printing solutions for different units by determining the label format template based on the unit information and historical label data. Each unit can have its own exclusive label format template to achieve personalized customization according to its unique business needs, historical usage habits and industry specifications. This flexibility enables labels to accurately adapt to various complex and changing business scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A diagram showing an application environment of a label printing method in an embodiment;
[0039] Figure 2 A schematic diagram of a process of label printing in one embodiment;
[0040] Figure 3 A schematic diagram of a process for determining a label format template in one embodiment;
[0041] Figure 4 A schematic diagram of a process for generating a label to be printed in one embodiment;
[0042] Figure 5 A schematic diagram of a process for obtaining a printing result in one embodiment;
[0043] Figure 6 It is a schematic diagram of a process of obtaining an updated label to be printed in one embodiment;
[0044] Figure 7 A schematic diagram of a process of correcting an updated label to be printed in one embodiment;
[0045] Figure 8 is a structural block diagram of a label printing device in one embodiment;
[0046] Fig. 9 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0048] The label printing method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The terminal obtains the unit information and multiple dynamic data of the currently logged-in user; when the historical label data corresponding to the unit information is obtained, the label format template is determined according to the unit information and the historical label data; according to the label format template and each dynamic data, a label to be printed is generated; the label to be printed is processed to obtain a printing result. Among them, the terminal 102 can be but is not limited to various personal computers, laptops, smart phones and tablets. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.
[0049] In an exemplary embodiment, Figure 2 As shown, the embodiment of the present application provides a label printing method, which is applied to Figure 1 The terminal in is used as an example to illustrate, including the following steps:
[0050] S201, obtaining the unit information and multiple dynamic data of the currently logged-in user.
[0051] Among them, the unit information of the currently logged-in user refers to the detailed information of the unit to which the user currently logged in to the label printing system belongs, including the unit name, unit unique identifier (such as unit code), unit organizational structure information, unit industry, unit main business areas, etc.
[0052] Dynamic data refers to data information that changes in real time with business processes and actual conditions during the label printing process. For example, in the product label printing scenario, data such as the real-time inventory quantity, the latest production batch number, the current production date, and the estimated shelf life of the product are all dynamic data.
[0053] In the embodiment of the present application, when a user logs into the label printing application on the terminal, he / she enters the pre-registered user name and password. The terminal sends the credentials entered by the user to the back-end server for identity authentication. The back-end server searches for a matching user record in the user database. Once the authentication is passed, the back-end server obtains the detailed information of the unit to which the user belongs from the associated unit information table, including the unit name, unit code, industry, unit address, etc.
[0054] S202: When the historical label data corresponding to the unit information is acquired, a label format template is determined according to the unit information and the historical label data.
[0055] Among them, historical label data refers to the relevant data records accumulated by the unit in the label printing process in the past, including various label format templates that have been used, examples of label printing content in different business scenarios, the specific printing time and printing quantity corresponding to each label, and related operation records, etc.
[0056] A label format template is a predefined label layout and style framework that is used to standardize the overall structure and appearance of a label. It determines the position, size, and arrangement of each element on the label (such as text boxes, image boxes, barcode or QR code areas, lines, graphics, etc.), as well as the font, size, color, background color, and other style attributes used by the elements.
[0057] In an embodiment of the present application, the server is connected to a label data repository, which stores historical label data of each unit. According to the unit information of the currently logged-in user, a precise query is performed in the repository to obtain all historical label data records of the unit. The terminal analyzes these historical label data, including counting the frequency of use of different types of labels (such as product labels, logistics labels, asset labels, etc.), analyzing the usage of various label format templates (such as the number of times different templates are used, the last time of use, etc.), and extracting key information from the label content (such as commonly used fixed text, data field combinations, etc.). Based on these analysis results, the terminal can use an intelligent matching algorithm to select a label format template from a predefined template library that best matches the unit's historical usage habits and current business needs.
[0058] S203, generating a label to be printed according to the label format template and various dynamic data.
[0059] In the embodiment of the present application, a selected label format template is loaded on the terminal, and the template is described in an extensible markup language or other structured format. The application parses the template file, identifies various elements in the template (such as text boxes, image boxes, barcode or QR code areas, etc.) and their attributes, as well as placeholders for filling dynamic data.
[0060] Then, the dynamic data obtained from each business system is mapped and filled according to the definition of data type and placeholder. For text type data, such as product name, batch number, etc., directly insert it into the corresponding text box placeholder position, and display format according to the style attributes such as font, font size, color, etc. defined in the template. For image type data, such as product pictures, company logos, etc., according to the size and style requirements of the image box, scale, crop, etc., and then load it into the corresponding position. For barcode or QR code data, use the corresponding encoding library to generate barcode or QR code graphics according to the data content, and draw it in the area specified by the template.
[0061] S204, printing the label to be printed to obtain a printing result.
[0062] In an embodiment of the present application, the terminal can automatically detect the locally connected printer and obtain the device information of the printer (such as the printer name, model, connection port, supported paper size and type, etc.). According to the model of the printer and the driver requirements, the generated label to be printed is converted into a format that the printer can recognize. The application sends the converted print data to the print queue of the printer through the print service of the operating system. The printer obtains the print task from the queue and starts the printing process. During the printing process, the terminal application maintains communication with the printer and obtains the status information of the printer in real time, such as printing progress and printer status.
[0063] The above-mentioned label printing method first obtains the unit information and multiple dynamic data of the currently logged-in user; when the historical label data corresponding to the unit information is obtained, the label format template is determined according to the unit information and the historical label data; the label to be printed is generated according to the label format template and the dynamic data; the label to be printed is printed to obtain the printing result. This application can provide customized label printing solutions for different units by determining the label format template based on the unit information and historical label data. Each unit can have its own exclusive label format template to achieve personalized customization according to its unique business needs, historical usage habits and industry specifications. This flexibility enables labels to accurately adapt to various complex and changing business scenarios.
[0064] In an exemplary embodiment, based on the above embodiment, see Figure 3The embodiment of the present application relates to a process of determining a label format template according to unit information and historical label data, including the following steps:
[0065] S301, using a machine learning algorithm to analyze and process historical label data to obtain analysis results.
[0066] The analysis results include the label format and content preference corresponding to the unit information. The machine learning algorithm can be a decision tree model or a neural network model.
[0067] In the embodiment of the present application, the analysis and processing based on the decision tree algorithm is as follows: first, the historical label data of the unit is collected and sorted and stored in a database. The data includes an image file of the label, a text description of the label content (including format information, such as font, font size, color, etc. recorded in a specific format) and related metadata (such as printing time, business scenario identification, etc.). Some data are extracted from the database as training samples, and label format features (such as layout structure, element size ratio, font style combination, etc.) and content features (such as the frequency of occurrence of specific information fields, the combination of different types of information, etc.) are used as input variables, and pre-defined label format categories (such as concise, detailed, illustrated, etc.) and content subject categories (such as product information, logistics information, asset information, etc.) are used as output variables to build a decision tree model.
[0068] During the training process, the decision tree algorithm selects the optimal features as split nodes based on information gain or other appropriate indicators, and gradually builds a decision tree structure. For example, through analysis, it is found that when the product name field occupies a large area in the label, it is more likely to belong to the concise product label format category. After the training is completed, the remaining historical label data is used as a test sample to evaluate and verify the model to ensure the accuracy and generalization ability of the model. Finally, the entire historical label data set is input into the trained decision tree model. The model determines the format category and content theme category of each label based on the features, thereby summarizing the label format and content preferences corresponding to the unit information. For example, the model may conclude that the unit prefers a concise format in product labels, focusing on content such as product name, specifications, and production date.
[0069] Analysis and processing using neural network algorithms: preprocess historical label data, convert label images into digital matrix representations, and perform word segmentation and encoding on text information to make it suitable for neural network input. Build a multi-layer neural network architecture, including input layer, hidden layer, and output layer. The number of input layer nodes is determined based on the number of extracted features, such as the position coordinates, size, font feature vectors, and word vectors of text content of label elements. The hidden layer uses an appropriate number of neurons and activation functions to learn complex nonlinear relationships in the data. The output layer can be designed with two nodes, one for representing label format preference and the other for content preference.
[0070] The neural network is trained using historical label data, and the weights and biases of the neural network are adjusted using the back-propagation algorithm so that the model's predicted output is as close to the actual label format and content category as possible. During the training process, parameters such as the learning rate and number of iterations are continuously adjusted to optimize model performance. After the training is completed, all historical label data are input into the neural network, and the neural network predicts the format and content preference of each label based on the learned weights and biases. For example, the output layer may output a numerical value for the label format preference node, and determine the format type to which it belongs based on the preset threshold range; for the content preference node, a vector may be output to indicate the degree of preference for different content types, thereby obtaining the label format and content preference analysis results corresponding to the unit information.
[0071] S302: Determine a label format template according to the label format and content preference corresponding to the unit information.
[0072] In an embodiment of the present application, based on the label format preference corresponding to the obtained unit information, a set of candidate templates that meet the format preference is screened out in the template library. Then, the template selection is further refined based on the content preference. For example, if the content preference shows that the unit focuses on the product name, specifications, and production date in the product label, then a candidate template with a reasonable and prominent design in these information display areas is selected. For the screened templates, appropriate adjustments are made based on the unit's special requirements or subtle differences in historical label data.
[0073] In the embodiment of the present application, through the in-depth analysis of historical label data by machine learning algorithms, the unit's preferences in label format and content can be accurately grasped, thereby determining a highly customized label format template. This customization not only takes into account the general needs of the unit, but also adapts to the subtle differences in different business scenarios, ensuring that each label can accurately convey key information, while conforming to the unit's habits and expectations in terms of visual and user experience.
[0074] In an exemplary embodiment, based on the above embodiment, the method of the embodiment of the present application also includes: when the historical label data corresponding to the unit information is not obtained, obtaining the system default template, and determining the system default template as the label format template.
[0075] Among them, the system default template is a universal, basic label format template pre-set in the label printing system.
[0076] In the embodiment of the present application, when the terminal attempts to obtain the historical label data corresponding to the unit information of the currently logged-in user from the data repository, if the query result is empty (i.e., no relevant historical data is found), the terminal can automatically trigger the process of obtaining the system default template. The system default template is stored in the fixed configuration directory of the system and is stored in a specific file format, which defines the basic layout structure of the label in detail; the main content area is divided into multiple equal-width columns for placing different types of information.
[0077] The terminal reads the default template file from the configuration directory through a file reading operation and parses it into a template object in memory, which contains the above layout and style information. Then, the parsed template object is determined as the label format template for the current label printing task, ready for subsequent combination with dynamic data to generate the label to be printed.
[0078] In the embodiment of the present application, when the unit-specific historical label data cannot be obtained, the terminal can automatically switch to using the system default template, which ensures the continuity of the label printing business. Whether the newly established unit has not yet accumulated historical data or the historical data cannot be obtained due to data storage problems, the label printing work will not be stagnant.
[0079] In an exemplary embodiment, based on the above embodiment, see Figure 4 The embodiment of the present application relates to a process of generating a label to be printed according to a label format template and various dynamic data, including the following steps:
[0080] S401, parsing the label format template to obtain a plurality of fixed elements of the label format template.
[0081] Among them, fixed elements refer to those parts of the label format template that are relatively fixed in layout and style and do not change with the dynamic data changes in each printing task. For example, the company's logo and the label title.
[0082] In the embodiment of the present application, when the label format template is described in XML format, the terminal first reads the label format template file in XML format, and uses an XML parser (such as a DOM or SAX parser in Java) to parse the file line by line and node by node. During the parsing process, the XML tags and their attributes are identified and converted into an internal data structure to represent each element of the template.
[0083] S402, filling each dynamic data into a corresponding fixed element according to the data type of each dynamic data, to obtain a label to be printed.
[0084] The data type is used to distinguish the different types and formats of dynamic data. Common data types include text types (such as product names and addresses in string form) and numeric types (such as integer quantities, prices, and years in dates).
[0085] In the embodiment of the present application, after obtaining the dynamic data, the terminal traverses the fixed element set obtained by the previous parsing. For each fixed element, check whether it contains a placeholder that needs to be filled with dynamic data. If so, according to the data type expected by the placeholder, obtain the corresponding type of data from the dynamic data set.
[0086] For example, if the placeholder is for the product name (text type), then find the value of the product name field from the dynamic data. For text type data, directly insert it into the corresponding text box fixed element, and display format it according to the pre-defined font, font size, color and other style attributes of the element. If it is numeric type data, such as product price, convert it to a suitable string format (such as retaining two decimal places) and fill it into the corresponding position.
[0087] In the embodiment of the present application, accurate combination of dynamic data and fixed elements is achieved by parsing the label format template and filling in dynamic data according to the data type.
[0088] In an exemplary embodiment, based on the above embodiment, see Figure 5 The embodiment of the present application relates to a process of printing a label to be printed and obtaining a printing result, including the following steps:
[0089] S501, obtaining custom configuration data.
[0090] Among them, the custom configuration data is the data information generated by the user's personalized settings of the label's printing parameters, style, content, etc. according to his or her own specific needs and preferences.
[0091] In the embodiment of the present application, the terminal provides the user with an intuitive graphical user interface, on which a preview of the label to be printed and various configurable options are displayed. The user can interact with the interface by mouse clicks, keyboard input, or touch screen operation. When the user completes all custom configuration operations, click the "OK" button, and the terminal collects all settings made by the user on the interface, converts them into custom configuration data, and stores them in a structured format in the memory, ready for subsequent label update processing.
[0092] S502, updating the label to be printed according to the custom configuration data to obtain an updated label to be printed.
[0093] In an embodiment of the present application, the terminal reads the custom configuration data in the memory and traverses each element in the label to be printed (including text boxes, image boxes, barcodes or QR code areas, etc.). For font selection configuration, according to the font family name specified in the configuration data, the corresponding font is searched and loaded in the system font library, and the font properties of all text elements in the label are updated to the selected font. When adjusting the font size, directly modify the font size attribute of the text element to the specified value in the configuration data to ensure that the text size meets user requirements. In terms of color setting, according to the color value in the configuration data, modify the properties of the text color, background color, and border color (if applicable) respectively, so that the visual effect of the label changes accordingly.
[0094] S503, sending the updated label to be printed to the target printer for printing processing to obtain a printing result.
[0095] In an embodiment of the present application, the terminal first detects whether the local computer is connected to the target printer, and obtains the printer connection information by querying the device manager or printer service of the operating system. If the target printer is connected, obtain the driver information of the target printer to ensure that the driver has been correctly installed and is the latest version. Then, the updated label to be printed is converted into a format that can be recognized by the target printer. After the conversion is completed, the terminal sends the print task to the target printer through the print queue of the operating system. The printer obtains the print task from the queue, starts the printing process, prints the label content page by page on the specified paper, and obtains the printing result.
[0096] In the embodiment of the present application, by acquiring the custom configuration data and updating the labels to be printed accordingly, the terminal can meet the personalized needs of the user in label printing.
[0097] In an exemplary embodiment, based on the above embodiment, see Figure 6 The embodiment of the present application relates to a process of updating a label to be printed according to custom configuration data to obtain an updated label to be printed, including the following steps:
[0098] S601, determining elements to be updated according to the custom configuration data.
[0099] In the embodiment of the present application, the custom configuration data is parsed, and the data is stored in a structured format (such as JSON or XML), which includes various configuration parameters and their corresponding values. The terminal can traverse these configuration parameters and determine the element to be updated according to the name and type of the parameter.
[0100] S602, modifying the content of the label to be printed according to the element to be updated to obtain a modified label to be printed.
[0101] In the embodiment of the present application, for the text content in the determined element to be updated, the terminal directly replaces the original content with the new text value. For example, if the user specifies a new text of a product name in the custom configuration data, the terminal finds the corresponding product name text box element in the label to be printed and replaces the text therein with the new value. At the same time, the corresponding attributes of the text element are modified according to the style parameters such as font, font size, color, etc. in the configuration data.
[0102] S603, adjusting the page layout of the modified label to be printed to obtain an updated label to be printed.
[0103] In the embodiment of the present application, the terminal calculates the new position coordinates of each element to be updated according to the layout adjustment parameters in the custom configuration data. For example, if the configuration data specifies that an element is to be moved 10 pixels to the right and 5 pixels downward.
[0104] The embodiment of the present application can achieve accurate customization of labels by performing detailed update processing on the labels to be printed according to the custom configuration data, thereby fully meeting the user's personalized needs in terms of label content, style and layout.
[0105] In an exemplary embodiment, based on the above embodiment, see Figure 7 , the method of the embodiment of the present application further includes the following steps:
[0106] S701, performing label integrity check and consistency check on the updated label to be printed to obtain a check result.
[0107] In an embodiment of the present application, for integrity checking, the rule base defines the elements and information templates that must be included in different types of labels (such as product labels, logistics labels, asset labels, etc.). For example, the product labeling rules stipulate that it must include information such as the product name, model, specifications, production date, shelf life, manufacturer, etc., and each information has corresponding format requirements (such as the production date must be in a specific date format). The terminal extracts the corresponding integrity check rules from the rule base according to the label type, and then traverses all elements in the updated label to be printed, checks whether each element and information required by the rules exists, and checks whether its format meets the requirements. If an element is missing or the format is incorrect, the relevant error information will be recorded.
[0108] For consistency checking, the rule library contains style consistency rules (such as the same type of elements must use the same font, size and color), logic consistency rules (such as the barcode or QR code encoding content and the corresponding text content must be consistent) and layout consistency rules (such as the spacing between elements must be within a certain range and follow a specific alignment), etc. The terminal can check various aspects of the label according to these rules.
[0109] S702, correcting the updated label to be printed according to the inspection result to obtain a corrected label to be printed.
[0110] In the embodiment of the present application, the terminal first reads the error information list in the inspection result, and for some problems that can be automatically corrected, the terminal automatically processes them according to predefined correction rules and algorithms. For example, if it is found that the font of a text element in the label is inconsistent with other similar elements, its font is automatically adjusted to be consistent with the standard; if the position of the element deviates from the range defined by the template, the terminal can automatically move it to the correct position according to the layout rules.
[0111] In the embodiment of the present application, by performing strict integrity checks and consistency checks on the updated labels to be printed, various problems that may exist in the labels can be discovered and corrected in a timely manner, ensuring that the labels are complete in content, contain all necessary information, and remain consistent and coordinated in style, logic, and layout.
[0112] In an exemplary embodiment, based on the above embodiment, the method of the embodiment of the present application further includes the following steps:
[0113] Step 1: Obtain the unit information and multiple dynamic data of the currently logged-in user; when the historical tag data corresponding to the unit information is obtained, use the machine learning algorithm to analyze and process the historical tag data to obtain the tag format and content preference corresponding to the unit information in the analysis result; determine the tag format template according to the tag format and content preference corresponding to the unit information;
[0114] Step 2: When the historical label data corresponding to the unit information is not obtained, a system default template is obtained, and the system default template is determined as a label format template;
[0115] Step 3: parse the label format template to obtain multiple fixed elements of the label format template; fill each dynamic data into the corresponding fixed element according to the data type of each dynamic data to obtain a label to be printed;
[0116] Step 4: Obtain custom configuration data; determine the elements to be updated according to the custom configuration data; modify the content of the label to be printed according to the elements to be updated to obtain a modified label to be printed; adjust the page layout of the modified label to be printed to obtain an updated label to be printed;
[0117] Step 5: Perform label integrity check and consistency check on the updated label to be printed to obtain a check result; perform correction processing on the updated label to be printed according to the check result to obtain a corrected label to be printed;
[0118] Step 6: Send the updated label to be printed to the target printer for printing processing to obtain the printing result.
[0119] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0120] Based on the same inventive concept, the embodiment of the present application also provides a label printing device for implementing the label printing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more embodiments of the label printing device provided below can refer to the limitations of the label printing method above, and will not be repeated here.
[0121] In one embodiment, Figure 8 As shown, a label printing device 800 is provided, comprising:
[0122] The data acquisition module 801 is used to acquire the unit information and multiple dynamic data of the currently logged-in user;
[0123] The template determination module 802 is used to determine the label format template according to the unit information and the historical label data when the historical label data corresponding to the unit information is acquired;
[0124] The label generation module 803 is used to generate a label to be printed according to the label format template and various dynamic data;
[0125] The label printing module 804 is used to print the label to be printed and obtain a printing result.
[0126] In one embodiment, the template determination module includes:
[0127] A data analysis unit is used to analyze and process the historical label data using a machine learning algorithm to obtain analysis results; the analysis results include label formats and content preferences corresponding to unit information;
[0128] The template determination unit is used to determine the label format template according to the label format and content preference corresponding to the unit information.
[0129] In one embodiment, the above device further comprises:
[0130] The default template acquisition module is used to acquire the system default template when the historical label data corresponding to the unit information is not acquired, and determine the system default template as the label format template.
[0131] In one embodiment, the label generation module includes:
[0132] The template parsing unit is used to parse the label format template to obtain multiple fixed elements of the label format template;
[0133] The label determination unit is used to fill each dynamic data into the corresponding fixed element according to the data type of each dynamic data to obtain a label to be printed.
[0134] In one embodiment, the label printing module includes:
[0135] A configuration data acquisition unit, used to acquire custom configuration data;
[0136] A label updating unit, used for updating the label to be printed according to the custom configuration data to obtain an updated label to be printed;
[0137] The printing unit is used to send the updated label to be printed to the target printer for printing processing to obtain the printing result.
[0138] In one embodiment, the label updating unit includes:
[0139] An element determination subunit, used to determine the element to be updated according to the custom configuration data;
[0140] The content modification subunit is used to modify the content of the label to be printed according to the element to be updated, so as to obtain a modified label to be printed;
[0141] The layout adjustment subunit is used to adjust the page layout of the modified label to be printed to obtain an updated label to be printed.
[0142] In one embodiment, the above device further comprises:
[0143] The inspection module is used to perform label integrity inspection and consistency inspection on the updated labels to be printed, and obtain inspection results;
[0144] The correction module is used to correct the updated label to be printed according to the inspection result to obtain a corrected label to be printed.
[0145] Each module in the above-mentioned label printing device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.
[0146] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig. 9As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a label printing method is realized. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0147] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0148] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0149] Get the unit information and multiple dynamic data of the currently logged-in user;
[0150] In the case where historical label data corresponding to the unit information is obtained, a label format template is determined according to the unit information and the historical label data;
[0151] Generate labels to be printed according to label format templates and dynamic data;
[0152] The labels to be printed are processed for printing to obtain printing results.
[0153] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0154] Analyze and process historical label data using machine learning algorithms to obtain analysis results; the analysis results include label formats and content preferences corresponding to unit information;
[0155] Determine the label format template based on the label format and content preferences corresponding to the unit information.
[0156] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0157] In the case where the historical label data corresponding to the unit information is not obtained, a system default template is obtained and the system default template is determined as the label format template.
[0158] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0159] Parsing the label format template to obtain multiple fixed elements of the label format template;
[0160] According to the data type of each dynamic data, each dynamic data is filled into the corresponding fixed element to obtain a label to be printed.
[0161] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0162] Get custom configuration data;
[0163] The label to be printed is updated according to the custom configuration data to obtain an updated label to be printed;
[0164] The updated label to be printed is sent to the target printer for printing processing to obtain the printing result.
[0165] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0166] Determine the elements to be updated according to the custom configuration data;
[0167] Modify the content of the label to be printed according to the element to be updated to obtain a modified label to be printed;
[0168] The page layout of the modified label to be printed is adjusted to obtain an updated label to be printed.
[0169] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0170] Perform label integrity check and consistency check on the updated labels to be printed, and obtain the check results;
[0171] Correction processing is performed on the updated label to be printed according to the inspection result to obtain a corrected label to be printed.
[0172] According to some embodiments of the present application, a computer program product is also provided, and when the computer program is executed by a processor, the above method can be implemented. The computer program product includes one or more computer instructions. When these computer instructions are loaded and executed on a computer, part or all of the above method can be implemented in whole or in part according to the process or function described in the embodiment of the present application.
[0173] According to some embodiments of the present application, there is also provided a non-transitory computer-readable storage medium including instructions, such as a memory including instructions, and the above instructions can be executed by a processor of an electronic device to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0174] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0175] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0176] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0177] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A label printing method, characterized in that: The method comprises: Get the unit information and multiple dynamic data of the currently logged-in user; In the case where the historical label data corresponding to the unit information is acquired, determining a label format template according to the unit information and the historical label data; Generate a label to be printed according to the label format template and each of the dynamic data; Printing is performed on the label to be printed to obtain a printing result.
2. The method according to claim 1, characterized in that The determining of the label format template according to the unit information and the historical label data includes: Analyzing and processing the historical tag data using a machine learning algorithm to obtain an analysis result; the analysis result includes a tag format and content preference corresponding to the unit information; The label format template is determined according to the label format and content preference corresponding to the unit information.
3. The method according to claim 1, characterized in that The method further comprises: In the case that the historical label data corresponding to the unit information is not obtained, a system default template is obtained, and the system default template is determined as the label format template.
4. The method according to claim 1, characterized in that The step of generating a label to be printed according to the label format template and each of the dynamic data comprises: Parsing the label format template to obtain a plurality of fixed elements of the label format template; According to the data type of each dynamic data, each dynamic data is filled into the corresponding fixed element to obtain the label to be printed.
5. The method according to claim 4, characterized in that The printing process of the label to be printed to obtain the printing result includes: Get custom configuration data; Performing an update process on the label to be printed according to the custom configuration data to obtain an updated label to be printed; The updated label to be printed is sent to the target printer for printing to obtain the printing result.
6. The method according to claim 5, characterized in that The updating process of the label to be printed according to the custom configuration data to obtain an updated label to be printed includes: Determine the element to be updated according to the custom configuration data; Modify the content of the label to be printed according to the element to be updated to obtain a modified label to be printed; The page layout of the modified label to be printed is adjusted to obtain the updated label to be printed.
7. The method according to claim 6, characterized in that The method further comprises: Performing label integrity check and consistency check on the updated label to be printed to obtain a check result; The updated label to be printed is corrected according to the inspection result to obtain a corrected label to be printed.
8. A label printing device, characterized in that: The device comprises: The data acquisition module is used to obtain the unit information and multiple dynamic data of the currently logged-in user; A template determination module, configured to determine a label format template according to the unit information and the historical label data when the historical label data corresponding to the unit information is acquired; A label generation module, used for generating a label to be printed according to the label format template and each of the dynamic data; The label printing module is used to print the label to be printed to obtain a printing result.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.