Print data recovery method, device, equipment, medium and program product

By automatically detecting and fixing the wrong printing command in the print description file, the problem of printing wrong pages is solved, and the efficiency and accuracy of printing tasks are improved.

CN119739356AActive Publication Date: 2025-04-01ZHUHAI PANTUM ELECTRONICS CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411768564.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-04-01
Estimated Expiration
2044-12-03

AI Technical Summary

Technical Problem

In the prior art, there may be incorrect printing commands in the printing description file, resulting in wrong pages in the printing results, affecting office efficiency.

Method used

By obtaining print description files and rule files, automatically detect and repair print commands that do not meet format requirements, including deletion, correction or replacement of error commands, to ensure that the fixed print commands meet format requirements.

Benefits of technology

It effectively avoids printing wrong pages caused by wrong commands, improves the efficiency and accuracy of printing tasks, and reduces the time for manual inspection and repair.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119739356A_ABST
    Figure CN119739356A_ABST
Patent Text Reader

Abstract

The invention provides a printing data recovery method and device, equipment, a medium and a program product. The method comprises the steps that a printing description file and a rule file are obtained, the printing description file is used for describing printing information through a preset printing command, and the rule file is used for determining the format requirement of the preset printing command; if a first printing command which does not meet the format requirement exists in the printing description file, the first printing command is repaired, a repaired printing description file is obtained, and printing commands in the repaired printing description file all meet the format requirement. According to the method, the problem that the office efficiency is affected due to wrong page printing caused by wrong commands in the printing description file can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to data repair technology, and in particular to a printing data repair method, device, equipment, medium and program product. Background Art

[0002] Image forming devices, such as printers, copiers, scanners and fax machines, are peripheral devices of electronic devices such as computers. Their normal operation depends on the corresponding drivers installed in the electronic devices. Taking a printer as an example, an electronic device can generate a print description file by running a driver. The print description file includes: converting the computer's print task into a print command that the printer can understand and execute, such as Printing Control Language (PCL), Printer Job Language (PJL), etc., so that the printer can correctly perform the printing task.

[0003] Currently, when there may be an erroneous print command in the print description file generated by the above method, the printer will parse out the erroneous print command, resulting in an error page in the print result. Summary of the invention

[0004] The present application provides a print data repair method, device, equipment, medium and program product, which are used to solve the problem of printing error pages due to erroneous commands in a print description file.

[0005] In a first aspect, the present application provides a print data repair method, comprising:

[0006] Acquire a print description file and a rule file, wherein the print description file is used to describe print information through a preset print command, and the rule file is used to determine the format requirement of the preset print command;

[0007] If the print description file contains a first print command that does not meet the format requirement, the first print command is repaired to obtain a repaired print description file, and the print commands in the repaired print description file all meet the format requirement.

[0008] In a possible manner, the rule file is further used to determine a target repair mode of the first print command;

[0009] The repairing the print description file comprises:

[0010] The print description file is repaired based on the target repair method.

[0011] In one possible manner, the target repair method includes any of the following:

[0012] deleting the first print command;

[0013] Deleting illegal bytes in the first print command;

[0014] Using a preset value to replace the illegal bytes in the first print command;

[0015] The missing bytes in the first print command are filled with preset values.

[0016] In a possible manner, if the first print command is a command related to a target function of a non-graphic printing device, the target repair manner is: deleting the first print command, or deleting illegal bytes in the first print command;

[0017] If the first print command is a command related to the target function, the target repair method is: replacing illegal bytes in the first print command with preset values, or filling missing bytes in the first print command with preset values.

[0018] In one possible manner, the rule file includes:

[0019] The mapping relationship between the printing protocol identification rules, format requirements, and repair methods corresponding to the printing commands.

[0020] In a possible manner, the obtaining of the print description file and the rule file includes:

[0021] While in repair mode, obtain the print description file and the rule file.

[0022] In one possible embodiment, the method further includes:

[0023] The description information of the first print command is used as patch information of the print driver, and the patch information is used to ensure that when a print description file is generated by the print driver, the first print command that does not meet the format requirement does not exist in the generated print description file.

