A printing method, device and storage medium for multiple jobs of different tasks
By assigning unique flags to print tasks and optimizing print queue management, the problem of inefficiency of traditional printers during task switching is solved, efficient multi-task printing is achieved, printer idle time and repetitive actions are reduced, and production efficiency is improved.
Patent Information
- Application Number
- CN202410079579.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-19
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-01-19
AI Technical Summary
Traditional printers need to frequently return and exit the warehouse when switching between different printing tasks, resulting in low production efficiency and unable to meet customers' needs for improved production efficiency.
By assigning a unique flag bit to each print task, the repetition of initialization and end of printing actions is reduced, and different printing areas can be switched once the task is started, eliminating the need for the action of returning the nozzle to the warehouse, sealing the head, and exiting the warehouse, and adopts the print queue management module Optimize task scheduling and reduce task switching time.
It improves printing efficiency and production efficiency, reduces the idle time of the printer, and enables continuous printing of multiple jobs for different tasks without interrupting or repeating initialization operations, significantly improving printing speed and efficiency.
Smart Images

Figure CN117908808B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of printers, and in particular to a printing method, a device and a storage medium for printing multiple jobs of different tasks. Background Art
[0002] When printing single or multiple copies of different tasks using the traditional printing method, the inkjet printer needs to return to the warehouse to seal the head and then come out to print when switching to the next task. This does not meet the customer's needs to improve production efficiency. The customer requires that only one task be started and only one print initialization action be performed. Subsequent actions will switch to different printing areas according to the identification of different jobs to improve printing production efficiency. Summary of the invention
[0003] The purpose of the present invention is to provide a printing method, device and storage medium for multiple jobs of different tasks, which eliminates the action of the inkjet printing vehicle returning to the warehouse and exiting the warehouse when switching each printing job of each task, saves the time of returning to the warehouse and exiting the warehouse for each printing job, and can greatly improve production efficiency.
[0004] The purpose of the present invention can be achieved by the following technical solutions:
[0005] The present application provides a method for printing multiple jobs of different tasks, comprising the following steps:
[0006] S1: Online, start the printer control software and then establish a connection with the printer;
[0007] S2: Load files. The user loads multiple files to be printed, imports the print files into the print list and sets the number of copies for each task.
[0008] S3: Import the list and save the print file into the print list;
[0009] S4: Initial printing, initializing all printing data, including printing status, printing equipment, and setting the cumulative number of printed tasks to 0;
[0010] S5: Start printing, create a print task, and send a start print command to the printer;
[0011] S6: Open the file, open a file from the print list, the printer control software opens the file to be printed, reads the PRN file header information, and obtains the information of the printed image;
[0012] S7: Flag assignment, print flag assignment, the flag value is equal to the current task number multiplied by the current number of copies to be printed modulo 2;
[0013] S8: Locate data, the file pointer points to the first line of data in the print file, and prepares to start reading the print data;
[0014] S9: Read data, read the data of the PRN file line by line according to each BytesPerLine of each color, and prepare to send it to the printer device;
[0015] S10: Send data. When the print data is enough for a print slice, the print data and print flag are sent to the printer device.
[0016] S11: Determine the file, determine whether the PRN file has read the last line of data in the file, if the file has not been read, jump to step, repeat step S9 to continue reading data, sending data and determining the file;
[0017] S12: the number of copies printed decreases, the total number of copies printed decreases by 1, and then the number of copies printed is determined to determine whether it is zero. If it is not zero, jump to step S7 and continue to print the next number of copies of the current task;
[0018] S13: updating the number of printed tasks, which is increased by 1, to record the number of completed printing tasks;
[0019] S14: judging the task list to determine whether all the printing task lists have been printed. If not, jump to step S6;
[0020] S15: End printing, end the printing task, exit printing and the printing task, and turn off the printer.
[0021] Preferably, the printer control software establishes a communication connection with the printer device, the printer control software loads the file to be printed and sets the number of copies to be printed, and the printing control software treats each print file as a small printing unit, and then sets a large printing unit, combines all the small printing units into a large printing unit, and sets a flag bit for each small printing unit, wherein each small printing unit has a flag bit for distinguishing each small printing unit, and the value of the flag bit = (current task number * current number of copies) % 2; * represents multiplication, and % represents remainder.
[0022] Preferably, during initialization, the printer control software only needs to create a print task once and send the large print unit data to the printer settings. The printer will identify each small print unit based on the flag bit, and finally only needs to send a print end command once to end printing. In this way, the printer does not need to repeat the initialization and end printing actions multiple times when printing multiple copies, and the printer program will identify the control bit of each small print unit. After printing each small unit, the inkjet carriage will stop at the position set by the user. Then when the user places the object to be printed and presses the continue printing button, the printer will automatically adjust and switch to the next small print unit to continue printing after receiving the trigger signal.
[0023] Preferably, according to the flag assignment in step S7, a unique flag is assigned to each print task for identification and distinction during the printing process, and the specific contents are as follows:
[0024] The current task number is assigned to each task according to the order of the tasks in the print task list. The task numbers start from 1 and increase in sequence according to the order of the tasks in the list.
[0025] The current number of copies to be printed. For each task, set the number of copies to be printed. It is specified by the user when loading the file and recorded in the task information.
[0026] The flag is calculated by multiplying the current task number by the current number of copies to be printed, and taking the modulus of 2, that is, the flag value is equal to (current task number × current number of copies to be printed) % 2;
[0027] The flag bit is used to assign the calculated flag bit to the print task. Each task will be assigned a unique flag bit to identify the print status or other information of the task.
[0028] Preferably, locating the data according to step S8, pointing the file pointer to the first line of data of the print file to prepare to start reading the print data, specifically includes:
[0029] In the print control software, use the file operation function to open the file to be printed, specify the open file by the file path or file name, move the file pointer to the first line of data in the print file by file pointer operation, use the file pointer offset function fseek() to move the file pointer to the beginning of the file, and then skip the file header information according to the file format and structure;
[0030] Directly read the first line of data without moving the file pointer. If the file format allows direct reading of the first line, then prepare to read the print data. After ensuring that the file pointer is correctly positioned, use the file reading function to read the print data line by line. Select the method of reading the text file line by line based on the file format and structure.
[0031] Preferably, according to the reading data described in step S9, the data of the PRN file is read line by line according to the size of each BytesPerLine of each color, and is prepared to be sent to the printer device, and the byte length BytesPerLine of each color and the number of colors are set according to the format of the print file and the requirements of the printer device;
[0032] Then read the data of the PRN file line by line, loop through each line until the entire PRN file is read, cut or parse each line of data according to the BytesPerLine of each color, obtain the printing data of each color, and then convert the data of each color into the corresponding format according to the communication protocol and data format requirements of the printer device, and send it to the printer device.
[0033] As a preferred method, a print queue management module is introduced to optimize the scheduling of print tasks, and the time of task switching is minimized by reasonably arranging the print job sequence and allocation of different tasks, specifically including:
[0034] Print job sorting: sort the jobs in the print queue according to factors such as the size of the print file and the estimated printing time. Use the first-come-first-served (FCFS) or priority scheduling algorithm to put jobs with shorter printing times in front, reducing the waiting time for task switching.
[0035] Resource allocation: According to the characteristics of the printer and available resources, tasks are reasonably allocated to the printer device, jobs suitable for simultaneous processing are assigned to the printer, and the number of concurrent jobs for each job is controlled;
[0036] Priority scheduling: assign priorities to different printing tasks based on user settings or system requirements;
[0037] Dynamic adjustment: dynamically adjust the order and allocation of tasks in the print queue according to the real-time status of the printer and resource utilization. If a job is found to have problems during printing or requires additional processing time, it will be paused or rescheduled.
[0038] Estimated printing time: by analyzing the printer device and file characteristics, the completion time of each print job is estimated.
[0039] As a preferred method, a print task management module is introduced to implement the management and monitoring of print tasks in the print control software, specifically including:
[0040] Print task list: Display the current print task list in the print control software, including all print tasks in progress or waiting to be executed, as well as task information;
[0041] Task status monitoring: real-time monitoring of the status of printing tasks, checking the current status of each task, and also displaying the remaining time of the task and the number of pages printed;
[0042] Task operation, operation functions for printing tasks, including task pause, cancel and restart, pausing or canceling ongoing tasks;
[0043] Error handling: when an error or exception occurs in a print task, the print task management module captures it and performs corresponding error handling;
[0044] Complete task statistics, record the number of completed printing tasks, and provide statistical reports.
[0045] A printing device for multiple jobs of different tasks includes: at least one processor, at least one memory and computer program instructions stored in the memory. When the computer program instructions are executed by the processor, the above-mentioned method is implemented.
[0046] A storage medium stores computer program instructions, which implement the above-mentioned method when the computer program instructions are executed by a processor.
[0047] The beneficial effects of the present invention are:
[0048] (1) Performing a print initialization action once at the beginning of printing, rather than performing the initialization operation each time a task is switched, can save repeated initialization time and improve printing efficiency. By assigning a unique flag to each print task, different printing areas can be switched according to the task identifier during the printing process, so that the nozzle can be directly switched to the corresponding position without returning to the magazine to seal the head, thereby reducing the waiting time for switching tasks;
[0049] (2) By optimizing the one-time task startup and switching the printing area according to the task identifier, the idle time of the printer can be reduced and the printing production efficiency can be improved. The printer can continuously print multiple print jobs of different tasks without interrupting or repeating the initialization operation, thereby effectively improving the printing speed and efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] For better understanding and implementation, the technical solution of the present application is described in detail below with reference to the accompanying drawings.
[0051] Figure 1 A flow chart of a method for printing multiple jobs of different tasks provided in Example 1 of the present application. DETAILED DESCRIPTION
[0052] In order to further explain the technical means and effects taken by the present invention to achieve the predetermined invention purpose, exemplary embodiments will be described in detail here, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of methods and systems consistent with some aspects of the present application as detailed in the attached claims.
[0053] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0054] The specific implementation methods, features and effects of the present invention are described in detail below in conjunction with the accompanying drawings and preferred embodiments.
[0055] Example 1
[0056] See also Figure 1 This embodiment provides a printing method, device and storage medium for multiple jobs of different tasks, which eliminates the action of the inkjet printing vehicle returning to the warehouse and exiting the warehouse when switching each printing job of each task, saves the time of returning to the warehouse and exiting the warehouse for each printing job, and can greatly improve production efficiency.
[0057] The present invention provides a printing method for multiple jobs of different tasks, comprising the following steps:
[0058] S1: Online, start the printer control software and then establish a connection with the printer device;
[0059] S2: Load files. The user loads multiple files to be printed, imports the print files into the print list and sets the number of copies for each task.
[0060] S3: Import the list and save the print file into the print list;
[0061] S4: Initial printing, initializing all printing data, including printing status, printing equipment, and setting the cumulative number of printed tasks to 0;
[0062] S5: Start printing, create a print task, and send a start printing command to the printer;
[0063] S6: Open the file, open a file from the print list, the printer control software opens the file to be printed, reads the PRN file header information, and obtains the information of the printed image, such as the calibration header, resolution, width, height, number of colors, number of PASS, single-point and two-point mode, etc.
[0064] S7: Flag assignment, print flag assignment, the flag value is equal to the current task number multiplied by the current number of prints modulo 2;
[0065] S8: Locate data, the file pointer points to the first line of data in the print file, and prepares to start reading the print data;
[0066] S9: Read data, read the data of the PRN file line by line according to each BytesPerLine of each color, and prepare to send it to the printer device;
[0067] S10: Send data. When the print data is enough for a print slice, the print data and print flag are sent to the printer device.
[0068] S11: Determine the file, determine whether the PRN file has read the last line of data in the file, if the file has not been read, jump to step, repeat step S9 to continue reading data, sending data and determining the file;
[0069] S12: the number of copies printed decreases, the total number of copies printed decreases by 1, and then the number of copies printed is determined to determine whether it is zero. If it is not zero, jump to step S7 and continue to print the next number of copies of the current task;
[0070] S13: updating the number of printed tasks, which is increased by 1, to record the number of completed printing tasks;
[0071] S14: judging the task list to determine whether all the printing task lists have been printed. If not, jump to step S6;
[0072] S15: End printing, end the printing task, exit printing and the printing task, and turn off the printer.
[0073] By improving the content of the above steps, it is possible to implement printing operations according to the preset print file list and number of print copies. Each step has a clear function and operation to ensure the smooth progress of the printing process and record the number of completed print tasks, which can improve printing efficiency and the accuracy of managing print tasks.
[0074] In this embodiment, the printing control software establishes a communication connection with the printer device, the printer control software loads the file to be printed and sets the number of copies to be printed, and the printing control software uses each print file as a small printing unit, and then sets a large printing unit, combines all the small printing units into a large printing unit, and sets a flag bit for each small printing unit, where each small printing unit has a flag bit for distinguishing each small printing unit, and the value of the flag bit = (current task number * current number of copies) % 2; (* represents multiplication, % represents remainder).
[0075] It can realize fine-grained management and combination of multiple print files, improve printing efficiency and production efficiency. At the same time, it uses flags to distinguish each small printing unit to ensure the uniqueness and accuracy of the printing task, which can meet the user's needs for efficient printing and task management and improve the utilization rate and production capacity of printer resources.
[0076] In this embodiment, during initialization, the printer control software only needs to create a print task once and send the large print unit data to the printer settings. The printer will identify each small print unit based on the flag bit, and finally only needs to send a print end command once to end printing. In this way, the printer does not need to repeat the initialization and end printing actions multiple times when printing multiple copies, and the printer program will identify the control bit of each small print unit. After printing each small unit, the inkjet carriage will stop at the position set by the user, and then when the user places the object to be printed and presses the continue printing button, the printer will automatically adjust and switch to the next small print unit to continue printing after receiving the trigger signal, thereby improving printing efficiency.
[0077] It can realize the continuous execution of printing tasks, reduce the repetition of initialization and ending actions, and identify different small printing units according to flag bits, which can greatly improve printing efficiency, enhance the production capacity of the printer, and meet users' needs for efficient printing.
[0078] In this embodiment, according to the flag assignment described in step S7, a unique flag is assigned to each print task for identification and distinction during the printing process. The specific contents are as follows:
[0079] The current task number is assigned to each task according to the order of the tasks in the print task list. The task numbers start from 1 and increase in sequence according to the order of the tasks in the list.
[0080] The current number of copies to be printed. For each task, set the number of copies to be printed. It is specified by the user when loading the file and recorded in the task information.
[0081] The flag is calculated by multiplying the current task number by the current number of copies to be printed, and taking the modulus of 2, that is, the flag value is equal to (current task number × current number of copies to be printed) % 2;
[0082] The flag bit is used to assign the calculated flag bit to the print task. Each task will be assigned a unique flag bit to identify the print status or other related information of the task.
[0083] Through the above content, a unique flag can be assigned to each printing task. The flag is calculated based on the task sequence number and the number of copies to ensure that each task has a different flag for accurate identification and distinction during the printing process, convenient tracking and management of the printing status of each task, and ensuring the smooth progress of the printing process.
[0084] In this embodiment, according to step S8, locating the data, the file pointer is pointed to the first line of data of the print file to prepare to start reading the print data, specifically including:
[0085] In the print control software, use the file operation function to open the file to be printed, specify the open file by the file path or file name, move the file pointer to the first line of data in the print file by file pointer operation, use the file pointer offset function fseek() to move the file pointer to the beginning of the file, and then skip the file header information according to the file format and structure;
[0086] Directly read the first line of data without moving the file pointer. If the file format allows direct reading of the first line, then prepare to read the print data. After ensuring that the file pointer is correctly positioned, use the file reading function to read the print data line by line. Select the method of reading the text file line by line based on the file format and structure.
[0087] Position the file pointer to the first line of data in the print file to prepare for subsequent data reading operations, ensure that data is read from the correct position, avoid data misalignment or loss, and enable smooth printing operations.
[0088] In this embodiment, according to the reading data described in step S9, the data of the PRN file is read line by line according to the size of each BytesPerLine of each color, and is ready to be sent to the printer device. According to the format of the print file and the requirements of the printer device, the byte length BytesPerLine of each color and the number of colors are set;
[0089] Then read the data of the PRN file line by line, loop through each line until the entire PRN file is read, cut or parse each line of data according to the BytesPerLine of each color, obtain the printing data of each color, and then convert the data of each color into the corresponding format according to the communication protocol and data format requirements of the printer device, and send it to the printer device.
[0090] Reading the data of the PRN file line by line according to the BytesPerLine size of each color and preparing to send it to the printer device can ensure the correctness and integrity of the data and meet the requirements of the printer device.
[0091] In this embodiment, a print queue management module is introduced to optimize the scheduling of print tasks. By reasonably arranging the print job sequence and allocation of different tasks, the time of task switching is minimized, thereby improving the utilization efficiency of printer resources. Specifically, the following steps are included:
[0092] Print job sorting: sort the jobs in the print queue according to factors such as the size of the print file and the estimated printing time, using a first-come-first-served (FCFS) or priority scheduling algorithm to put jobs with shorter printing times in front to reduce the waiting time for task switching;
[0093] Resource allocation: According to the characteristics of the printer and available resources, tasks are reasonably allocated to the printer device. Taking into account factors such as the printer's processing power, memory capacity, and number of print heads, jobs suitable for simultaneous processing are allocated to the printer, and the number of concurrent jobs for each job is controlled to avoid excessive jobs causing a decrease in print quality or a slow print speed.
[0094] Priority scheduling: assign priorities to different printing tasks according to user settings or system requirements. For example, urgent tasks can be set as high priority to ensure their timely completion. Priority scheduling can ensure that important tasks are processed first and improve work efficiency.
[0095] Dynamic adjustment: dynamically adjust the order and allocation of tasks in the print queue according to the real-time status of the printer and resource utilization. For example, if a job is found to have problems during printing or requires additional processing time, it will be paused or rescheduled to ensure the best utilization of printer resources.
[0096] Estimated printing time: By analyzing the characteristics of the printer device and the file, the completion time of each print job can be estimated, so that the order and distribution of print jobs can be arranged more accurately, avoiding the waiting time of other jobs being affected by a time-consuming print job.
[0097] Through the print queue management method, the scheduling and allocation of print tasks can be optimized, the time for task switching can be minimized, the utilization efficiency of printer resources can be improved, and the printing time can be dynamically adjusted and estimated according to different needs to improve printing efficiency and user experience.
[0098] In this embodiment, a print task management module is introduced to manage and monitor print tasks in the print control software, display the current print task list, task status, number of completed tasks and other information, and provide tasks Pause, cancel, restart and other operations, including
[0099] Print task list: Display the current print task list in the print control software, including all print tasks in progress or waiting to be executed, as well as task related information, such as task name, task status, printing progress, etc.
[0100] Task status monitoring: real-time monitoring of the status of printing tasks. You can view the current status of each task, such as printing, paused, canceled, completed, etc. It can also display information such as the remaining time of the task and the number of pages printed, so that users can understand the progress of the task.
[0101] Task operation provides the operation functions for printing tasks, including task pause, cancel and restart. Users can pause the ongoing task as needed to handle other urgent tasks, or cancel the task to avoid unnecessary printing consumption. If the paused task needs to be resumed, the task can be restarted;
[0102] Error handling: When errors or exceptions occur in a print task, the print task management module can capture and perform corresponding error handling. For example, when a printer fails, a file is damaged, or a network connection is interrupted, the system can automatically mark the task as an error and provide error prompts and solutions.
[0103] Complete task statistics, record the number of completed printing tasks, and provide corresponding statistical reports to facilitate users to carry out task management and performance evaluation.
[0104] By introducing print task management, comprehensive management and monitoring of print tasks can be achieved. Users can clearly understand the current print task status and progress, and perform task operations and error handling as needed. At the same time, the number of completed tasks can be counted to help users with task management and performance analysis.
[0105] A printing device for multiple jobs of different tasks includes: at least one processor, at least one memory and computer program instructions stored in the memory. When the computer program instructions are executed by the processor, the above-mentioned method is implemented.
[0106] A storage medium stores computer program instructions, which implement the above-mentioned method when the computer program instructions are executed by a processor.
[0107] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technical personnel in this field can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any brief modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are still within the scope of the technical solution of the present invention.
Claims
1. A method for printing multiple jobs of different tasks, characterized in that: The steps include: S1: Online, start the printer control software and then establish a connection with the printer; S2: Load files. The user loads multiple files to be printed, imports the print files into the print list and sets the number of copies for each task. S3: Import the list and save the print file into the print list; S4: Initial printing, initializing all printing data, including printing status, printing equipment, and setting the cumulative number of printed tasks to 0; S5: Start printing, create a print task, and send a start print command to the printer; S6: Open the file, open a file from the print list, the printer control software opens the file to be printed, reads the PRN file header information, and obtains the information of the printed image; S7: Flag assignment, print flag assignment, the flag value is equal to the current task number multiplied by the current number of prints modulo 2; S8: Locate data, the file pointer points to the first line of data in the print file, and prepares to start reading the print data; S9: Read data, read the data of the PRN file line by line according to each BytesPerLine of each color, and prepare to send it to the printer device; S10: Send data. When the print data is enough for a print slice, the print data and print flag are sent to the printer device. S11: Determine the file, determine whether the PRN file has read the last line of data in the file, if the file has not been read, jump to step S9, repeat step S9 to continue reading data, sending data and determining the file; S12: the number of copies printed decreases, the total number of copies printed decreases by 1, and then the number of copies printed is determined to determine whether it is zero. If it is not zero, jump to step S7 and continue to print the next number of copies of the current task; S13: updating the number of printed tasks, which is increased by 1, to record the number of completed printing tasks; S14: judging the task list to determine whether all the printing task lists have been printed. If not, jump to step S6; S15: End printing, end the printing task, exit printing and the printing task, and turn off the printer.
2. The method for printing multiple jobs of different tasks according to claim 1, characterized in that: The printer control software establishes a communication connection with the printer device, the printer control software loads the file to be printed and sets the number of copies to be printed, and the printing control software treats each print file as a small printing unit, sets a large printing unit, combines all the small printing units into a large printing unit, and sets a flag bit for each small printing unit, wherein each small printing unit has a flag bit for distinguishing each small printing unit.
3. The method for printing multiple jobs of different tasks according to claim 1, characterized in that: During initialization, the printer control software only needs to create a print task once and send the large print unit data to the printer settings. The printer will identify each small print unit according to the flag bit. Finally, it only needs to send a print end command once to end printing. In this way, the printer does not need to repeat the initialization and end printing actions multiple times when printing multiple copies. The printer program will identify the control bit of each small print unit. After printing each small unit, the inkjet carriage will stop at the position set by the user. Then when the user places the object to be printed and presses the continue printing button, the printer will automatically adjust and switch to the next small print unit to continue printing after receiving the trigger signal.
4. The method for printing multiple jobs of different tasks according to claim 1, characterized in that: According to the flag assignment in step S7, a unique flag is assigned to each print task to identify and distinguish it during the printing process. The specific content is as follows: The current task number is assigned to each task according to the order of the tasks in the print task list. The task numbers start from 1 and increase in sequence according to the order of the tasks in the list. The current number of copies to be printed. For each task, set the number of copies to be printed. It is specified by the user when loading the file and recorded in the task information. Calculate the flag bit, then multiply the current task number by the current number of copies to be printed, and take the modulus of 2, that is, the flag bit value is equal to (current task number × current number of copies to be printed) % 2; The flag bit is used to assign the calculated flag bit to the print task. Each task will be assigned a unique flag bit to identify the printing status of the task.
5. The method for printing multiple jobs of different tasks according to claim 1, characterized in that: According to step S8, the data is located and the file pointer is pointed to the first line of data of the print file to prepare to start reading the print data, which specifically includes: In the print control software, use the file operation function to open the file to be printed, specify the open file by the file path or file name, move the file pointer to the first line of data in the print file by file pointer operation, use the file pointer offset function fseek() to move the file pointer to the beginning of the file, and then skip the file header information according to the file format and structure; Directly read the first line of data without moving the file pointer. If the file format allows direct reading of the first line, then prepare to read the print data. After ensuring that the file pointer is correctly positioned, use the file reading function to read the print data line by line. Select the method of reading the text file line by line based on the file format and structure.
6. The method for printing multiple jobs of different tasks according to claim 1, characterized in that: According to the read data described in step S9, the data of the PRN file is read line by line according to the BytesPerLine size of each color, and is prepared to be sent to the printer device, and the byte length BytesPerLine of each color and the number of colors are set according to the format of the print file and the requirements of the printer device; Then read the data of the PRN file line by line, loop through each line until the entire PRN file is read, cut or parse each line of data according to the BytesPerLine of each color, obtain the printing data of each color, and then convert the data of each color into the corresponding format according to the communication protocol and data format requirements of the printer device, and send it to the printer device.
7. The method for printing multiple jobs of different tasks according to claim 1, characterized in that: The print queue management module is introduced to optimize the scheduling of print tasks. By reasonably arranging the print job sequence and allocation of different tasks, the task switching time can be minimized. Specifically, it includes: Print job sorting: sort the jobs in the print queue according to the size of the print file and the estimated printing time. Use the first-come-first-served (FCFS) or priority scheduling algorithm to put the jobs with shorter printing time in the front, thus reducing the waiting time for task switching. Resource allocation: According to the characteristics of the printer and available resources, tasks are reasonably allocated to the printer device, jobs suitable for simultaneous processing are assigned to the printer, and the number of concurrent jobs for each job is controlled; Priority scheduling: assign priorities to different printing tasks based on user settings or system requirements; Dynamic adjustment: dynamically adjust the order and allocation of tasks in the print queue according to the real-time status of the printer and resource utilization. If a job is found to have problems during printing or requires additional processing time, it will be paused or rescheduled. Estimated printing time: by analyzing the printer device and file characteristics, the completion time of each print job is estimated.
8. The method for printing multiple jobs of different tasks according to claim 1, characterized in that: Introduce the print task management module to manage and monitor print tasks in the print control software, including Print task list: Display the current print task list in the print control software, including all print tasks in progress or waiting to be executed, as well as task information; Task status monitoring: real-time monitoring of the status of printing tasks, checking the current status of each task, and also displaying the remaining time of the task and the number of pages printed; Task operation, operation functions for printing tasks, including task pause, cancel and restart, pausing or canceling ongoing tasks; Error handling: when an error or exception occurs in a print task, the print task management module captures it and performs corresponding error handling; Complete task statistics, record the number of completed printing tasks, and provide statistical reports.
9. A printing device for multiple jobs of different tasks, characterized in that: The method comprises at least one processor, at least one memory and computer program instructions stored in the memory, and when the computer program instructions are executed by the processor, the method according to any one of claims 1 to 8 is implemented.
10. A storage medium, characterized in that: Computer program instructions are stored thereon, and when the computer program instructions are executed by a processor, any method described in claims 1-8 is implemented.
Citation Information
Patent Citations
Method for Generating Print Jobs in a Printing System, Method for Sorting Print Jobs in a Printing System, Computer Program Product and Printing System for Carrying Out Said Methods
US20080266594A1
Information processing apparatus, control method, and storage medium
US20180121147A1
