Printing method and device, electronic equipment and storage medium

By obtaining the printer's printing status information and calculating the difference in the number of printed pages, determining the data to be filled and sending it to the printer, the problem of accounting and actual differences caused by printing abortion is solved, and the accuracy of the printing data and the reliability of the system is improved.

CN118963682APending Publication Date: 2024-11-15BEIJING DINGDUN INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411019048.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

In the printing system of confidential units, when the printer is suspended due to power outage, paper jams, paper outages and other failures, the life cycle management system cannot accurately record the printing data, resulting in the problem of inconsistent accounts and actual accounts.

Method used

By obtaining the printer's printing status information, calculate the difference between the target number of printed pages and the actual number of printed pages. If the difference is greater than the preset value, determine the data to be filled and sent to the printer to ensure the integrity of the printing task and reduce the The situation where the account is inconsistent.

Benefits of technology

It realizes the integrity of printing tasks, reduces the situation of inconsistent accounts and actual accounts in the life cycle management system, and improves the accuracy and reliability of printing data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118963682A_ABST
    Figure CN118963682A_ABST
Patent Text Reader

Abstract

The invention discloses a printing method and device, electronic equipment and a storage medium, and relates to the technical field of document printing, and the method comprises the following steps: obtaining printing state information of a printer for first to-be-printed data; when it is determined that printing of the first to-be-printed data is completed based on the printing state information, the page difference value between the target printing page number and the actual printing page number in the printing state information is calculated; and when the page difference value is greater than a preset value and a reprinting instruction is received, determining to-be-reprinted data based on the printing state information, and sending the to-be-reprinted data to the printer. By means of the method, complete printing of the first to-be-printed data can be achieved, and the situation that accounts are inconsistent in a life cycle management system is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of document printing, and in particular to a printing method, device, electronic device and storage medium. Background Art

[0002] In confidential units, it is required to manage the entire life cycle of all printed paper carriers. That is to say, the printing system needs to manage and record data such as the number of pages printed on a paper material and the type of paper until the paper carrier is finally destroyed, and there must be no discrepancies between the accounts and the actual situation.

[0003] Currently, if a printer encounters a power outage, paper jam, paper shortage, or any other hardware failure during the printing process, the printer may report that the printing task has been terminated or completed. At this time, the lifecycle management system can only record the completion of printing, resulting in a discrepancy between the accounts and the actual situation. Summary of the invention

[0004] The present application provides a printing method, device, electronic device and storage medium, which can solve the problem of discrepancy between accounts and actuals when the current printing system manages and records printing data.

[0005] In a first aspect, the present application provides a printing method, the method comprising:

[0006] Acquire printing status information of the printer for the first data to be printed;

[0007] When it is determined based on the printing status information that the first to-be-printed data has been printed, calculating a page difference between a target number of printed pages and an actual number of printed pages in the printing status information;

[0008] When the page difference is greater than a preset value and a supplementary printing instruction is received, the data to be supplemented is determined based on the page difference, and the data to be supplemented is sent to the printer.

[0009] Through the above method, the target number of printed pages and the actual number of printed pages of the printer are obtained. Therefore, when it is determined that there is an incomplete printing problem based on the difference between the target number of printed pages and the actual number of printed pages, the data to be reprinted can be sent to the printer to achieve complete printing of the first data to be printed, thereby reducing the discrepancy between accounts and actuals in the lifecycle management system.

[0010] In a possible embodiment, before obtaining the printing status information of the printer for the first to-be-printed data, the method further includes:

[0011] Acquire the first to-be-printed data issued by the printing system;

[0012] Parsing the first data to be printed to obtain printing information; wherein the printing information at least includes the number of printed pages, the number of printed copies and the printing order;

[0013] The second data to be printed corresponding to each page to be printed is determined based on the first data to be printed and the printing information, and a mark is added to the second data to be printed corresponding to each page to be printed.

[0014] By means of the above method, the first data to be printed and the printing information are obtained, so that when reprinting is required, the data to be reprinted is determined based on the first data to be printed and the printing information.

[0015] In a possible embodiment, obtaining the printing status information of the printer for the first to-be-printed data includes:

[0016] Acquire the printing data built into the printer through SNMP to obtain the printing status information; or

[0017] Use PJL to obtain the printing data built into the printer to obtain the printing status information; or

[0018] The printing status information is obtained from the printer add-on component.

[0019] Through the above method, the printing status information can be obtained in different ways.

[0020] In a possible embodiment, determining that printing of the first to-be-printed data is completed based on the printing status information includes:

[0021] When it is detected based on the printing status information that the working state of the printer is switched from printing to idle state, determining that the printing of the first to-be-printed data is completed; or

[0022] When it is detected based on the printing status information that the actual number of printed pages of the printer currently obtained is the same as the actual number of printed pages obtained N times before, it is determined that the printing of the first data to be printed is completed; wherein N is an integer greater than 0.

[0023] Through the above method, it is possible to accurately determine whether the printing task is completed.

[0024] In a possible embodiment, determining the data to be reprinted based on the printing status information includes:

[0025] Determine the pages to be supplemented based on the page difference, the number of printed pages and the number of printed copies in the printing information corresponding to the first data to be printed;

[0026] The data to be reprinted corresponding to the pages to be reprinted are determined based on the printing order in the printing information and the first data to be printed.

[0027] By using the above method, the pages to be supplemented and the supplemented data corresponding to the pages to be supplemented are determined, and the supplemented data is sent to the printer, thereby achieving complete printing of the first data to be printed.

[0028] In a possible embodiment, determining the data to be reprinted based on the printing status information further includes:

[0029] Determining a printing completion page based on the marked printing completion data in the printing status information;

[0030] Determine the page to be supplemented based on the number of copies in the printing information corresponding to the printing completed page and the first data to be printed;

[0031] Based on the second data to be printed corresponding to each page to be printed, the data to be reprinted corresponding to the page to be reprinted is determined.

[0032] Through the above method, the printed page can be determined based on the marked printed data, so that the page to be supplemented can be specifically and accurately determined based on the printed page.

[0033] In a possible embodiment, the method further includes:

[0034] When the page difference is equal to the preset value, confirming that the first data to be printed has been printed;

[0035] When the page difference is less than the preset value, a prompt message of printing abnormality is generated.

[0036] Through the above method, the accuracy of printing can be improved, and when printing abnormalities occur, they can be discovered and resolved in time.

[0037] In a second aspect, the present application provides a printing device, the device comprising:

[0038] A first acquisition module, used to acquire the printing status information of the printer for the first to-be-printed data;

[0039] a calculation module, configured to calculate a page difference between a target number of printed pages and an actual number of printed pages in the printing status information when it is determined based on the printing status information that printing of the first data to be printed is completed;

[0040] The reprinting module is used to determine the data to be reprinted based on the page difference when the page difference is greater than a preset value and a reprinting instruction is received, and send the data to be reprinted to the printer.

[0041] In a possible embodiment, the device further includes:

[0042] A second acquisition module, used for acquiring the first to-be-printed data sent by the printing system;

[0043] A parsing module, used for parsing the first data to be printed to obtain printing information; wherein the printing information at least includes the number of printed pages, the number of printed copies and the printing order;

[0044] A determination module is used to determine the second data to be printed corresponding to each page to be printed based on the first data to be printed and the printing information, and to add a mark to the second data to be printed corresponding to each page to be printed.

[0045] In a possible embodiment, the first acquisition module is specifically used to:

[0046] Acquire the printing data built into the printer through SNMP to obtain the printing status information; or

[0047] Use PJL to obtain the printing data built into the printer to obtain the printing status information; or

[0048] The printing status information is obtained from the printer add-on component.

[0049] In a possible embodiment, the calculation module is specifically used for:

[0050] When it is detected based on the printing status information that the working state of the printer is switched from printing to idle state, determining that the printing of the first to-be-printed data is completed; or

[0051] When it is detected based on the printing status information that the actual number of printed pages of the printer currently obtained is the same as the actual number of printed pages obtained N times before, it is determined that the printing of the first data to be printed is completed; wherein N is an integer greater than 0.

[0052] In a possible embodiment, the supplementary printing module is specifically used for:

[0053] Determine the pages to be supplemented based on the page difference and the number of printed pages and the number of printed copies in the printing information corresponding to the first data to be printed;

[0054] The data to be reprinted corresponding to the pages to be reprinted are determined based on the printing order in the printing information and the first data to be printed.

[0055] In a possible embodiment, the supplementary printing module is further used for:

[0056] Determining a printing completion page based on the marked printing completion data in the printing status information;

[0057] Determine the page to be supplemented based on the number of copies in the printing information corresponding to the printing completed page and the first data to be printed;

[0058] Based on the second data to be printed corresponding to each page to be printed, the data to be reprinted corresponding to the page to be reprinted is determined.

[0059] In a possible embodiment, the supplementary printing module is further used for:

[0060] When the page difference is equal to the preset value, confirming that the first data to be printed has been printed;

[0061] When the page difference is less than the preset value, a prompt message of printing abnormality is generated.