[0024] In one possible embodiment, the method further includes:

[0025] The patch information is synchronized to the server.

[0026] In one possible embodiment, the method further includes:

[0027] A print driver updated based on the patch information and sent by the server is received, where the print driver is used to generate a print description file based on the print task.

[0028] In a second aspect, the present application provides a print data repair device, comprising:

[0029] An acquisition module, used for acquiring a print description file and a rule file, wherein the print description file is used for describing print information by a preset print command, and the rule file is used for determining the format requirement of the preset print command;

[0030] The repair module is used to repair the first print command that does not meet the format requirements when there is a first print command in the print description file, so as to obtain a repaired print description file, wherein all print commands in the repaired print description file meet the format requirements.

[0031] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;

[0032] The memory stores computer-executable instructions;

[0033] The processor executes the computer-executable instructions stored in the memory to implement the method as described in any one of the first aspects.

[0034] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method as described in any one of the first aspects.

[0035] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the method as described in any one of the first aspects.

[0036] The present application provides a print data repair method, device, equipment, medium and program product. The electronic device control driver can locate the print commands that do not meet the format requirements in the print description file according to the rule file and automatically repair them. This can avoid the problem of printing error pages due to erroneous commands in the print description file, which affects office efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0038] Figure 1 A schematic diagram of a flow chart of a printing data repair method provided in an embodiment of the present application;

[0039] Figure 2 A schematic diagram of a user interaction interface provided in an embodiment of the present application;

[0040] Figure 3 It is a flowchart of another printing data repair method provided by an embodiment of the present application;

[0041] Figure 4 A schematic diagram of the structure of a print data repair device provided in an embodiment of the present application;

[0042] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0043] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0044] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0045] In the present application, the term "include" and its variations may refer to non-restrictive inclusion; the term "or" and its variations may refer to "and / or". The terms "first", "second", etc. in the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. In the present application, "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previously associated objects are in an "or" relationship.

[0046] The following describes and explains the terms and concepts involved in the embodiments of the present application:

[0047] Image forming equipment: For example, printers, copiers, scanners and fax machines, have greatly improved the efficiency of data processing and output.

[0048] Electronic device: may be a device that controls an image forming device to perform an image forming operation, for example, may be a computer, a mobile phone, or a tablet computer.

[0049] Driver: As a bridge between the electronic device and the image forming device, it can translate the commands issued by the electronic device into commands that the image forming device can understand, thereby ensuring that the image forming device can accurately execute various commands. Optionally, the driver can be on the image forming device or on the electronic device.

[0050] Print command: for example, may include one or more of PCL command, PJL command, Graphics Device Interface (GDI) command or Print Language (PL) command.

[0051] PCL command: It is a command about page description language, which can specify how to present various elements on the page, including the layout and format of text and images, and how to present the printed content on the page, such as the font, size, color of the text, pixel data of the image, etc. PCL command can ensure that the content printed by the printer is consistent with the content displayed on the screen of the electronic device, so as to achieve high-quality printing effect.

[0052] PJL command: is a control language command, which is mainly used to manage the overall process of printing jobs. PJL commands can not only include direct control instructions for printer hardware, such as starting printing, pausing printing, canceling printing, etc., but also provide settings for print job properties, such as printing speed, number of copies, printing resolution, etc.

[0053] Graphics Device Interface (GDI) commands: used to output document content such as text and images. The difference between GDI commands and PCL commands is that GDI is a command for rasterization, while PCL is a command for vectorization.

[0054] Print Language (PL) command: a set of commands that control the operation of the printer.

[0055] Similar to PCL commands and PJL commands, graphics device interface commands or commands formed by printing languages ​​can translate commands issued by electronic devices into commands that can be understood by image forming devices. Such commands can be collectively referred to as printing commands.

[0056] Print description file: A file that uses print commands to describe print information. The print information may include any one or more items such as print area, page settings, and print content.

[0057] Printer firmware: The software on the printer that is responsible for connecting the computer and printer hardware communication and control.

