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

By automatically detecting and repairing erroneous commands in the print description file, the problem of printing error pages is solved, improving the efficiency and accuracy of printing tasks and meeting users' personalized needs.

CN119739356BActive Publication Date: 2026-08-04ZHUHAI PANTUM ELECTRONICS CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHUHAI PANTUM ELECTRONICS CO LTD
Filing Date
2024-12-03
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

In existing technologies, incorrect print commands in the print description file can cause error pages in the print results, affecting office efficiency.

Method used

By acquiring print description files and rule files, the system automatically detects and repairs print commands that do not meet format requirements, including deleting or replacing illegal bytes and filling missing bytes with preset values, to ensure that print commands meet format requirements.

Benefits of technology

It avoids printing error pages caused by incorrect commands, improves the efficiency and accuracy of printing tasks, reduces manual inspection and repair time, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119739356B_ABST
    Figure CN119739356B_ABST
Patent Text Reader

Abstract

The application provides a printing data repairing method, device, equipment, medium and program product. The method comprises the following steps: acquiring a printing description file and a rule file, the printing description file is used for describing printing information through a preset printing command, and the rule file is used for determining format requirements of the preset printing command; if a first printing command not meeting the format requirements exists in the printing description file, the first printing command is repaired to obtain a repaired printing description file, and printing commands in the repaired printing description file all meet the format requirements. The method of the application can avoid the problem that an error page is caused due to an error command in the printing description file, and the office efficiency is affected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to data recovery technology, and more particularly to a method, apparatus, device, medium, and program product for recovering printed data. Background Technology

[0002] Image forming devices, such as printers, copiers, scanners, and fax machines, are peripheral devices of electronic devices like computers. Their proper operation depends on the corresponding drivers installed in the electronic devices. Taking printers as an example, electronic devices can generate print description files by running drivers. These print description files include: converting the computer's print jobs into print commands that the printer can understand and execute, such as Printing Control Language (PCL) and Printer Job Language (PJL), so that the printer can correctly perform the print job.

[0003] Currently, when there are incorrect print commands in the print description file generated in the above manner, the printer will parse the incorrect print commands, resulting in an error page in the print result. Summary of the Invention

[0004] This application provides a method, apparatus, device, medium, and program product for repairing print data, which solves the problem of printing error pages caused by erroneous commands in the print description file.

[0005] Firstly, this application provides a method for repairing printed data, including:

[0006] Obtain a print description file and a rule file, wherein the print description file is used to describe print information through preset print commands, and the rule file is used to determine the format requirements of the preset print commands;

[0007] If the print description file contains a first print command that does not conform to the format requirements, then the first print command is repaired to obtain a repaired print description file, wherein all print commands in the repaired print description file conform to the format requirements.

[0008] In one possible approach, the rule file is also used to determine the target repair method for the first print command;

[0009] The repair of the print description file includes:

[0010] Repair the print description file based on the target repair method.

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

[0012] Delete the first print command;

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

[0014] Replace the illegal bytes in the first print command with preset values;

[0015] Fill in the missing bytes in the first print command with preset values.

[0016] In one possible approach, if the first print command is a command related to the target function of a non-graphical printing device, then the target repair method is: to delete the first print command, or to delete illegal bytes in the first print command;

[0017] If the first print command is a command related to the target function, then the target repair method is: 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.

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

[0019] The printing protocol identification rules, format requirements, and mapping relationship of the printing command and the repair method.

[0020] In one possible approach, obtaining the print description file and the rules file includes:

[0021] In repair mode, obtain the print description file and the rules file.

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

[0023] The description information of the first print command is used as patch information for the print driver. The patch information is used to ensure that the first print command that does not conform to the format requirements does not exist in the generated print description file when the print driver generates the print description file.

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

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

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

[0027] The system receives the updated print driver from the server, which is based on the patch information. The print driver is used to generate a print description file based on the print task.

[0028] Secondly, this application provides a print data repair device, comprising:

[0029] An acquisition module is used to acquire a print description file and a rule file, wherein the print description file is used to describe print information through preset print commands, and the rule file is used to determine the format requirements of the preset print commands;

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

[0031] Thirdly, this application provides an electronic device, including: a processor and a memory communicatively connected to the processor;

[0032] The memory stores computer-executed instructions;

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

[0034] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any of the first aspects.

[0035] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the method described in any of the first aspects.

[0036] This application provides a method, apparatus, device, medium, and program product for repairing print data. The electronic device control driver can locate print commands in the print description file that do not meet the format requirements according to the rule file and automatically repair them, which can avoid the problem of printing error pages due to erroneous commands in the print description file, thus affecting office efficiency. Attached Figure Description

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

[0038] Figure 1 A flowchart illustrating a print data repair method provided in this application embodiment;

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

[0040] Figure 3 This is a flowchart illustrating another print data repair method provided in an embodiment of this application;

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

[0042] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0043] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0044] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0045] In this application, the term "comprising" and its variations can refer to non-limiting inclusion; the term "or" and its variations can refer to "and / or". The terms "first", "second", etc., in this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. In this application, "multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0046] The terms and concepts involved in the embodiments of this application will be explained and interpreted below:

[0047] Image forming equipment, such as printers, copiers, scanners, and fax machines, greatly improves the efficiency of data processing and output.

[0048] Electronic device: This can be a device that controls the image forming device to perform image forming operations, such as a computer, mobile phone, or tablet computer.

[0049] Driver: Acting as a bridge between electronic devices and image forming equipment, it translates commands issued by the electronic devices into commands that the image forming equipment can understand, thereby ensuring that the image forming equipment can accurately execute the commands. Optionally, the driver can be located on the image forming equipment or on the electronic device.

[0050] Print commands: These may include one or more of the following: PCL commands, PJL commands, Graphics Device Interface (GDI) commands, or Print Language (PL).

[0051] PCL commands are page description language commands that specify how various elements on a page should be presented, including the layout and formatting of text and images. They also specify how printed content should be presented, such as font, size, and color of text, and pixel data of images. PCL commands ensure that the content printed by the printer matches the content displayed on the electronic device screen, achieving high-quality printing results.

[0052] PJL commands are a type of control language command primarily used to manage the overall workflow of print jobs. PJL commands can include direct control instructions on printer hardware, such as starting, pausing, and canceling printing, as well as settings for print job attributes, such as print speed, number of copies, and print resolution.

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

[0054] Print Language (PL) commands are a set of commands used to control the operation of a printer.

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

[0056] Print description file: A file that uses print commands to describe print information, which may include one or more of the following: print area, page setup, print content, etc.

[0057] Printer firmware: This refers to the software on the printer that is responsible for connecting and controlling the computer and printer hardware.

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

[0059] The printer is equipped with printer firmware, which is used to parse the print description file sent by the electronic device, render the obtained print command into an image, and finally convert it into an electrical signal to control the laser scanning unit to form the print content.

[0060] Errors may occur during the process of generating a print description file through an electronic device's driver, resulting in incorrect print commands in the print description file. For example, the generated print commands may not conform to format requirements. Conformity to format requirements can include syntax errors and / or semantic errors. Syntax errors may mean that the generated print commands do not conform to the rules in terms of structure; semantic errors may mean that the generated print commands contain logical errors.

[0061] In this scenario, the printer firmware will obtain incorrect print commands when parsing the print description file, resulting in an error page in the print output. This error page may include, for example, the reason for the error, as shown below:

[0062] PCL XL error:

[0063] Subsystem: KERNEL

[0064] Error: Insufficient Memory

[0065] Operator: BeginImage

[0066] Position: 1411

[0067] Therefore, when electronic devices encounter errors during the process of generating print profiles through drivers, users may be unable to use the printer normally until the problem is resolved, thus affecting office efficiency.

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

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

[0070] It should be understood that when the program is installed on an electronic device, the entity executing this method can be the electronic device running the program. When the program is installed on a printer, the entity executing this method can be the printer running the program.

