File printing method and device and storage medium
By using executable files in a cloud desktop environment to simulate printers in a user-state, file format conversion and communication protocol support, the instability caused by kernel-driven processing is solved, and the stability and maintainability of cloud desktop file printing is achieved.
Patent Information
- Application Number
- CN202310752909.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-25
- Publication Date
- 2024-12-27
AI Technical Summary
In a cloud desktop environment, printing processing through kernel drivers is likely to cause kernel instability, and a cloud desktop file printing solution is needed without affecting the kernel.
The executable file simulates the printer in the user state, receives the files to be printed, converts the format and supports the communication protocol of the printing device connected to the terminal, avoids processing files through the kernel driver, and ensures the stability of the printing process.
It realizes file printing without kernel impact in a cloud desktop environment, ensuring the stability and maintainability of the printing process, and avoiding kernel instability caused by problems in the printing process.
Smart Images

Figure CN119201012A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular, to a file printing method, device, and storage medium. Background Art
[0002] In a cloud desktop environment, a printing device can be simulated by loading a device driver in the kernel. For example, when a print request for a file to be printed is received, the file to be printed can be directly sent to the kernel driver, which processes the file to be printed and then sends the processed file to the terminal for printing.
[0003] However, if a problem occurs when printing is performed through a kernel driver, the kernel may become unstable. Therefore, a solution for cloud desktop file printing is needed without affecting the kernel. Summary of the invention
[0004] Embodiments of the present application provide a file printing method, device, and storage medium to provide a solution for cloud desktop file printing without affecting the kernel.
[0005] In a first aspect, a file printing method is provided, which is applied to a cloud desktop server, and the method includes: receiving a print request for a file to be printed; in response to the print request, performing format conversion processing on the file to be printed through an executable file to obtain a target file; the executable file supports a communication protocol of a printing device connected to a terminal, and the terminal is a terminal equipped with the cloud desktop; the target file is sent to the terminal, and the target file is used to trigger the terminal to send the target file to the printing device for printing processing.
[0006] In a second aspect, a file printing method is provided, which is applied to a terminal equipped with a cloud desktop, and the method includes: receiving a print request for a target file, the target file being a file obtained by the cloud desktop server through an executable file by performing format conversion processing on the file to be printed, and the executable file supports the communication protocol of a printing device connected to the terminal; based on the file processing format of the printing device, performing format conversion processing on the target file to obtain a converted target file, and sending the converted target file to the printing device, wherein the converted target file is used to trigger the printing device to print the converted target file.
[0007] In a third aspect, a file printing device is provided, which includes: a request receiving module, used to receive a print request for a file to be printed; a format conversion module, used to respond to the print request, and perform format conversion processing on the file to be printed through an executable file to obtain a target file; the executable file supports a communication protocol of a printing device connected to a terminal, and the terminal is a terminal equipped with the cloud desktop; a file forwarding module, used to send the target file to the terminal, and the target file is used to trigger the terminal to send the target file to the printing device for printing processing.
[0008] In a fourth aspect, a file printing device is provided, which includes: a request receiving module, used to receive a print request for a target file, wherein the target file is a file obtained by the cloud desktop server through an executable file, by performing format conversion processing on the file to be printed, and the executable file supports the communication protocol of the printing device connected to the terminal; a file forwarding module, used to perform format conversion processing on the target file based on the file processing format of the printing device to obtain the converted target file, and send the converted target file to the printing device, wherein the converted target file is used to trigger the printing device to print the converted target file.
[0009] In a fifth aspect, a file printing device is provided, the terminal comprising a processor and a memory, the memory storing a program or instruction that can be run on the processor, and the program or instruction, when executed by the processor, implements the steps of the file printing method as described in the first aspect, or implements the steps of the file printing method as described in or the second aspect.
[0010] In a sixth aspect, a readable storage medium is provided, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the file printing method described in the first aspect are implemented, or the steps of the file printing method described in the second aspect are implemented.
[0011] At least one technical solution adopted in the embodiments of the present application includes:
[0012] A print request for a file to be printed is received. In response to the print request, the cloud desktop server can perform format conversion processing on the file to be printed through an executable file to obtain a target file, wherein the executable file can support the communication protocol of a printing device connected to a terminal, and the terminal is a terminal equipped with a cloud desktop. The cloud desktop server can send the target file to the terminal, and the target file is used to trigger the terminal to send the target file to the printing device for printing processing.
[0013] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects:
[0014] The format of the file to be printed can be converted through the executable file to obtain the target file, that is, a printer can be simulated in the user state through the executable file. In order to ensure that the file to be printed can be correctly intercepted by the executable file, the executable file can support the communication protocol of the printing device connected to the terminal. In this way, since the file to be printed is not processed by the kernel driver, even if there is a problem in the printing process, it will not cause instability of the kernel, thereby ensuring the stability and maintainability of the printing process. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 is a schematic flow chart of a file printing method according to an embodiment of the present application;
[0016] Figure 2 is a schematic diagram of a file printing process according to an embodiment of the present application;
[0017] Figure 3 is a schematic flow chart of another file printing method according to an embodiment of the present application;
[0018] Figure 4 is a schematic diagram of another file printing process according to an embodiment of the present application;
[0019] Figure 5 is a schematic diagram of another file printing process according to an embodiment of the present application;
[0020] Figure 6 is a schematic flow chart of another file printing method according to an embodiment of the present application;
[0021] Figure 7 is a schematic diagram of another file printing process according to an embodiment of the present application;
[0022] Figure 8 is a schematic flow chart of another file printing method according to an embodiment of the present application;
[0023] Fig. 9 is a structural schematic diagram of a document printing device according to an embodiment of the present application;
[0024] Fig.10 is a schematic structural diagram of another document printing device according to an embodiment of the present application;
[0025] Fig.11 It is a structural schematic diagram of a file printing device according to an embodiment of the present application. DETAILED DESCRIPTION
[0026] The embodiments of this specification provide a file printing method, device and storage medium.
[0027] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0028] The inventive concept of the present application is as follows: In a cloud desktop environment, a printing device can be simulated by loading a device driver in the kernel. For example, when a print request for a file to be printed is received, the file to be printed can be directly sent to the kernel driver, which processes the file to be printed and then sends the processed file to the terminal for printing. However, if a problem occurs when printing is processed through the kernel driver, the kernel will become unstable. Therefore, a solution for cloud desktop file printing without affecting the kernel is needed. To this end, the embodiments of this specification provide a technical solution that can solve the above-mentioned problems. For details, please refer to the following content.
[0029] Embodiment 1
[0030] like Figure 1 As shown, the embodiment of this specification provides a file printing method, and the execution subject of the method can be applied to a cloud desktop server, wherein the cloud desktop server can be a server that can provide cloud desktop services to users, wherein the server can be an independent server or a server cluster composed of multiple servers. The method can specifically include the following steps:
[0031] In S102, a print request for a file to be printed is received.
[0032] Among them, the file to be printed can be a file of any format that can be printed by the printing device. For example, the file to be printed can be a picture file, a table file, a text file, etc. The print request can also carry the printing requirements selected by the user for the file to be printed. For example, the print request can also carry the number of copies, whether to print on both sides, the paper type, black and white printing or color printing, and other printing requirements.
[0033] In practice, cloud desktop is a way of using cloud computing to place computing and storage in the cloud through transmission protocols to provide virtual desktop services. In the cloud desktop environment, the printer redirection function can map the printing device connected to the terminal to the cloud desktop. Users can print through the cloud desktop's printing device manager, or they can print directly in each application through the "Print" option provided by the application.
[0034] The essence of printer redirection is to create a virtual printing device in the cloud desktop, while the physical printing device is directly connected to the terminal equipped with the cloud desktop and mapped to the cloud desktop. Users can trigger operations on the printing device in the cloud desktop. For example, users can trigger property viewing requests for a certain printing device and print requests for files to be printed in the cloud desktop. Among them, the requests received by the cloud desktop will be routed to the virtual printing device in the cloud desktop. The cloud desktop server can send the processed files (i.e., the target files) to the printing device connected to the terminal for printing through subsequent file processing.
[0035] In S104, in response to the print request, the file to be printed is format converted by the executable file to obtain a target file.
[0036] Among them, the executable file can support the communication protocol of the printing device connected to the terminal, and the terminal is a terminal equipped with a cloud desktop.
[0037] In practice, the cloud desktop server can intercept the file to be printed through an executable file that supports the communication protocol of the printing device, and convert the format of the file to be printed through the executable file to obtain the target file, wherein the data format of the target file can be a cross-platform data format to be applicable to terminals of different operating systems (such as Windows system, Linux system, etc.). In this way, since the data format of the target file is a cross-platform data format, the target file can be connected to terminals of different operating systems, and the terminal only needs to process a fixed data format to achieve compatibility with terminals of different operating systems.
[0038] In S106, the target file is sent to the terminal.
[0039] The target file may be used to trigger the terminal to send the target file to the printing device for printing processing.
[0040] In implementation, Figure 2As shown, the user can start the cloud desktop in the terminal and trigger a print request for the file to be printed in the cloud desktop. In response to the print request, the cloud desktop server can intercept the file to be printed through an executable file and convert the data format of the file to be printed into a cross-platform data format to obtain the target file. The cloud desktop server can send the target file to the terminal, and the terminal can send the target file to the printing device to print the target file through the printing device.
[0041] The embodiment of this specification provides a file printing method, which is applied to a cloud desktop server, by receiving a print request for a file to be printed, responding to the print request, and converting the format of the file to be printed through an executable file to obtain a target file. The executable file can support the communication protocol of a printing device connected to a terminal, and the terminal is a terminal equipped with a cloud desktop. The target file is sent to the terminal, and the target file is used to trigger the terminal to send the target file to the printing device for printing. In this way, a printer can be simulated in user mode through an executable file, wherein, in order to ensure that the file to be printed can be correctly intercepted by the executable file, the executable file can support the communication protocol of the printing device connected to the terminal. In this way, since the file to be printed is not processed through the kernel driver, even if there is a problem in the printing process, it will not cause instability of the kernel, thereby ensuring the stability and maintainability of the printing process.
[0042] In another embodiment, if Figure 3 As shown, the embodiment of this specification provides a file printing method, and the execution subject of the method can be applied to a cloud desktop server, wherein the cloud desktop server can be a server that can provide cloud desktop services to users, wherein the server can be an independent server or a server cluster composed of multiple servers. The method can specifically include the following steps:
[0043] In S302, a user login request for a cloud desktop sent by a terminal is received.
[0044] The cloud desktop may be a cloud desktop of a Linux operating system, and the executable file may be a binary file written under a Common UNIX Printing System (CUPS) framework.
[0045] In S304, in response to the login request, the printing device connected to the terminal is initialized.
[0046] In implementation, when a user logs in to a cloud desktop, the cloud desktop server needs to obtain the printing devices connected to the terminal and map these printing devices to the cloud desktop.
[0047] In practical applications, the processing method of the above S304 can be various. The following provides an optional implementation method. For details, please refer to the following steps A1 to A4:
[0048] In step A1, first device information of a printing device that has been set up in the terminal and sent by the terminal, and second device information of the printing device that has been set up and sent by the printing device manager are acquired.
[0049] In implementation, Figure 4 As shown, the user can trigger a login request for the cloud desktop in the terminal. When the terminal receives the login request for the cloud desktop from the user, it can construct a login message and send the constructed login message to the daemon of the cloud desktop of the Linux operating system. After receiving the login message, the daemon of the cloud desktop can perform initialization operations.
[0050] The terminal daemon can query the first device information of the printing device currently connected to the terminal and set up, and send the first device information to the cloud desktop server, that is, the cloud desktop server can receive the first device information sent by the terminal to determine the printing device set up on the terminal through the first device information.
[0051] The cloud desktop server can send a device information acquisition request to the printing device manager. In response to the device information acquisition request, the printing device manager can query the printing devices that have been set up on the printing device manager, and send the second device information of the printing devices that have been set up on the queried printing device manager to the cloud desktop server. That is, the cloud desktop server can obtain the second device information of the set printing device sent by the printing device manager.
[0052] In step A2, the first device information and the second device information are matched, and when the first device information and the second device information do not match, a printing device that is not set by the printing device manager is determined based on the first device information and the second device information.
[0053] In implementation, after receiving the first device information and the second device information of the set printing device, the cloud desktop daemon process can match the first device information and the second device information.
[0054] In step A3, the setting information of the unset printing device is acquired, and the setting information is sent to the printing device manager.
[0055] The setting information may be used to trigger the printing device manager to perform setting processing on the printing device that has not been set.
[0056] In step A4, in the case where a setting completion message of the printing device manager is received, it is determined that the initialization operation is completed.
[0057] In implementation, after the initialization operation is completed, the cloud desktop daemon process can return a message of initialization completion to the terminal, and the terminal daemon process can return a message of successful login to the user.
[0058] In S306, after the initialization operation is completed, the communication protocol of the printing device connected to the terminal is obtained.
[0059] In implementation, after the initialization operation is completed, the cloud desktop server can send a communication protocol acquisition request to the terminal. In response to the communication protocol acquisition request, the terminal can obtain the communication protocol of the printing device connected to the terminal and send the acquired communication protocol to the cloud desktop server. That is, the cloud desktop server can obtain the communication protocol of the printing device connected to the terminal.
[0060] In S308, based on the communication protocol of the printing device connected to the terminal, a candidate executable file is generated and stored in a predetermined storage directory.
[0061] In implementation, there may be multiple printing devices connected to the terminal, and different printing devices may support different communication protocols. Therefore, the cloud desktop server can generate a corresponding candidate executable file under the CPUS framework for each different communication protocol and store it in a predetermined storage directory.
[0062] In addition, in order to improve the efficiency of determining subsequent executable files, when storing candidate executable files, the names of the candidate executable files may be determined as the names of the corresponding communication protocols.
[0063] In S102, a print request for a file to be printed is received.
[0064] In S310, based on the device identification of the target printing device, a target communication protocol corresponding to the target printing device is determined.
[0065] In implementation, the print request may also carry the device identifier of the target printing device selected by the user from the printing devices connected to the terminal. In this way, the cloud desktop server can determine the target communication protocol corresponding to the target printing device based on the device identifier of the target printing device carried in the print request.
[0066] In S312, an executable file corresponding to the target communication protocol is obtained from candidate executable files stored in a predetermined storage directory.
[0067] In implementation, the user can select the file to be printed in the cloud desktop application, the cloud desktop can display the "Print" interface, the user can select the set printing device (ie, virtual printing device) in the "Print" interface, and the application can call the printing interface provided by CUPS.
[0068] When cpusd in CPUS (i.e., the core of the CPUS framework, a daemon process used to receive and forward print requests) receives a file to be printed, it can search for an executable file corresponding to the target communication protocol in a predetermined storage directory. The executable file needs to support the communication protocol of the printing device selected by the user. That is, the cloud desktop server can search for an executable file corresponding to the target communication protocol in the candidate executable files stored in a predetermined storage directory based on the daemon process under the general Unix printing system framework.
[0069] Since the CUPS framework is the de facto standard for Linux printing systems, file printing in cloud desktop applications will be called according to the interface defined by CUPS. Therefore, multiple candidate executable files can be generated in advance and stored in a predetermined storage target to intercept CUPS's files to be printed. At the same time, the printing device can communicate with CUPS through a communication protocol. When CUPS receives a file to be printed, the cloud desktop server can first reserve the candidate executable files in the storage directory to check whether there is an executable file that supports the target communication protocol.
[0070] In S104, in response to the print request, the file to be printed is format converted by the executable file to obtain a target file.
[0071] In S314, the target file is sent to the daemon process of the terminal through the daemon process of the cloud desktop server.
[0072] The target file can be used to trigger the daemon process of the terminal to send the target file to the target printing device for printing processing.
[0073] In implementation, Figure 5 As shown, cpusd can send the file to be printed to the executable file, the executable file can convert the data format of the file to be printed into a cross-platform data format to obtain the target file, and cpusd can send the target file to the daemon process of the cloud desktop. The daemon process of the cloud desktop server can send the target file to the daemon process of the terminal. After receiving the target file, the daemon process of the terminal can convert the data format of the target file into a data format that can be received by the target printing device, and send the converted target file to the target printing device for printing processing.
[0074] Since the printing device in the cloud desktop of the embodiment of the present specification is virtualized, the data to be printed is intercepted by writing a binary file based on the CUPS framework and further sent to the terminal. In order to ensure that the data of the virtual printing device can be correctly intercepted by the executable file, the executable file can support the communication protocol of the printing device connected to the terminal, and the printing device can communicate with CUPS based on the communication protocol. At the same time, since the CUPS framework is in user mode, it is convenient to debug the code, and if there is a problem in the printing process, it will not cause kernel instability.
[0075] The embodiment of this specification provides a file printing method, which is applied to a cloud desktop server, by receiving a print request for a file to be printed, responding to the print request, and converting the format of the file to be printed through an executable file to obtain a target file. The executable file can support the communication protocol of a printing device connected to a terminal, and the terminal is a terminal equipped with a cloud desktop. The target file is sent to the terminal, and the target file is used to trigger the terminal to send the target file to the printing device for printing. In this way, a printer can be simulated in user mode through an executable file, wherein, in order to ensure that the file to be printed can be correctly intercepted by the executable file, the executable file can support the communication protocol of the printing device connected to the terminal. In this way, since the file to be printed is not processed through the kernel driver, even if there is a problem in the printing process, it will not cause instability of the kernel, thereby ensuring the stability and maintainability of the printing process.
[0076] In another embodiment, if Figure 6 As shown, the embodiment of this specification provides a method for printing a file, and the execution subject of the method can be a terminal equipped with a cloud desktop, wherein the terminal can be a mobile terminal such as a mobile phone, a tablet computer, or a terminal such as a server. The method can specifically include the following steps:
[0077] In S602, a print request for a target file is received.
[0078] The target file may be a file obtained by performing format conversion processing on a file to be printed through an executable file in the cloud desktop, and the executable file may support a communication protocol of a printing device connected to the terminal.
[0079] In the implementation, the cloud desktop is a cloud desktop with a Linux operating system, and the executable file is a binary file written under the general Unix printing system framework as an example. Figure 7As shown, the user can trigger a print request for the file to be printed in the cloud desktop application. The cpusd of the cloud desktop server can intercept the print request and forward the print request to the executable file. The cloud desktop server can convert the format of the file to be printed through the executable file to obtain the target file, and send the target file to the terminal daemon through the daemon of the cloud desktop server. The daemon can be used as a connection between the terminal and the cloud desktop, and the data communication between the executable file and the terminal can be through the daemon.
[0080] In S604, based on the file processing format of the printing device, the target file is format converted to obtain a converted target file, and the converted target file is sent to the printing device.
[0081] The converted target file may be used to trigger a printing device to print the converted target file.
[0082] In implementation, Figure 7 As shown, the daemon process of the terminal can send the converted target file to the printing device connected to the terminal for printing processing.
[0083] The embodiment of the present specification provides a file printing method, which is applied to a terminal equipped with a cloud desktop, by receiving a print request for a target file, the target file can be a file obtained by the cloud desktop server through an executable file, performing format conversion processing on the file to be printed, the executable file supports the communication protocol of the printing device connected to the terminal, and based on the file processing format of the printing device, performs format conversion processing on the target file to obtain the converted target file, and sends the converted target file to the printing device, and the converted target file is used to trigger the printing device to print the converted target file. In this way, since a printer is simulated in the user state through an executable file in the cloud desktop, in order to ensure that the file to be printed can be correctly intercepted by the executable file, the executable file can support the communication protocol of the printing device connected to the terminal. In this way, since the file to be printed is not processed through the kernel driver, even if there is a problem in the printing process, it will not cause instability of the kernel, thereby ensuring the stability and maintainability of the printing process.
[0084] In another embodiment, if Figure 8 As shown, the embodiment of this specification provides a method for printing a file, and the execution subject of the method can be a terminal equipped with a cloud desktop, wherein the terminal can be a mobile terminal such as a mobile phone, a tablet computer, or a terminal such as a server. The method can specifically include the following steps:
[0085] In S602, a print request for a target file is received.
[0086] The target file may be a file obtained by performing format conversion processing on a file to be printed through an executable file in the cloud desktop, and the executable file supports a communication protocol of a printing device connected to the terminal.
[0087] In S802, based on the device identifier of the target printing device selected by the user from the printing devices connected to the terminal and carried in the print request, the file processing format of the target printing device is acquired.
[0088] In S804, based on the file processing format of the target printing device, the target file is converted to obtain a converted target file, and the converted target file is sent to the target printing device.
[0089] The embodiment of the present specification provides a file printing method, which is applied to a terminal equipped with a cloud desktop, by receiving a print request for a target file, the target file can be a file obtained by the cloud desktop server through an executable file, performing format conversion processing on the file to be printed, the executable file supports the communication protocol of the printing device connected to the terminal, and based on the file processing format of the printing device, performs format conversion processing on the target file to obtain the converted target file, and sends the converted target file to the printing device, and the converted target file is used to trigger the printing device to print the converted target file. In this way, since a printer is simulated in the user state through an executable file in the cloud desktop, in order to ensure that the file to be printed can be correctly intercepted by the executable file, the executable file can support the communication protocol of the printing device connected to the terminal. In this way, since the file to be printed is not processed through the kernel driver, even if there is a problem in the printing process, it will not cause instability of the kernel, thereby ensuring the stability and maintainability of the printing process.
[0090] In another embodiment, the present specification provides a file printing system, which includes a cloud desktop server and a terminal equipped with a cloud desktop, wherein:
[0091] The cloud desktop server can be used to receive print requests for files to be printed, and in response to the print requests, perform format conversion processing on the files to be printed through an executable file to obtain a target file, wherein the executable file supports the communication protocol of the printing device connected to the terminal, and the terminal is a terminal equipped with the cloud desktop, and the target file is sent to the terminal.
[0092] The terminal equipped with the cloud desktop can be used to convert the target file format based on the file processing format of the printing device, obtain the converted target file, and send the converted target file to the printing device. The converted target file can be used to trigger the printing device to print the converted target file.
[0093] The embodiment of the present specification provides a file printing system, which simulates a printer in user mode through an executable file in a cloud desktop. In order to ensure that the file to be printed can be correctly intercepted by the executable file, the executable file can support the communication protocol of the printing device connected to the terminal. In this way, since the file to be printed is not processed by the kernel driver, even if there is a problem in the printing process, it will not cause instability of the kernel, thereby ensuring the stability and maintainability of the printing process.
[0094] In another embodiment, the above is a file printing method provided in the embodiment of this specification. Based on the same idea, the embodiment of this specification also provides a file printing device, such as Fig. 9 shown.
[0095] The file printing device comprises: a request receiving module 901, a format conversion module 902 and a file forwarding module 903, wherein:
[0096] The request receiving module 901 is used to receive a print request for a file to be printed;
[0097] The format conversion module 902 is used to respond to the print request and perform format conversion processing on the file to be printed through an executable file to obtain a target file; the executable file supports the communication protocol of the printing device connected to the terminal, and the terminal is a terminal equipped with the cloud desktop;
[0098] The file forwarding module 903 is used to send the target file to the terminal, and the target file is used to trigger the terminal to send the target file to the printing device for printing processing.
[0099] In the embodiment of the present specification, the cloud desktop is a cloud desktop of the Linux operating system, and the executable file is a binary file written under the framework of a general Unix printing system.
[0100] In the embodiment of the present specification, the print request carries a device identifier of a target printing device selected by a user from among the printing devices connected to the terminal, and the apparatus further includes:
[0101] A protocol determination module, used to determine a target communication protocol corresponding to the target printing device based on the device identification of the target printing device;
[0102] The file acquisition module is used to acquire the executable file corresponding to the target communication protocol from the candidate executable files stored in the predetermined storage directory.
[0103] In the embodiment of this specification, the device further includes:
[0104] A login module, configured to receive a login request from the user for the cloud desktop sent by the terminal;
[0105] An initialization module, configured to perform initialization processing on the printing device connected to the terminal in response to the login request;
[0106] A protocol acquisition module, used to acquire the communication protocol of the printing device connected to the terminal after the initialization operation is completed;
[0107] The file generation module is used to generate the candidate executable file based on the communication protocol of the printing device connected to the terminal, and store the candidate executable file in the predetermined storage directory.
[0108] In the embodiment of this specification, the file acquisition module is used to:
[0109] Based on the daemon process under the general Unix printing system framework, the executable file corresponding to the target communication protocol is searched among the candidate executable files stored in the predetermined storage directory.
[0110] In the embodiment of this specification, the initialization module is used to:
[0111] Acquire first device information of a printing device that has been set by the terminal and sent by the terminal, and second device information of the printing device that has been set and sent by the printing device manager;
[0112] performing matching processing on the first device information and the second device information, and determining a printing device that is not set by the printing device manager based on the first device information and the second device information when the first device information does not match the second device information;
[0113] Acquire setting information of the unconfigured printing device, and send the setting information to the printing device manager, wherein the setting information is used to trigger the printing device manager to perform setting processing on the unconfigured printing device;
[0114] In the case where a setting completion message of the printing device manager is received, it is determined that the initialization operation is completed.
[0115] In the embodiment of this specification, the file forwarding module 903 is used to:
[0116] The target file is sent to the daemon process of the terminal through the daemon process of the cloud desktop server, and the target file is used to trigger the daemon process of the terminal to send the target file to the target printing device for printing processing.
[0117] The embodiments of the present specification provide a file printing device that can simulate a printer in user mode through an executable file, wherein, in order to ensure that the file to be printed can be correctly intercepted by the executable file, the executable file can support the communication protocol of the printing device connected to the terminal. In this way, since the file to be printed is not processed by the kernel driver, even if there is a problem in the printing process, it will not cause instability of the kernel, thereby ensuring the stability and maintainability of the printing process.
[0118] In another embodiment, the above is a file printing method provided in the embodiment of this specification. Based on the same idea, the embodiment of this specification also provides a file printing device, such as Fig.10 shown.
[0119] The file printing device comprises: a request receiving module 1001 and a file forwarding module 1002, wherein:
[0120] The request receiving module 1001 is used to receive a print request for a target file, wherein the target file is a file obtained by the cloud desktop server through an executable file by performing format conversion processing on the file to be printed, and the executable file supports a communication protocol of a printing device connected to the terminal;
[0121] The file forwarding module 1002 is used to perform format conversion processing on the target file based on the file processing format of the printing device to obtain a converted target file, and send the converted target file to the printing device. The converted target file is used to trigger the printing device to print the converted target file.
[0122] In the embodiment of this specification, the file forwarding module 1002 is used to:
[0123] Based on the device identifier of the target printing device selected by the user from the printing devices connected to the terminal and carried in the print request, acquiring the file processing format of the target printing device;
[0124] Based on the file processing format of the target printing device, the target file is format converted to obtain the converted target file, and the converted target file is sent to the target printing device.
[0125] The embodiments of the present specification provide a file printing device that can simulate a printer in user mode through an executable file, wherein, in order to ensure that the file to be printed can be correctly intercepted by the executable file, the executable file can support the communication protocol of the printing device connected to the terminal. In this way, since the file to be printed is not processed by the kernel driver, even if there is a problem in the printing process, it will not cause instability of the kernel, thereby ensuring the stability and maintainability of the printing process.
[0126] In another embodiment, based on the same idea, the embodiment of this specification also provides a data processing device, such as Fig.11 shown.
[0127] The data processing device may have relatively large differences due to different configurations or performances, and may include one or more processors 1101 and memory 1102, and the memory 1102 may store one or more storage applications or data. Among them, the memory 1102 may be a short-term storage or a persistent storage. The application stored in the memory 1102 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the data processing device. Furthermore, the processor 1101 may be configured to communicate with the memory 1102 and execute a series of computer executable instructions in the memory 1102 on the data processing device. The data processing device may also include one or more power supplies 1103, one or more wired or wireless network interfaces 1104, one or more input and output interfaces 1105, and one or more keyboards 1106.
[0128] Specifically in this embodiment, the data processing device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions in the data processing device, and the one or more programs are configured to be executed by one or more processors, including computer executable instructions for performing the following:
[0129] receiving a print request for a file to be printed;
[0130] In response to the print request, the file to be printed is format converted through an executable file to obtain a target file; the executable file supports a communication protocol of a printing device connected to a terminal, and the terminal is a terminal equipped with the cloud desktop;
[0131] The target file is sent to the terminal, where the target file is used to trigger the terminal to send the target file to the printing device for printing processing.
[0132] Optionally, the cloud desktop is a cloud desktop of a Linux operating system, and the executable file is a binary file written under a general Unix printing system framework.
[0133] Optionally, the print request carries a device identifier of a target printing device selected by a user from the printing devices connected to the terminal, and before the format conversion of the file to be printed is performed by the executable file to obtain the target file, the process further includes:
[0134] Determining a target communication protocol corresponding to the target printing device based on the device identification of the target printing device;
[0135] The executable file corresponding to the target communication protocol is obtained from the candidate executable files stored in the predetermined storage directory.
[0136] Optionally, before receiving a print request from a user for a target file, the method further includes:
[0137] Receiving a login request from the user for the cloud desktop sent by the terminal;
[0138] In response to the login request, initializing the printing device connected to the terminal;
[0139] After the initialization operation is completed, obtaining a communication protocol of a printing device connected to the terminal;
[0140] Based on the communication protocol of the printing device connected to the terminal, the candidate executable file is generated, and the candidate executable file is stored in the predetermined storage directory.
[0141] Optionally, obtaining the executable file corresponding to the target communication protocol from the candidate executable files stored in the predetermined storage directory includes:
[0142] Based on the daemon process under the general Unix printing system framework, the executable file corresponding to the target communication protocol is searched among the candidate executable files stored in the predetermined storage directory.
[0143] Optionally, the initializing the printing device connected to the terminal includes:
[0144] Acquire first device information of a printing device that has been set by the terminal and sent by the terminal, and second device information of the printing device that has been set and sent by the printing device manager;
[0145] performing matching processing on the first device information and the second device information, and determining a printing device that is not set by the printing device manager based on the first device information and the second device information when the first device information does not match the second device information;
[0146] Acquire setting information of the unconfigured printing device, and send the setting information to the printing device manager, wherein the setting information is used to trigger the printing device manager to perform setting processing on the unconfigured printing device;
[0147] In the case where a setting completion message of the printing device manager is received, it is determined that the initialization operation is completed.
[0148] Optionally, sending the target file to the terminal includes:
[0149] The target file is sent to the daemon process of the terminal through the daemon process of the cloud desktop server, and the target file is used to trigger the daemon process of the terminal to send the target file to the target printing device for printing processing.
[0150] In addition, the one or more programs configured to be executed by one or more processors may also include computer executable instructions for performing the following:
[0151] Receiving a print request for a target file, wherein the target file is a file obtained by the cloud desktop server through an executable file by performing format conversion processing on a file to be printed, and the executable file supports a communication protocol of a printing device connected to the terminal;
[0152] Based on the file processing format of the printing device, the target file is format converted to obtain a converted target file, and the converted target file is sent to the printing device. The converted target file is used to trigger the printing device to print the converted target file.
[0153] Optionally, performing format conversion processing on the target file based on the file processing format of the printing device to obtain a converted target file, and sending the converted target file to the printing device includes:
[0154] Based on the device identifier of the target printing device selected by the user from the printing devices connected to the terminal and carried in the print request, acquiring the file processing format of the target printing device;
[0155] Based on the file processing format of the target printing device, the target file is format converted to obtain the converted target file, and the converted target file is sent to the target printing device.
[0156] The embodiments of the present specification provide a data processing device that can simulate a printer in user mode through an executable file, wherein, in order to ensure that the file to be printed can be correctly intercepted by the executable file, the executable file can support the communication protocol of the printing device connected to the terminal. In this way, since the file to be printed is not processed by the kernel driver, even if there is a problem in the printing process, it will not cause instability of the kernel, thereby ensuring the stability and maintainability of the printing process.
[0157] In another embodiment, the embodiment of this specification also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above-mentioned file printing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0158] The embodiments of the present specification provide a computer-readable storage medium that can simulate a printer in user mode through an executable file, wherein, in order to ensure that the file to be printed can be correctly intercepted by the executable file, the executable file can support the communication protocol of the printing device connected to the terminal. In this way, since the file to be printed is not processed by the kernel driver, even if there is a problem in the printing process, it will not cause instability of the kernel, thereby ensuring the stability and maintainability of the printing process.
[0159] The above is a description of a specific embodiment of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0160] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0161] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0162] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0163] For the convenience of description, the above devices are described in terms of functions and are divided into various units. Of course, when implementing one or more embodiments of this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0164] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, one or more embodiments of this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, one or more embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0165] The embodiments of this specification are described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0166] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0167] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0168] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0169] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0170] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0171] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0172] It should be understood by those skilled in the art that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, one or more embodiments of this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, one or more embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0173] One or more embodiments of the present specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0174] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0175] The above description is only an embodiment of the present specification and is not intended to limit the present specification. For those skilled in the art, the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of the claims of the present specification.
Claims
1. A file printing method, the method being applied to a cloud desktop server, the method comprising: receiving a print request for a file to be printed; In response to the print request, the file to be printed is format converted by an executable file to obtain a target file; The executable file supports a communication protocol of a printing device connected to a terminal, and the terminal is a terminal equipped with the cloud desktop; The target file is sent to the terminal, where the target file is used to trigger the terminal to send the target file to the printing device for printing processing.
2. According to the method of claim 1, the cloud desktop is a cloud desktop of the Linux operating system, and the executable file is a binary file written under the framework of a general Unix printing system.
3. The method according to claim 2, wherein the print request carries a device identifier of a target printing device selected by a user from the printing devices connected to the terminal, and before the executable file is used to convert the format of the file to be printed to obtain the target file, the method further comprises: Determining a target communication protocol corresponding to the target printing device based on the device identification of the target printing device; The executable file corresponding to the target communication protocol is obtained from the candidate executable files stored in the predetermined storage directory.
4. The method according to claim 3, before receiving a print request from a user for a target file, further comprising: Receiving a login request from the user for the cloud desktop sent by the terminal; In response to the login request, initializing the printing device connected to the terminal; After the initialization operation is completed, obtaining a communication protocol of a printing device connected to the terminal; Based on the communication protocol of the printing device connected to the terminal, the candidate executable file is generated, and the candidate executable file is stored in the predetermined storage directory.
5. The method according to claim 4, wherein obtaining the executable file corresponding to the target communication protocol from the candidate executable files stored in the predetermined storage directory comprises: Based on the daemon process under the general Unix printing system framework, the executable file corresponding to the target communication protocol is searched among the candidate executable files stored in the predetermined storage directory.
6. The method according to claim 4, wherein the initializing process of the printing device connected to the terminal comprises: Acquire first device information of a printing device that has been set by the terminal and sent by the terminal, and second device information of the printing device that has been set and sent by the printing device manager; performing matching processing on the first device information and the second device information, and determining a printing device that is not set by the printing device manager based on the first device information and the second device information when the first device information does not match the second device information; Acquire setting information of the unconfigured printing device, and send the setting information to the printing device manager, wherein the setting information is used to trigger the printing device manager to perform setting processing on the unconfigured printing device; In the case where a setting completion message of the printing device manager is received, it is determined that the initialization operation is completed.
7. The method according to claim 3, wherein sending the target file to the terminal comprises: The target file is sent to the daemon process of the terminal through the daemon process of the cloud desktop server, and the target file is used to trigger the daemon process of the terminal to send the target file to the target printing device for printing processing.
8. A file printing method, the method being applied to a terminal equipped with a cloud desktop, the method comprising: Receiving a print request for a target file, wherein the target file is a file obtained by the cloud desktop server through an executable file by performing format conversion processing on a file to be printed, and the executable file supports a communication protocol of a printing device connected to the terminal; Based on the file processing format of the printing device, the target file is format converted to obtain a converted target file, and the converted target file is sent to the printing device. The converted target file is used to trigger the printing device to print the converted target file.
9. The method according to claim 8, wherein the step of performing format conversion processing on the target file based on the file processing format of the printing device to obtain a converted target file and sending the converted target file to the printing device comprises: Based on the device identifier of the target printing device selected by the user from the printing devices connected to the terminal and carried in the print request, acquiring the file processing format of the target printing device; Based on the file processing format of the target printing device, the target file is format converted to obtain the converted target file, and the converted target file is sent to the target printing device.
10. A document printing device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the file printing method according to any one of claims 1 to 7 or the steps of the file printing method according to any one of claims 8 to 9 are implemented.
11. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the file printing method according to any one of claims 1 to 7, or the steps of the file printing method according to any one of claims 8 to 9 are implemented.