[0058] Taking a printer as an example, a printer driver is installed in the electronic device, which is used to generate a print description file when a user triggers a print task. The print description file includes: converting the computer's print task into commands that the printer can understand and execute, such as PCL commands and / or PJL commands, to convert the electronic device's print task into print commands that the printer can understand and execute.

[0059] The printer is provided with printer firmware for parsing the print description file sent by the electronic device, rendering and imaging the print command obtained by the parsing, and finally converting it into an electrical signal for controlling the laser scanning unit to form the print content.

[0060] In the process of generating a print description file by a driver, an error may occur in the electronic device, resulting in an erroneous print command in the print description file, for example, the generated print command does not meet the format requirements. The non-compliance with the format requirements mentioned here may include syntax errors and / or semantic errors. Among them, a syntax error may be that the generated print command does not meet the rules in structure; a semantic error may be that the generated print command has a logical error.

[0061] In this scenario, the printer firmware will parse the print description file and obtain an erroneous print command, resulting in an error page in the print result. The error page may include the current error reason, for example, as shown below:

[0062] PCL XL error:

[0063] Subsystem: KERNEL

[0064] Error: InsufficientMemory

[0065] Operator: BeginImage

[0066] Position: 1411

[0067] Therefore, currently, when an error occurs in the process of an electronic device generating a print description file through a driver, the user will not be able to use the printer normally before the problem is resolved, which affects office efficiency.

[0068] In view of this, the present application provides a print data repair method that can automatically detect and repair erroneous print commands in a print description file, thereby avoiding the problem of printing erroneous pages due to erroneous commands, which affects office efficiency.

[0069] The code corresponding to the print data repair method provided in the present application can be set in the driver or printer firmware, or in other programs independent of the driver or printer firmware, or it can be a newly added program specifically used to execute the repair method, etc.

[0070] It should be understood that when the program is set on an electronic device, the execution subject of the method can be the electronic device running the program. When the program is set on a printer, the execution subject of the method can be the printer running the program.

[0071] The following embodiments are all described by taking the electronic device as the execution subject and the code corresponding to the printing data repair method being set in the driver as an example.

[0072] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0073] Figure 1 The following is a flow chart of a printing data repair method provided in an embodiment of the present application. Figure 1 As shown, the method includes:

[0074] S101, obtaining a print description file and a rule file, wherein the print description file is used to describe print information through a preset print command, and the rule file is used to determine the format requirements of the preset print command.

[0075] The above-mentioned print description file may be generated by the electronic device through a driver based on a print task triggered by a user.

[0076] The rule file may include, for example, the format requirements of the preset print command. The format requirements may include, for example, any one or more of the start identifier, end symbol, action indication, keyword, and parameter validity of the preset print command. The action indication may indicate the specific operation to be performed by the preset print command; the keyword may specify the parameters of the specific operation.

[0077] Taking the PJL command as an example, its format requirement can be:

[0078] (1) Each individual PJL command begins with “@PJL”.

[0079] (2) Ends with "0x0D, 0x0A".

[0080] (3) “@PJL” is followed by “action”, for example, “SET” or “ENTER”.

[0081] (4) "Action" is followed by "keywords", for example, "USERNAME", "RENDERMODE", etc.

[0082] (5) The content after the “keyword” does not contain grammatical errors or semantic errors.

[0083] A preset printing command that satisfies (1)-(5) at the same time can be considered to meet the format requirements.

[0084] This embodiment does not limit the method for obtaining the rule file. For example, the rule file may be set in a driver program.

[0085] S102: If the print description file contains a first print command that does not meet the format requirement, repair the first print command to obtain a repaired print description file, wherein all print commands in the repaired print description file meet the format requirement.

[0086] By comparing the print command in the print description file with the rule file, it can be determined whether the print command in the print description file meets the format requirements. For the print command that does not meet the format requirements (referred to as the first print command in this application), the electronic device can repair it through the repair code in the driver, and the target repair method can include, for example, deleting the first print command, deleting illegal bytes in the first print command, replacing illegal bytes in the first print command with preset values, filling missing bytes in the first print command with preset values, and any one or more of the above.