[0071] The following embodiments all use an electronic device as the execution subject and the code corresponding to the print data repair method is set in the driver as an example for illustration.

[0072] The technical solution of this application and how it solves the above-mentioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.

[0073] Figure 1 This is a flowchart illustrating a print data repair method provided in an embodiment of this application. Figure 1 As shown, the method includes:

[0074] S101. Obtain the print description file and the rule file. The print description file is used to describe print information using preset print commands, and the rule file is used to determine the format requirements of the preset print commands.

[0075] The aforementioned print description file can be generated by the electronic device through the driver based on a user-triggered print job.

[0076] The aforementioned rule file may include, for example, format requirements for preset print commands. Format requirements may include, for example, any one or more of the following: start identifier, end identifier, action indicator, keyword, and parameter validity of the preset print command. The action indicator specifies the specific operation to be performed by the preset print command; the keyword specifies the parameters of that specific operation.

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

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

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

[0080] (3) "@PJL" is followed by an "action", such as "SET" or "ENTER".

[0081] (4) "Action" is followed by "keyword", such as "USERNAME", "RENDERMODE", etc.

[0082] (5) There are no grammatical or semantic errors in the content following the “keyword”.

[0083] Preset print commands that simultaneously satisfy (1)-(5) can be considered to meet the format requirements.

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

[0085] S102. If the print description file contains a first print command that does not conform to the format requirements, then the first print command is repaired to obtain a repaired print description file, wherein all print commands in the repaired print description file conform to the format requirements.

[0086] By comparing the print commands in the print description file with the rule file, it can be determined whether the print commands in the print description file meet the format requirements. For print commands that do not meet the format requirements (hereinafter referred to as the first print command), the electronic device can repair them through repair code in the driver. The target repair method may include any one or more 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, or filling missing bytes in the first print command with preset values.

[0087] It should be understood that the embodiments of this application do not limit how print commands are identified from the above-described print description file. For example, print commands can be identified from the above-described print description file through print protocol identification rules. Print protocol identification rules can be a separate rule file or a rule file that covers the format requirements for determining preset print commands, and there is no limitation on this.

[0088] Printing protocol identification rules can include specific beginning and ending sequences of the print command. Taking the PJL command as an example, its printing protocol identification rules could be:

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

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

[0091] The command that satisfies both (1) and (2) the printing protocol identification rules can be the PJL command.

[0092] It should be understood that the target repair method used to repair the first print command can be determined, for example, based on the type of the first print command and / or the reason why the first print command does not meet the format requirements.

[0093] The following section explains how to select the corresponding target repair method based on the type of the first print command.

[0094] The type of print command can be a target function-related command for non-graphic printing devices or a target function-related command.

[0095] Optionally, the target function-related commands of the non-graphical printing device can be non-core function commands during the printing process, such as any one or more commands related to the username or printer status. Since the presence or absence of these target function-related commands does not affect the printed content, the target repair method for such commands could be, for example, deleting the first print command or deleting illegal bytes from the first print command. This ensures the accuracy of the printed content while repairing erroneous commands.

[0096] For example, the PJL command for the username (USERNAME) in the rules 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, namely the PJL command for the username (USERNAME), is:

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

[0100] The first print command contains a duplicate 0x0D0x0A byte, resulting in a second 0x0D0x0A byte being invalid. Therefore, the first print command is faulty, and attempting to print with this command may cause error pages. Since this first print command is not related to the target function of the graphics printing device, the electronic device can control the driver to delete the first print command, allowing the printer to output the print content. Alternatively, it can delete the invalid byte in the first print command, specifically the second 0x0D0x0A invalid byte, to allow the printer to output the print content.

[0101] Optionally, the target function-related commands can be core function commands in the printing process, such as commands for the number of copies to print, printing direction, or any one or more of these. Deleting or removing illegal bytes from the target function commands will affect the printed output. Therefore, the method for repairing target function-related commands is to either replace illegal bytes in the first print command with preset values, or fill in missing bytes in the first print command with preset values.

[0102] For example, the PJL command regarding the number of copies in the rules file is:

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