[0062] In a third aspect, the present application provides an electronic device, including:

[0063] Memory, used to store computer programs;

[0064] The processor is used to implement the printing method of the first aspect when executing the computer program stored in the memory.

[0065] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the printing method of the first aspect is implemented.

[0066] In a fifth aspect, the present application provides a computer program product, which includes: a computer program code, when the computer program code is run on a computer, the computer executes the printing method of the first aspect.

[0067] The technical effects that can be achieved in each of the above-mentioned second to fifth aspects and each of the above-mentioned aspects refer to the technical effects that can be achieved in the above-mentioned first aspect or various possible schemes in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] Figure 1 A schematic diagram of a scenario applicable to an embodiment of the present application;

[0069] Figure 2 A flowchart of a printing method provided in an embodiment of the present application;

[0070] Figure 3 A schematic diagram of the structure of a printing device provided in an embodiment of the present application;

[0071] Figure 4 A schematic diagram of the structure of another printing device provided in an embodiment of the present application;

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

[0073] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The specific operating methods in the method embodiments can also be applied to device embodiments or system embodiments. It should be noted that in the description of the present application, "multiple" is understood as "at least two". "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, and A and B exist, and B exists alone. A is connected to B, which can represent: A is directly connected to B and A is connected to B through C. In addition, in the description of the present application, words such as "first" and "second" are only used to distinguish the purpose of description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.

[0074] In order to facilitate understanding by those skilled in the art, the technical terms involved in the embodiments of the present application are first explained.

[0075] (1) Simple Network Management Protocol (SNMP) is an application layer protocol that specifies a standardized management framework, a common language for communication, and corresponding security and access control mechanisms for monitoring and managing devices in a network environment. SNMP can be used to query printer information, modify printer parameter values, monitor printer status, automatically detect network faults, generate reports, etc.

[0076] (2) Printer Job Language (PJL) is a printer command language used to control the behavior of the printer, control the status of the printer in a print job, and send instructions to the printer. PJL commands can be written into a printer job through a printer driver or a print data stream.

[0077] The following is a brief introduction to the application scenarios to which the technical solutions of the embodiments of the present application can be applied. It should be noted that the application scenarios introduced below are only used to illustrate the embodiments of the present application and are not limited. In specific implementation, the technical solutions provided by the embodiments of the present application can be flexibly applied according to actual needs.

[0078] Figure 1Schematic diagram of an application scenario applicable to the embodiment of the present application. The scenario mainly includes a printing system 101 and a printer 102. The printing system 101 and the printer exchange information through a printing control component, and the printing system 101 and the printing control component, and the printing control component and the printer 102 can exchange information through a communication network, USB, serial port, parallel port, etc. The communication mode adopted by the communication network may include: wireless communication mode and wired communication mode.

[0079] Exemplarily, the printer 102 can access the network through cellular mobile communication technology to communicate with the printing control component. The cellular mobile communication technology may include the fifth generation mobile communication (5th Generation Mobile Networks, 5G) technology.

[0080] Exemplarily, the printer 102 may access the network and communicate with the printing control component via short-range wireless communication. The short-range wireless communication may include Wireless Fidelity (Wi-Fi) technology.

[0081] The present application embodiment does not impose any restriction on the number of the above-mentioned devices. Figure 1 As shown, only the printing system 101 and the printer 102 are described as examples, and the above-mentioned devices and their respective functions are briefly introduced below.

[0082] The printing system 101 is installed in the operating system on a PC or a server, and generally refers to the printing pool service of a Windows system, the Common Unix Printing System (CUPS) of a Linux system, etc. After receiving a printing task initiated by an application (such as MS Office, WPS), the printing system 101 cooperates with the printer driver to parse the first data to be printed, and sends the first data to be printed to the printer 102 via the printing control component.

[0083] The print control component is deployed between the printing system 101 and the printer 102. It is used to intercept the print task that the printing system 101 should originally send to the printer 102, and connect with the printer 102 to control the printing process, send the print task to the printer 102, and obtain the print status information of the printer 102, determine the printing completion status, and perform reprinting as needed.

[0084] The print control component can be a software program installed in a PC or server together with the printing system 101, or a hardware device installed between the PC or server and the printer 102. It is mainly used to obtain the print task issued by the printing system, obtain the first data to be printed, and parse the first data to be printed to obtain the printing information, wherein the printing information at least includes the number of pages to be printed, the number of copies to be printed, the printing mode, the environmental protection information, and the printing order, and at the same time, store the first data to be printed and the printing information. Then, the print control component sends the first data to be printed to the printer 102, monitors the printer 102, and obtains the printing status information of the printer 102. Among them, the printer status information includes the target number of pages to be printed, the working status and other information.

[0085] The printer 102 is used to print the first data to be printed and generate corresponding printing status information.

[0086] Based on the above application scenario, a printing method provided in an embodiment of the present application can obtain the target number of pages and the actual number of pages of the printer, so that when it is determined that there is an incomplete printing problem based on the difference between the target number of pages and the actual number of pages, the data to be supplemented can be sent to the printer to achieve complete printing of the first data to be printed, thereby reducing the discrepancy between the account and the actual in the life cycle management system. Among them, the method and device described in the embodiment of the present application are based on the same technical concept. Since the principles of the problems solved by the method and the device are similar, the embodiments of the device and the method can refer to each other, and the repeated parts will not be repeated.

[0087] To further illustrate the technical solution provided by the embodiment of the present application, this is described in detail below in conjunction with the accompanying drawings and specific implementation methods. Although the embodiment of the present application provides the method operation steps as shown in the following embodiments or drawings, more or fewer operation steps may be included in the method based on routine or no creative labor. In the steps where there is no necessary causal relationship logically, the execution order of these steps is not limited to the execution order provided by the embodiment of the present application. The method may be executed or executed in parallel in the actual processing process or when the device is executed in accordance with the method sequence shown in the embodiment or drawings.

[0088] Figure 2 This is a flow chart of a printing method provided in an embodiment of the present application. The flow can be executed by a printing device, which can be implemented by software, hardware, or a combination of software and hardware. Figure 2 As shown, the process includes the following steps:

[0089] 201: Obtain printing status information of a printer for first data to be printed.

[0090] In the embodiment of the present application, in order to achieve Figure 1 The control of the printer 102 shown can be achieved by deploying a print control component between the printing system 101 and the printer 102, replacing the communication between the printing system 101 and the printer 102 with the communication between the print control component and the printing system 101. Specifically:

[0091] The printing control component obtains the first data to be printed sent by the printing system 101, wherein the first data to be printed is the data that the printing system 101 will send to the printer 102, including the data of the page to be printed, the printing task information and the control instructions. And parse the first data to be printed to obtain the printing information; wherein the printing information at least includes the number of printed pages, the number of printed copies, the printing method (for example, single-sided printing, double-sided printing), environmental protection information, and the printing order (for example, sequential printing, reverse printing). The first data to be printed and the printing information are thus stored so that reprinting can be performed based on the stored first data to be printed and the printing information when reprinting is needed. As shown in Table 1, a first data table to be printed is provided in an embodiment of the present application:

[0092] Printing task information First page data Second page data Page 3 Data ……

[0093] Table 1 A first data table to be printed

[0094] The first data to be printed corresponding to each page to be printed can be determined from Table 1, wherein the data structure of the first data to be printed varies according to different printer drivers.

[0095] Furthermore, the print control component communicates with the printer 102 , and the content of the communication includes sending the first to-be-printed data to the printer 102 , and obtaining the printing status information of the printer 102 from the printer 102 .

[0096] Specific:

[0097] Obtain the printing status information of the printer 102. The method for obtaining the printing status information may be: obtaining the built-in printing data of the printer 102 through SNMP to obtain the printing status information. For example, the printing data includes the working status, connection status, actual number of printed pages, and other information of the printer 102. Then, the working status, connection status, and actual number of printed pages in the printing data are extracted to generate the printing status information; or

[0098] For a printer 102 that supports PJL, PJL is used to obtain data built into the printer 102 to obtain printing status information. For example, if the printing data includes the working status, connection status, printing result, and other information of the printer 102, the working status, connection status, and printing result in the printing data are extracted to generate printing status information; or

[0099] Communicate with the printer add-on component and obtain the printing status information from the printer add-on component, so that the printing status information of the printer can be obtained in different ways.

[0100] It should be noted that the above acquisition process can be performed according to a preset period, for example, once every 30 seconds or once every minute. The preset period can also be dynamically adjusted according to the number of printed pages. The specific value of the preset period depends on the situation and is not limited here.

[0101] Optionally, the printing result in the printer status information may be the total number of pages printed historically, or it may be the number of pages within a certain time period, that is, the number of pages can be reset, and the printing result can be used to perform numerical calculations before and after printing, that is, the target number of printed pages and the actual number of printed pages can be obtained from the printer status information. The target number of printed pages is the total number of printed pages recorded in the printer 102 or the printer's additional components before the actual printing occurs; the actual number of printed pages is the number of printed pages recorded in the printer 102 or the printer's additional components after the actual printing is completed; the working status of the printer 102 includes: printing, idle, out of paper, paper jam, etc., to assist in judging the printing situation.

[0102] In a possible embodiment, the print control component can also determine the second data to be printed corresponding to each page to be printed based on the first data to be printed and the printing information, and add a mark to the second data to be printed corresponding to each page to be printed and store it, for example, respectively add a mark to the header data and footer data corresponding to each page to be printed, so as to send the marked data to be reprinted to the printer 102, so that the print control component can determine through the mark that the printer 102 has completed printing the data. Or

[0103] Marks may also be added to the first and last data of each M lines of the second data to be printed corresponding to each page to be printed, thereby sending the marked data to be reprinted to the printer 102, so that the print control component can determine through the mark that the printer 102 has completed printing the data.

[0104] 202: When it is determined based on the printing status information that the printing of the first to-be-printed data is completed, a page difference between the target number of printed pages in the printing status information and the actual number of printed pages is calculated.

[0105] In an embodiment of the present application, the printing control component determines that the printing of the first data to be printed is completed when it detects based on the printing status information that the working status of the printer switches from printing to idle status; or determines that the printing of the first data to be printed is completed when it detects based on the printing status information that the actual number of printed pages currently obtained by the printer is the same as the actual number of printed pages obtained N times before, that is, when the actual number of printed pages obtained twice or more times is the same, it is considered that the printer 102 is in an idle state, and when the actual number of printed pages is gradually increasing, it is considered that the printer 102 is printing; wherein N is an integer greater than 0, and the specific value of N depends on the situation and is not limited here.

[0106] Further, the print control component calculates the page difference between the target number of printed pages and the actual number of printed pages in the print status information.

[0107] In some possible embodiments, when encountering abnormal working conditions such as paper shortage or paper jam, the printing process will be blocked, but printing will usually continue after the fault is resolved, which will not affect the final actual number of printed pages. Therefore, it is treated as printing in progress. If abnormal working conditions such as paper shortage or paper jam eventually lead to printing termination, the final number of printed pages will be used as the actual number of printed pages; when encountering abnormal conditions such as power failure or fault of the printer 102 where printing cannot be restored, the number of printed pages obtained from the last communication will be used as the actual number of printed pages.

[0108] 203: When the page difference is greater than a preset value and a reprint instruction is received, the data to be reprinted is determined based on the printing status information, and the data to be reprinted is sent to the printer.

[0109] In an embodiment of the present application, after the page difference is calculated by the above method, it is further determined whether the page difference is greater than a preset value, wherein the preset value is 0. When the page difference is equal to the preset value, it is confirmed that the first data to be printed has been printed, and the communication with the printer 102 is disconnected; when the page difference is less than the preset value, a prompt message of a printing abnormality is generated and the communication with the printer 102 is disconnected so that the user can handle the abnormality in time.

[0110] When the page difference is greater than a preset value, the printing is considered incomplete and needs to be reprinted at an appropriate time. Specifically, when a reprint instruction is received, the pages to be reprinted are determined based on the page difference and the number of printed pages and the number of printed copies in the printing information parsed from the first data to be printed. For example, when the number of printed copies is 1, the pages to be reprinted can be determined by calculating the difference between the page difference and the number of printed pages in the printing information. The reprint instruction can be a signal sent manually, a signal for the printer to resume normal operation, or a signal sent by other related systems.

[0111] Furthermore, based on the printing order in the printing information and the first data to be printed, the data to be reprinted corresponding to the page to be reprinted is determined, the data to be reprinted is sent to the printer 102 , and the printing status information of the printer 102 is obtained.

[0112] For example, the number of printed pages in the printing information is 10 pages and 1 copy, that is, the total number of printed pages is 10 pages. The first data to be printed contains the data of these 10 pages, and the data corresponding to each printed page can be analyzed. The page difference is 4, and the number of pages to be reprinted is 6. The printing order is sequential printing, so pages 1 to 4 have been printed normally, and pages 5 to 10 need to be reprinted, which are the pages to be reprinted. Then, the data of pages 5 to 10 are extracted from the first data to be printed and sent to the printer 102 as the data to be reprinted for printing.

[0113] In a possible embodiment, when a mark is added to the second data to be printed corresponding to each page to be printed, and the marked data to be reprinted is sent to the printer 102 for printing, the marked printing completion data can be extracted from the printing data of the printer 102 and added to the printing status information, so that the printing control component can determine the printing completion page based on the marked printing completion data in the printing status information. Further, the page to be reprinted is determined based on the number of copies of the printing completion page and the printing information corresponding to the first data to be printed, and the data to be reprinted corresponding to the page to be reprinted is determined according to the second data to be printed corresponding to each page to be printed, so that the data to be reprinted is sent to the printer 102 and the printing status information of the printer 102 is obtained.

[0114] In a possible embodiment, when marking the first data and the last data of each M lines of the second data to be printed corresponding to each page to be printed, and sending the marked data to be reprinted to the printer 102 for printing, the marked printing completion data can be extracted from the printing data of the printer 102 and added to the printing status information, so that the printing control component can determine the corresponding printing page based on the marked printing completion data in the printing status information. Then, it can be determined whether the printing page is printed based on the second data to be printed corresponding to each page to be printed. If so, the page to be reprinted is determined based on the number of print copies in the printing information corresponding to the printing page and the first data to be printed, and the data to be reprinted corresponding to the page to be reprinted is determined; if not, the unprinted data in the printing page and the data to be reprinted corresponding to the page to be reprinted determined based on the number of print copies in the printing information corresponding to the printing page and the first data to be printed are both used as the data to be reprinted. Wherein, M is an integer greater than or equal to 1.

[0115] Through the above-mentioned printing method, the target number of printed pages and the actual number of printed pages of the printer are obtained. Therefore, when it is determined that there is an incomplete printing problem based on the difference between the target number of printed pages and the actual number of printed pages, the data to be reprinted can be sent to the printer to achieve complete printing of the first data to be printed, thereby reducing the discrepancy between accounts and actuals in the lifecycle management system.

[0116] Based on the same inventive concept, the present application also provides a printing device in an embodiment, such as Figure 3 FIG. 1 is a schematic diagram of a printing device provided in an embodiment of the present application, the device comprising:

[0117] The first acquisition module 301 is used to acquire the printing status information of the printer for the first to-be-printed data;

[0118] A calculation module 302, configured to calculate a page difference between a target number of printed pages and an actual number of printed pages in the printing status information when it is determined based on the printing status information that printing of the first data to be printed is completed;

[0119] The supplementary printing module 303 is used to determine the data to be supplemented based on the page difference value when the page difference value is greater than a preset value and a supplementary printing instruction is received, and send the data to be supplemented to the printer.

[0120] In a possible embodiment, the first acquisition module 301 is specifically used to:

[0121] Obtain the printer's built-in print data and print status information through SNMP; or

[0122] Use PJL to obtain the printer's built-in print data and obtain the print status information; or

[0123] The printing status information is obtained from the printer add-on component.

[0124] In a possible embodiment, the calculation module 302 is specifically used for:

[0125] When it is detected based on the printing status information that the working state of the printer is switched from printing to idle state, determining that the printing of the first to-be-printed data is completed; or

[0126] When it is detected based on the printing status information that the actual number of printed pages currently acquired by the printer is the same as the actual number of printed pages acquired N times previously, it is determined that the printing of the first data to be printed is completed; wherein N is an integer greater than 0.

[0127] In a possible embodiment, the supplementary printing module 303 is specifically used for:

[0128] Determine the pages to be supplemented based on the page difference and the number of printed pages and the number of printed copies in the printing information corresponding to the first data to be printed;

[0129] The to-be-printed data corresponding to the to-be-printed pages is determined based on the printing order in the printing information and the first to-be-printed data.

[0130] In a possible embodiment, the supplementary printing module 303 is further used for:

[0131] Determining a print completed page based on the marked print completed data in the print status information;

[0132] Determine the pages to be supplemented based on the number of copies in the printing information corresponding to the printing completed page and the first data to be printed;

[0133] Based on the second data to be printed corresponding to each page to be printed, the data to be reprinted corresponding to the page to be reprinted is determined.

[0134] In a possible embodiment, the supplementary printing module 303 is further used for:

[0135] When the page difference is equal to a preset value, confirming that the first data to be printed has been printed;

[0136] When the page difference is less than a preset value, a prompt message of printing abnormality is generated.

[0137] In other embodiments, in addition to the above Figure 3 In addition to the modules shown in FIG. 1 , the second acquisition module, the parsing module and the determination module may be further included. Figure 4 , which is a schematic diagram of the structure of another printing device provided by an embodiment of the present application. The device comprises: a first acquisition module 301 , a calculation module 302 , a supplementary printing module 303 , a second acquisition module 401 , a parsing module 402 and a determination module 403 .

[0138] The second acquisition module 401 is used to acquire the first to-be-printed data sent by the printing system;

[0139] The parsing module 402 is used to parse the first data to be printed and obtain printing information; wherein the printing information at least includes the number of printed pages, the number of printed copies and the printing order;