[0087] It should be understood that the embodiments of the present application do not limit how to identify the print command from the above-mentioned print description file. For example, the print command can be identified from the above-mentioned print description file through the print protocol identification rule. The print protocol identification rule can be a separate rule file, or it can be included in the rule file for determining the format requirements of the preset print command, which is not limited.

[0088] The print protocol identification rule may include a specific beginning sequence and a specific ending sequence of the print command. Taking the PJL command as an example, its print protocol identification rule may be:

[0089] (1) Starts with the data “0x1B%-12345X@PJL”.

[0090] (2) Ends with the data “@PJL ENTER LANGUAGE”.

[0091] A command that satisfies both (1) and (2) printing protocol identification rules may be a PJL command.

[0092] It should be understood that the target repairing method adopted for repairing the first print command may be determined according to, for example, the type of the first print command and / or the reason why the first print command does not meet the format requirement.

[0093] The following first describes how to select a corresponding target repairing method according to the type of the first printing command.

[0094] The type of the print command may be a target function-related command of a non-graphic printing device or a target function-related command.

[0095] Optionally, the target function-related commands of the non-graphic printing device may be non-core function commands in the printing process, such as any one or more of the commands for user name and command for displaying printer status. Since the existence or non-existence of the target function-related commands of the non-graphic printing device does not affect the printed content, the target repair method of such commands may be, for example, a repair method of deleting the first printing command or deleting illegal bytes in the first printing command, so that the accuracy of the printed content can be guaranteed when the erroneous command is repaired.

[0096] For example, the PJL command for the user name (USERNAME) in the rule file is:

[0097] "@PJL SET USERNAME = link 0x0D0x0A", (link is set by the user and is not limited here)

[0098] In the print description file, the first print command, that is, the PJL command of the user name (USERNAME), is:

[0099] "@PJL SET USERNAME=link 0x0D0x0A 0x0D0x0A",

[0100] Since the first print command repeats 0x0D0x0A, the second 0x0D0x0A is an illegal byte. At this time, the first print command is wrong. If the first print command is used for printing, it may cause the problem of printing an error page. Since the first print command is a command related to the target function of the non-graphic printing device, the electronic device can control the driver to delete the first print command so that the printer outputs the print content. Alternatively, the illegal bytes in the first print command are deleted, that is, the second 0x0D0x0A illegal byte is deleted, so that the printer outputs the print content.

[0101] Optionally, the target function-related command may be a core function command in the printing process, such as a command for the number of copies to be printed, a command for the printing direction, or any one or more of the above. Deleting or deleting illegal bytes from the target function command may affect the printed output content. Therefore, the target function-related command repair method selects to replace the illegal bytes in the first print command with a preset value, or to fill the missing bytes in the first print command with a preset value.

[0102] For example, the PJL command for printing the number of copies (COPIES) in the rule file is:

[0103] "@PJL SET COPIES = 1 0x0D0x0A", (1 is the default value of this command, which is not limited here)

[0104] In the print description file, the first print command, that is, the PJL command for printing the number of copies (COPIES), is:

[0105] "@PJL SET COPIES=-5 0x0D0x0A",

[0106] Since the number of copies to be printed is usually an integer greater than or equal to 1, -5 in the above-mentioned first print command is an illegal byte in the first print command. If the first print command is used for printing, an error page may be printed. Since the first print command is a command related to the target function, deleting the first print command or deleting the illegal bytes in the first print command may cause a failure to print. Therefore, the preset value (also called the default value) corresponding to the first print command, i.e., 1, can be used to replace the illegal byte -5 in the first print command so that the printer can correctly output the print content.

[0107] Exemplarily, in the print description file, the first print command, that is, the PJL command for printing the number of copies (COPIES) is:

[0108] "@PJL SET COPIES=0x0D0x0A",