[0104] In the print description file, the first print command, namely the PJL command for the number of 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 first print command is an illegal byte. Printing with this first print command may result in an error page being printed. Because this first print command is related to the target function, deleting it or removing illegal bytes from it may prevent printing. Therefore, the default value (also called the default value), 1, corresponding to this first print command can be used to replace the illegal byte -5 in the first print command to ensure the printer outputs the correct content.

[0107] For example, in the print description file, the first print command, i.e., the PJL command for the number of copies, is:

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

[0109] In this first print command, the PJL command for the number of copies is missing a byte. Printing with this first print command may result in printing error pages. Since this first print command is a target function-related command, deleting this first print command or deleting illegal bytes in the first print command may prevent printing. Therefore, the default value (also known as the default value), i.e., 1, corresponding to this first print command can be used to fill in the missing bytes in the first print command so that the printer can output the correct print content.

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

[0111] The following explains how to select the corresponding repair method based on the reason why the first print command does not meet the format requirements.

[0112] Optionally, the reason why the first print command does not meet the format requirements may be due to a syntax error or a semantic error. When the first print command has a syntax error, you can choose to delete the first print command or delete the illegal bytes in the first print command as a repair method. When the first print command has a semantic error, you can choose to replace the illegal bytes in the first print command with preset values, or fill the missing bytes in the first print command with preset values.

[0113] For example, in the print description file, the first print command for the username (USERNAME) is the PJL command as follows:

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

[0115] The first print command contains a duplicate 0x0D0x0A, resulting in a second 0x0D0x0A being an illegal byte, thus constituting a syntax error. Since the presence or absence of a syntax error command does not affect the printed content, the target repair method for such commands could be, for example, deleting the first print command or removing the illegal bytes within it. This would ensure the accuracy of the printed content while correcting the erroneous command. Therefore, the electronic device can control the driver to delete the first print command, allowing the printer to output the printed content. Alternatively, it can delete the illegal bytes within the first print command, specifically the second 0x0D0x0A illegal byte, to allow the printer to output the correct printed content.

[0116] For example, in the print description file, the first print command's PJL command regarding the number of 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, resulting in a semantic error. Because this first print command is semantically incorrect, deleting it or removing the illegal byte might prevent printing. Therefore, the default value (also known as the default value), 1, corresponding to the first print command can be used to replace the illegal byte -5, allowing the printer to output the correct content.

[0119] Similarly, if the PJL command regarding the number of copies to be printed is missing a byte, 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 illegal bytes in the first print command may cause printing failure. Therefore, the default value (also known as the default value) corresponding to the first print command, i.e., 1, can be used to fill the missing bytes in the first print command so that the printer can output the print content correctly.

[0120] In addition, the corresponding repair method can be selected based on the type of the first print command and the reason why the first print command does not meet the format requirements.

[0121] Taking the first print command in the print description file, the PJL command related to the username (USERNAME), as an example:

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

[0123] The first print command repeats the 0x0D0x0A byte, making the second 0x0D0x0A an illegal byte. Firstly, this first print command is not related to the target function of the graphics printing device; secondly, the error in the first print command is a syntax error. Since the presence or absence of a syntax error command does not affect the printed content, the first print command can be deleted to allow the printer to output the printed content. Alternatively, the illegal bytes in the first print command can be deleted, specifically the second 0x0D0x0A illegal byte, to allow the printer to output the correct printed content.

[0124] Based on selecting the 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, embodiments of this application can also display error information and repair methods to the user, allowing the user to choose whether to repair the first print command. For example, the electronic device control driver can display error information and repair methods to the user in a pop-up window, providing the user with an option to perform repair, and can perform repair in response to the user's selection of the repair option.

[0125] Optionally, in this embodiment of the application, the error information and repair method can also be displayed to the user after the automatic repair is completed or after printing, so that the user can understand the error information and automatic repair method in a timely manner and improve the user experience.

[0126] The print data repair method provided in this application can locate print commands in the print description file that do not meet the format requirements according to the rule file, and automatically repair them, so as to avoid the situation where error pages are printed due to the existence of erroneous print commands.

[0127] The aforementioned target repair method can also be located in the rule file used to determine the format requirements of the 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 used to further determine the repair method of the print command.

[0128] In this embodiment, the electronic device control driver can accurately identify printing commands according to the rule file, and determine whether the printing command is erroneous according to the rule file. For erroneous printing commands, they can also be quickly repaired according to the mapping relationship in the rule file, which improves the accuracy of repairing erroneous commands, reduces the time for manual inspection and repair of printing commands, and improves the efficiency of printing tasks.

[0129] The aforementioned print data repair method can be considered a function of the electronic device control driver. This print data repair method can be an optional mode of the driver, meaning it can be enabled or disabled based on user needs.

[0130] Specifically, Figure 2 This is a schematic diagram of a user interface provided in an embodiment of this application. Figure 2 As illustrated, the print data repair method can be offered as an option in the driver's user interface for user operation. When the user selects the automatic repair mode option, the electronic device, after generating the print description file using the driver, will first execute the above steps. Figure 1 After following the repair method shown, send the repaired print profile to the printer to perform the print operation. After the repair is complete, the user can uncheck this option to turn off the repair mode. The electronic device will then directly send the print profile to the printer for printing without performing any further steps. Figure 1 The repair method shown improves the printer's operating speed.

[0131] This application embodiment provides an option in the user interface of the driver that the user can choose to enable or disable the repair mode. The user can use this option to choose whether to enter the repair mode according to their own needs. This method meets the user's personalized needs, and the printer's running speed is improved after the repair mode is disabled, thus enhancing the user's 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, embodiments of this application may also use the description information of the first print command as patch information for the print driver to prevent subsequent driver execution from including this erroneous print command in the generated print description file.

[0133] Optionally, the description information of the first print command can be a "keyword" of the first print command. The description information of the first print command can also serve as patch information for the print driver.

[0134] For example, the PJL command for the first print command in the above print description file regarding the username is:

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

[0136] The first print command failed because it repeated 0x0D0x0A, causing the second 0x0D0x0A to be an illegal byte. To resolve this error, the "keyword" of the PJL command regarding the username (USERNAME), i.e., USERNAME, can be used as patch information.

[0137] Subsequently, when the driver is running to generate the print description file, the patch information can be traversed. 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, or 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] Patch information can be stored in a separate file or in the aforementioned rule file. Taking the PJL command as an example, the rule file can be as shown in Table 1 below:

[0139] Table 1

[0140]

[0141] Furthermore, patch information can also be synchronized to a server, which could be the server corresponding to the printer manufacturer. By synchronizing patch information to the server, the printer manufacturer can analyze the erroneous commands and thoroughly resolve the issues in subsequent driver updates. In other words, the electronic device can receive the updated printer driver from the server, based on the patch information. Since the updated printer driver resolves the aforementioned problems, the situation of generating an erroneous first print command will not occur again when generating the required print profile the next time.

[0142] In existing technologies, when error pages are printed, users can only rely on contacting the printer manufacturer to have them inspect the job data that caused the problem in order to analyze the cause of the error. This results in time-consuming and inefficient driver repair. Furthermore, if the job data involves confidential user information and cannot be disclosed to the manufacturer, the problem becomes difficult to resolve.

[0143] This application embodiment obtains erroneous print commands and the causes of errors by reporting patch information to the server, eliminating the need for printer manufacturers to visit and inspect job data. This improves the efficiency and accuracy of analyzing the causes of errors, thereby improving the efficiency and accuracy of driver updates and preventing the leakage of user confidential information.

[0144] Figure 3 This is a flowchart illustrating another print data repair method provided in an embodiment of this application. Figure 3 As shown, the method may include the following steps:

[0145] 1. In response to the user launching the driver through the user interface, launch the driver.

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

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

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

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

[0150] 6. Print the print description file.

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

[0152] The above are the method embodiments provided in this application. The apparatus provided in this application will be described below.