[0140] The determination module 403 is used to determine the second data to be printed corresponding to each page to be printed based on the first data to be printed and the printing information, and to add a mark to the second data to be printed corresponding to each page to be printed.

[0141] It should be noted here that the above-mentioned device provided in the embodiment of the present application can implement all the method steps in the above-mentioned method embodiment and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as the method embodiment will not be described in detail here.

[0142] Based on the same inventive concept, an electronic device is also provided in the embodiment of the present application, and the electronic device can realize the function of the aforementioned printing device, referring to Figure 5 , the electronic device comprises:

[0143] At least one processor 501, and a memory 502 connected to the at least one processor 501. The specific connection medium between the processor 501 and the memory 502 is not limited in the embodiment of the present application. Figure 5 In the example, the processor 501 and the memory 502 are connected via a bus 500. The bus 500 is Figure 5 The connections between other components are shown in bold lines, and are not intended to be limiting. The bus 500 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. Alternatively, the processor 501 can also be called a controller, and there is no limitation on the name.

[0144] In the embodiment of the present application, the memory 502 stores instructions that can be executed by at least one processor 501. The at least one processor 501 can execute the printing method discussed above by executing the instructions stored in the memory 502. The processor 501 can implement Figure 3 Or the functions of each module in the device shown in 4.

[0145] Among them, the processor 501 is the control center of the device, and can use various interfaces and lines to connect the various parts of the entire control device. By running or executing instructions stored in the memory 502 and calling data stored in the memory 502, the various functions of the device and processing data, the device can be monitored as a whole.

[0146] In one possible design, the processor 501 may include one or more processing units, and the processor 501 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 501. In some embodiments, the processor 501 and the memory 502 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on separate chips.

[0147] The processor 501 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and may implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the printing method disclosed in the embodiments of the present application may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0148] The memory 502 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 502 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 502 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 502 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.

[0149] By programming the processor 501, the code corresponding to the printing method described in the above embodiment can be fixed into the chip, so that the chip can execute the printing method when running. Figure 2 The steps of the printing method in the embodiment shown are as follows: How to design and program the processor 501 is a technique well known to those skilled in the art and will not be described in detail here.

[0150] Based on the same inventive concept, the embodiment of the present disclosure provides a computer storage medium, the computer storage medium includes: computer program code, when the computer program code is executed on a computer, the computer executes any one of the printing methods discussed above. Since the principle of solving the problem by the above computer storage medium is similar to that of a printing method, the implementation of the above computer storage medium can refer to the implementation of the method, and the repeated parts will not be repeated.

[0151] In the specific implementation process, the computer storage medium may include: Universal Serial Bus Flash Drive (USB), mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, and other storage media that can store program codes.

[0152] Based on the same inventive concept, the embodiment of the present disclosure also provides a computer program product, which includes: computer program code, when the computer program code is run on a computer, the computer executes any one of the printing methods discussed above. Since the principle of solving the problem by the above computer program product is similar to that of a printing method, the implementation of the above computer program product can refer to the implementation of the method, and the repeated parts will not be repeated.

[0153] The computer program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more conductors, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0154] The method in the present application can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed on a computer, the process or function described in the present application is executed in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device, a core network device, an OAM or other programmable device.

[0155] The computer program or instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program or instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired or wireless means. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; it may also be an optical medium, such as a digital video disk; it may also be a semiconductor medium, such as a solid-state drive. The computer-readable storage medium may be a volatile or non-volatile storage medium, or may include both volatile and non-volatile types of storage media.

[0156] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.

[0157] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor 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 has the functions specified in one or more boxes.

[0158] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including 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.

[0159] 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.

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

Claims

1. A printing method, characterized in that: The method comprises: Acquire printing status information of the printer for the first data to be printed; When it is determined based on the printing status information that the first to-be-printed data has been printed, calculating a page difference between a target number of printed pages and an actual number of printed pages in the printing status information; When the page difference is greater than a preset value and a reprint instruction is received, the data to be reprinted is determined based on the printing status information, and the data to be reprinted is sent to the printer.

2. The method according to claim 1, characterized in that Before obtaining the printing status information of the first to-be-printed data by the printer, the method further includes: Acquire the first to-be-printed data issued by the printing system; Parsing the first data to be printed to obtain printing information; wherein the printing information at least includes the number of printed pages, the number of printed copies and the printing order; The second data to be printed corresponding to each page to be printed is determined based on the first data to be printed and the printing information, and a mark is added to the second data to be printed corresponding to each page to be printed.