[0109] In the first print command, since the PJL command for the number of copies is missing bytes, if the first print command is used for printing, an error page may be printed. Since the first print command is a command related to the target function, deleting the first print command or deleting illegal bytes in the first print command may cause a situation where printing cannot be performed. Therefore, the preset value (also called the default value) corresponding to the first print command, i.e., 1, may be used to fill the missing bytes in the first print command so that the printer can correctly output the print content.

[0110] The embodiment of the present application can select a corresponding repair method according to the type of the first printing command, select a repair method of deleting or deleting illegal bytes when an error occurs in a command related to the target function of a non-graphic printing device, and select a repair method of replacing or filling with preset values ​​when an error occurs in a command related to the target function, thereby avoiding invalid repairs and improving repair efficiency.

[0111] The following describes how to select a corresponding repair method according to the reason why the first print command does not meet the format requirement.

[0112] Optionally, the reason why the first print command does not meet the format requirement may be that there is a syntax error or a semantic error. When a syntax error occurs in the first print command, a repair method of deleting the first print command or deleting illegal bytes in the first print command may be selected. When a semantic error occurs in the first print command, a preset value may be used to replace the illegal bytes in the first print command, or a preset value may be used to fill the missing bytes in the first print command.

[0113] Exemplarily, in the print description file, the PJL command of the first print command regarding the user name (USERNAME) is:

[0114] "@PJL SET USERNAME=link 0x0D0x0A 0x0D0x0A",

[0115] Since the first print command repeats 0x0D0x0A, the second 0x0D0x0A is an illegal byte, and the first print command is a syntax error. The existence or non-existence of a command with a syntax error does not affect the printed content. Therefore, the target repair method of such a command can be, for example, a repair method of deleting the first print command or deleting the illegal bytes in the first print command, so that the accuracy of the printed content can be guaranteed when the erroneous command is repaired. Therefore, the electronic device can control the driver to delete the first print command so that the printer outputs the printed content. Alternatively, the illegal bytes in the first print command are deleted, that is, the second illegal byte 0x0D0x0A is deleted, so that the printer correctly outputs the printed content.

[0116] Exemplarily, in the print description file, the PJL command of the first print command regarding the number of copies (COPIES) is:

[0117] "@PJL SET COPIES=-5 0x0D0x0A",

[0118] Since the number of copies to be printed is usually an integer greater than or equal to 1, -5 in the first print command is an illegal byte in the first print command, and a semantic error occurs in the first print command. Since the first print command is a semantic error, deleting the first print command or deleting the illegal byte in the first print command may cause a situation where printing cannot be performed. Therefore, a preset value (also called a default value) corresponding to the first print command, i.e., 1, may be used to replace the illegal byte -5 in the first print command, so that the printer can correctly output the print content.

[0119] Similarly, if the PJL command regarding the number of copies to be printed is missing bytes, it is also a semantic error. Since the first print command is a command related to the target function, deleting the first print command or deleting the illegal bytes in the first print command may cause printing failure. Therefore, the preset value corresponding to the first print command (also called the default value), that is, 1, can be used to fill the missing bytes in the first print command so that the printer can correctly output the print content.

[0120] In addition, a corresponding repair method may be selected according to the type of the first print command and the reason why the first print command does not meet the format requirement.

[0121] Still taking the PJL command of the first print command about the user name (USERNAME) in the print description file as an example:

[0122] "@PJL SET USERNAME=link 0x0D0x0A 0x0D0x0A",

[0123] The first print command repeats 0x0D0x0A, resulting in the second 0x0D0x0A being an illegal byte. The first print command firstly belongs to a command related to the target function of the non-graphic printing device, and secondly, the error of the first print command is a syntax error. The existence or non-existence of a command with a syntax error does not affect the print content. Therefore, the first print command can be deleted to enable the printer to output the print content. Alternatively, the illegal bytes in the first print command are deleted, that is, the second 0x0D0x0A illegal bytes are deleted to enable the printer to correctly output the print content.

