Printer sharing method and device between cloud desktop and terminal, equipment and storage medium
By building virtual printers and drivers in cloud desktops or terminals, the problem of difficult printer driver adaptation under the ARM architecture is solved, and printer sharing between cloud desktops and terminals is realized, ensuring the normal use of printing functions.
Patent Information
- Application Number
- CN202411970709.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-25
AI Technical Summary
In a cloud desktop environment, the difference between the ARM architecture and the traditional x86 architecture makes it difficult to adapt the printer driver, and the printer driver resources are scarce under the domestic operating system, which limits the use of users' printing functions.
By building virtual printers and virtual drivers in a cloud desktop or terminal, simulating the key parameters of real printers, realizing printer sharing between cloud desktop and terminal. The specific steps include: installing a virtual driver and building a virtual printer in a cloud desktop or terminal, receiving printing tasks and rendering and generating documents, sending documents and printing parameters to the peer device to complete printing.
It effectively solves the problem of printer sharing between cloud desktop and terminal, ensures the normal use of printing functions, and is suitable for different operating systems and architecture platforms.
Smart Images

Figure CN119883150A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of printing technology, and in particular to a method, device, equipment and storage medium for sharing a printer between a cloud desktop and a terminal. Background Art
[0002] With the rise of domestic operating systems, more and more users are facing the trend of migrating their office work from traditional non-domestic operating systems such as Windows to domestic operating systems. In this process, the adaptation of printer drivers will face severe challenges. Among them, in the cloud application environment, when the cloud desktop adopts the ARM architecture (a processor architecture based on reduced instruction set computing RISC), due to the significant differences between its architectural characteristics and the traditional x86 architecture, the printer driver corresponding to the traditional x86 architecture cannot be adapted to the ARM architecture; and currently most printer manufacturers focus their research and development on the mainstream architecture, and the printer driver resources for this architecture on the market are extremely scarce, which leads to the fact that there are very few printer drivers that can run normally and fully functional under the ARM architecture, which seriously limits the use of users' printing functions in the cloud desktop environment, greatly affecting office efficiency and the smoothness of business processes.
[0003] At the same time, for scenarios where terminals use domestic operating systems, due to the wide variety of printer devices, especially in the case of reuse, many model manufacturers have not yet fully developed and adapted drivers for them, resulting in a large number of printer devices being unable to find the corresponding adapter driver when connected to domestic operating system terminals and thus being unable to be used.
[0004] It can be seen that how to effectively realize printer sharing between cloud desktops and terminals to ensure the normal use of the printing function is a problem that needs to be solved urgently. Summary of the invention
[0005] The present application provides a method, apparatus, device and storage medium for sharing printers between a cloud desktop and a terminal, which can effectively realize printer sharing between a cloud desktop and a terminal to ensure the normal use of the printing function.
[0006] In a first aspect, an embodiment of the present application provides a method for sharing a printer between a cloud desktop and a terminal, wherein a target driver corresponding to a target real printer does not exist in the cloud desktop and a target driver exists in the terminal, comprising the following steps:
[0007] When it is determined according to the target name of the target driver that the target virtual driver corresponding to the target real printer is not installed in the cloud desktop, installing the target virtual driver in the cloud desktop and constructing the target virtual printer based on the printer information corresponding to the target real printer;
[0008] When receiving a target print task corresponding to the target virtual printer, calling the target virtual driver to render the target print task to generate a target document;
[0009] The target document and the target printing parameters corresponding to the target printing task are sent to the terminal, so that the terminal calls the target driver to enable the target real printer to print the target document based on the target printing parameters.
[0010] In combination with the first aspect, in one implementation, before the step of determining, according to the target name of the target driver, that the target virtual driver corresponding to the target real printer is not installed in the cloud desktop, the step further includes:
[0011] When it is determined according to the name of the target real printer that there is no target virtual printer corresponding to the target real printer in the cloud desktop, determining whether there is a target printer driver name identical to the target name among all the printer driver names installed in the cloud desktop;
[0012] If so, determining that the target virtual driver has been installed in the cloud desktop, and constructing the target virtual printer based on the printer information corresponding to the target real printer;
[0013] If not, it is determined that the target virtual driver is not installed in the cloud desktop.
[0014] In combination with the first aspect, in one implementation, the step of installing the target virtual driver in the cloud desktop includes:
[0015] Generate a driver configuration file based on the paper size and target name supported by the target real printer;
[0016] A target virtual driver is installed in the cloud desktop based on the driver configuration file and the preset rendering file.
[0017] In a second aspect, an embodiment of the present application provides a method for sharing a printer between a cloud desktop and a terminal, wherein a target driver corresponding to a target real printer does not exist in the terminal and a target driver exists in the cloud desktop, comprising the following steps:
[0018] Redirect the target real printer to the cloud desktop through port redirection technology;
[0019] When it is determined according to the target name of the target driver that the target virtual driver corresponding to the target real printer is not installed in the terminal, installing the target virtual driver in the terminal and constructing the target virtual printer based on the printer information corresponding to the target real printer;
[0020] When receiving a target print task corresponding to the target virtual printer, calling the target virtual driver to render the target print task to generate a target document;
[0021] The target document and the target printing parameters corresponding to the target printing task are sent to the cloud desktop, so that the cloud desktop calls the target driver to enable the target real printer to print the target document based on the target printing parameters.
[0022] In conjunction with the second aspect, in one implementation, before the step of determining, according to the target name of the target driver, that the target virtual driver corresponding to the target real printer is not installed in the terminal, the step further includes:
[0023] When it is determined according to the name of the target real printer that there is no target virtual printer corresponding to the target real printer in the terminal, determining whether there is a target printer driver name identical to the target name among all the printer driver names installed in the terminal;
[0024] If yes, determining that the target virtual driver has been installed in the terminal, and constructing the target virtual printer based on the printer information corresponding to the target real printer;
[0025] If not, it is determined that the target virtual driver is not installed in the terminal.
[0026] In conjunction with the second aspect, in one implementation, installing the target virtual driver in the terminal includes:
[0027] Generate a driver configuration file based on the paper size and target name supported by the target real printer;
[0028] A target virtual driver is installed in the terminal based on the driver configuration file and the preset rendering file.
[0029] In a third aspect, an embodiment of the present application provides a printer sharing device between a cloud desktop and a terminal, including a cloud desktop and a terminal, wherein a target driver corresponding to a target real printer does not exist in the cloud desktop and the target driver exists in the terminal;
[0030] The cloud desktop is used for, when it is determined according to the target name of the target driver that the target virtual driver corresponding to the target real printer is not installed therein, installing the target virtual driver therein and constructing the target virtual printer based on the printer information corresponding to the target real printer; upon receiving a target printing task corresponding to the target virtual printer, calling the target virtual driver to render the target printing task to generate a target document; and sending the target document and the target printing parameters corresponding to the target printing task to the terminal;
[0031] The terminal is used to call a target driver to enable a target real printer to print a target document based on target printing parameters.
[0032] In a fourth aspect, an embodiment of the present application provides a printer sharing device between a cloud desktop and a terminal, comprising a redirection module, a cloud desktop and a terminal, wherein a target driver corresponding to a target real printer does not exist in the terminal and the target driver exists in the cloud desktop;
[0033] The redirection module is used to redirect the target real printer to the cloud desktop through the port redirection technology;
[0034] The terminal is used for, when it is determined according to the target name of the target driver that the target virtual driver corresponding to the target real printer is not installed therein, installing the target virtual driver therein and constructing the target virtual printer based on the printer information corresponding to the target real printer; upon receiving a target printing task corresponding to the target virtual printer, calling the target virtual driver to render the target printing task to generate a target document; and sending the target document and the target printing parameters corresponding to the target printing task to the cloud desktop;
[0035] The cloud desktop is used to call a target driver to enable a target real printer to print a target document based on target printing parameters.
[0036] In the fifth aspect, an embodiment of the present application provides a cloud desktop and terminal printer sharing device, wherein the cloud desktop and terminal printer sharing device includes a processor, a memory, and a cloud desktop and terminal printer sharing program stored in the memory and executable by the processor, wherein when the cloud desktop and terminal printer sharing program is executed by the processor, the steps of the aforementioned cloud desktop and terminal printer sharing method are implemented.
[0037] In the sixth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a printer sharing program between a cloud desktop and a terminal is stored. When the printer sharing program between the cloud desktop and the terminal is executed by a processor, the steps of the aforementioned printer sharing method between the cloud desktop and the terminal are implemented.
[0038] The beneficial effects brought by the technical solution provided in the embodiments of the present application include:
[0039] For the scenario where there is no target driver corresponding to the target real printer in the cloud desktop and there is a target driver in the terminal, by installing the target virtual driver corresponding to the target real printer in the cloud desktop and constructing the target virtual printer, the cloud desktop can call the target virtual driver to render the target printing task to generate the target document when receiving the target printing task corresponding to the target virtual printer; then send the target document and the target printing parameters corresponding to the target printing task to the terminal, so that the terminal calls the target driver to make the target real printer print the target document based on the target printing parameters. For the scenario where there is no target driver corresponding to the target real printer in the terminal and there is a target driver in the cloud desktop, the target real printer is redirected to the cloud desktop through the port redirection technology, so that the cloud desktop can call the target real printer to realize the printing function; then install the target virtual driver corresponding to the target real printer in the terminal and construct the target virtual printer, so that the terminal can call the target virtual driver to render the target printing task to generate the target document when receiving the target printing task corresponding to the target virtual printer; then send the target document and the target printing parameters corresponding to the target printing task to the cloud desktop, so that the cloud desktop calls the target driver to make the target real printer print the target document based on the target printing parameters. It can be seen that this application can effectively realize printer sharing between cloud desktops and terminals in different application scenarios to ensure the normal use of the printing function. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 This is a flow chart of the first embodiment of the method for sharing a printer between a cloud desktop and a terminal of the present application;
[0041] Figure 2 A schematic diagram of the process of creating a virtual printer and a virtual driver in a cloud desktop involved in the embodiment of the present application;
[0042] Figure 3 A schematic diagram of the printing process in the cloud desktop involved in the embodiment of the present application;
[0043] Figure 4 This is a flow chart of the second embodiment of the method for sharing printers between cloud desktops and terminals in this application.
[0044] Figure 5 A schematic diagram of the process of creating a virtual printer and a virtual driver in a terminal involved in the embodiment of the present application;
[0045] Figure 6 This is a schematic diagram of the printing process in the terminal involved in the embodiment of the present application;
[0046] Figure 7 This is a schematic diagram of the hardware structure of the cloud desktop and terminal printer sharing device involved in the embodiment of the present application. DETAILED DESCRIPTION
[0047] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0048] First, some technical terms in the present application are explained to facilitate those skilled in the art to understand the present application.
[0049] Cloud application: refers to the application that interacts between the terminal and the cloud. It is the specific manifestation of cloud computing technology at the application level. It projects the remote application interface onto the terminal system through the cloud desktop protocol.
[0050] Cloud desktop: Desktop virtualization is a new model to replace traditional computers. Its main architectures include VDI (Virtual Desktop Infrastructure), IDV (Intelligent Desktop Virtualization) and VOI (Virtual Operating System Infrastructure).
[0051] CUPS API: API (Application Programming Interface), CUPS (Common Unix Printing System) is a common tool for managing printers on the Linux operating system. CUPS API is a series of application program interfaces provided by the tool, which can be used to realize printer connection, configuration, printing and other functions.
[0052] WINDOWS Print Subsystem API: A set of application programming interfaces for managing printers provided by the Windows operating system. Developers can use these APIs to control and manage various printer operations, such as connecting to a printer, querying printer status, setting printer properties, submitting print tasks, etc.
[0053] WINDOWS GDI API: GDI (Graphics Device Interface) is the graphics device interface in the Windows operating system, and GDI API is an application program interface based on this interface for printing-related operations.
[0054] USB redirection: A redirection technology that can redirect the input and output requests of a USB device connected to a local device to a remote device or server, allowing the remote device to use the USB device like a local device.
[0055] PPD (PostScript Printer Description): is a file format used to describe the characteristics and functions of a PostScript printer. It contains various parameters and setting information of the printer, such as the printer's resolution, paper size, color mode, font support, etc.
[0056] LPADMIN: It is a command line tool used to manage printers and print queues in the Linux operating system. The LPADMIN command can be used to add and delete printers, set printer default options, and manage print queues, so that system administrators can effectively configure and manage printer resources.
[0057] Spooler API: Print spooler application program interface, which is used to manage print queues and handle the submission, scheduling, and execution of print tasks.
[0058] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0059] In a first aspect, an embodiment of the present application provides a method for sharing a printer between a cloud desktop and a terminal.
[0060] In one embodiment, referring to Figure 1 , Figure 1 The flowchart of the first embodiment of the printer sharing method between the cloud desktop and the terminal of the present application is shown in FIG. Figure 1 As shown, the printer sharing method between the cloud desktop and the terminal includes:
[0061] Step S10: When it is determined according to the target name of the target driver that the target virtual driver corresponding to the target real printer is not installed in the cloud desktop, the target virtual driver is installed in the cloud desktop and the target virtual printer is constructed based on the printer information corresponding to the target real printer.
[0062] Exemplarily, it should be understood that in a cloud application environment, a cloud desktop may adopt an ARM architecture, but currently there are very few printer drivers that can run normally and are fully functional under the ARM architecture, so that it is impossible to find a corresponding adapter driver, which seriously limits the normal use of the printing function in the cloud desktop environment. For the above scenario where there is no available print driver in the cloud desktop but there is one on the terminal (that is, the cloud desktop does not have the target driver required for the target real printer that is physically connected to the terminal, but the terminal has the target driver required for the target real printer, that is, the user has installed the target driver required for the target real printer to be used on the terminal system but the cloud desktop has not installed the target driver), this embodiment will overcome the above problem by installing a virtual printer and a virtual driver in the cloud desktop, so that the cloud desktop can call the target real printer through the target driver on the terminal to realize the printing function.
[0063] Specifically, it is first necessary to determine whether the target virtual driver corresponding to the target real printer has been installed in the cloud desktop based on the target name of the target driver. If it has not been installed, it is necessary to first install the target virtual driver in the cloud desktop, and build a target virtual printer with the same properties as the target real printer in the cloud desktop based on the printer information of the target real printer (including but not limited to printer resolution, paper size, color mode and font support). It should be noted that although the target virtual driver and the target virtual printer actually exist in the cloud desktop, the target virtual driver cannot drive the target virtual printer to truly realize the printing function, that is, the setting of the target virtual driver and the target virtual printer is only to comply with and meet the process and necessary properties required for printing, so that the cloud desktop can start normally and enter the printing process.
[0064] Furthermore, in one embodiment, before the step of determining, according to the target name of the target driver, that the target virtual driver corresponding to the target real printer is not installed in the cloud desktop, the step further includes:
[0065] When it is determined according to the name of the target real printer that there is no target virtual printer corresponding to the target real printer in the cloud desktop, determining whether there is a target printer driver name identical to the target name among all the printer driver names installed in the cloud desktop;
[0066] If so, determining that the target virtual driver has been installed in the cloud desktop, and constructing the target virtual printer based on the printer information corresponding to the target real printer;
[0067] If not, it is determined that the target virtual driver is not installed in the cloud desktop.
[0068] By way of example, it can be understood that if the printer has been created, then its corresponding driver must have been installed, and if the printer has not been created, then its corresponding driver may have been installed or may not have been installed; therefore, in this embodiment, it is possible to first determine whether the name of the target real printer already exists among the names of all printers that have been created and installed by the cloud desktop. If so, it means that a target virtual printer corresponding to the target real printer has been created in the cloud desktop, that is, the target virtual driver has been installed in the cloud desktop. In this case, there is no need to repeat the creation and installation of the virtual printer and virtual driver in the cloud desktop, but the target virtual printer and target virtual driver can be directly applied.
[0069] However, if the name of the target real printer does not exist among the names of all printers created and installed in the cloud desktop, it means that the target virtual printer has not been created and installed in the cloud desktop. At this time, it is necessary to further determine whether the target virtual driver has been installed in the cloud desktop based on the target name of the target driver; specifically, if a target printer driver name that is the same as the target name exists among the names of all printer drivers installed in the cloud desktop, it means that the target virtual driver has been installed in the cloud desktop. At this time, there is no need to install the driver repeatedly, but the target virtual printer can be directly built and installed in the cloud desktop according to the printer information of the target real printer; if the target printer driver name that is the same as the target name does not exist among the names of all printer drivers installed in the cloud desktop, it means that the target virtual driver has not been installed in the cloud desktop. At this time, it is necessary to install the target virtual driver in the cloud desktop, and at the same time, it is necessary to build and install the target virtual printer in the cloud desktop according to the printer information of the target real printer.
[0070] Further, in one embodiment, the step of installing the target virtual driver in the cloud desktop includes:
[0071] Generate a driver configuration file based on the paper size and target name supported by the target real printer;
[0072] A target virtual driver is installed in the cloud desktop based on the driver configuration file and the preset rendering file.
[0073] Exemplarily, in this embodiment, for the installation of the target virtual driver, it is first necessary to obtain the paper size supported by the target real printer and the target name corresponding to the target driver required by the target real printer to generate a driver configuration file; secondly, one of the functions of the virtual driver is to render the received print task (i.e., print document), that is, to convert the print task into a format document (such as a PDF format document) that can be processed by the real driver (i.e., the target driver). Since the rendering process and method are fixed, a rendering file can be preset to implement the rendering function; therefore, the driver configuration file and the preset rendering file are deployed in the cloud desktop, and the installation of the target virtual driver can be implemented in the cloud desktop.
[0074] Step S20: when receiving a target print task corresponding to the target virtual printer, calling the target virtual driver to render the target print task to generate a target document.
[0075] Exemplarily, in this embodiment, when the user selects a target virtual printer for printing in the cloud desktop, the corresponding target printing task will be submitted; therefore, when the cloud desktop receives the target printing task, the target virtual driver will be called to render the target printing task to generate a target document.
[0076] Step S30: sending the target document and the target printing parameters corresponding to the target printing task to the terminal, so that the terminal calls the target driver to enable the target real printer to print the target document based on the target printing parameters.
[0077] Exemplarily, in this embodiment, after generating the target document, the cloud desktop will not only send the target document to the terminal, but also send the target printing parameters corresponding to the target printing task (including but not limited to paper size, single-sided and double-sided printing, page range, number of copies and number of versions per page) to the terminal, so that the terminal calls the target driver to translate the target document and target printing parameters into a format that the target real printer can understand, so as to ensure that the target real printer can accurately perform the printing task; the target driver transmits the translation result to the target real printer, so that the target real printer can print the target document based on the target printing parameters, that is, the target real printer will perform printing based on the received data, thereby ensuring the normal use of the printing function.
[0078] The following combination Figure 2 Explain the process of creating virtual printers and virtual drives in the cloud desktop.
[0079] First, the user selects the desired target real printer on the "Printer Peripherals" panel corresponding to the cloud application client and clicks the put-on-shelf button corresponding to the target real printer; secondly, after receiving the target real printer, the printer server (i.e., cloud desktop) will enumerate all the currently installed printer names in it through the Spooler API to determine whether the name of the target real printer already exists; if it does, it means that the target virtual printer and the target virtual driver corresponding to the target real printer have been created in the cloud desktop, and the installation of the virtual printer and the virtual driver is terminated; if it does not exist, it means that the target virtual printer has not been created in the cloud desktop, and the cloud application client will notify the printer client (i.e., terminal) of the name of the target real printer to be put on the shelf, that is, the name of the printer to be used by the user among the installed printers in the printer client, so that the printer client obtains the target information such as the paper size supported by the target real printer and the target name of the required target driver through the CUPS API, and sends the obtained target information to the printer server through the network; after receiving the target information, the printer server will enumerate all the currently installed printer driver names in it through the Spooler API to determine whether the target name exists.
[0080] If the target name exists, it means that the target virtual driver has been installed in the cloud desktop. In this case, the target virtual printer is created through the Spooler API and the previously installed target virtual driver is used. If the target name does not exist, it means that the target virtual driver has not been installed in the cloud desktop. In this case, the target virtual driver is first installed through the Spooler API, and then the target virtual printer is created through the Spooler API and the previously installed target virtual driver is used. At this point, the installation is complete.
[0081] The following combination Figure 3 Explain the printing process in the cloud desktop.
[0082] After the user selects a document to print in the cloud application interface and selects the created target virtual printer in the print dialog box, the target print task will be submitted to the Spooler; after receiving the target print task, the Spooler calls the target virtual driver to render the target print task into a target document (such as a PDF document) and notifies the printer server; the printer server obtains the target print parameters corresponding to the target print task through the Spooler API, and transmits the target print parameters, target document, and target real printer name to the printer client through the network; after receiving the target document and target print parameters, the printer client will call the target driver to translate the target document based on the target print parameters, so that the target real printer prints the translation result, that is, the target real printer prints the target document.
[0083] In a second aspect, an embodiment of the present application provides another method for sharing printers between a cloud desktop and a terminal.
[0084] In one embodiment, referring to Figure 4 , Figure 4 The flowchart of the second embodiment of the printer sharing method between the cloud desktop and the terminal of the present application is shown in FIG. Figure 4 As shown, the printer sharing method between the cloud desktop and the terminal includes:
[0085] Step N10: Redirect the target real printer to the cloud desktop through port redirection technology.
[0086] Exemplarily, it is understandable that for the scenario where the terminal adopts a domestic operating system, due to the wide variety of printer devices, especially in the case of reuse, many model manufacturers have not yet fully developed and adapted drivers for them, so that a large number of printer devices cannot find the corresponding adapter driver when connected to the domestic operating system terminal and cannot be used. For the scenario where there is no available print driver in the above terminal but there is one on the cloud desktop (that is, the target driver required by the target real printer does not exist in the terminal, but the target driver required by the target real printer exists on the cloud desktop, that is, the user has installed the target driver required by the target real printer to be used on the cloud desktop but the terminal has not installed the target driver), this embodiment will overcome the above problem by installing a virtual printer and a virtual driver in the terminal, so that the terminal can call the target real printer through the target driver on the cloud desktop to realize the printing function.
[0087] Among them, since the target real printer can only be physically connected to the terminal, but cannot be physically connected to the cloud desktop, the target driver in the cloud desktop cannot directly drive the target real printer to realize the printing function; and in order to solve the above problem, this embodiment will redirect the target real printer to the cloud desktop by means of port redirection technology (i.e. USB port redirection), so as to redirect the input and output requests of the target real printer to the cloud desktop, so that the cloud desktop can drive the target real printer to print through its internal target driver. Among them, when specifically implementing USB redirection, a function button for triggering USB redirection can be set in the terminal, that is, if the user wants to use a virtual printer to perform terminal printing, the USB redirection function can be turned on by clicking the function button. It should be noted that since the working method and principle of port redirection technology are common knowledge in the field, they will not be repeated here for the sake of brevity of description.
[0088] Step N20: When it is determined according to the target name of the target driver that the target virtual driver corresponding to the target real printer is not installed in the terminal, the target virtual driver is installed in the terminal and the target virtual printer is constructed based on the printer information corresponding to the target real printer.
[0089] Exemplarily, in this embodiment, it will be determined whether the target virtual driver corresponding to the target real printer has been installed in the terminal according to the target name of the target driver. If it has not been installed, it is necessary to first install the target virtual driver in the terminal, and build a target virtual printer with the same properties as the target real printer in the terminal according to the printer information of the target real printer (including but not limited to printer resolution, paper size, color mode and font support). It should be noted that although the target virtual driver and the target virtual printer actually exist in the terminal, the target virtual driver cannot drive the target virtual printer to actually realize the printing function, that is, the setting of the target virtual driver and the target virtual printer is only to comply with and meet the process and necessary properties required for printing, so that the terminal can start normally and enter the printing process.
[0090] Furthermore, in one embodiment, before the step of determining, according to the target name of the target driver, that the target virtual driver corresponding to the target real printer is not installed in the terminal, the step further includes:
[0091] When it is determined according to the name of the target real printer that there is no target virtual printer corresponding to the target real printer in the terminal, determining whether there is a target printer driver name identical to the target name among all the printer driver names installed in the terminal;
[0092] If yes, determining that the target virtual driver has been installed in the terminal, and constructing the target virtual printer based on the printer information corresponding to the target real printer;
[0093] If not, it is determined that the target virtual driver is not installed in the terminal.
[0094] By way of example, it can be understood that if the printer has been created, then its corresponding driver must have been installed, and if the printer has not been created, then its corresponding driver may or may not have been installed; therefore, in this embodiment, it is possible to first determine whether the name of the target real printer already exists among the names of all printers that have been created and installed in the terminal. If so, it means that a target virtual printer corresponding to the target real printer has been created in the terminal, that is, the target virtual driver has been installed in the terminal. In this case, there is no need to repeatedly create and install the virtual printer and virtual driver in the terminal, but the target virtual printer and target virtual driver can be directly applied.
[0095] However, if the name of the target real printer does not exist among the names of all the printers that have been created and installed in the terminal, it means that the target virtual printer has not been created and installed in the terminal. At this time, it is necessary to further determine whether the target virtual driver has been installed in the terminal based on the target name of the target driver; specifically, if a target printer driver name that is the same as the target name exists among the names of all the printer drivers that have been installed in the terminal, it means that the target virtual driver has been installed in the terminal. At this time, there is no need to install the driver repeatedly, and the target virtual printer can be directly built and installed in the terminal according to the printer information of the target real printer; if the target printer driver name that is the same as the target name does not exist among the names of all the printer drivers that have been installed in the terminal, it means that the target virtual driver has not been installed in the terminal. At this time, it is necessary to install the target virtual driver in the terminal, and at the same time, it is necessary to build and install the target virtual printer in the terminal according to the printer information of the target real printer.
[0096] Further, in one embodiment, the step of installing the target virtual driver in the terminal includes:
[0097] Generate a driver configuration file based on the paper size and target name supported by the target real printer;
[0098] A target virtual driver is generated based on the driver configuration file and a preset rendering file, and the target virtual driver is installed in the terminal.
[0099] Exemplarily, in this embodiment, for the installation of the target virtual driver, it is first necessary to obtain the paper size supported by the target real printer and the target name corresponding to the target driver required by the target real printer to generate a driver configuration file; secondly, one of the functions of the virtual driver is to render the received print task (i.e., print document), that is, to convert the print task into a format document (such as a PDF format document) that can be processed by the real driver (i.e., the target driver). Since the rendering process and method are fixed, a rendering file can be preset to implement the rendering function; therefore, by deploying the driver configuration file and the preset rendering file in the terminal, the installation of the target virtual driver can be implemented in the terminal.
[0100] Step N30: when receiving a target print task corresponding to the target virtual printer, calling the target virtual driver to render the target print task to generate a target document.
[0101] Exemplarily, in this embodiment, when the user selects a target virtual printer for printing in the terminal, the corresponding target printing task will be submitted; therefore, when the terminal receives the target printing task, the target virtual driver will be called to render the target printing task to generate a target document.
[0102] Step N40: sending the target document and the target printing parameters corresponding to the target printing task to the cloud desktop, so that the cloud desktop calls the target driver to enable the target real printer to print the target document based on the target printing parameters.
[0103] Exemplarily, in this embodiment, after generating the target document, the terminal will not only send the target document to the cloud desktop, but also send the target printing parameters corresponding to the target printing task (including but not limited to paper size, single-sided and double-sided printing, page range, number of copies and number of pages per page) to the cloud desktop, so that the cloud desktop calls the target driver to translate the target document and target printing parameters into a format that the target real printer can understand, so as to ensure that the target real printer can accurately perform the printing task; the target driver transmits the translation result to the target real printer, so that the target real printer can print the target document based on the target printing parameters, that is, the target real printer will perform printing based on the received data, thereby ensuring the normal use of the printing function.
[0104] It can be seen that the present application aims to provide a method to effectively solve the dilemma of lack of adapted printer drivers faced by users when they transition from traditional operating systems such as Windows to domestic operating systems for office work, that is, based on the way of building a virtual printer device on a cloud desktop or terminal to simulate multiple key printing parameters of a real printer (covering available paper types, paper horizontal and vertical settings, device resolution, number of prints, and single-sided and double-sided printing modes, etc.), so as to achieve efficient sharing of printer devices between cloud desktops and terminals, so as to solve the problem that users cannot use printers normally due to the lack of printer drivers in different architecture platform environments, and ensure that users' printing needs in the process of switching between different operating systems can be smoothly realized. In summary, through this application, printer sharing between cloud desktops and terminals in different application scenarios can be effectively realized to ensure the normal use of the printing function.
[0105] The following combination Figure 5 Explain the process of creating a virtual printer and virtual driver in the terminal.
[0106] First, after the user selects the desired target real printer on the "Printer Peripherals" panel corresponding to the terminal application client, the terminal application client will notify the printer client user to select the name of the target real printer to be shared; secondly, after receiving the name of the target real printer, the printer client will enumerate all the printer names currently installed inside it through the CUPS API to determine whether the name of the target real printer already exists; if it does, it means that the target virtual printer and the target virtual driver corresponding to the target real printer have been created in the terminal, and the installation of the virtual printer and the virtual driver is terminated; if it does not exist, it means that the target virtual printer has not been created in the terminal, then the printer client will notify the printer server (i.e., the cloud desktop) of the target real printer that the user wants to share, so that the printer server obtains the target information such as the paper size supported by the target real printer and the target name of the target driver required by it through the Spoole API, and sends the obtained target information to the printer client through the network; after receiving the target information, the printer client will enumerate all the printer driver names currently installed inside it through the CUPS API to determine whether the target name exists.
[0107] If the target name exists, it means that the target virtual driver has been installed in the terminal. In this case, the target virtual printer is created through the CUPS API and the target virtual driver that has been installed before is used. If the target name does not exist, it means that the target virtual driver has not been installed in the terminal. In this case, the target virtual driver is installed through the CUPS API first, and then the target virtual printer is created through the CUPS API and the target virtual driver that has been installed before is used. At this point, the installation is complete.
[0108] The following combination Figure 6 Explain the printing process in the terminal.
[0109] The user selects a document to print in the terminal application interface, and after selecting the created target virtual printer in the print dialog box, the target print task will be submitted to CUPS; after receiving the target print task, CUPS calls the target virtual driver to render the target print task into a target document (such as a PDF document) and notifies the printer client; the printer client obtains the target print parameters corresponding to the target print task through the CUPS API, and transmits the target print parameters, target document, and target real printer name to the printer server through the network; after receiving the target document and target print parameters, the printer server will call the target driver to translate the target document based on the target print parameters, so that the target real printer prints the translation result, that is, the target real printer prints the target document.
[0110] In a third aspect, an embodiment of the present application also provides a printer sharing device between a cloud desktop and a terminal.
[0111] In one embodiment, a printer sharing device between a cloud desktop and a terminal includes: a cloud desktop and a terminal, wherein a target driver corresponding to a target real printer does not exist in the cloud desktop and the target driver exists in the terminal;
[0112] The cloud desktop is used for, when it is determined according to the target name of the target driver that the target virtual driver corresponding to the target real printer is not installed therein, installing the target virtual driver therein and constructing the target virtual printer based on the printer information corresponding to the target real printer; upon receiving a target printing task corresponding to the target virtual printer, calling the target virtual driver to render the target printing task to generate a target document; and sending the target document and the target printing parameters corresponding to the target printing task to the terminal;
[0113] The terminal is used to call a target driver to enable a target real printer to print a target document based on target printing parameters.
[0114] Furthermore, in one embodiment, the cloud desktop is also used for:
[0115] When it is determined according to the name of the target real printer that there is no target virtual printer corresponding to the target real printer, determining whether there is a target printer driver name identical to the target name among all the printer driver names installed therein;
[0116] If so, it is determined that the target virtual driver has been installed therein, and the target virtual printer is constructed based on the printer information corresponding to the target real printer;
[0117] If not, it is determined that the target virtual driver is not installed therein.
[0118] Furthermore, in one embodiment, the cloud desktop is specifically used for:
[0119] Generate a driver configuration file based on the paper size and target name supported by the target real printer;
[0120] The target virtual driver is installed therein based on the driver configuration file and the preset rendering file.
[0121] Among them, the functional implementation of each part in the above-mentioned cloud desktop and terminal printer sharing device corresponds to the steps in the first embodiment of the above-mentioned cloud desktop and terminal printer sharing method, and its functions and implementation processes will not be repeated here one by one.
[0122] In a fourth aspect, the embodiment of the present application also provides another device for sharing printers between a cloud desktop and a terminal.
[0123] In one embodiment, a printer sharing device between a cloud desktop and a terminal includes: a redirection module, a cloud desktop, and a terminal, wherein a target driver corresponding to a target real printer does not exist in the terminal and the target driver exists in the cloud desktop;
[0124] The redirection module is used to redirect the target real printer to the cloud desktop through the port redirection technology;
[0125] The terminal is used for, when it is determined according to the target name of the target driver that the target virtual driver corresponding to the target real printer is not installed therein, installing the target virtual driver therein and constructing the target virtual printer based on the printer information corresponding to the target real printer; upon receiving a target printing task corresponding to the target virtual printer, calling the target virtual driver to render the target printing task to generate a target document; and sending the target document and the target printing parameters corresponding to the target printing task to the cloud desktop;
[0126] The cloud desktop is used to call a target driver to enable a target real printer to print a target document based on target printing parameters.
[0127] Furthermore, in one embodiment, the terminal is also used for:
[0128] When it is determined according to the name of the target real printer that there is no target virtual printer corresponding to the target real printer, determining whether there is a target printer driver name identical to the target name among all the printer driver names installed therein;
[0129] If so, it is determined that the target virtual driver has been installed therein, and the target virtual printer is constructed based on the printer information corresponding to the target real printer;
[0130] If not, it is determined that the target virtual driver is not installed therein.
[0131] Furthermore, in one embodiment, the terminal is specifically used for:
[0132] Generate a driver configuration file based on the paper size and target name supported by the target real printer;
[0133] The target virtual driver is installed therein based on the driver configuration file and the preset rendering file.
[0134] Among them, the functional implementation of each part in the above-mentioned cloud desktop and terminal printer sharing device corresponds to the steps in the second embodiment of the above-mentioned cloud desktop and terminal printer sharing method, and its functions and implementation processes are no longer repeated here.
[0135] In a fifth aspect, an embodiment of the present application provides a printer sharing device between a cloud desktop and a terminal. The printer sharing device between the cloud desktop and the terminal can be a personal computer (PC), a laptop computer, a server, or other device with data processing capabilities.
[0136] Reference Figure 7 , Figure 7 The hardware structure diagram of the cloud desktop and terminal printer sharing device involved in the embodiment of the present application is shown in FIG. In the embodiment of the present application, the cloud desktop and terminal printer sharing device may include a processor, a memory, a communication interface, and a communication bus.
[0137] The communication bus may be of any type and is used to interconnect the processor, the memory, and the communication interface.
[0138] The communication interface includes input / output (I / O) interfaces, physical interfaces, and logical interfaces, which are used to interconnect the devices inside the cloud desktop and terminal printer sharing device, and interfaces used to interconnect the cloud desktop and terminal printer sharing device with other devices (such as other computing devices or user devices). The physical interface can be an Ethernet interface, a fiber optic interface, an ATM interface, etc.; the user device can be a display, a keyboard, etc.
[0139] The memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.
[0140] The processor may be a general-purpose processor, which may call the cloud desktop and terminal printer sharing program stored in the memory and execute the cloud desktop and terminal printer sharing method provided in the embodiment of the present application. For example, the general-purpose processor may be a central processing unit (CPU). The method executed when the cloud desktop and terminal printer sharing program is called may refer to the various embodiments of the cloud desktop and terminal printer sharing method of the present application, which will not be repeated here.
[0141] Those skilled in the art will understand that Figure 7 The hardware structure shown in the figure does not constitute a limitation on the present application, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0142] In a sixth aspect, an embodiment of the present application also provides a computer-readable storage medium.
[0143] The readable storage medium of the present application stores a printer sharing program between a cloud desktop and a terminal, wherein when the printer sharing program between a cloud desktop and a terminal is executed by a processor, the steps of the printer sharing method between a cloud desktop and a terminal as described above are implemented.
[0144] Among them, the method implemented when the printer sharing program between the cloud desktop and the terminal is executed can refer to the various embodiments of the printer sharing method between the cloud desktop and the terminal of the present application, and will not be repeated here.
[0145] It should be noted that the serial numbers of the above-mentioned embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments.
[0146] The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices. The terms "first", "second" and "third" are used to distinguish different objects, etc., and do not represent a sequence, nor do they limit "first", "second" and "third" to different types.
[0147] In the description of the embodiments of the present application, "exemplary", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a specific way.
[0148] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; the “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two.
[0149] In some processes described in the embodiments of the present application, multiple operations or steps that appear in a specific order are included, but it should be understood that these operations or steps may not be executed in the order in which they appear in the embodiments of the present application or in parallel, and the sequence number of the operation is only used to distinguish the different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed in sequence or in parallel, and these operations or steps may be combined.
[0150] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD) as described above, and includes a number of instructions for a terminal device to execute the methods described in each embodiment of the present application.
[0151] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for sharing printers between a cloud desktop and a terminal, characterized in that: The target driver corresponding to the target real printer does not exist in the cloud desktop and the target driver exists in the terminal, including the following steps: When it is determined according to the target name of the target driver that the target virtual driver corresponding to the target real printer is not installed in the cloud desktop, installing the target virtual driver in the cloud desktop and constructing the target virtual printer based on the printer information corresponding to the target real printer; When receiving a target print task corresponding to the target virtual printer, calling the target virtual driver to render the target print task to generate a target document; The target document and the target printing parameters corresponding to the target printing task are sent to the terminal, so that the terminal calls the target driver to enable the target real printer to print the target document based on the target printing parameters.
2. The method for sharing a printer between a cloud desktop and a terminal according to claim 1, wherein: Before the step of determining, according to the target name of the target driver, that the target virtual driver corresponding to the target real printer is not installed in the cloud desktop, the step further includes: When it is determined according to the name of the target real printer that there is no target virtual printer corresponding to the target real printer in the cloud desktop, determining whether there is a target printer driver name identical to the target name among all the printer driver names installed in the cloud desktop; If so, determining that the target virtual driver has been installed in the cloud desktop, and constructing the target virtual printer based on the printer information corresponding to the target real printer; If not, it is determined that the target virtual driver is not installed in the cloud desktop.
3. The method for sharing a printer between a cloud desktop and a terminal according to claim 1, wherein: The step of installing the target virtual driver in the cloud desktop includes: Generate a driver configuration file based on the paper size and target name supported by the target real printer; A target virtual driver is installed in the cloud desktop based on the driver configuration file and the preset rendering file.
4. A method for sharing printers between a cloud desktop and a terminal, characterized in that: The target driver corresponding to the target real printer does not exist in the terminal and the target driver exists in the cloud desktop, including the following steps: Redirect the target real printer to the cloud desktop through port redirection technology; When it is determined according to the target name of the target driver that the target virtual driver corresponding to the target real printer is not installed in the terminal, installing the target virtual driver in the terminal and constructing the target virtual printer based on the printer information corresponding to the target real printer; When receiving a target print task corresponding to the target virtual printer, calling the target virtual driver to render the target print task to generate a target document; The target document and the target printing parameters corresponding to the target printing task are sent to the cloud desktop, so that the cloud desktop calls the target driver to enable the target real printer to print the target document based on the target printing parameters.
5. The method for sharing a printer between a cloud desktop and a terminal according to claim 4, wherein: Before the step of determining, according to the target name of the target driver, that the target virtual driver corresponding to the target real printer is not installed in the terminal, the method further includes: When it is determined according to the name of the target real printer that there is no target virtual printer corresponding to the target real printer in the terminal, determining whether there is a target printer driver name identical to the target name among all the printer driver names installed in the terminal; If yes, determining that the target virtual driver has been installed in the terminal, and constructing the target virtual printer based on the printer information corresponding to the target real printer; If not, it is determined that the target virtual driver is not installed in the terminal.
6. The method for sharing a printer between a cloud desktop and a terminal according to claim 4, wherein: The step of installing the target virtual driver in the terminal includes: Generate a driver configuration file based on the paper size and target name supported by the target real printer; A target virtual driver is installed in the terminal based on the driver configuration file and the preset rendering file.
7. A printer sharing device between a cloud desktop and a terminal, characterized in that: It includes a cloud desktop and a terminal, wherein a target driver corresponding to a target real printer does not exist in the cloud desktop and the target driver exists in the terminal; The cloud desktop is used for installing the target virtual driver therein and constructing the target virtual printer based on the printer information corresponding to the target real printer when it is determined according to the target name of the target driver that the target virtual driver corresponding to the target real printer is not installed therein; When receiving a target print task corresponding to the target virtual printer, calling the target virtual driver to render the target print task to generate a target document; Sending the target document and the target printing parameters corresponding to the target printing task to the terminal; The terminal is used to call a target driver to enable a target real printer to print a target document based on target printing parameters.
8. A printer sharing device between a cloud desktop and a terminal, characterized in that: It includes a redirection module, a cloud desktop and a terminal, wherein the terminal does not have a target driver corresponding to the target real printer and the cloud desktop has the target driver; The redirection module is used to redirect the target real printer to the cloud desktop through the port redirection technology; The terminal is used for installing the target virtual driver therein and constructing the target virtual printer based on the printer information corresponding to the target real printer when it is determined according to the target name of the target driver that the target virtual driver corresponding to the target real printer is not installed therein; When receiving a target print task corresponding to the target virtual printer, calling the target virtual driver to render the target print task to generate a target document; Sending the target document and the target printing parameters corresponding to the target printing task to the cloud desktop; The cloud desktop is used to call a target driver to enable a target real printer to print a target document based on target printing parameters.
9. A printer sharing device between a cloud desktop and a terminal, characterized in that: The cloud desktop and terminal printer sharing device includes a processor, a memory, and a cloud desktop and terminal printer sharing program stored in the memory and executable by the processor. When the cloud desktop and terminal printer sharing program is executed by the processor, the steps of the cloud desktop and terminal printer sharing method as described in any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a printer sharing program between a cloud desktop and a terminal, wherein when the printer sharing program between a cloud desktop and a terminal is executed by a processor, the steps of the printer sharing method between a cloud desktop and a terminal as described in any one of claims 1 to 6 are implemented.