[0153] Figure 4 This is a schematic diagram of a print data repair device provided in an embodiment of this application. Figure 4 As shown, the print data repair device 400 may include, for example, an acquisition module 401 and a repair 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 print information through preset print commands, and the rule file is used to determine the format requirements of the preset print commands.

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

[0156] Optionally, the rule file is also used to determine the target repair method for the first print command. Repair module 402 is specifically used to repair the print description file based on the target repair method.

[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 a 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.

[0159] Optionally, the rules file includes printing protocol identification rules, format requirements, and mapping relationships of repair methods corresponding to the printing commands.

[0160] Optionally, module 401 is specifically used to obtain the print description file and the rule file when in repair mode.

[0161] Optionally, the processing module 403 is further configured to use the description information of the first print command as patch information for the print driver. The patch information is used to ensure that the first print command that does not meet the format requirements does not exist in the generated print description file when the print driver generates the print description file.

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

[0163] Optionally, the transceiver module 404 is also used to receive the updated print driver based on patch information sent by the server. The print driver is used to generate a print description file based on the print job.

[0164] The print data repair device 400 provided in this application embodiment can be used to implement the actions performed by the electronic device in any of the aforementioned method embodiments. Its implementation principle and technical effect are similar, and will not be described again here.

[0165] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 5 As shown, the electronic device 500 may include a memory 501 and a processor 502. Optionally, the electronic device may also include a transceiver 503, wherein the memory 501 and the processor 502 communicate with each other; for example, 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 embodiments.

[0166] Optionally, the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps in the method embodiments disclosed in this application can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.

[0167] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the methods in any of the above method embodiments.

[0168] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the methods in any of the above method embodiments.

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

[0170] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0171] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0172] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

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

[0174] In this application, the term "comprising" and its variations can refer to non-limiting inclusion; the term "or" and its variations can refer to "and / or". The terms "first", "second", etc., in this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. In this application, "multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.

Claims

1. A method for repairing printed data, characterized in that, The method includes: Obtain a print description file and a rule file. The print description file is used to describe print information through preset print commands, and the rule file is used to determine the format requirements of the preset print commands. If there is a first print command in the print description file that does not meet the format requirements, then the first print command is repaired to obtain a repaired print description file. All print commands in the repaired print description file meet the format requirements. The rule file is also used to determine the target repair method for the first print command; The repair of the print description file includes: repairing the print description file based on the target repair method; If the first print command is a command related to the target function of the graphic printing device, the target repair method is: 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; If the first print command is not related to the target function, the target repair method is: delete the first print command, or delete the illegal bytes in the first print command.

2. The method according to claim 1, characterized in that, The rule file includes: The printing protocol identification rules, format requirements, and mapping relationship of the printing command and the repair method.

3. The method according to claim 1 or 2, characterized in that, The process of obtaining the print description file and rule file includes: In repair mode, obtain the print description file and rule file.

4. The method according to claim 1, characterized in that, The method further includes: The description information of the first print command is used as patch information for the print driver. The patch information is used to ensure that the first print command that does not conform to the format requirements does not exist in the generated print description file when the print driver generates the print description file.

5. The method according to claim 4, characterized in that, The method further includes: The patch information is synchronized to the server.

6. The method according to claim 5, characterized in that, The method further includes: The system receives the updated print driver from the server, which is based on the patch information. The print driver is used to generate a print description file based on the print task.

7. A print data repair device, characterized in that, The device includes: The acquisition module is used to acquire a print description file and a rule file. The print description file is used to describe print information through preset print commands, and the rule file is used to determine the format requirements of the preset print commands. The repair module is used to repair the first print command in the print description file when it does not conform to the format requirements, thereby obtaining a repaired print description file in which all print commands conform to the format requirements. The rule file is also used to determine the target repair method for the first print command; and to repair the print description file based on the target repair method. If the first print command is a command related to the target function of the graphic printing device, 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. If the first print command is not a command related to the target function, the target repair method is: deleting the first print command, or deleting illegal bytes in the first print command.

8. An electronic device, characterized in that, include: Processor; memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-6.

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

10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method of any one of claims 1-6.