[0124] On the basis of selecting a corresponding repair method according to the type of the first print command and / or the reason why the first print does not meet the format requirements, the embodiment of the present application can also display the error information and the repair method to the user, and the user can choose whether to repair the first print command. Exemplarily, the electronic device control driver can display the error information and the repair method to the user in the form of a pop-up window, and provide the user with an option of whether to perform the repair, and can perform the repair in response to the user selecting the option to perform the repair.

[0125] Optionally, the embodiment of the present application can also display the error information and the repair method to the user after the automatic repair is completed or after printing, so that the user can understand the error information and the automatic repair method in time and improve the user experience.

[0126] The print data repair method provided in the embodiment of the present application can locate the print commands that do not meet the format requirements in the print description file according to the rule file, and automatically repair them, thereby avoiding the situation where error pages appear in printing due to erroneous print commands.

[0127] The above-mentioned target repairing method may also be located in a rule file used to determine the format requirements of a preset print command, that is, the rule file is not only used to determine whether the print command meets the format requirements, but can also be further used to determine the repairing method of the print command.

[0128] In an embodiment of the present application, the electronic device control driver can accurately identify the print command based on the rule file, and determine whether the print command is incorrect based on the rule file. The incorrect print command can also be quickly repaired according to the mapping relationship in the rule file, thereby improving the accuracy of repairing erroneous commands, reducing the time for manual inspection and repair of print commands, and improving the efficiency of printing tasks.

[0129] The above printing data repair method can be regarded as a function of the electronic device controlling the driver program. The printing data repair method can be an optional mode of the driver program, that is, it can be turned on or off based on the needs of the user.

[0130] Specifically, Figure 2 A schematic diagram of a user interaction interface provided in an embodiment of the present application. Figure 2 As shown, the print data repair method can be used as an option in the driver user interface for the user to operate. When the user selects the automatic repair mode option, the electronic device will first execute the above-mentioned method after running the driver to generate the print description file. Figure 1 After the repair method is shown, the repaired print description file is sent to the printer to perform the printing operation. After the repair is completed, the user can uncheck this option to turn off the repair mode. After the electronic device generates the print description file, it will directly send it to the printer to perform the printing operation without executing Figure 1 The fix shown here makes the printer run faster.

[0131] The embodiment of the present application provides the user with an option in the user interaction interface of the driver to enable the user to choose to turn on or off the repair mode. The user can use this option to choose whether to enter the repair mode according to his or her own needs. This method meets the personalized needs of the user, increases the operating speed of the printer after turning off the repair mode, and enhances the user experience.

[0132] It should be understood that the repair process described above only repairs the print description file in the current printing process. The erroneous print description file is usually caused by the driver. Furthermore, the embodiment of the present application can also use the description information of the first print command as the patch information of the print driver to avoid the subsequent operation of the driver to generate a print description file containing this erroneous print command.

[0133] Optionally, the description information of the first print command may be a “keyword” of the first print command. The description information of the first print command may be used as patch information of the print driver.

[0134] Exemplarily, the PJL command of the first print command in the above print description file regarding the user name (USERNAME) is:

[0135] "@PJL SET USERNAME=link 0x0D0x0A 0x0D0x0A",

[0136] Since the first print command repeats 0x0D0x0A, the second 0x0D0x0A is an illegal byte, and the first print command is wrong. For this wrong first print command, the "keyword" of the PJL command about the user name (USERNAME), that is, USERNAME, can be used as patch information.

[0137] Subsequently, when running the driver to generate a print description file, the patch information can be traversed, so that based on the description information of the first print command included in the patch information, the generation of the first print command can be skipped. Alternatively, the target repair method corresponding to the first print command can be used to generate and repair the first print command, so that the generated print description file does not contain the first print command that does not meet the format requirements.

[0138] The patch information may be stored in a separate file or in the aforementioned rule file. Taking the PJL command as an example, the rule file may be as shown in the following Table 1:

[0139] Table 1

[0140]

[0141] Furthermore, the patch information can also be synchronized to the server, which can be the server corresponding to the printer device manufacturer. By synchronizing the patch information to the server, the printer device manufacturer can analyze the command with the error, so as to completely solve the related problems in the subsequent driver update. That is, the electronic device can receive the print driver updated based on the patch information sent by the server. The print driver updated based on the patch information solves the above problem, so that the next time the required print description file is generated, the situation of generating the first print command with the error will no longer occur.

[0142] In the prior art, when an error page appears during printing, the user can only rely on contacting the printer device manufacturer to visit the manufacturer to check the job data that caused the problem in order to analyze the cause of the error, which results in a long time and low efficiency in repairing the driver. Furthermore, if the job data involves the user's confidential information and cannot be disclosed to the device manufacturer, the problem will be difficult to solve.

[0143] The embodiment of the present application reports patch information to the server, so that the erroneous printing command and the cause of the error can be obtained without the printer device manufacturer having to visit the server to check the job data. This improves the efficiency and accuracy of analyzing the cause of the error, thereby improving the efficiency and accuracy of driver updates and avoiding the leakage of user confidential information.

[0144] Figure 3 FIG. 1 is a flow chart of another printing data repair method provided by an embodiment of the present application. Figure 3 As shown, the method may include the following steps:

[0145] 1. In response to a user starting a driver program in a user interaction interface, start the driver program.

[0146] 2. The sending module of the driver sends the print description file.

[0147] 3. Determine whether the automatic repair mode is selected. If yes, go to step 4; if no, go to step 5.

[0148] 4. Analyze and repair the print description file according to the rule file.

[0149] 5. Store patch information to the driver.

[0150] 6. Print the print description file

[0151] It should be noted that step 5 can be performed first and then step 6, or step 6 can be performed first and then step 5, or step 5 and step 6 can be performed simultaneously, and this application does not limit this.

[0152] The above is an embodiment of the method provided by the present application. The following is a description of the device provided by the present application.

[0153] Figure 4 This is a schematic diagram of the structure of a print data repair device provided in an embodiment of the present application. Figure 4 As shown, the print data repairing device 400 may include, for example: an acquisition module 401 and a repairing module 402. Optionally, the device 400 may also include, for example, a processing module 403 and / or a transceiver module 404.

[0154] The acquisition module 401 is used to acquire a print description file and a rule file. The print description file is used to describe the print information through a preset print command, and the rule file is used to determine the format requirement of the preset print command.

[0155] The repair module 402 is used to repair the first print command when there is a first print command that does not meet the format requirement in the print description file, so as to obtain a repaired print description file, wherein the print commands in the repaired print description file all meet the format requirement.

[0156] Optionally, the rule file is also used to determine a target repair mode of the first print command. The repair module 402 is specifically used to repair the print description file based on the target repair mode.

[0157] Optionally, the target repair method includes any of the following: deleting the first print command; deleting illegal bytes in the first print command; replacing illegal bytes in the first print command with preset values; filling missing bytes in the first print command with preset values.

[0158] Optionally, if the first print command is a command related to the target function of the non-graphic printing device, the target repair method is: deleting the first print command, or deleting illegal bytes in the first print command; if the first print command is a command related to the target function, the target repair method is: replacing the illegal bytes in the first print command with a preset value, or filling the missing bytes in the first print command with a preset value.

[0159] Optionally, the rule file includes a printing protocol identification rule, a format requirement, and a mapping relationship of a repair method corresponding to the printing command.

[0160] Optionally, the acquisition module 401 is specifically configured to acquire a print description file and a rule file when in the repair mode.

[0161] Optionally, the processing module 403 is further used to use the description information of the first print command as patch information of the print driver, and the patch information is used to ensure that when a print description file is generated by the print driver, the generated print description file does not contain the first print command that does not meet the format requirement.

[0162] Optionally, the transceiver module 404 is used to synchronize the patch information to the server.

[0163] Optionally, the transceiver module 404 is further configured to receive a print driver updated based on the patch information and sent by the server, where the print driver is configured to generate a print description file based on the print task.

[0164] The print data repair device 400 provided in the embodiment of the present application can be used to implement the actions performed by the electronic device in any of the aforementioned method embodiments. Its implementation principles and technical effects are similar and will not be repeated here.

