Printer configuration method and device, computer equipment and storage medium
The template engine generates a unified layout intermediate file and uses the printer adapter module for syntax conversion, which solves the problem of inadaptable printer configuration in the prior art, ensures that the printed file matches the printer parameters and meets the user's printing needs.
Patent Information
- Application Number
- CN202411109195.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2024-12-27
AI Technical Summary
Existing printer configurations cannot meet users' printing needs, especially when multiple printers or new printer models are added, problems such as inconsistent printing effects, limited functions and unsupported problems are prone to occur.
By obtaining the target printing template, using the template engine to restrict the printing dynamic data and the target printing template, generate an intermediate printing file, and determine the adapter module to syntax the intermediate file according to the printer parameters, generate a print file matching the printer, and send it to Cloud printers perform printing tasks.
Implement unified layout and structured intermediate files, which are abstract and inclusive, can accommodate different types of printing content, carefully describe layout rules and presentation styles, solve the problem of printer mismatch, and ensure the generated printing files Matches the printer parameters.
Smart Images

Figure CN119201015A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of printer configuration, and in particular to a printer configuration method, device, computer equipment and storage medium. Background Art
[0002] With the rapid development of the printer and Internet industries, the types of printers and print control syntax are increasing, and becoming more and more complex. When using multiple printers, it is easy to have problems such as inconsistent printing results, limited printer functions, and unsupported new printer models, resulting in the printer configuration being unable to meet the user's printing needs. Summary of the invention
[0003] Based on this, it is necessary to provide a printer configuration method, device, computer equipment and storage medium to solve the incompatibility problem of existing printers in response to the above technical problems.
[0004] A printer configuration method, comprising:
[0005] Get the target printing template;
[0006] Performing template constraints on the dynamic data to be printed and the target printing template through a template engine to obtain an intermediate printing file;
[0007] When receiving a printing task including printer parameters, performing task parsing on the printer parameters to obtain a parsing result;
[0008] Determine a printer adapter module corresponding to the print task according to the parsing result, and perform syntax conversion on the intermediate print file through the printer adapter module to obtain a print file;
[0009] The print file is sent to the cloud printer to execute the print task.
[0010] A printer configuration device, comprising:
[0011] A target printing template module is used to obtain a target printing template;
[0012] An intermediate printing file module, used for performing template constraints on the dynamic data to be printed and the target printing template through a template engine to obtain an intermediate printing file;
[0013] The parsing result module is used to perform task parsing on the printer parameters to obtain parsing results when receiving a print task containing printer parameters;
[0014] A print file module, used for determining a printer adapter module corresponding to the print task according to the parsing result, and performing syntax conversion on the intermediate print file through the printer adapter module to obtain a print file;
[0015] The execution module is used to send the print file to the cloud printer to execute the print task.
[0016] A computer device comprises a memory, a processor and computer-readable instructions stored in the memory and executable on the processor, wherein the printer configuration method is implemented when the processor executes the computer-readable instructions.
[0017] One or more readable storage media storing computer readable instructions, when the computer readable instructions are executed by one or more processors, the one or more processors execute the printer configuration method as described above.
[0018] The printer configuration method, device, computer equipment and storage medium include: obtaining a target printing template; using a template engine to perform template constraints on the dynamic data to be printed and the target printing template to obtain an intermediate printing file; when receiving a printing task containing printer parameters, performing task parsing on the printer parameters to obtain a parsing result; determining a printer adapter module corresponding to the printing task according to the parsing result, and performing syntax conversion on the intermediate printing file through the printer adapter module to obtain a printing file; and sending the printing file to a cloud printer to execute the printing task. In the present invention, a template engine is used to perform template constraints on the printing content to generate a uniformly typed and structured intermediate file. The intermediate file does not care about the characteristics of the printer hardware, but focuses on describing the logical structure and style information of the printing content, so that the intermediate file has sufficient abstraction and inclusiveness, can accommodate different types of printing content, and can describe the layout rules and presentation styles of each part of the printing content in detail. Furthermore, the intermediate file is converted into a syntax by the printer adapter module corresponding to the printer parameters to obtain a printing file corresponding to the printer parameters, so that the generated printing file is more compatible with the printer parameters, which can solve the problem of printer incompatibility. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0020] Figure 1is a schematic diagram of an application environment of a printer configuration method in an embodiment of the present invention;
[0021] Figure 2 is a flow chart of a printer configuration method according to an embodiment of the present invention;
[0022] Figure 3 is a schematic diagram of a structure of a printer configuration device in one embodiment of the present invention;
[0023] Figure 4 is a schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0025] The printer configuration method provided in this embodiment can be applied in Figure 1 In an application environment, a client communicates with a server. The client includes but is not limited to various personal computers, laptops, smart phones, tablet computers, and portable wearable devices. The server can be implemented with an independent server or a server cluster consisting of multiple servers.
[0026] In one embodiment, if Figure 2 As shown, a printer configuration method is provided, which is applied in Figure 1 The server in the example is used as an example to illustrate, including the following steps S10-S50:
[0027] S10, obtaining a target printing template.
[0028] Understandably, the target printing template refers to the printing template required by the user. The target printing template can be obtained by selecting an existing printing template, creating a new printing template, or editing an existing printing template. Among them, selecting an existing printing template means selecting a printing template from the existing printing templates to determine as the target printing template.
[0029] In one embodiment, before step S10, that is, before obtaining the target printing template, the following steps are included:
[0030] S11. Receive a print template start instruction and generate a print template editing page; the print template editing page includes a print template editing box and an editing toolbar; it is understandable that the print template start instruction refers to an instruction to start the print template, which is generated in response to the user's selection of creating a new print template or opening an existing print template in the cloud printing system. The print template editing page refers to a page containing a template editor, that is, a page for editing the print template. That is, when the user chooses to create a new print template or open an existing print template, the cloud printing system generates a print template editing page for the user to edit the newly created print template or the existing print template. The print template editing box refers to an editing box that can be used to edit the print template. The editing toolbar contains at least one editing control, wherein the editing control is used to edit the print template to generate a target print template.
[0031] S12. Arrange the layout of the print template edit box through the edit control of the edit toolbar, generate the target print template and save it. It can be understood that the edit control is used to edit the print template to generate the target print template. The edit toolbar includes at least one edit control, for example, the edit toolbar includes a QR code control, a picture control, a barcode control, and a text control. Layout arrangement refers to adjusting the layout and arrangement of the print template edit box to generate the target print template. Furthermore, after the target print template is generated, the target print template is saved so that the user can reuse or edit the target print template to improve the user experience.
[0032] Preferably, through the cloud printing system, users can manage the saved target printing templates. For example, they can rename, delete, and sort the saved target printing templates, and modify the layout and arrangement of the content of the target printing templates. At the same time, the cloud printing system will record the usage and modification history of each saved target printing template, which is convenient for users to version control and track the target printing templates and improve the user experience.
[0033] Optionally, the editing control includes a QR code control; the target printing template includes a target QR code image; understandably, the QR code control refers to a control for editing a QR code. Through the QR code control, the user can add a QR code image to the printing template editing box and adjust the QR code image accordingly to obtain the target QR code image.
[0034] In one embodiment, that is, in step S12, the layout and arrangement of the print template edit box by the edit control of the edit toolbar to generate the target print template includes:
[0035] S121. When it is detected that the target user starts the QR code control, a coding fill box is generated in the print template edit box, so that the target user can enter coding information in the coding fill box; understandably, when the user clicks to select the QR code control through the cloud printing system, the print template edit box will pop up the coding fill box, so that the user can enter the corresponding coding information in the coding fill box. Among them, the coding fill box includes at least one coding fill item, such as a website fill item, a text fill item, a contact fill item, etc. The coding information refers to the information entered by the user into the coding fill box, such as the website information entered by the user in the website fill box, the text information entered by the user in the text fill box, the contact information entered by the user in the contact fill item, etc.
[0036] S122. Generate an initial QR code image according to the coding information. It can be understood that the initial QR code image refers to a QR code image generated according to the coding information input by the user in the coding fill box.
[0037] S123. In response to the target user's QR code adjustment operation on the initial QR code image, generate the target QR code image. Understandably, the QR code adjustment operation refers to the operation of adjusting the initial QR code image. The QR code adjustment operation includes the operation of adjusting the color, style, background pattern, etc. of the initial QR code image, and the operation of adjusting the position, size, and rotation angle of the initial QR code image in the print template edit box. By performing the QR code adjustment operation on the initial QR code image, the target QR code image is generated to better meet user needs, which can improve the user experience.
[0038] Optionally, the editing control includes a text control and a picture control; the target printing template includes a target text box and a target picture; understandably, the text control refers to a control for editing text. Through the text control, the user can add a text box in the printing template editing box, and edit the text box accordingly to obtain a target text box. The picture control refers to a control for editing a picture. Through the picture control, the user can add an initial picture in the printing template editing box, and edit the initial picture accordingly to obtain a target picture.
[0039] In one embodiment, that is, in step S12, the layout and arrangement of the print template edit box by the edit control of the edit toolbar to generate the target print template includes:
[0040] S124. Add a text box in the print template edit box through the text control; understandably, the text box refers to a filling box for filling text.
[0041] S125. In response to the target user's text editing operation on the text box, a target text box is generated; understandably, the text editing operation refers to an operation of editing the text box. The text editing operation includes an operation of adjusting the color and style of the text box, an operation of adjusting the position, size, and rotation angle of the text box in the print template editing box, and an operation of adjusting the font, font size, color, alignment, line spacing, etc. of the text filled in the text box. Generating a target text box by performing a text editing operation on the text box is more in line with user needs and can improve user experience.
[0042] S126. Add an initial picture in the print template edit box through the picture control. It can be understood that the initial picture refers to the picture that the user chooses to add to the print template edit box after clicking the picture control.
[0043] S127. In response to the target user's picture adjustment operation on the initial picture, generate a target picture. It can be understood that the picture adjustment operation refers to the operation of adjusting the initial picture. The picture adjustment operation includes the operation of adjusting the position, size, and rotation angle of the initial picture in the print template edit box, as well as the operation of adjusting the cropping, filter, transparency, etc. of the initial picture. Generating a target text box by performing picture adjustment operations on the initial picture is more in line with user needs, which can improve user experience.
[0044] S20, performing template constraints on the dynamic data to be printed and the target printing template through a template engine to obtain an intermediate printing file.
[0045] Understandably, the template engine refers to an engine for unified typesetting, and the template engine can be a print template specification based on XMLSchema Definition (XSD). Among them, XSD is a recommended standard released by W3C in May 2001. The template engine provides a formalized and standardized language framework, through which the data structure of the target print template can be accurately defined and verified, thereby achieving a high degree of unification across platforms and systems. Template constraints refer to the process of constraining the data structure of the dynamic data to be printed and the target print template. Template constraints include basic attribute constraints (for example, paper size, page margins, and direction, etc.) and element attribute constraints (for example, each element position coordinates, size, and style, etc.). The dynamic data to be printed refers to the dynamic data that needs to be printed. The dynamic data can be the order information that the user wants to print, and the order information can be obtained through a third-party platform (for example, shopping platforms such as Taobao). The intermediate file refers to the file generated after the template engine constrains the dynamic data to be printed and the target print template. Here, since the template engine is a print template specification based on XSD, the generated intermediate file is essentially an XML file.
[0046] Understandably, the dynamic data to be printed and the target printing template after template constraints are converted into structured data, that is, the text information in the dynamic data to be printed and the target printing template will be split into independent text blocks and structured data of their related style attributes. Therefore, the intermediate file does not care about the characteristics of the printer hardware, but focuses on describing the logical structure and style information of the printed content. This makes the intermediate file abstract and inclusive enough to accommodate different types of printed content, and can describe the layout rules and presentation style of each part of the printed content in detail.
[0047] Understandably, since different printer brands and models have corresponding printing syntax or drivers, when using multiple printers or adding new printers, it is easy to have inconsistent printing results, limited printer functions, unsupported new printer models, and other problems, resulting in the printer configuration being unable to meet the user's printing needs. The intermediate format, as an intermediary bridge, can achieve decoupling from various printing protocols through unified typesetting content to solve the problem of printer incompatibility.
[0048] In one embodiment, before step S20, that is, before the template engine performs template constraints on the dynamic data to be printed and the target printing template, the process includes:
[0049] S21. Obtain the account information of the user for logging into the cloud printing system. It can be understood that the account information refers to the relevant information used by the user to log into the cloud printing system, including account identity information, login password, etc. The account identity information may be the account information of the user at other merchants or shopping platforms. The cloud printing system can obtain the user's to-be-printed data at other merchants or shopping platforms through the account identity information.
[0050] S22. Account binding the account information with the target printing template through the account control of the printing template editing box, so that when the data to be printed corresponding to the account information is detected to be dynamically updated, the dynamic data to be printed is obtained. It can be understood that the account control refers to a control for editing the account information. By account binding the account information with the target printing template, the dynamic data to be printed can be obtained in time when the data to be printed corresponding to the account information is detected to be updated.
[0051] In one embodiment, that is, in step S20, the template engine is used to perform template constraints on the dynamic data to be printed and the target printing template to obtain an intermediate printing file, including:
[0052] S201. Mark the binding data between the dynamic data to be printed and the target printing template by the template engine to generate a position mark; it can be understood that the binding data refers to the data bound between the dynamic data to be printed and the target printing template. The binding data can be set by the user (for example, the user binds the dynamic data such as order information and user data to the target printing template). After binding, when printing, the template engine will generate personalized dynamic data to be printed in real time according to the dynamic data. For example, the order number, order time and quantity of the dynamic data to be printed can be bound to the target printing template, and the generated dynamic data to be printed may include the order number, product name, order time and quantity. Position marking refers to marking the position of the binding data by the template engine.
[0053] S202: When the target printing template is rendered by the template engine, the binding data corresponding to the position mark is updated according to the dynamic data to be printed to obtain a data update file; it can be understood that data rendering refers to the process of dynamically displaying the dynamic data to be printed in the target printing template. The data update file refers to a file that fills and updates the target printing template with the data to be printed.
[0054] S203: Perform data structuring processing on the data update file through a template engine to obtain the intermediate print file. It can be understood that data structuring processing refers to the process of performing structured processing on the data in the data update file.
[0055] In this embodiment, by marking the position of the binding data between the dynamic data to be printed and the target printing template, when the target printing template is rendered, the binding data can be quickly updated to obtain a data update file.
[0056] S30: When a print task including printer parameters is received, the printer parameters are parsed to obtain a parsing result.
[0057] Understandably, printer parameters refer to the parameters of the printer, including parameters such as the printer's hardware and printing protocol. Task parsing refers to the process of parsing the printer parameters to obtain parsing results. Parsing results refer to the results of parsing the printer parameters, which include the printer model, printing syntax, and driver-related information.
[0058] S40. Determine the printer adapter module corresponding to the print task according to the analysis result, and perform syntax conversion on the intermediate print file through the printer adapter module to obtain a print file. It is understandable that the printer adapter module corresponding to the printer task can be quickly matched according to the parsed printer model, print syntax, driver and other related information. Among them, the printer adapter module is used to convert the intermediate file into a print file that matches the printer corresponding to the print task. The printer adapter module is matched according to the printer model, print syntax and driver, that is, different printer models, print syntax and drivers are correspondingly provided with corresponding printer adapter modules. Syntax conversion refers to the process of converting the syntax of the intermediate file into the control syntax that matches the printer corresponding to the print task.
[0059] In one embodiment, that is, in step S40, the intermediate print file is converted into a grammatical format by the printer adapter module to obtain a print file, including:
[0060] S401, obtaining an abstract syntax tree corresponding to the printer adapter module; understandably, different printers provide different control syntaxes. The control syntax includes data of various label style instructions. Here, the data related to the control syntax provided by the printer is lexically analyzed by a lexical analyzer, and the data related to the control syntax is decomposed into morphemes one by one to obtain a morpheme stream. Based on the rules of the control syntax, the morpheme stream generated by the lexical analyzer is organized into a tree structure, i.e., an abstract syntax tree, by a syntax analyzer. Understandably, a printer adapter module may include elements such as configuration settings and print tasks, and the abstract syntax tree corresponding to the printer adapter module will include nodes representing these elements, as well as the association relationship between these elements. For example, a print task may be represented by a task node in the abstract syntax tree. The task node has multiple child nodes, and the multiple child nodes can respectively represent print content, print parameters, print time, etc.
[0061] S402: Based on the abstract syntax tree, convert the intermediate print file into a print file using a target print syntax tag. Understandably, according to the abstract syntax tree, the intermediate print file is converted into a print file using a target print syntax tag. The target print syntax tag refers to a print syntax tag corresponding to the control syntax, and the target print syntax tag is obtained through the abstract syntax tree, and then the intermediate print file is converted into a print file using the target print syntax tag.
[0062] In this embodiment, the abstract syntax tree can be used to quickly and accurately convert the intermediate print file into a print file using the target print syntax tag, so that the generated print file is more compatible with the printer parameters, thus solving the problem of printer incompatibility.
[0063] S50: Send the print file to the cloud printer to execute the print task.
[0064] Understandably, a cloud printer refers to a printer used to perform printing tasks.
[0065] In steps S10-S50, the target printing template is obtained; the template engine is used to perform template constraints on the dynamic data to be printed and the target printing template to obtain an intermediate printing file; when a printing task containing printer parameters is received, the printer parameters are task parsed to obtain a parsing result; the printer adapter module corresponding to the printing task is determined according to the parsing result, and the intermediate printing file is grammatically converted by the printer adapter module to obtain a printing file; the printing file is sent to the cloud printer to execute the printing task. In this embodiment, the template engine is used to perform template constraints on the printing content to generate a uniformly typed and structured intermediate file. The intermediate file does not care about the characteristics of the printer hardware, but focuses on describing the logical structure and style information of the printing content, so that the intermediate file has sufficient abstraction and inclusiveness, can accommodate different types of printing content, and can describe the layout rules and presentation styles of each part of the printing content in detail. Furthermore, the intermediate file is grammatically converted by the printer adapter module corresponding to the printer parameters to obtain a printing file corresponding to the printer parameters, so that the generated printing file is more compatible with the printer parameters, which can solve the problem of printer incompatibility.
[0066] It should be understood that the order of execution of the steps in the above embodiment does not necessarily 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 embodiment of the present invention.
[0067] In one embodiment, a printer configuration device is provided, which corresponds one-to-one to the printer configuration method in the above embodiment. Figure 3 As shown, the printer configuration device includes a target printing template module 10, an intermediate printing file module 20, a parsing result module 30, a printing file module 40 and an execution module 50. The functional modules are described in detail as follows:
[0068] A target printing template module 10 is used to obtain a target printing template;
[0069] An intermediate printing file module 20, used for performing template constraints on the dynamic data to be printed and the target printing template through a template engine to obtain an intermediate printing file;
[0070] The parsing result module 30 is used to perform task parsing on the printer parameters to obtain parsing results when receiving a print task including printer parameters;
[0071] A print file module 40, configured to determine a printer adapter module corresponding to the print task according to the parsing result, and perform syntax conversion on the intermediate print file through the printer adapter module to obtain a print file;
[0072] The execution module 50 is used to send the print file to the cloud printer to execute the print task.
[0073] Optionally, the printer configuration device comprises:
[0074] A page unit, used to receive a print template start instruction and generate a print template editing page; the print template editing page includes a print template editing box and an editing toolbar;
[0075] The layout arrangement unit is used to arrange the layout of the print template editing box through the editing control of the editing toolbar, generate a target print template and save it.
[0076] Optionally, the editing control includes a QR code control; the target printing template includes a target QR code image;
[0077] The layout arrangement unit comprises:
[0078] A code filling box unit is used to generate a code filling box in the print template editing box when it is detected that the target user starts the two-dimensional code control, so that the target user can enter code information in the code filling box;
[0079] An initial two-dimensional code image unit, used to generate an initial two-dimensional code image according to the coding information;
[0080] The initial two-dimensional code image unit is used to generate the target two-dimensional code image in response to the target user's two-dimensional code adjustment operation on the initial two-dimensional code image.
[0081] Optionally, the editing control includes a text control and a picture control; the target printing template includes a target text box and a target picture;
[0082] The layout arrangement unit comprises:
[0083] A text box adding unit, used for adding a text box in the print template editing box through the text control;
[0084] A text editing operation unit, used for generating a target text box in response to a target user's text editing operation on the text box;
[0085] An initial picture adding unit, used for adding an initial picture in the print template editing box through the picture control;
[0086] The target picture unit is used to generate a target picture in response to a picture adjustment operation of the target user on the initial picture.
[0087] Optionally, the printer configuration device comprises:
[0088] An account information unit, used to obtain the account information of the user logging into the cloud printing system;
[0089] The dynamic data unit to be printed is used to bind the account information with the target printing template through the account control of the printing template editing box, so that when it is detected that the data to be printed corresponding to the account information is dynamically updated, the dynamic data to be printed is obtained.
[0090] Optionally, the intermediate printing file module 20 includes:
[0091] A position marking unit, used for marking the binding data between the dynamic data to be printed and the target printing template through a template engine to generate a position mark;
[0092] A data update file unit, used for updating the binding data corresponding to the position mark according to the dynamic data to be printed when the target printing template is rendered by the template engine, so as to obtain a data update file;
[0093] The intermediate printing file unit is used to process the data structure of the data update file through a template engine to obtain the intermediate printing file.
[0094] Optionally, the printing file module 40 includes:
[0095] An abstract syntax tree unit, used to obtain an abstract syntax tree corresponding to the printer adapter module;
[0096] The print file unit is used to convert the intermediate print file into a print file using target print syntax tags based on the abstract syntax tree.
[0097] The specific definition of the printer configuration device can be found in the above definition of the printer configuration method, which will not be repeated here. Each module in the above printer configuration device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above modules 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 operations corresponding to each of the above modules.
[0098] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 4As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a readable storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer-readable instructions. The internal memory provides an environment for the operation of the operating system and computer-readable instructions in the readable storage medium. The network interface of the computer device is used to communicate with an external server through a network connection. When the computer-readable instructions are executed by the processor, a printer configuration method is implemented. The readable storage medium provided in this embodiment includes a non-volatile readable storage medium and a volatile readable storage medium.
[0099] In one embodiment, a computer device is provided, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, wherein the processor executes the computer-readable instructions to implement the following steps:
[0100] Get the target printing template;
[0101] Performing template constraints on the dynamic data to be printed and the target printing template through a template engine to obtain an intermediate printing file;
[0102] When receiving a printing task including printer parameters, performing task parsing on the printer parameters to obtain a parsing result;
[0103] Determine a printer adapter module corresponding to the print task according to the parsing result, and perform syntax conversion on the intermediate print file through the printer adapter module to obtain a print file;
[0104] The print file is sent to the cloud printer to execute the print task.
[0105] In one embodiment, one or more computer-readable storage media storing computer-readable instructions are provided. The readable storage media provided in this embodiment include non-volatile readable storage media and volatile readable storage media. The readable storage media store computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the following steps are implemented:
[0106] Get the target printing template;
[0107] Performing template constraints on the dynamic data to be printed and the target printing template through a template engine to obtain an intermediate printing file;
[0108] When receiving a printing task including printer parameters, performing task parsing on the printer parameters to obtain a parsing result;
[0109] Determine a printer adapter module corresponding to the print task according to the parsing result, and perform syntax conversion on the intermediate print file through the printer adapter module to obtain a print file;
[0110] The print file is sent to the cloud printer to execute the print task.
[0111] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through computer-readable instructions, and the computer-readable instructions can be stored in a non-volatile readable storage medium or a volatile readable storage medium. When the computer-readable instructions are executed, they may include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0112] Those skilled in the art 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. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0113] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those 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 invention, and should all be included in the protection scope of the present invention.
Claims
1. A printer configuration method, characterized in that: Applied to the cloud printing system, the printer configuration method includes: Get the target printing template; Performing template constraints on the dynamic data to be printed and the target printing template through a template engine to obtain an intermediate printing file; When receiving a printing task including printer parameters, performing task parsing on the printer parameters to obtain a parsing result; Determine a printer adapter module corresponding to the print task according to the parsing result, and perform syntax conversion on the intermediate print file through the printer adapter module to obtain a print file; The print file is sent to the cloud printer to execute the print task.
2. The printer configuration method according to claim 1, wherein: Before obtaining the target printing template, the method includes: Receive a print template start instruction and generate a print template editing page; the print template editing page includes a print template editing box and an editing toolbar; The print template editing box is laid out and arranged through the editing controls of the editing toolbar, and a target print template is generated and saved.
3. The printer configuration method according to claim 2, characterized in that: The editing control includes a QR code control; the target printing template includes a target QR code image; The step of arranging the print template edit box by using the edit controls of the edit toolbar to generate a target print template includes: When it is detected that the target user starts the two-dimensional code control, a code filling box is generated in the print template editing box, so that the target user can input code information in the code filling box; Generate an initial QR code image according to the coding information; In response to the target user's QR code adjustment operation on the initial QR code image, the target QR code image is generated.
4. The printer configuration method according to claim 2, wherein: The editing control includes a text control and a picture control; the target printing template includes a target text box and a target picture; The step of arranging the print template edit box by using the edit controls of the edit toolbar to generate a target print template includes: Add a text box in the print template edit box through the text control; In response to a target user's text editing operation on the text box, generating a target text box; Adding an initial image to the print template edit box through the image control; In response to a target user's picture adjustment operation on the initial picture, a target picture is generated.
5. The printer configuration method according to claim 1, characterized in that: Before the template engine performs template constraints on the dynamic data to be printed and the target printing template, the method includes: Obtaining the account information of the user logging into the cloud printing system; The account information is bound to the target printing template through the account control of the printing template editing box, so that when it is detected that the data to be printed corresponding to the account information is dynamically updated, the dynamic data to be printed is obtained.
6. The printer configuration method according to claim 1, characterized in that: The template engine is used to perform template constraints on the dynamic data to be printed and the target printing template to obtain an intermediate printing file, including: Performing position marking on the binding data between the dynamic data to be printed and the target printing template by a template engine to generate a position mark; When the target printing template is rendered by the template engine, the binding data corresponding to the position mark is updated according to the dynamic data to be printed to obtain a data update file; The data updating file is processed in a data structured manner by a template engine to obtain the intermediate printing file.
7. The printer configuration method according to claim 1, characterized in that: The intermediate print file is converted into a grammar by the printer adapter module to obtain a print file, including: Obtaining an abstract syntax tree corresponding to the printer adapter module; Based on the abstract syntax tree, the intermediate print file is converted into a print file using target printing syntax tags.
8. A printer configuration device, characterized in that: include: A target printing template module is used to obtain a target printing template; An intermediate printing file module, used for performing template constraints on the dynamic data to be printed and the target printing template through a template engine to obtain an intermediate printing file; The parsing result module is used to perform task parsing on the printer parameters to obtain parsing results when receiving a print task containing printer parameters; A print file module, used for determining a printer adapter module corresponding to the print task according to the parsing result, and performing syntax conversion on the intermediate print file through the printer adapter module to obtain a print file; The execution module is used to send the print file to the cloud printer to execute the print task.
9. A computer device comprising a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, characterized in that: When the processor executes the computer-readable instructions, the printer configuration method according to any one of claims 1 to 7 is implemented.
10. One or more computer-readable storage media storing computer-readable instructions, characterized in that: When the computer-readable instructions are executed by one or more processors, the one or more processors are caused to perform the printer configuration method according to any one of claims 1 to 7.
Citation Information
Cited By
Intelligent label printing optimization system, method and device based on image recognition
CN120029570A
Intelligent Label Printing Optimization System, Method and Device Based on Image Recognition
CN120029570B