3. The method according to claim 1, characterized in that The step of obtaining the printing status information of the printer for the first data to be printed includes: Acquire the printing data built into the printer through the Simple Network Management Protocol (SNMP) to obtain the printing status information; or Using the print task language PJL to obtain the built-in print data of the printer to obtain the print status information; or The printing status information is obtained from the printer add-on component.

4. The method according to claim 1, characterized in that The determining, based on the printing status information, that the first to-be-printed data has been printed, includes: When it is detected based on the printing status information that the working state of the printer is switched from printing to idle state, determining that the printing of the first to-be-printed data is completed; or When it is detected based on the printing status information that the actual number of printed pages of the printer currently obtained is the same as the actual number of printed pages obtained N times before, it is determined that the printing of the first data to be printed is completed; wherein N is an integer greater than 0.

5. The method according to claim 1, characterized in that The step of determining the data to be supplemented based on the printing status information includes: Determine the pages to be supplemented based on the page difference, the number of printed pages and the number of printed copies in the printing information corresponding to the first data to be printed; The data to be reprinted corresponding to the pages to be reprinted are determined based on the printing order in the printing information and the first data to be printed.

6. The method according to claim 1, characterized in that The step of determining the data to be supplemented based on the printing status information further includes: Determining a printing completion page based on the marked printing completion data in the printing status information; Determine the page to be supplemented based on the number of copies in the printing information corresponding to the printing completed page and the first data to be printed; Based on the second data to be printed corresponding to each page to be printed, the data to be reprinted corresponding to the page to be reprinted is determined.

7. The method according to claim 1, characterized in that The method further comprises: When the page difference is equal to the preset value, confirming that the first data to be printed has been printed; When the page difference is less than the preset value, a prompt message of printing abnormality is generated.

8. A printing device, characterized in that: The device comprises: A first acquisition module, used to acquire the printing status information of the printer for the first to-be-printed data; a calculation module, configured to calculate a page difference between a target number of printed pages and an actual number of printed pages in the printing status information when it is determined based on the printing status information that printing of the first data to be printed is completed; The reprinting module is used to determine the data to be reprinted based on the page difference when the page difference is greater than a preset value and a reprinting instruction is received, and send the data to be reprinted to the printer.

9. The device according to claim 8, characterized in that The device also includes: A second acquisition module, used for acquiring the first to-be-printed data sent by the printing system; A parsing module, used for parsing the first data to be printed to obtain printing information; wherein the printing information at least includes the number of printed pages, the number of printed copies and the printing order; A determination module is used to determine the second data to be printed corresponding to each page to be printed based on the first data to be printed and the printing information, and to add a mark to the second data to be printed corresponding to each page to be printed.

10. The device according to claim 8, characterized in that The first acquisition module is specifically used for: Acquire the printing data built into the printer through the Simple Network Management Protocol (SNMP) to obtain the printing status information; or Using the print task language PJL to obtain the built-in print data of the printer to obtain the print status information; or The printing status information is obtained from the printer add-on component.

11. The device according to claim 8, characterized in that The calculation module is specifically used for: When it is detected based on the printing status information that the working state of the printer is switched from printing to idle state, determining that the printing of the first to-be-printed data is completed; or When it is detected based on the printing status information that the actual number of printed pages of the printer currently obtained is the same as the actual number of printed pages obtained N times before, it is determined that the printing of the first data to be printed is completed; wherein N is an integer greater than 0.

12. The device according to claim 8, characterized in that The supplementary printing module is specifically used for: Determine the pages to be supplemented based on the page difference and the number of printed pages and the number of printed copies in the printing information corresponding to the first data to be printed; The data to be reprinted corresponding to the pages to be reprinted are determined based on the printing order in the printing information and the first data to be printed.

13. The device according to claim 8, characterized in that The supplementary printing module is also used for: Determining a printing completion page based on the marked printing completion data in the printing status information; Determine the page to be supplemented based on the number of copies in the printing information corresponding to the printing completed page and the first data to be printed; Based on the second data to be printed corresponding to each page to be printed, the data to be reprinted corresponding to the page to be reprinted is determined.

14. The device according to claim 8, characterized in that The supplementary printing module is also used for: When the page difference is equal to the preset value, confirming that the first data to be printed has been printed; When the page difference is less than the preset value, a prompt message of printing abnormality is generated.

15. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to implement the method according to any one of claims 1 to 7 when executing the computer program stored in the memory.

16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

17. A computer program product, characterized in that The computer program product comprises: a computer program code, and when the computer program code is run on a computer, the computer is caused to execute the method according to any one of claims 1 to 7.