[0165] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 As shown, the electronic device 500 may include: a memory 501 and a processor 502. Optionally, the electronic device may further include a transceiver 503, wherein the memory 501 and the processor 502 communicate; illustratively, the memory 501, the processor 502 and the transceiver 503 may communicate via a communication bus 505, the memory 501 is used to store a computer program, and the processor 502 executes the computer program to implement the method of the above embodiment.

[0166] Optionally, the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The steps in the method embodiments disclosed in the present application may be directly implemented as being executed by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.

[0167] An embodiment of the present application further provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, a method in any of the above method embodiments is implemented.

[0168] An embodiment of the present application also provides a computer program product, including a computer program, which implements the method in any of the above method embodiments when the computer program is executed by a processor.

[0169] All or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a readable memory. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned memory (storage medium) includes: read-only memory (ROM), RAM, flash memory, hard disk, solid state drive, magnetic tape, floppy disk, optical disc and any combination thereof.

[0170] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0171] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0172] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0173] Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

[0174] In the present application, the term "include" and its variations may refer to non-restrictive inclusion; the term "or" and its variations may refer to "and / or". The terms "first", "second", etc. in the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. In the present application, "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previously associated objects are in an "or" relationship.

Claims

1. A printing data repair method, characterized in that: The method comprises: Acquire a print description file and a rule file, wherein the print description file is used to describe print information through a preset print command, and the rule file is used to determine the format requirement of the preset print command; If the print description file contains a first print command that does not meet the format requirement, the first print command is repaired to obtain a repaired print description file, and the print commands in the repaired print description file all meet the format requirement.

2. The method according to claim 1, characterized in that The rule file is also used to determine a target repair mode of the first print command; The repairing the print description file comprises: The print description file is repaired based on the target repair method.

3. The method according to claim 2, characterized in that The target repair method includes any of the following: deleting the first print command; Deleting illegal bytes in the first print command; Using a preset value to replace the illegal bytes in the first print command; The missing bytes in the first print command are filled with preset values.

4. The method according to claim 3, characterized in that If the first print command is a command related to the target function of the non-graphic printing device, the target repair method is: deleting the first print command, or deleting illegal bytes in the first print command; If the first print command is a command related to the target function, the target repair method is: replacing illegal bytes in the first print command with preset values, or filling missing bytes in the first print command with preset values.

5. The method according to claim 3, characterized in that: The rule file includes: The mapping relationship between the printing protocol identification rules, format requirements, and repair methods corresponding to the printing commands.

6. The method according to any one of claims 1 to 5, characterized in that: The obtaining of the print description file and the rule file includes: While in repair mode, obtain the print description file and the rule file.

7. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: The description information of the first print command is used as patch information of the print driver, and the patch information is used to ensure that when a print description file is generated by the print driver, the first print command that does not meet the format requirement does not exist in the generated print description file.

8. The method according to claim 7, characterized in that The method further comprises: The patch information is synchronized to the server.

9. The method according to claim 8, characterized in that The method further comprises: A print driver updated based on the patch information and sent by the server is received, where the print driver is used to generate a print description file based on the print task.

10. A print data repair device, characterized in that: The device comprises: An acquisition module, used for acquiring a print description file and a rule file, wherein the print description file is used for describing print information by a preset print command, and the rule file is used for determining the format requirement of the preset print command; The repair module is used to repair the first print command that does not meet the format requirements when there is a first print command in the print description file, so as to obtain a repaired print description file, wherein all print commands in the repaired print description file meet the format requirements.

11. An electronic device, characterized in that: include: a processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 9 when executed by a processor.

13. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 9 when being executed by a processor.

Citation Information

Patent Citations

  • File fixing method and device

    CN106295334A

  • Print drive repair method, print drive repair device, and electronic device

    CN109460198A

  • Intelligent printing abnormity rotary control repair method and system, printer and storage medium

    CN114675794A

  • Printing system for predicting printing error through preliminary inspection of printer driver and method thereof

    CN1648850A

  • Output error predicting device and code optimizing device for printer page describing language

    JP1995129429A