CN111176591B - Print auditing method, device, equipment and medium based on CUPS system - Google Patents

Print auditing method, device, equipment and medium based on CUPS system Download PDF

Info

Publication number
CN111176591B
CN111176591B CN202010011813.6A CN202010011813A CN111176591B CN 111176591 B CN111176591 B CN 111176591B CN 202010011813 A CN202010011813 A CN 202010011813A CN 111176591 B CN111176591 B CN 111176591B
Authority
CN
China
Prior art keywords
file
printed
printing
print
printer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010011813.6A
Other languages
Chinese (zh)
Other versions
CN111176591A (en
Inventor
张志强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sangfor Technologies Co Ltd
Original Assignee
Sangfor Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sangfor Technologies Co Ltd filed Critical Sangfor Technologies Co Ltd
Priority to CN202010011813.6A priority Critical patent/CN111176591B/en
Publication of CN111176591A publication Critical patent/CN111176591A/en
Application granted granted Critical
Publication of CN111176591B publication Critical patent/CN111176591B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1202Dedicated interfaces to print systems specifically adapted to achieve a particular effect
    • G06F3/1222Increasing security of the print job
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1223Dedicated interfaces to print systems specifically adapted to use a particular technique
    • G06F3/1237Print job management
    • G06F3/1238Secure printing, e.g. user identification, user rights for device usage, unallowed content, blanking portions or fields of a page, releasing held jobs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1223Dedicated interfaces to print systems specifically adapted to use a particular technique
    • G06F3/1237Print job management
    • G06F3/1273Print job history, e.g. logging, accounting, tracking

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Accessory Devices And Overall Control Thereof (AREA)

Abstract

The invention discloses a print auditing method, a device, equipment and a medium based on a CUPS system, wherein the method comprises the following steps: acquiring a print queue in the CUPS system, and determining newly-added task data in the print queue; determining a corresponding file to be printed according to the newly added task data; and sending the file to be printed to a printer corresponding to the CUPS system for printing, and generating a printing audit log of the file to be printed. According to the invention, the task data is acquired by providing the print queue based on the CUPS system, so that a specific file to be printed is acquired, a print audit log is generated in the process of printing the file, and the print information of the printed file and the printer information of the printed file are traced through the print audit log, so that the traceability of printing based on the CUPS system is improved, and the security of printing based on the CUPS system is improved.

Description

Print auditing method, device, equipment and medium based on CUPS system
Technical Field
The invention relates to the technical field of data processing, in particular to a print auditing method, device, equipment and medium based on a CUPS system.
Background
The Mac (Mac OS is a set of operating systems running on apple Macintosh series computers) system printing is a virtual printer driver based on a cup (Common Unix PRINTING SYSTEM, UNIX universal printing system) system, when a user needs to print a file, the virtual printer driver needs to be installed in a corresponding printing device, and the user can only print the file by accessing the virtual printer driver. In the process of printing a file or after the file is printed, the CUPS system cannot check the information of the physical printer through the virtual printer driver, the information of the physical printer is directly printed on the file, and the CUPS system cannot record the printing information of the printed file, so that whether the file is printed or not cannot be found through the CUPS system, that is, whether the file is leaked or not cannot be found, and therefore the safety and confidentiality of the file cannot be guaranteed. Therefore, the virtual printer of the current CUPS system has low driving safety and poor traceability.
Disclosure of Invention
The invention mainly aims to provide a print auditing method, device, equipment and medium based on a CUPS system, and aims to solve the technical problems of low driving safety and poor traceability of a virtual printer of the traditional CUPS system.
In order to achieve the above object, the present invention provides a print auditing method based on a CUPS system, the print auditing method based on the CUPS system includes the steps of:
acquiring a print queue in the CUPS system, and determining newly-added task data in the print queue;
Determining a corresponding file to be printed according to the newly added task data;
And sending the file to be printed to a printer corresponding to the CUPS system for printing, and generating a printing audit log of the file to be printed.
Preferably, the step of sending the file to be printed to a printer corresponding to the cup system for printing, and generating a print audit log of the file to be printed includes:
The file to be printed is sent to a printer corresponding to the CUPS system for printing, printer information of the printer is obtained, and the printer information is stored in an information storage unit of the CUPS system;
acquiring printing information of the file to be printed and code program information of the information storage unit;
And generating a control file corresponding to the file to be printed according to the printing information and the code program information, and generating a printing audit log of the file to be printed according to the control file.
Preferably, after the step of generating the control file corresponding to the file to be printed according to the print information and the code program information, the method further includes:
acquiring a printing state field in the control file, and determining whether the file to be printed is successfully printed according to the printing state field;
and if the fact that the file to be printed is successfully printed is determined, executing the step of generating a printing audit log of the file to be printed according to the control file.
Preferably, the step of obtaining a print status field in the control file, and determining whether the file to be printed is printed successfully according to the print status field includes:
acquiring a printing state field in the control file, and detecting whether the printing state field is a preset completion field;
if the printing state field is other fields except the preset finishing field, determining that the file to be printed fails to be printed;
And if the printing state field is the preset finishing field, determining that the file to be printed is successfully printed.
Preferably, after the step of generating the control file corresponding to the file to be printed according to the print information and the code program information, the method further includes:
and generating the file name of the control file according to the newly added task data so as to establish a corresponding relation between the control file and the file to be printed.
Preferably, the step of obtaining a print queue in the cup system and determining newly added task data in the print queue includes:
acquiring a printing queue in the CUPS system, and determining first maximum data corresponding to a printing task in the printing queue;
acquiring second maximum data corresponding to a print task in the print queue from the print queue after a preset time interval;
and if the first maximum data is different from the second maximum data, determining the second maximum data as the newly added task data in the print queue.
Preferably, the step of determining the corresponding file to be printed according to the newly added task data includes:
and acquiring a file to be printed corresponding to the newly added task data from a data file storage catalog pre-generated by the CUPS system.
In addition, in order to achieve the above purpose, the present invention also provides a print auditing apparatus based on a universal UNIX print system cup system, the print auditing apparatus based on the cup system includes:
The acquisition module is used for acquiring a printing queue in the CUPS system;
The determining module is used for determining newly-added task data in the printing queue and determining a corresponding file to be printed according to the newly-added task data;
The printing module is used for sending the file to be printed to a printer corresponding to the CUPS system for printing;
and the generation module is used for generating the printing audit log of the file to be printed.
In addition, in order to achieve the above object, the present invention also provides a print auditing apparatus based on a UNIX universal print system CUPS system, where the print auditing apparatus based on a CUPS system includes a memory, a processor, and a print auditing program based on a CUPS system stored on the memory and running on the processor, where the print auditing program based on a CUPS system implements the steps of the print auditing method based on a CUPS system as described above when being executed by the processor.
In addition, in order to achieve the above object, the present invention further provides a computer-readable storage medium, on which a print auditing program based on a CUPS system is stored, the print auditing program based on the CUPS system implementing the steps of the auditing method of the CUPS system as described above when being executed by a processor.
The invention determines the corresponding file to be printed by acquiring the print queue in the CUPS system and newly adding task data in the print queue, prints the file to be printed by the printer corresponding to the CUPS system, and generates a print audit log of the file to be printed. The print queue based on the CUPS system is provided to acquire task data, so that a specific file to be printed is acquired, a print audit log is generated in the process of printing the file, and the print information of the printed file and the printer information of the printed file are traced through the print audit log, so that the traceability of printing based on the CUPS system is improved, and the security of printing based on the CUPS system is improved.
Drawings
FIG. 1 is a flow chart of a first embodiment of a print audit method based on a CUPS system of the present invention;
FIG. 2 is a schematic diagram of a hardware environment of a print audit method based on a CUPS system of the present invention;
FIG. 3 is a schematic diagram of a preferred configuration of a print auditing apparatus based on a CUPS system according to the present invention;
FIG. 4 is a schematic diagram of a hardware operating environment according to an embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The invention provides a printing auditing method based on a CUPS system of a UNIX universal printing system, and referring to FIG. 1, FIG. 1 is a flow chart of a first embodiment of the printing auditing method based on the CUPS system.
Embodiments of the present invention provide embodiments of a print auditing method based on a CUPS system, it being noted that although a logical sequence is shown in the flowchart, in some cases the steps shown or described may be performed in a different order than that shown or described herein.
The print auditing method based on the CUPS system can be applied to a hardware environment formed by the printer 102 and the terminal 104 as shown in FIG. 2. As shown in fig. 2, the terminal 104 is connected to the printer 102 via a connection terminal, and performs data communication. The printer 102 is connected to the terminal 104 via a connection including, but not limited to: the terminal 104 is not limited to a PC, a tablet computer, a notebook computer, or the like, and the printer 102 performs a print job.
The print auditing method based on the CUPS system comprises the following steps:
Step S10, a print queue in the CUPS system is obtained, and newly-increased task data in the print queue is determined.
After receiving a print request of a user, the terminal acquires a print queue in the CUPS system according to the print request, and determines newly-added task data in the print queue. The CUPS system, namely a UNIX universal printing system, is a combined printing system similar to a Unix operating system and is suitable for systems such as UNIX, LINUX, MAC OS and the like. In this embodiment, the terminal may be a computer, or the terminal may be a server. The core of the CUPS system is a code program in the CUPS system, which is installed in the terminal, wherein the code program on the terminal comprises a code program corresponding to an information storage unit of the CUPS system and other additional code programs. The print queue is a print file list formed in the process that the terminal sends the file to be printed to the printer, and a code program in the CUPS system is operated in the terminal, so that data communication can be carried out between the terminal and the printer.
In this embodiment, the print queue may store a file to be printed in the terminal, and the terminal may obtain task data of a task to be printed in the print queue by running a code program in the CUPS system, so as to determine newly added task data in the print queue. Specifically, in this embodiment, the terminal displays the current print queue by calling the http Connect2 interface and the cut GET NAME DEST interface of the lpq command line tool in the cut system, where the http Connect2 and the cut GET NAME DEST are interfaces in the cut system lpq command line tool, so as to obtain a print job in the print queue and record corresponding job data, thereby determining newly added job data in the print queue.
The terminal acquires and records the printing information of the file to be printed and the corresponding printer information through the information storage unit of the CUPS system, so that the safety of the protection information is realized, and the printing information and the printer information in the process of printing the file become more effectively traced. The printing information of the files to be printed comprises the number of the files to be printed, the size of the files to be printed, the file format of the files to be printed, the names of the files to be printed and the like. The printer information includes a terminal IP (Internet Protocol ) address, a printer IP address, a printer name, an application name for performing a printing operation, etc., and the IP address is an Internet address or an Internet address, which is a logical address for uniquely identifying a computer on the Internet.
Further, the step S10 includes:
step a, a print queue in the CUPS system is obtained, and first maximum data corresponding to a print task in the print queue is determined;
Step b, acquiring second maximum data corresponding to a print task in the print queue from the print queue after a preset time interval;
And c, if the first maximum data is different from the second maximum data, determining the second maximum data as the newly added task data in the print queue.
Specifically, when the terminal detects that a new print job to be printed exists in the print queue of the CUPS system, the terminal calls lpq command line tools in the CUPS system code program to display the print queue in the current CUPS system, so that the print job in the print queue is acquired and corresponding job data is recorded. If two print jobs are determined to exist in the print queue, the job data value is the first maximum data, and the job data value is a value corresponding to the job data. And acquiring two printing tasks again in the CUPS system printing queue after the preset time interval, wherein the maximum task data value is the second maximum data, comparing the task data values respectively corresponding to the first maximum data and the second maximum data, and if the task data values corresponding to the first maximum data and the second maximum data are different, determining that the second maximum data is newly added task data in the printing queue. In this embodiment, the preset interval duration for recording the maximum task data is in the millisecond level, and the preset interval duration can be set according to needs, for example, a print queue of the CUPS system is acquired once every 100ms (milliseconds) of the preset interval duration. If the first acquisition is performed, the print queue of the CUPS system has two print jobs, and the job data are respectively 100 and 101, then the first maximum data is 101. The second time of acquiring the task data of the two print tasks from the print queue of the CUPS system is 101 and 102 respectively, which indicates that the print task with the task data of 100 is already printed, so that the print task with the task data of 101 is not already printed in the print queue of the CUPS system, and the print task with the task data of 102 is newly added, the second maximum task data of 102 is compared with the first maximum task data 101 when the print task with the task data of 102 is acquired last time, and the print task with the task data of 102 is obtained as the newly added print task, wherein the task data are 100, 101 and 102 respectively, and the corresponding values of 100, 101 and 102 are the task data values.
It should be noted that, in this embodiment, the print queue of the CUPS system is obtained once every preset time, the largest task data in the print queue of the CUPS system is recorded, if no new task data is added in the print queue, the number of the new print tasks is 0, and if the print tasks are not completed, the print tasks will always exist in the print queue of the CUPS system until the print of the print tasks is completed. There are various generation rules of job data of a print job, and in this embodiment, the job data generation rules of the print job are as follows: the job data of the print job is an integer from 1 to 2 ζ1 (31 th power of 2) -1, sequentially increases by 1 each time, and determines which print jobs are newly added by the recorded maximum job data. For example, when the task data of the current print task is 100 and one print task is added, the task data is 101, and if the terminal is interrupted or restarted, the task data value in the task queue will not be reset.
S20, determining the corresponding file to be printed according to the newly added task data.
After the newly added task data is obtained, the terminal searches and obtains a file to be printed corresponding to the newly added task data in a data file storage directory generated under a CUPS system spool directory. Before the print queue is obtained, when a user initiates a request for printing a file, the terminal generates a data file storage directory under the cup system spool directory, and in fact, the data file is the file to be printed, and the data file storage directory is the directory for storing the file to be printed. The file format of the file to be printed may be doc, excel, pdf (Portable Document Format ) or the like, and in this embodiment, the file format of the file to be printed may be pdf format. The spool directory is a directory that allows a print file transferred from a terminal to a printer to be temporarily stored in the CUPS system, and after the transfer is completed, the terminal re-acquires the print job stored in the CUPS system spool directory, and performs file printing by the printer, and the spool directory may be expressed as/var/spool/caps. The terminal performs data transmission and file printing with the printer by running a code program in the CUPS system. In this embodiment, d may be used to represent a data file, where the naming of the data file has a direct relationship with the task data, and in this embodiment, the name of the corresponding data file is set according to the task data, for example, if the task data is 5, the name of the data file is d-00005. In addition, a print job may include a plurality of files to be printed, and a plurality of data files are generated according to the job data, for example, if there are two files to be printed in the print job with the job data of 5, the names of the data files are d00005-001 and d00005-002. The spool directory can store a plurality of files to be printed, when the files are printed, the files do not need to be operated one by one through the terminal, and according to the newly added task data obtained in the CUPS system printing queue, the files to be printed corresponding to the newly added task data are obtained in the data file storage directory to be printed, so that the efficiency of file printing can be improved by utilizing the spool directory.
Further, the step S20 includes:
And d, acquiring a file to be printed corresponding to the newly added task data from a data file storage catalog pre-generated by the CUPS system.
Specifically, if the newly added task data is determined in the print queue, the terminal searches and acquires a file to be printed corresponding to the newly added task data in a data file storage directory under a CUPS system spool by the corresponding newly added task data.
S30, sending the file to be printed to a printer corresponding to the CUPS system for printing, and generating a printing audit log of the file to be printed.
And after determining the file to be printed, the terminal determines a printer corresponding to the CUPS system and sends the file to be printed to the determined printer. When the printer receives the file to be printed, the printer prints the file to be printed. When the printer finishes printing the file to be printed, the printer generates prompt information and sends the prompt information to the terminal so that the terminal can determine that the file to be printed is printed according to the printing information. And after the terminal determines that the file to be printed is printed by the printer, the terminal generates a printing audit log of the file to be printed. It should be noted that, the printer information corresponding to each printer is stored in the terminal in advance, and when the terminal is connected with the printer by running the CUPS system code program, the CUPS system obtains the printer information of the printer, and determines the printer for printing the file to be printed through the printer information. The information of the printing audit log consists of printing information of the file to be printed and printer information. If the required printer information is to be queried, a new query request is established by using ippNewRequests, then a field to be queried is added into the query request by IPPADDSTRINGS, and finally the printer information is returned through CUPS DoRequest according to the query field in the query request. Wherein ippNewRequests, ippAddStrings, CUPS DoRequest commands are APIs (Application Programming Interface ) in the cup system, which are predefined functions to provide the application and developer with the ability to access a set of routines based on certain software or hardware without having to access source code or understand the details of the internal working mechanism. For example, if the printer name and the IP address need to be obtained, the query fields printer-name and device-ur (IP address) need to be added at IPPADDSTRINGS. In addition, the user operates by clicking the interface of the terminal, and if the information of the audit log to be printed does not have a prefix field, the terminal directly interacts with the printer by using an lp or lpr command to finish the printing operation of the file to be printed. Wherein, lp and lpr commands are command line tools of the CUPS system. For example, the input command lp test.doc can print test.doc files directly, and the information of the print audit log does not appear with the com.apple.print prefix field. When there are multiple files to be printed in a print job, each file to be printed will have corresponding document-format-supplied, document-format, document-name-supplied fields.
Further, the step 30 includes:
Step e, the file to be printed is sent to a printer corresponding to the CUPS system for printing, printer information of the printer is obtained, and the printer information is stored in an information storage unit of the CUPS system;
step f, obtaining the printing information of the file to be printed and the code program information of the information storage unit;
and g, generating a control file corresponding to the file to be printed according to the printing information and the code program information, and generating a printing audit log of the file to be printed according to the control file.
Specifically, after determining the file to be printed, the terminal immediately acquires the printing information of the file to be printed, and simultaneously the terminal sends the file to be printed to the printer, so that the printer prints the file to be printed, the terminal acquires the printer information of the printer corresponding to the terminal, the acquired printer information is stored in an information storage unit of the CUPS system, a control file is generated together according to the acquired printing information of the file to be printed and the code program information stored in the information storage unit of the CUPS system, and a printing audit log of the file to be printed is generated according to the control file, wherein the code program information of the CUPS system comprises an IP address of the terminal, an IP address of the printer, a name of the printer, an application name for executing printing operation and the like. It should be noted that the code program installed on the terminal includes a code program corresponding to an information storage unit of the cup system and other additional code programs.
Further, the print auditing method based on the CUPS system further comprises the following steps:
And step o, generating the file name of the control file according to the newly added task data so as to establish the corresponding relation between the control file and the file to be printed.
After the terminal generates the control file, the terminal generates the file name of the control file according to the newly added task data so as to establish the corresponding relation between the files to be printed of the control file, and the user can conveniently determine the task data corresponding to the files to be printed according to the file name of the control file. In this embodiment, the name of the control file has a direct relationship with the task data, and the embodiment sets the file name of the corresponding control file according to the task data, for example, if the task data is 5, the file name of the generated control file is c-00005, and one print job corresponds to only one control file, regardless of the number of the files to be printed. The control file has a special format, and the terminal needs to parse the control file by using testipp command line tools generated from the CUPS system code program, so as to obtain corresponding parsed fields, wherein testipp is a command line auxiliary tool in the CUPS system source code program. The following table is the control file part field meaning.
According to the embodiment, the corresponding file to be printed is determined by acquiring the print queue in the CUPS system and newly adding task data in the print queue, then the file to be printed is printed by the printer corresponding to the CUPS system, and the print audit log of the file to be printed is generated. The print queue based on the CUPS system is provided to acquire task data, so that a specific file to be printed is acquired, a print audit log is generated in the process of printing the file, and the print information of the printed file and the printer information of the printed file are traced through the print audit log, so that the traceability of printing based on the CUPS system is improved, and the security of printing based on the CUPS system is improved.
Further, a second embodiment of the print auditing method based on the CUPS system is provided.
The difference between the second embodiment of the print auditing method based on the CUPS system and the first embodiment of the print auditing method based on the CUPS system is that the print auditing method based on the CUPS system further comprises:
And h, acquiring a printing state field in the control file, and determining whether the file to be printed is successfully printed according to the printing state field.
After the control file is obtained, the terminal needs to analyze the control file to obtain a printing state field in the control file, and judges whether the file to be printed is printed successfully or not according to the printing state field. It should be noted that, the print status field of the file to be printed is obtained by parsing the control file using testipp command lines. The print status field of the document to be printed may be classified into two types, one is a print status field indicating that the document to be printed is successfully printed, and one is a print status field indicating that the document to be printed is failed to be printed.
Further, the step h includes:
Step i, obtaining a printing state field in the control file, and detecting whether the printing state field is a preset completion field or not;
step j, if the printing state field is other fields except the preset finishing field, determining that the printing of the file to be printed fails;
and step k, if the printing state field is the preset completion field, determining that the file to be printed is successfully printed.
Specifically, after obtaining the control file, the terminal obtains the print status field of the file to be printed in the control file by parsing the control file using testipp command line, and detects whether the obtained print status field is a preset completion field in the CUPS system code program. If the obtained printing status field is a preset completion field in the CUPS system code program, which indicates that the file to be printed is successfully printed, the terminal needs to acquire the printing information and the printer information of the file to be printed from the control file, and generates a printing audit log of the file to be printed according to the printing information and the printer information. After the printing audit log is generated, the printing audit log is stored and output so that the printing audit log can be conveniently checked by the terminal user. The preset completion field may be set according to the requirement, and the present embodiment does not limit the expression form of the preset completion field, for example, the preset completion field may be expressed as "complete". If the obtained printing status field is other fields except the preset completion field in the CUPS system code program, the printing operation is canceled or the printing of the file to be printed fails, audit is not needed, and a printing audit log is not generated.
In this embodiment, the generated control file is parsed by the testipp command in the CUPS system code program to obtain a print status field of the file to be printed, and whether the file to be printed is printed successfully is determined according to the print status field, so as to determine whether the print audit log needs to be generated and output. If the printing state field is a preset completion field, generating a printing audit log corresponding to the file to be printed, and if the printing state field is other fields except the preset completion field, no audit is needed, and no printing audit log is generated. Therefore, whether the printing audit log is required to be generated or not can be judged according to the preset completion field, the printing audit log is not required to be generated under all conditions, the load of the terminal is reduced, and the high efficiency of printing audit based on the CUPS system is ensured.
In addition, the invention also provides a print auditing device based on the CUPS system, referring to FIG. 3, the print auditing device based on the CUPS system comprises:
an obtaining module 10, configured to obtain a print queue in the cup system;
The determining module 20 is configured to determine new task data in the print queue, and determine a corresponding file to be printed according to the new task data;
The printing module 30 is configured to send the file to be printed to a printer corresponding to the cup system for printing;
And the generating module 40 is used for generating the printing audit log of the file to be printed.
Further, the generating module 40 includes:
A first obtaining unit, configured to obtain printer information of the printer, print information of the file to be printed, and code program information of the information storage unit;
a storage unit for storing the printer information in an information storage unit of the CUPS system;
And the generating unit is used for generating a control file corresponding to the file to be printed according to the printing information and the code program information, and generating a printing audit log of the file to be printed according to the control file.
Further, the obtaining module 10 is further configured to obtain a print status field in the control file;
the determining module 20 is further configured to determine whether the file to be printed is printed successfully according to the print status field;
The generating module 40 is further configured to generate a print audit log of the file to be printed according to the control file if it is determined that the file to be printed is printed successfully.
Further, the determining module 20 includes:
a second acquisition unit configured to acquire a print status field in the control file;
A detection unit configured to detect whether the printing status field is a preset completion field;
The first determining unit is used for determining that the file to be printed fails to be printed if the printing state field is other fields except the preset finishing field; and if the printing state field is the preset finishing field, determining that the file to be printed is successfully printed.
Further, the print auditing apparatus based on the CUPS system further comprises:
And the building module is used for generating the file name of the control file according to the newly added task data so as to build the corresponding relation between the control file and the file to be printed.
Further, the determining module 20 includes:
A third obtaining unit, configured to obtain a print queue in the cup system, determine first maximum data corresponding to a print task in the print queue, and obtain second maximum data corresponding to the print task in the print queue after a preset time interval;
And the second determining unit is used for determining that the second maximum data is the newly added task data in the printing queue if the first maximum data is different from the second maximum data.
Further, the determining module 20 is further configured to obtain, in a data file storage directory pre-generated by the cup system, a file to be printed corresponding to the newly added task data.
The specific implementation manner of the print auditing device based on the CUPS system is basically the same as the embodiments of the print auditing method based on the CUPS system, and is not repeated here.
In addition, the invention also provides a print auditing device based on the CUPS system. As shown in fig. 4, fig. 4 is a schematic structural diagram of a hardware running environment according to an embodiment of the present invention.
It should be noted that fig. 4 may be a schematic structural diagram of a hardware running environment of the print auditing apparatus based on the CUPS system.
As shown in fig. 4, the print-auditing apparatus based on the cup system may include: a processor 1001, such as a CPU (Central Processing Unit ), a memory 1005, a user interface 1003, a network interface 1004, a communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
Optionally, the print auditing apparatus based on the CUPS system may also include RF (Radio Frequency) circuitry, sensors, wiFi modules, and so forth.
Those skilled in the art will appreciate that the CUPS system-based print audit device architecture shown in FIG. 4 is not limiting of the CUPS system-based print audit device and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
As shown in fig. 4, an operating system, a network communication module, a user interface module, and a print auditing program based on the cut system may be included in a memory 1005 as a print auditing apparatus based on the cut system. The operating system is a program for managing and controlling hardware and software resources of the print auditing equipment based on the CUPS system, and supports the operation of the print auditing program based on the CUPS system and other software or programs.
In the print auditing apparatus based on the cup system shown in fig. 4, the user interface 1003 is mainly used for connecting to a printer, so that data communication can be performed between the terminal and the printer; the network interface 1004 is mainly used for a background server and is in data communication with the background server; the processor 1001 may be configured to call the print auditing program based on the cup system stored in the memory 1005 and execute the steps of the print auditing method based on the cup system as described above.
The specific implementation manner of the print auditing equipment based on the CUPS system is basically the same as the embodiments of the print auditing method based on the CUPS system, and is not repeated here.
In addition, the embodiment of the invention also provides a computer readable storage medium, wherein the computer readable storage medium is stored with a print auditing program based on the CUPS system, and the print auditing program based on the CUPS system realizes the steps of the print auditing method based on the CUPS system when being executed by a processor.
The specific implementation manner of the computer readable storage medium of the present invention is basically the same as the above embodiments of the print auditing method based on the cup system, and will not be described herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (7)

1. The print auditing method based on the CUPS system is characterized by comprising the following steps of:
Acquiring a print queue in the CUPS system, and determining newly added task data in the print queue, wherein the print queue is a print file list formed in the process that a terminal sends a file to be printed to a printer;
Determining a corresponding file to be printed according to the newly added task data;
The file to be printed is sent to a printer corresponding to the CUPS system for printing, and when the terminal determines that the file to be printed is printed by the printer, a print audit log of the file to be printed is generated;
The step of obtaining the print queue in the CUPS system and determining the newly added task data in the print queue comprises the following steps:
acquiring a printing queue in the CUPS system, and determining first maximum data corresponding to a printing task in the printing queue;
acquiring second maximum data corresponding to a print task in the print queue from the print queue after a preset time interval;
if the first maximum data is different from the second maximum data, determining that the second maximum data is newly added task data in the print queue;
the step of generating a print audit log of the file to be printed after the terminal determines that the file to be printed is printed by the printer comprises the following steps of:
The file to be printed is sent to a printer corresponding to the CUPS system for printing, printer information of the printer is obtained, and the printer information is stored in an information storage unit of the CUPS system;
acquiring printing information of the file to be printed and code program information of the information storage unit;
generating a control file corresponding to the file to be printed according to the printing information and the code program information, and generating a printing audit log of the file to be printed according to the control file;
after the step of generating the control file corresponding to the file to be printed according to the printing information and the code program information, the method further comprises the following steps:
acquiring a printing state field in the control file, and determining whether the file to be printed is successfully printed according to the printing state field;
and if the fact that the file to be printed is successfully printed is determined, executing the step of generating a printing audit log of the file to be printed according to the control file.
2. The method for auditing printing based on a CUPS system according to claim 1, wherein the step of obtaining a printing status field in the control file and determining whether the file to be printed is successfully printed according to the printing status field comprises:
acquiring a printing state field in the control file, and detecting whether the printing state field is a preset completion field;
if the printing state field is other fields except the preset finishing field, determining that the file to be printed fails to be printed;
And if the printing state field is the preset finishing field, determining that the file to be printed is successfully printed.
3. The print auditing method based on the cup system according to claim 1, further comprising, after the step of generating the control file corresponding to the file to be printed according to the print information and the code program information:
and generating the file name of the control file according to the newly added task data so as to establish a corresponding relation between the control file and the file to be printed.
4. A print auditing method according to any of claims 1 to 3, wherein said step of determining a corresponding document to be printed from said newly added task data comprises:
and acquiring a file to be printed corresponding to the newly added task data from a data file storage catalog pre-generated by the CUPS system.
5. Print audit device based on CUPS system, its characterized in that, print audit device based on CUPS system includes:
The acquisition module is used for acquiring a printing queue in the CUPS system;
The determining module is used for determining newly-added task data in the printing queue and determining corresponding files to be printed according to the newly-added task data, wherein the printing queue is a printing file list formed in the process that the terminal sends the files to be printed to the printer;
The printing module is used for sending the file to be printed to a printer corresponding to the CUPS system for printing;
The generation module is used for generating a printing audit log of the file to be printed after the terminal determines that the file to be printed is printed by the printer;
the determining module is specifically configured to:
acquiring a printing queue in the CUPS system, and determining first maximum data corresponding to a printing task in the printing queue;
acquiring second maximum data corresponding to a print task in the print queue from the print queue after a preset time interval;
if the first maximum data is different from the second maximum data, determining that the second maximum data is newly added task data in the print queue;
The generating module is specifically configured to:
The file to be printed is sent to a printer corresponding to the CUPS system for printing, printer information of the printer is obtained, and the printer information is stored in an information storage unit of the CUPS system;
acquiring printing information of the file to be printed and code program information of the information storage unit;
generating a control file corresponding to the file to be printed according to the printing information and the code program information, and generating a printing audit log of the file to be printed according to the control file;
wherein, print audit device based on CUPS system still is used for:
acquiring a printing state field in the control file, and determining whether the file to be printed is successfully printed according to the printing state field;
and if the fact that the file to be printed is successfully printed is determined, executing the step of generating a printing audit log of the file to be printed according to the control file.
6. A print auditing apparatus based on a CUPS system, characterized in that it comprises a memory, a processor and a print auditing program based on a CUPS system stored on the memory and running on the processor, the print auditing program of a CUPS system implementing the steps of the print auditing method based on a CUPS system according to any of claims 1 to 4 when executed by the processor.
7. A computer-readable storage medium, wherein the computer-readable storage medium has stored thereon a print auditing program based on a CUPS system, which when executed by a processor, implements the steps of the print auditing method of the CUPS system according to any one of claims 1 to 4.
CN202010011813.6A 2020-01-03 2020-01-03 Print auditing method, device, equipment and medium based on CUPS system Active CN111176591B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010011813.6A CN111176591B (en) 2020-01-03 2020-01-03 Print auditing method, device, equipment and medium based on CUPS system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010011813.6A CN111176591B (en) 2020-01-03 2020-01-03 Print auditing method, device, equipment and medium based on CUPS system

Publications (2)

Publication Number Publication Date
CN111176591A CN111176591A (en) 2020-05-19
CN111176591B true CN111176591B (en) 2024-05-24

Family

ID=70657921

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010011813.6A Active CN111176591B (en) 2020-01-03 2020-01-03 Print auditing method, device, equipment and medium based on CUPS system

Country Status (1)

Country Link
CN (1) CN111176591B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113868158B (en) * 2021-08-27 2024-02-23 浪潮电子信息产业股份有限公司 System-on-chip and data comparison method, device, equipment and computer medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102830946A (en) * 2012-08-06 2012-12-19 电子科技大学 Network printing system under private cloud environment for massive seismic data processing
CN105183403A (en) * 2015-09-21 2015-12-23 西安电子科技大学 Printing management and control method based on CUPS framework
US9501251B1 (en) * 2015-03-31 2016-11-22 Symantec Corporation Techniques for print monitoring
JP2017173917A (en) * 2016-03-18 2017-09-28 株式会社リコー Information processing device, system, information processing method, and program
CN109522095A (en) * 2018-11-27 2019-03-26 无锡华云数据技术服务有限公司 Cloud host abnormal failure detects recovery system, method and cloud platform

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6992496B2 (en) * 2017-12-26 2022-01-13 ブラザー工業株式会社 Control program and information processing device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102830946A (en) * 2012-08-06 2012-12-19 电子科技大学 Network printing system under private cloud environment for massive seismic data processing
US9501251B1 (en) * 2015-03-31 2016-11-22 Symantec Corporation Techniques for print monitoring
CN105183403A (en) * 2015-09-21 2015-12-23 西安电子科技大学 Printing management and control method based on CUPS framework
JP2017173917A (en) * 2016-03-18 2017-09-28 株式会社リコー Information processing device, system, information processing method, and program
CN109522095A (en) * 2018-11-27 2019-03-26 无锡华云数据技术服务有限公司 Cloud host abnormal failure detects recovery system, method and cloud platform

Also Published As

Publication number Publication date
CN111176591A (en) 2020-05-19

Similar Documents

Publication Publication Date Title
CN110347560B (en) Method, device, system, equipment and medium for prompting abnormity of big data product
US9584679B2 (en) Information processing apparatus, control method therefor, and medium
US8458771B2 (en) Image forming apparatus, authentication method, and recording medium
US8982400B2 (en) Device management device and recording medium
CN109558320B (en) System testing method, device, system, equipment and computer readable storage medium
WO2014183444A1 (en) Method, terminal, server, and system for data processing
CN112906024A (en) Data desensitization method, device, storage medium and server
CN110674376A (en) Interface parameter checking method, device, equipment and computer readable storage medium
CN111176591B (en) Print auditing method, device, equipment and medium based on CUPS system
CN111224878B (en) Route forwarding method and device, electronic equipment and storage medium
CN110990335A (en) Log archiving method, device, equipment and computer readable storage medium
CN112445433A (en) File printing method, device, equipment and system
CN111845143B (en) Method and device for printing by handheld device
CN110852603B (en) High-throughput wind control data processing method, device, equipment and storage medium
US8773706B2 (en) Apparatus, systems, and methods for dynamic language customization
US9442741B2 (en) Method, terminal, server, and system for data processing
US20030162559A1 (en) Mobile communications terminal, information transmitting system and information receiving method
CN113342845B (en) Data synchronization method, computer device and readable storage medium
CN112698796A (en) Printing control method and device based on printer, electronic equipment and storage medium
CN114706772A (en) Installation environment detection method, device, equipment and storage medium
CN107341048B (en) Method and device for inquiring client occupying specific resources of server
CN112950370A (en) Service processing method, device, equipment and storage medium
CN112417012A (en) Data processing method and system
CN112182054A (en) Vehicle competitive product data processing method, system, equipment and storage medium
JP2013089160A (en) Network printing system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant