Printing driving method and system based on scene automatic adaptation
By obtaining printer configuration information and combining task scenario model and scenario protocol library, and automatically adapting to the printing language and communication protocol, the traditional printing driving method is solved, and a more efficient and intelligent printing driving system is achieved.
Patent Information
- Application Number
- CN202510016991.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-06
- Publication Date
- 2025-05-06
AI Technical Summary
Traditional printing driving methods cannot flexibly adjust communication strategies based on specific printing scenarios, resulting in inefficient printing efficiency and print quality that cannot meet the needs of specific scenarios.
By obtaining the configuration information of the target printer, combining the task scenario model and the scenario protocol library, the optimal printing language and communication protocol are automatically adapted to achieve an optimized printing process for different scenarios.
Improves the accuracy and efficiency of printing, avoids printing errors and waste of resources caused by improper settings, and enhances the practicality and intelligence of the print driver system.
Smart Images

Figure CN119937950A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of print driver technology, and in particular to a print driver method and system based on scene automatic adaptation. Background Art
[0002] In today's office and various document output scenarios, printers play an important role as common equipment. Due to the large number of printer brands and models on the market, the printing languages used and the communication protocols supported by each printer are different, which leads to many inconveniences when actually using the printer for printing operations, so a convenient printing method is urgently needed.
[0003] The current traditional printing method can often support driver files of various formats. Print drivers usually use fixed printing languages and communication protocols to achieve data transmission between computers and printers. During the printing process, the driver first obtains the basic information of the printer, then converts the document into a data format supported by the printer, and finally sends the data to the printer through a preset communication protocol to complete the printing.
[0004] However, when facing different scenarios, traditional printing methods can only operate based on fixed communication protocols. Different printing tasks may need to be performed in different usage scenarios, such as high-speed printing, high-quality printing, or confidential printing. It is difficult to flexibly adjust the communication strategy according to the specific printing scenario, which may lead to low printing efficiency or printing quality that cannot meet the needs of specific scenarios. Therefore, traditional methods lack the ability to automatically adapt to the best protocol according to the actual usage scenario. Summary of the invention
[0005] The present application provides a scenario-based automatic adaptation printing driver method and system, which is used to solve the problem of low printing efficiency caused by the lack of flexible adaptation capabilities of traditional printing drivers when facing diversified printing scenarios.
[0006] In the first aspect, the present application provides a printing driver method based on automatic scene adaptation, which is applied to a printing driver system, and the method includes: obtaining configuration information of the target printer, the configuration information including printing language information and protocol information of the target printer; sending the user's printing requirements and the document to be printed to a conversion module; converting the printing requirements and the printing document into a driver file matching the target printer according to the printing language information by the conversion module; determining the usage scenario of the current printing task based on the task to be printed in combination with a task scenario model, and the task scenario model is pre-constructed through deep learning based on multiple historical printing tasks labeled with corresponding scenes; determining the protocol of the printing task to be sent based on a pre-constructed scenario protocol library in combination with the protocol information, and the scenario protocol library includes protocols to be used in different scenarios; sending the driver file to the target printer according to the protocol of the printing task to be sent; and driving the target printer to start printing.
[0007] By adopting the above technical solution, the configuration information of the target printer is first obtained. The printing language information can ensure that the conversion module accurately converts the printing requirements and documents into matching driver files. The protocol information combined with the scenario protocol library can determine the appropriate sending protocol, and the two cooperate with each other. The usage scenario is determined according to the task scenario model, so that the entire printing process can be optimized for different scenarios. In this way, whether printing a large number of documents in the office or printing photos at home, the optimal settings can be automatically adapted, which improves the accuracy and efficiency of printing, avoids printing errors and waste of resources caused by improper settings, and enhances the practicality and intelligence of the print driver system.
[0008] In combination with some embodiments of the first aspect, in some embodiments, the step of determining the protocol of the print task to be sent according to a pre-constructed scenario protocol library in combination with the protocol information specifically includes: if there are multiple adaptable protocols for the usage scenario in the scenario protocol library, then select according to a preset protocol priority order, and the protocol priority order is obtained according to the success rate of sending print tasks using different protocols in the protocol history under the usage scenario.
[0009] By adopting the above technical solution, when determining the protocol of the print task to be sent in combination with the protocol information, if the scenario protocol library has multiple adaptation protocols for the usage scenario, the protocol priority order is selected. This priority order is based on the success rate of the protocol history in the scenario, which means that the system can select the most stable and efficient protocol based on past experience.
[0010] In combination with some embodiments of the first aspect, in some embodiments, after the step of determining the usage scenario of the current printing task based on the task to be printed in combination with the task scenario model, it also includes: if the task scenario model cannot clearly define the usage scenario, a prompt message is sent to the user end, and selectable usage scenarios are provided for the user to select; the usage scenario selected by the user is obtained, and the result of the user's selection is used as reference data to supplement the scenario model learning.
[0011] By adopting the above technical solutions, a combination of human-computer interaction and machine learning is achieved. On the one hand, the user's choice can promptly solve the scene determination problem of the current printing task and ensure the smooth progress of the printing process; on the other hand, the continuously supplemented user selection data will make the task scene model more and more accurate. When facing similar fuzzy scenes in the future, the system can automatically judge more accurately, which improves the system's recognition ability and intelligent decision-making level for diversified scenes, and enhances the user experience and system adaptability.
[0012] In combination with some embodiments of the first aspect, in some embodiments, after the step of converting the printing requirement and the print document into a driver file matching the target printer according to the printing language information through the conversion module, it also includes: if it is detected that the conversion module cannot successfully convert according to the printing language information, a corresponding error prompt message is sent to the user terminal; and a request is sent to the user terminal to try to match the printing language by itself.
[0013] By adopting the above technical solution, the user is first informed of the problem in time to avoid blind waiting. The operation of trying to match the printing language by itself is selected by using the automatic matching model and the matching degree of multiple historical text feature data and the printing language type, which increases the possibility of successful conversion.
[0014] In combination with some embodiments of the first aspect, in some embodiments, after the step of sending a request to the user terminal to try to match the printing language by itself, it also includes: after receiving the instruction from the user terminal to try to match the printing language by itself, starting the automatic matching model, the automatic matching model is prepared in advance and constructed by machine learning through the matching degree of multiple historical text feature data and the printing language type; the printing language with the highest matching degree is determined by the automatic matching model for the task to be printed as the printing language to be matched; and the printing requirement and the printed document are converted by the conversion module according to the printing language to be matched.
[0015] By adopting the above technical solutions, the system can continuously learn and optimize. With the accumulation of successful conversion cases, the automatic matching model will be more accurate in matching various text features and printing languages. The next time a printing task with similar text features is encountered, the appropriate printing language can be determined more quickly and accurately, which improves the conversion efficiency and accuracy, and further enhances the system's adaptability and processing capabilities for different document types.
[0016] In combination with some embodiments of the first aspect, in some embodiments, after the step of converting the printing requirement and the printed document according to the printing language to be matched through the conversion module, it also includes: if the conversion is successful, constructing a correspondence between the text feature information of the task to be printed and the printing language to be matched to update the automatic matching model; if the conversion fails, sending a corresponding conversion failure prompt message to the user end.
[0017] By adopting the above technical solution, the update operation when successful allows the system to continuously learn and evolve, and can cope with more diverse text types and printing needs. The prompt information when failed also allows users to take other measures in time, ensuring the integrity and controllability of the entire printing process, and improving the stability and reliability of the system in complex printing task scenarios.
[0018] In combination with some embodiments of the first aspect, in some embodiments, after the step of converting the printing requirement and the print document into a driver file matching the target printer according to the printing language information through the conversion module, it also includes: performing an integrity check on the driver file according to a preset verification standard to obtain a first verification result; if the first verification result shows that the driver file is incomplete, extracting the corresponding part from a preset driver file supplementary resource library according to the missing part to obtain a supplementary driver file, and the driver file supplementary resource library stores various types of printer driver file resources; performing an integrity check on the supplementary driver file again to obtain a second verification result; if the second verification result shows that the driver file is incomplete, sending a prompt message to the user end that the driver file integrity check failed.
[0019] By adopting the above technical solution, the integrity and correctness of the driver file are ensured, avoiding the problem of the printer not being able to work properly or printing errors due to the missing content of the driver file.
[0020] In a second aspect, the present application provides a print driver system, which includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the print driver system to execute the method described in the first aspect and any possible implementation method of the first aspect.
[0021] In a third aspect, the present application provides a computer-readable storage medium comprising instructions, which, when executed on a print driver system, causes the print driver system to execute the method described in the first aspect and any possible implementation of the first aspect.
[0022] In a fourth aspect, the present application provides a computer program product, which, when executed on a print driver system, enables the print driver system to execute the method described in the first aspect and any possible implementation of the first aspect.
[0023] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: 1. Due to the technical means of obtaining printer configuration information and combining it with the task scenario model and scenario protocol library to adapt the print driver, the technical problem of low printing efficiency and poor quality caused by the inability of the print driver method in the prior art to automatically adapt according to the scenario is effectively solved, thereby achieving the technical effect of accurately converting driver files and selecting appropriate protocols to send in different scenarios, thereby improving printing accuracy, efficiency and intelligence.
[0024] 2. Since the technical means of selecting the adaptation protocol according to the protocol priority order determined by the historical success rate of the protocol is adopted, the technical problem of the inability to select the optimal protocol in complex scenarios in the prior art, resulting in unstable and low efficiency of printing task transmission, is effectively solved, thereby achieving the technical effect of ensuring printing smoothness and speed when multiple adaptation protocols exist, and improving the reliability and adaptability of the printing driver system.
[0025] 3. Due to the technical means of starting the automatic matching model based on user instructions and updating the model according to the conversion results, the technical problems in the existing technology that the printing language conversion is difficult and the system cannot optimize itself are effectively solved, thereby improving the success rate of printing language matching for different document types, enhancing the system's adaptability and processing capabilities for diversified documents, and continuously optimizing the technical effects through continuous learning. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 is a schematic diagram of an application structure of a printing driver method in a related embodiment; Figure 2 It is a schematic diagram of an application structure of a printing driver method based on automatic adaptation of a scenario in an embodiment of the present application; Figure 3 It is a flow chart of a printing driver method based on scene automatic adaptation in an embodiment of the present application; Figure 4 is another flow chart of the print driver method based on scene automatic adaptation in an embodiment of the present application; Figure 5 It is a schematic diagram of a physical device structure of the print drive system in an embodiment of the present application. DETAILED DESCRIPTION
[0027] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification and appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to and includes any or all possible combinations of one or more listed items.
[0028] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0029] The following is an overview of the relevant embodiments of the conventional method. Figure 1 , Figure 1 It is a schematic diagram of an application structure of a printing driver method in a related embodiment.
[0030] exist Figure 1 In the article, AirPrint on the Apple system is used as an example to illustrate that AirPrint has certain printing driver functions, and it supports driver files in three formats: AppleRaster / URF, JPEG, and PDF. In terms of sending protocols, ipp / ipps are supported. When a printing operation is required, the workflow is as follows: First, input the document to be printed into the CUPS scheduling system in one of these three formats (such as AppleRaster / URF, JPEG, or PDF). Then, the CUPS scheduling system will determine the sending protocol based on the URI (Uniform Resource Identifier) when adding the driver queue. If the URI is IPP, the driver file is sent to the printer through the IPP protocol; if it is not IPP (that is, other situations), the driver file is sent through the IPPS protocol. Finally, the printer receives the driver file and outputs the printed document.
[0031] This traditional printing driver method realizes basic printing functions to a certain extent, but lacks certain flexibility and intelligence compared with the scene-based automatic adaptation printing driver method provided by the present invention.
[0032] The following is an overview of the scenario structure to which the method provided in this application is applied. Figure 2 , Figure 2 It is a schematic diagram of an application structure of a printing driver method based on automatic adaptation of scenarios in an embodiment of the present application.
[0033] exist Figure 2 In the invention, a more flexible and intelligent printing driver system is constructed. In this system, several key components are included: filter, backend and configuration file, which work together to realize support for various formats of driver files and different sending protocols, so as to adapt to different printers and diversified printing scenarios. The present invention is not limited to a specific driver file format, and can support a variety of common and uncommon formats, such as PDF, PostScript, PWG, URF, PCLm, JPEG, etc., which means that no matter what format the user's document exists in, the system has the ability to convert it into a format that can be recognized by the printer, which greatly improves the versatility of the system and its adaptability to different types of documents. The filter plays a key conversion role in the entire printing process. It uses other filters and ghostscript that come with the CUPS printing system to read the configuration file that records all the properties of the printer, and converts the input ordinary document into the corresponding printing language (i.e., driver file) according to the characteristics of different printers. For example, it can convert the PDF format into PostScript, PWG, URF, PCLm or other formats supported by other printers to ensure that the driver file finally generated matches the target printer perfectly. The backend is mainly responsible for receiving the driver file from the filter and sending it to the printer. During the sending process, it will select the appropriate printing protocol according to the properties of the printer in the configuration file. These protocols include but are not limited to private protocols supported by printers such as IPP / IPPS, LPD, SOCKET, and even cover protocols corresponding to common connection methods such as USB protocol. When a driver file of a format can be sent through multiple protocols, for example, if the originally preferred protocol is not available in a certain printer state, the backend can detect it in time and switch to another available protocol to ensure the smooth progress of the printing task.
[0034] The embodiments of the present application are based on Figure 2 Based on the above, the content of scene recognition is added. For easy understanding, the following describes the process of the method provided by this implementation in combination with the above content. Figure 3 , which is a flow chart of a printing driver method based on automatic adaptation of scenarios in an embodiment of the present application.
[0035] S301, obtaining configuration information of a target printer, where the configuration information includes printing language information and protocol information of the target printer; The print driver system first obtains the configuration information of the target printer through multiple channels. The specific implementation methods include: the system sends a detection request to the printer in the network through SNMP (Simple Network Management Protocol), the printer responds to the request and returns MIB (Management Information Base) data, including a list of supported printing languages (such as PCL, PostScript, etc.) and a list of supported communication protocols (such as LPD, IPP, etc.), the system parses the MIB data to extract the required configuration information, the system monitors the Bonjour / mDNS broadcast of the printer, parses the service description information in the broadcast data packet to obtain the configuration, refreshes regularly to keep the information up to date, reads the PPD provided by the printer manufacturer, analyzes the PPD file and establishes a support mapping table for printing languages and protocols.
[0036] S302, sending the user's printing requirement and the document to be printed to the conversion module; In this step, the print driver system will obtain the print job submitted by the user. The print job contains the user's specific printing requirements and the document to be printed. The printing requirements may include the number of copies, color mode, page range, double-sided printing and other print job parameters. The print driver system provides a print service interface, and users can submit print jobs through standard print commands or graphical interfaces. After receiving the print job, the print driver system will parse the job to obtain the printing requirement parameters and the document data to be printed, and then submit it to the conversion module to start the printing workflow.
[0037] The conversion module is one of the key components of the print driver system. It is responsible for converting documents in a common format into a print language file that can be recognized by the target printer, that is, generating a driver file. Therefore, the print driver system will transfer the print job containing the user's printing requirements and the document to be printed to the conversion module in its entirety, providing input and basis for subsequent file conversion operations. The user's printing requirements transmitted to the conversion module will contain key information related to document conversion, such as printing targets and printing parameters, which is crucial for the conversion module to accurately understand the user's intentions and generate matching driver files. The document to be printed provides complete document content and format as the basic object for conversion. The conversion module needs to analyze the document format and extract the content. Therefore, this step passes the print job to the conversion module in its entirety, providing both the user's intentions and the complete source data of the document to be printed, preparing for the subsequent conversion to generate the driver file.
[0038] S303, converting the printing requirement and the print document into a driver file matching the target printer according to the printing language information by the conversion module; After receiving the print job, the conversion module will start the conversion process, with the goal of converting the document in the print job into a driver file that matches a specific printer. The conversion module needs to refer to the printer's print language information to determine the print language type supported by the target printer, such as PostScript, PCL, etc. This print language information comes from the printer configuration pre-acquired by the print driver system, and the conversion module can query the printer configuration database to obtain this information.
[0039] Next, the conversion module will parse and process the format and content of the document to be printed. Common document formats such as Word, PDF, Excel, etc. will contain different objects, such as text, pictures, charts, etc. The conversion module needs to extract the text, graphics, pictures and other elements in the document, and then organize and describe these elements according to the printing language supported by the printer. For example, the Target printer supports the PostScript language, and the conversion module needs to generate PostScript code to describe each text character, graphic and picture in the document, as well as their position layout information in the document, so as to construct a print file describing the complete document content in the PostScript language. In addition, the conversion module also needs to convert the user's printing requirements into the driver file, such as setting the number of print copies, color mode and other parameters through the comment code in the PostScript. The generated PostScript driver file will contain the document content and printing parameter information.
[0040] By parsing the document structure, extracting content elements, and reorganizing the description in the target printing language, the conversion module can generate a print driver file that fully matches a specific printer. This file can be directly interpreted by the printer and print the results expected by the user.
[0041] In some embodiments, the driver file generated by the conversion module can be checked for integrity according to a preset check standard to obtain a first check result. This check standard may involve multiple inspection rules such as file format specifications, key data segment integrity, code logic integrity, etc. These rules are set according to the general requirements of the printer driver file and the specific requirements of the target printer. If the first check result shows that the driver file is incomplete, the system will further analyze to clarify the missing part, which may be compared with the standard driver file template, or accurately locate the missing code segment, data block or configuration information based on the error information provided by the check algorithm. After clarifying the missing part, the system searches and extracts the corresponding part from the preset driver file supplementary resource library, which stores various types of printer driver file resources. These resources can be driver file fragments or templates under different printer models, different printing languages and protocols that are pre-collected and organized. They can cover common driver file missing situations, integrate the extracted missing part into the original driver file, and generate a supplementary driver file. During the integration process, it is necessary to ensure the compatibility and coherence of the supplementary part with the original file so that the supplemented driver file remains correct in logic and format. The driver file after supplementation is checked for integrity again to obtain the second test result. The purpose of this check is to confirm whether the previous supplementation operation has successfully made the driver file complete and usable. The verification process is similar to the initial verification, and all aspects of the file are comprehensively checked according to the preset verification standards. If the second test result shows that the driver file is still incomplete, this means that there may be more complex problems that make it impossible to repair the driver file by simply supplementing resources. At this time, the system sends a prompt message to the user end that the driver file integrity check has failed. The prompt message may contain a detailed error description so that the user can understand the situation and take further measures.
[0042] S304, determining the usage scenario of the current printing task according to the task to be printed and a task scenario model, wherein the task scenario model is constructed in advance through deep learning based on a plurality of historical printing tasks annotated with corresponding scenarios; After obtaining the driver file for the target printer, the print driver system will use the task scenario model to determine which usage scenario the current print task belongs to. Different scenarios will affect the subsequent printing parameter settings. The task scenario model is a model generated by machine learning training, which is used to predict the usage scenario type corresponding to the incoming print task. The training process is as follows: A large number of historical print tasks are collected as training sets. These print tasks cover various scenarios such as office document printing, photo printing, bill printing, and book printing. Through manual annotation, each historical print task is labeled with a corresponding scenario, such as office document printing, photo printing, etc. Using a deep learning algorithm, the characteristics of the print task are used as input and the scene label is used as output to train a task scenario prediction model. The features can include information such as document type, page size, color mode, quality parameters, etc. After iterative training, the model can make scenario predictions for new print tasks. For the current task to be printed, the print driver system will extract the relevant features of the task and input them into the task scenario model. The model will output a prediction label indicating the most likely scenario for the current print task. Through the prediction of the scene model, the print driver system can know the scene type to which the current print task belongs, which serves as the basis for subsequently determining the printing parameters to achieve the purpose of optimization for different scenes.
[0043] In some embodiments, when the task scenario model cannot clearly define the usage scenario of the current printing task, the system adopts a combination of human-computer interaction and machine learning to solve this problem. The specific steps are as follows: After the printing driver system detects that the task scenario model cannot accurately determine the usage scenario of the current printing task, it immediately sends a prompt message to the user terminal. This prompt message is intended to inform the user that the system has encountered difficulties in determining the printing scenario and needs the user's assistance. At the same time, the system provides the user with a series of optional usage scenario options. These options cover common printing scenario types. These scenario options are based on the system's pre-classification and induction of various types of printing tasks, and are intended to fully cover the printing scenarios that users may encounter and help users accurately select scenarios that meet the current task requirements. After receiving the prompt information and the scenario selection list, the user selects a usage scenario that they think is most suitable from the provided options according to the nature and requirements of the actual printing task. The printing driver system receives the usage scenario selected by the user and adds the result of the user's selection to the training data set of the task scenario model as new sample data. In the subsequent model training process, these data with user-defined scenario annotations will be used together with other historical printing task data to retrain and optimize the task scenario model. In this way, the model can learn the characteristic patterns of printing tasks in more different scenarios, and continuously improve its recognition ability and accuracy for various printing task scenarios.
[0044] S305, determining the protocol of the print task to be sent according to a pre-built scenario protocol library in combination with the protocol information, where the scenario protocol library contains protocols to be used in different scenarios; After determining the usage scenario of the current print task, the print driver system needs to further select the best protocol for the print task to be sent based on the protocol information and the scenario protocol library. First, the print driver system will query the protocol information of the target printer obtained in step S301, which contains various communication protocols supported by the printer, such as IPP, LPD, Socket, etc. Then, the print driver system will match the recommended protocol information corresponding to different scenarios contained in the scenario protocol library. The scenario protocol library is a knowledge base constructed by the print driver system by learning a large amount of print task data. It extracts the use of various protocols in historical print tasks in different scenarios, and counts the success rate, speed and other indicators of different protocols in various scenarios. According to these comprehensive indicators, the best protocol recommendation scheme for each scenario is evaluated. For example, in the daily office printing scenario, the historical success rate and speed indicators of the IPP protocol are better than the LPD protocol, so the scenario protocol library will recommend the IPP protocol as the first choice in this scenario.
[0045] The print driver system will match the protocols supported by the target printer with the current scenario recommended protocols given by the scenario protocol library to find the candidate protocol set that matches the printer configuration. If there is only one protocol in the matching result, then this protocol will be determined as the protocol for the print task to be sent.
[0046] When there are multiple adaptable protocols for the usage scenario of the current print task in the scenario protocol library, in order to ensure that the print task can be transmitted in the most stable and efficient way, the system will select the appropriate protocol according to the preset protocol priority order. The specific process is as follows: First, the print driver system will search for all adaptable protocols that match the currently determined usage scenario in the scenario protocol library. The system will refer to the protocol history records to obtain the success rate data when using different protocols to send print tasks in this usage scenario. These data are obtained by tracking and counting a large number of actual print tasks in the past. For each adaptable protocol, the proportion of its successful completion of the print task in this scenario is recorded. According to the obtained success rate data, the adaptable protocols are sorted to determine the protocol priority order. The higher the success rate of the protocol, the higher its priority. Finally, the print driver system selects the protocol with the highest priority from the adaptable protocol set as the print task protocol to be sent. In the subsequent printing process, the system will use the selected protocol to send the driver file to the target printer to ensure that the print task can be transmitted with a high success rate and efficiency. At the same time, the system will continue to track and record the actual situation of using the protocol for printing tasks, including indicators such as print quality and transmission speed, so as to continuously optimize the protocol priority order so that it can better adapt to changes in actual printing needs. In this way, the system realizes the function of automatically selecting the optimal protocol based on historical experience, improving the adaptability and reliability of the print driver system in complex scenarios.
[0047] S306: Send the driver file to the target printer according to the protocol of the print task to be sent, and drive the target printer to start printing.
[0048] After determining the protocol of the print task to be sent, the print driver system will start the backend component to transmit the driver file and control the work of the printer. Specifically, the backend component will initialize the connection with the target printer according to the selected print task protocol to be sent. The connection can be through the network interface or other interfaces such as USB and serial port, depending on the transmission method of the protocol. For example, if the selected protocol is IPP, the backend will establish a network transmission channel through the TCP / IP protocol stack; if it is a USB protocol, the USB device connection will be initialized. After the transmission channel is established, the backend will read the printer driver file generated by the conversion module and encapsulate and package it according to the format requirements of the selected protocol, such as adding a protocol control header. Then the encapsulated driver file is transmitted to the target printer through the initialized channel. While the file is being transmitted, the backend will also issue a print control instruction to notify the printer to start receiving file data and start the printing operation. Finally, the target printer receives the driver file and parses it to execute printing, outputs the document, and the backend component will track and record the quality data during the printing process as feedback input for the optimization scenario protocol library.
[0049] In the embodiment of the present application, due to the technical means of obtaining printer configuration information and combining it with the task scenario model and the scenario protocol library to adapt the print driver, the technical problem of low printing efficiency and poor quality caused by the inability of the print driver method in the prior art to automatically adapt according to the scenario is effectively solved, thereby achieving the technical effect of accurately converting driver files and selecting appropriate protocols for sending in different scenarios, thereby improving printing accuracy, efficiency and intelligence.
[0050] After combining the above content, the following is a more detailed description of the process of the method provided by this implementation. Figure 4 , which is another flow chart of the printing driver method based on automatic adaptation of the scene in an embodiment of the present application.
[0051] S401, if it is detected that the conversion module cannot successfully convert according to the printing language information, a corresponding error prompt message is sent to the user terminal; When the conversion module in the print driver system tries to convert the user's printing requirements and the document to be printed into a matching driver file according to the printing language information of the target printer, the conversion may fail. When the conversion module detects that the conversion from the document to the driver file cannot be successfully completed, the print driver system will promptly send an error prompt to the user to avoid the user being at a loss because of the delay in receiving the printer feedback.
[0052] S402, sending a request to the user terminal to try to match the printing language by itself; After the print driver system sends a conversion failure prompt to the user, if it determines that the print task can be converted by other means, it can continue to send a request to the user to try to match the print language by itself. This request usually appears at the same time as the error prompt, asking the user whether to agree to the print driver system to try to match the print language by itself. If the user confirms that he agrees, the system will be triggered to enable an alternative conversion solution. If the user refuses the request, the conversion module will directly abandon the conversion, and the user will need to complete the printing in another way or submit a new print task.
[0053] S403, after receiving the instruction from the user end to try to match the printing language by itself, start the automatic matching model, which is prepared in advance and constructed by machine learning based on the matching degree of multiple historical text feature data and the printing language type; When the conversion module cannot successfully complete the document conversion according to the printing language information of the target printer, the printing driver system will send a request to the user end to try to match the printing language by itself. After the user confirms, the printing driver system will start the automatic matching model to match the printing language. The automatic matching model is pre-built by the printing driver system through the machine learning algorithm. The establishment process is as follows: The printing driver system collects a large number of document samples with different text features. These samples span various common file formats, such as Word documents, Excel tables, PDF documents, web page texts, etc., and extracts text features for each sample, such as letter frequency distribution, vocabulary complexity, syntactic complexity, horizontal format ratio, vertical format ratio, non-text element ratio, etc. Statistical analysis is performed on different printing languages to determine the text features supported by each language, such as a language that supports formatted text better, a language that supports text elements poorly, etc., match the sample text features with the printing language features, calculate the matching degree of each sample with different printing languages, and then use the machine learning algorithm, with the sample features as input and the matching degree of the sample and the printing language as the label, to train the classification model and obtain an automatic matching model of the matching degree of text features and printing languages.
[0054] During the actual conversion process, the print driver system extracts the text features of the document to be printed and inputs them into the automatic matching model. The model outputs the printing language that best matches these features and its degree of matching. The printing language with the highest degree of matching is determined as the printing language to be matched.
[0055] S404, determining the printing language with the highest matching degree through the automatic matching model for the task to be printed as the printing language to be matched; The print driver system submits the document content in the print task submitted by the user as input text to the automatic matching model. The model will analyze the input text according to the trained logic, extract the text's lexical features, grammatical features, semantic features and other comprehensive information related to the printing language, and calculate the matching probability between the text and various printing language types, such as PostScript, PCL, URF, etc. Finally, the print driver system will select the printing language with the highest matching degree, that is, the highest matching probability, as the printing language to be matched. Compared with simple rule-based methods such as keyword matching, this machine learning matching model can more accurately analyze the deep language features of the text, and can provide reliable printing language matching results for texts of different types and styles.
[0056] S405, converting the printing requirement and the printing document according to the printing language to be matched by the conversion module; After determining the print language to be matched, the print driver system will call the conversion module to convert the format of the print requirements submitted by the user and the document to be printed according to the print language to be matched, and generate a driver file that can be recognized by the printer for the print language. The conversion module integrates algorithm components for various print language conversions, such as PostScript generators, PCL generators, URF generators, etc. The print driver system will call the corresponding component to process the input print job according to the type of print language to be matched. Taking the PostScript print language as an example, the conversion module will activate the PostScript generator, parse the printing requirement parameters, extract the text, graphics, images and other content in the document, and use the drawing commands of the PostScript language to render it into the page description information described in the PostScript language. After all documents are converted, the printer driver file for the PostScript printer can be output.
[0057] S406: If the conversion is successful, a corresponding relationship between the text feature information of the task to be printed and the printing language to be matched is constructed to update the automatic matching model; After the conversion is successful, the print driver system will call the online learning function of the automatic matching model to update the model so that the model can be continuously optimized and can handle future printing tasks better and better. The print driver system will extract the key feature information of the text to be printed, including vocabulary features, grammatical features, etc., and mark the type of printing language to be matched determined in this conversion, so as to construct a new text-printing language correspondence sample. Then, the sample will be added to the training data set of the automatic matching model and trigger a new training iteration process.
[0058] S407: If the conversion fails, a corresponding conversion failure prompt message is sent to the user terminal.
[0059] When the conversion module cannot complete the conversion of the document to the specified printing language, it will return the conversion failure status to the printing driver system. At this time, the printing driver system will send a prompt message of conversion failure to the user terminal through the user interface, notifying the user that an abnormality has occurred in the conversion process and the print job cannot be processed further. The prompt message will contain failure details, such as the target printing language type, the reason for the failure, and other information. The sending of the conversion failure prompt message can avoid the situation where the user waits for the print output but ultimately fails. The user will immediately know the conversion error and can choose to check whether there is a problem with the document itself that causes the conversion abnormality, or contact the printing driver system provider to resolve the conversion module failure. This can greatly improve the transparency of the printing process and help users solve the problem and re-initiate printing as soon as possible.
[0060] In the embodiments of the present application, due to the use of technical means such as sending an error prompt to the user and attempting to match the printing language request by itself when the conversion module cannot successfully convert according to the original printing language information, as well as starting the automatic matching model based on user instructions and updating the model according to the conversion results, the problem of difficulty in printing language conversion and the inability of the system to self-optimize in the prior art is effectively solved, thereby achieving the technical effect of improving the success rate of printing language matching for different document types, enhancing the system's adaptability and processing capabilities for diversified documents, and continuously optimizing through continuous learning.
[0061] The following describes the print driver system in the embodiment of the present invention from the perspective of hardware processing. Figure 5 , is a schematic diagram of a physical device structure of a printing drive system in an embodiment of the present application.
[0062] It should be noted that Figure 5 The structure of the print driver system shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0063] like Figure 5 As shown, the print driver system includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 502 or the program loaded from the storage part 508 to the random access memory (RAM) 503, such as executing the method described in the above embodiment. In the RAM 503, various programs and data required for system operation are also stored. The CPU 501, the ROM 502 and the RAM 503 are connected to each other through the bus 504. The input / output (I / O) interface 505 is also connected to the bus 504.
[0064] The following components are connected to the I / O interface 505: an input section 506 including an audio input device, a button switch, etc.; an output section 507 including a liquid crystal display (LCD) and an audio output device, an indicator light, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed so that a computer program read therefrom is installed into the storage section 508 as needed.
[0065] In particular, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part 509, and / or installed from a removable medium 511. When the computer program is executed by a central processing unit (CPU) 501, various functions defined in the present invention are performed.
[0066] It should be noted that specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.
[0067] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. Each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings.
[0068] Specifically, the printing driver system of this embodiment includes a processor and a memory. The memory stores a computer program. When the computer program is executed by the processor, the printing driver method based on automatic adaptation based on the scenario provided in the above embodiment is implemented.
[0069] As another aspect, the present invention further provides a computer-readable storage medium, which may be included in the print driver system described in the above embodiment; or may exist independently without being assembled into the print driver system. The above storage medium carries one or more computer programs, and when the above one or more computer programs are executed by a processor of the print driver system, the print driver system implements the scene-based automatic adaptation print driver method provided in the above embodiment.
[0070] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
[0071] As used in the above embodiments, the term "when..." may be interpreted to mean "if..." or "after..." or "in response to determining..." or "in response to detecting...", depending on the context. Similarly, the phrases "upon determining..." or "if (the stated condition or event) is detected" may be interpreted to mean "if determining..." or "in response to determining..." or "upon detecting (the stated condition or event)" or "in response to detecting (the stated condition or event)", depending on the context.
[0072] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
Claims
1. A scene-based automatic adaptation printing driver method, applied to a printing driver system, characterized in that: The method comprises: Acquire configuration information of a target printer, wherein the configuration information includes printing language information and protocol information of the target printer; Send the user's printing requirements and documents to be printed to the conversion module; Converting the printing requirement and the printing document into a driver file matching the target printer according to the printing language information by the conversion module; Determine the usage scenario of the current printing task according to the task to be printed in combination with a task scenario model, wherein the task scenario model is constructed in advance through deep learning based on a plurality of historical printing tasks annotated with corresponding scenarios; Determine the print task protocol to be sent according to a pre-built scenario protocol library in combination with the protocol information, wherein the scenario protocol library contains protocols to be used in different scenarios; Sending the driver file to the target printer according to the print task protocol to be sent; Drive the target printer to start printing.
2. The method according to claim 1, characterized in that The step of determining the protocol of the print task to be sent according to the pre-built scenario protocol library in combination with the protocol information specifically includes: If there are multiple adaptable protocols for the usage scenario in the scenario protocol library, selection is made according to a preset protocol priority order, where the protocol priority order is obtained based on the success rate of the protocol history when sending print tasks using different protocols in the usage scenario.
3. The method according to claim 1, characterized in that After the step of determining the usage scenario of the current printing task according to the task to be printed in combination with the task scenario model, the method further includes: If the task scenario model cannot clearly identify the usage scenario, a prompt message is sent to the user terminal, and selectable usage scenarios are provided for the user to select; The usage scenario selected by the user is obtained, and the result of the user's selection is used as reference data to supplement the scenario model learning.
4. The method according to claim 1, characterized in that After the step of converting the printing requirement and the printing document into a driver file matching the target printer according to the printing language information by the conversion module, the method further includes: If it is detected that the conversion module cannot successfully convert according to the printing language information, a corresponding error prompt message is sent to the user terminal; Sends a request to the client to try to match the printing language itself.
5. The method according to claim 4, characterized in that After the step of sending a request to the user end to try to match the printing language by itself, the step further includes: After receiving the instruction from the user end to try to match the printing language by itself, the automatic matching model is started, and the automatic matching model is prepared in advance and constructed by machine learning based on the matching degree of multiple historical text feature data and the printing language type; Determine the printing language with the highest matching degree for the task to be printed by the automatic matching model as the printing language to be matched; The conversion module performs a conversion operation on the printing requirement and the printing document according to the printing language to be matched.
6. The method according to claim 5, characterized in that After the step of converting the printing requirement and the printing document according to the printing language to be matched by the conversion module, the method further includes: If the conversion is successful, a corresponding relationship between the text feature information of the task to be printed and the printing language to be matched is constructed to update the automatic matching model; If the conversion fails, a corresponding conversion failure prompt message is sent to the user end.
7. The method according to claim 1, characterized in that After the step of converting the printing requirement and the printing document into a driver file matching the target printer according to the printing language information by the conversion module, the method further includes: Performing integrity verification on the driver file according to a preset verification standard to obtain a first verification result; If the first verification result shows that the driver file is incomplete, then the corresponding part is extracted from a preset driver file supplementary resource library according to the missing part to complete the missing part to obtain a supplementary driver file, wherein the driver file supplementary resource library stores various types of printer driver file resources; Performing integrity check on the supplementary driver file again to obtain a second check result; If the second inspection result shows that the driver file is incomplete, a prompt message indicating that the driver file integrity check has failed is sent to the user terminal.
8. A printing drive system, characterized in that: The print driver system includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the print driver system to execute the method described in any one of claims 1-7.
9. A computer-readable storage medium comprising instructions, characterized in that: When the instruction is executed on a print driver system, the print driver system is caused to execute the method according to any one of claims 1 to 7.
10. A computer program product, characterized in that When the computer program product runs on a print driver system, the print driver system is caused to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Printing method and device, electronic equipment and computer readable storage medium
CN113190187A
Airborne printing interface protocol extension and printing job automatic scheduling method and device
CN113961155A
Printing management method and device, storage medium and electronic equipment
CN114942734A
Adaptive print driver selection systems and methods
US20030103224A1
Information processing apparatus, method for controlling information processing apparatus, and storage medium
US20200089452A1
Cited By
Multi-protocol adaptive serial port communication method, meter reading equipment and meter reading system
CN121000803A