Printing method, electronic equipment and storage medium
By establishing virtual printers and virtual ports in the cloud desktop environment, the isolation problem between the cloud desktop and the local printer is solved, and printer type information matching and format conversion are realized, improving printing efficiency and user experience.
Patent Information
- Application Number
- CN202511037371.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-25
- Publication Date
- 2025-12-19
AI Technical Summary
In a cloud desktop environment, users may have difficulty using local printers, resulting in printer isolation issues.
By establishing virtual printers and virtual ports between the cloud and the terminal, print request conversion and real-time data stream transmission are achieved, ensuring printer type information matching and format conversion, and supporting seamless integration of multiple printer types.
It improves the efficiency of the printing process and the user experience, ensures compatibility and print quality for different types of printers, and achieves seamless integration between the cloud and local printers.
Smart Images

Figure CN121166044A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more particularly to a printing method, electronic device, and storage medium. Background Technology
[0002] In a cloud desktop environment, users typically need to print using either a network printer or a local printer. However, due to the isolation between the cloud desktop and the local device, successfully using a local printer within the cloud desktop presents a technical challenge. Summary of the Invention
[0003] This disclosure provides a printing method, an electronic device, and a storage medium to at least solve the above-mentioned technical problems existing in the prior art.
[0004] According to a first aspect of this disclosure, a printing method is provided, the method comprising:
[0005] Obtain a print request triggered by terminal-based triggering information, wherein the print request includes printer type information;
[0006] Based on the print request, a target virtual printer is identified from at least one virtual printer, and the target virtual printer corresponds to the printer type information;
[0007] The target virtual printer is used to convert the document to be printed into printable information in the target format;
[0008] The information to be printed is sent to a terminal using a virtual port, and the terminal is connected to a target physical printer that corresponds to the printer type information.
[0009] According to a second aspect of this disclosure, another printing method is provided, the method comprising:
[0010] Send trigger information to the cloud, the trigger information being used to trigger a print request in the cloud;
[0011] Receive printable information in the target format from the cloud;
[0012] According to the target format, select a target physical printer from at least one physical printer connected to the terminal;
[0013] The information to be printed is printed using the target physical printer.
[0014] According to a third aspect of this disclosure, a printing apparatus is provided, comprising:
[0015] The acquisition module is used to acquire a print request triggered by terminal-based triggering information, wherein the print request includes printer type information;
[0016] A determination module is used to identify a target virtual printer from at least one virtual printer based on the print request, wherein the target virtual printer corresponds to the printer type information;
[0017] The first processing module is used to convert the file to be printed into printable information in the target format using the target virtual printer;
[0018] The first transmission module is used to send the information to be printed to a terminal using a virtual port, wherein the terminal is connected to a target physical printer corresponding to the printer type information.
[0019] According to a fourth aspect of this disclosure, another printing apparatus is provided, comprising:
[0020] The second transmission module is used to send trigger information to the cloud, the trigger information being used to trigger a print request on the cloud; and to receive printable information in a target format from the cloud.
[0021] The second processing module is used to select a target physical printer from at least one physical printer connected to the terminal according to the target format; and to print the information to be printed using the target physical printer.
[0022] According to a fifth aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method of this disclosure.
[0023] According to a sixth aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions for causing the computer to perform the methods described in this disclosure. Attached Figure Description
[0024] The above and other objects, features, and advantages of this disclosure will become readily apparent from the following detailed description of exemplary embodiments, taken in conjunction with the accompanying drawings. Several embodiments of this disclosure are illustrated in the drawings by way of example and not limitation, in which:
[0025] In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
[0026] Figure 1 A schematic flowchart illustrating a printing method provided in an embodiment of this disclosure;
[0027] Figure 2 A schematic flowchart illustrating another printing method provided in this embodiment of the disclosure;
[0028] Figure 3 A schematic diagram illustrating a printing method provided in an embodiment of this disclosure;
[0029] Figure 4 This is a schematic diagram of the structure of a printing apparatus provided in an embodiment of the present disclosure;
[0030] Figure 5 A schematic diagram of another printing apparatus provided in an embodiment of this disclosure;
[0031] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0032] To make the objectives, features, and advantages of this disclosure more apparent and understandable, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without creative effort are within the scope of protection of this disclosure.
[0033] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0034] In the following description, the terms "first" and "second" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first" and "second" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this disclosure described herein can be implemented in an order other than that illustrated or described herein.
[0035] Unless otherwise defined, all technical and scientific terms used in this disclosure have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure belongs. The terminology used in this disclosure is for the purpose of describing embodiments of this disclosure only and is not intended to be limiting of this disclosure.
[0036] It should be understood that in the various embodiments of this disclosure, the sequence number of each implementation process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this disclosure.
[0037] Figure 1 This is a schematic flowchart of a printing method provided in an embodiment of the present disclosure; as shown below. Figure 1 As shown, the method includes:
[0038] Step 101: Obtain a print request triggered by terminal-based triggering information, wherein the print request includes printer type information;
[0039] Step 102: Based on the print request, confirm the target virtual printer from at least one virtual printer, wherein the target virtual printer corresponds to the printer type information;
[0040] Step 103: Use the target virtual printer to convert the file to be printed into printable information in the target format;
[0041] Step 104: Use a virtual port to send the information to be printed to the terminal, which is connected to a target physical printer corresponding to the printer type information.
[0042] Here, the method can be applied to the cloud (such as the backend virtual machine of a cloud computer). The cloud is a computer service based on cloud computing technology, which centralizes computing resources, storage space, operating systems and applications on cloud servers through the Internet. Users can access and use the cloud through terminals.
[0043] The terminal is the device through which the user accesses the cloud, such as a personal computer, smartphone, or tablet. The terminal has a human-computer interaction interface, such as a mouse, display screen, keyboard, or touchscreen, through which the user can operate. For example, a user can double-click or right-click a file to select a print file and choose the printer type. Trigger information is crucial for the interaction between the terminal device and the cloud. Based on detecting these operations, the terminal determines the trigger information and then sends it to the cloud. This information conveys the user's actions on the terminal and informs the cloud of the appropriate action to be taken. For example, in a printing scenario, the trigger information tells the cloud the user's printing intention, the appropriate printer type, and the content to be printed. Correspondingly, the cloud receives the print request triggered by the terminal's trigger information.
[0044] The print request includes printer type information, which can be used to indicate the specific model, brand, or type of printer that the user wishes to use (e.g., a specific model of laser printer, inkjet printer, etc.), so that the cloud can determine which printer should be selected to handle the print job.
[0045] The print request can also specify the document to be printed. The cloud selects the target virtual printer and the document based on the print request to execute the print operation, optimizing the printing process. It can automatically select a suitable virtual printer and complete format conversion, enhancing the operability and efficiency of print jobs. This more efficiently meets various printing needs and significantly improves printing performance and user experience. Furthermore, the use of virtual ports ensures real-time data stream reception, meeting different user printing needs while providing a more efficient and convenient printing experience.
[0046] In some embodiments, the method further includes:
[0047] Receive device information from at least one physical printer from the terminal;
[0048] Based on the device information of the at least one physical printer, establish the at least one virtual printer.
[0049] Here, the cloud can receive device information from the physical printer at the terminal in advance. The device information may include the printer model, supported printing languages (such as XPS, PostScript, PCL, etc.), and other printer-related parameters (such as the custom physical printer name).
[0050] Based on the device information of the physical printer, a corresponding virtual printer can be created. The virtual printer may include a software driver that simulates the behavior of the physical printer, allowing users to perform printing tasks through the virtual printer. For example, the driver can convert the file to be printed into a data stream in a data format supported by the corresponding physical printer. Thus, the appropriate virtual printer type can be selected based on the type of physical printer, ensuring that the system can support the printing needs of different types of printers.
[0051] In one example, device information may include printer type; for example, a physical printer may include at least one of the following:
[0052] XPS printer: A type of printer that supports the XPS format;
[0053] PostScript printer: A printer that supports PostScript (.ps) format;
[0054] PCL printer: A printer that supports the PCL (Printer Control Language) format;
[0055] Other printers: A printer that supports a specific format.
[0056] Accordingly, a virtual printer may include at least one of the following:
[0057] The XPS virtual printer can be configured according to the characteristics of the XPS printing language;
[0058] A PostScript virtual printer can be configured according to the characteristics of the PostScript printing language;
[0059] A PCL virtual printer can be configured according to the characteristics of the PCL printing language;
[0060] Other virtual printers can be configured according to the characteristics of a certain printing language (such as PDF, XPS, PCL, etc.).
[0061] In this way, by setting up at least one virtual printer, it is ensured that print jobs can be sent to the corresponding physical printer through the correct target virtual printer during subsequent use. This achieves seamless integration between the physical and virtual printers, avoids print failures caused by format mismatches, and ensures print speed and quality.
[0062] In another example, device information may include printer type and custom name; for example, a physical printer may include at least one of the following:
[0063] Printer number one is an XPS printer;
[0064] Printer number two is a PostScript printer;
[0065] Printer number three is a PCL printer;
[0066] Accordingly, a virtual printer may include at least one of the following:
[0067] The No. 1 virtual printer is specifically an XPS virtual printer that can be configured according to the characteristics of the XPS printing language.
[0068] The second virtual printer is specifically a PostScript virtual printer, which can be configured according to the characteristics of the PostScript printing language;
[0069] The third virtual printer is specifically a PCL virtual printer that can be configured according to the characteristics of the PCL printing language.
[0070] In this way, by establishing a virtual printer with the same name and format as the physical printer, it is easy to intuitively understand the correspondence between the physical and virtual printers, ensuring convenient and simple operation for users. Furthermore, it ensures that print jobs can be sent to the corresponding physical printer through the correct target virtual printer during subsequent use, thereby achieving seamless integration between the physical and virtual printers. This avoids print failures caused by format mismatches and other issues, ensuring print speed and quality.
[0071] In some embodiments, sending the information to be printed to the terminal using a virtual port includes:
[0072] The information to be printed is sent to the virtual port, which can match virtual printers of different printer types.
[0073] The data stream of the information to be printed received by the virtual port is collected using a port monitor;
[0074] The collected data stream is sent to the terminal in real time.
[0075] Here, after establishing at least one virtual printer, the cloud can also establish virtual ports and virtual printers. These virtual ports can be matched with virtual printers of different types. This virtual port can be used by multiple virtual printers to transmit print information to the physical printer connected to the terminal for printing.
[0076] The target virtual printer first sends the information to be printed to a virtual port, which can be understood as a software-simulated communication interface used to transmit the information to the physical printer connected to the terminal for printing. The virtual port can also be used to distinguish and match different types of data streams, ensuring that the data stream of the information to be printed enters the correct processing channel and is delivered to the physical printer connected to the terminal that matches the data stream type.
[0077] Port monitors can be used to listen to data flowing over virtual ports. When a virtual port receives a print request, the port monitor captures these data streams in real time. This capture is dynamic, eliminating the need to wait for the entire print file to arrive. It captures print job data promptly, and then the port monitor immediately forwards the captured data stream to the terminal (i.e., the user's device or the device ultimately controlling the physical printer). In this way, print data can be transmitted in real-time in a streaming manner, rather than waiting for the complete file to be generated before sending, greatly improving data transmission and print initiation speed.
[0078] In some embodiments, converting the file to be printed into printable information in a target format using the target virtual printer includes:
[0079] The printer type corresponding to the printer type information is determined as the target type. The file to be printed is converted into printable information in a first target format, where the first target format is the format corresponding to the target virtual printer.
[0080] Here, the target type can include types such as XPS, PostScript, and PCL, or it can also include other printer types with their own specific supported file formats.
[0081] After determining the printer type information based on the print request, if the printer type information corresponds to the target type, the virtual printer corresponding to the printer type information is determined to be the target virtual printer. The file to be printed is converted into the format corresponding to the target virtual printer, namely the first target format, which is the format supported by the printer type of the target type.
[0082] The first target format may include printing languages or formats supported by the printer, such as XPS, PostScript, PCL, etc.
[0083] Depending on the printer type, the document to be printed needs to be converted to a format suitable for that printer. For example, if the target virtual printer is a PostScript printer, the original document to be printed will be converted to PostScript format. The first target format refers to the format that the physical printer corresponding to the target virtual printer can recognize and process, i.e., PostScript format (i.e., .ps format). As another example, if the target virtual printer is an XPS printer, then the first target format is XPS format.
[0084] In some embodiments, the method further includes:
[0085] If the printer type corresponding to the printer type information is determined to be different from the target type, the file to be printed is converted into the print information in the second target format, which is a format that supports file splitting and can be printed by multiple physical printers.
[0086] Here, after determining the printer type information based on the print request, if the printer type corresponding to the printer type information is not the target type, the document to be printed is converted into a format supported by multiple physical printers, namely the second target format. In this way, the terminal can also print using a physical printer after receiving the document in the second target format.
[0087] For example, the second target format can be PDF, a format supported by multiple physical printers. Furthermore, this format also supports file splitting. Thus, files in the second target format can be split to improve printing efficiency.
[0088] In some embodiments, sending the information to be printed to the terminal using a virtual port includes:
[0089] The information to be printed in the second target format is grouped by page to obtain at least one sub-file to be sent;
[0090] The at least one sub-file to be sent is sent to the terminal in parallel using multiple threads.
[0091] Here, the printable information in the second target format can be grouped by page to obtain multiple sub-files to be sent. These sub-files are then sent to the terminal in parallel using multi-threading, allowing multiple physical printers connected to the terminal to jointly process the print job. File splitting and parallel transmission help accelerate the transmission and printing processes, improving print quality.
[0092] Furthermore, multiple physical printers connected to the terminal can work simultaneously, allowing multiple physical printers connected to the terminal to work together to handle printing tasks, share the printing workload, reduce waiting time, and improve efficiency.
[0093] In some embodiments, the method further includes:
[0094] If the printer type corresponding to the printer type information is determined to be different from the target type, the file to be printed is converted into printable information in the first target format.
[0095] The first target format of the printable information is sent to the terminal; the first target format of the printable information is converted by the terminal into a second target format of printable information, and the second target format of the printable information is grouped by page to obtain at least one printable sub-file; at least one printable sub-file is sent to multiple physical printers in parallel using multi-threading.
[0096] Here, if the printer type information corresponds to a printer type other than the target type, the file to be printed can be converted into a first target format (such as XPS, PostScript, or PCL), and the converted file can be sent to the terminal. The terminal can then convert the first target format file into a second target format file. In other words, the conversion to the second target format file can also be performed by the terminal.
[0097] For example, the cloud sends the printable information in PostScript format to the terminal. After receiving it, the terminal converts it into printable information in PDF format, then groups it by page to obtain multiple printable sub-files. These multiple printable sub-files are then distributed to multiple physical printers. Since PDF is a universal printing format, multiple physical printers can print simultaneously.
[0098] In this way, multiple different physical printers connected to the terminal can work simultaneously to process printing tasks, share the printing workload, reduce waiting time, and improve efficiency.
[0099] Figure 2 A flowchart illustrating another printing method provided in this disclosure embodiment; as shown Figure 2 As shown, the method includes:
[0100] Step 201: Send trigger information to the cloud, the trigger information being used to trigger a print request on the cloud;
[0101] Step 202: Receive the printable information in the target format from the cloud;
[0102] Step 203: Select a target physical printer from at least one physical printer connected to the terminal according to the target format;
[0103] Step 204: Print the information to be printed using the target physical printer.
[0104] Here, the method can be applied to a terminal, which is a device that allows a user to access the cloud or has a communication relationship with the cloud, such as a personal computer, smartphone, tablet, etc.
[0105] The terminal has a human-computer interaction interface, such as a mouse, display screen, keyboard, or touchscreen. Users can operate through this interface, such as double-clicking or right-clicking a file to select the print file and printer type. Trigger information is crucial for the interaction between the terminal and the cloud. Based on these detected operations, the terminal determines the trigger information and sends it to the cloud. This information conveys the user's actions on the terminal and informs the cloud of the appropriate action. For example, in a printing scenario, the trigger information tells the cloud the user's printing intent, the appropriate printer type, and the print content. Correspondingly, the cloud receives the print request triggered by the terminal's trigger information.
[0106] In some embodiments, the target format may be a first target format or a second target format; the first target format may include formats such as XPS, PostScript, and PCL; the second target format may be PDF format.
[0107] In one example, after receiving printable information in a first target format, the terminal selects a target physical printer from at least one physical printer connected to the terminal according to the first target format. For example, if printable information in XPS format is received, an XPS physical printer is determined accordingly, and the printable information is printed using the target physical printer (i.e., the XPS physical printer).
[0108] In another example, after receiving the printable information in a first target format, the terminal fails to select a matching physical printer from at least one physical printer connected to the terminal according to the first target format. For example, if the terminal receives printable information in PostScript format but finds no physical printer that can print PostScript format printable information, the terminal receives it and converts it into printable information in PDF format. Then, it groups the printable information by page to obtain multiple printable sub-files and distributes the multiple printable sub-files to multiple physical printers. The multiple physical printers (as target physical printers) can print simultaneously.
[0109] In another example, the terminal uses multithreading to receive multiple sub-files to be sent, such as multiple PDF sub-files. The terminal then distributes these multiple sub-files to multiple physical printers connected to it, and the multiple physical printers work together to process the printing task.
[0110] It should be noted that, considering some physical printers do not support PDF format, if it is confirmed that none of the physical printers connected to the terminal support PDF, the PDF file to be printed can be further converted to .bmp format. Since .bmp is a universal format for all physical printers, it ensures successful printing. Furthermore, the conversion of the PDF file to .bmp can be transparent, meaning it is displayed to the user, or it can be performed automatically by the system without being displayed to the user. No limitation is made here.
[0111] In some embodiments, the method further includes:
[0112] Send device information of at least one physical printer to the cloud. The device information is used to establish at least one virtual printer in the cloud. The virtual printer is used to convert the document to be printed into a target format corresponding to the virtual printer's own device type.
[0113] Here, the terminal can send the device information of at least one physical printer to the cloud in advance, so that the cloud can create a virtual printer in advance based on the device information of the physical printer.
[0114] The device information may include the printer model, supported printing languages (such as XPS, PostScript, PCL, etc.), and other printer-related parameters (such as a custom physical printer name).
[0115] Based on the device information of the physical printer, a corresponding virtual printer can be created in the cloud. The virtual printer may include software drivers to simulate the behavior of the physical printer, allowing users to perform printing tasks through the virtual printer.
[0116] A virtual printer can convert a file to be printed into a target format that corresponds to the virtual printer's own device type. In other words, a virtual printer can convert a file to be printed into a data stream that is supported by the physical printer corresponding to the virtual printer, so that the physical printer can print based on the data stream.
[0117] This ensures that the physical printer connected to the terminal can support the printing needs of the different types of printers required.
[0118] Figure 3 A schematic diagram of a printing method provided in an embodiment of this disclosure; as shown Figure 3 As shown, the method involves the cloud and the terminal. In the figure, the cloud agent represents the agent of the cloud on the terminal.
[0119] Custom virtual ports (such as VPrintPort) and port monitors can be pre-developed or created in the cloud to pass various types of data streams to the terminal's printing port. The port monitor acts as a driver (DLL), responsible for forwarding the data streams.
[0120] The terminal can transmit device information (such as name, type, etc.) of all local physical printers to the cloud. Based on the device information transmitted by the terminal, the cloud uses the corresponding driver (such as XPSDdrv.dll) to create a virtual printer with the same name, and matches the port of the virtual printer with the created virtual port (such as VPrintPort). In this way, the data stream of the virtual printer can be transmitted to the virtual port.
[0121] For example, the XPS Printer Stub in the figure is the virtual printer icon corresponding to the XPS printer, which corresponds to the XPS printer driver (XPSDrv.dll), forming a virtual printer that supports the XPS format.
[0122] Similarly, the PostScript Printer Stub in the diagram is the virtual printer icon corresponding to the XPS printer, which corresponds to the PS printer driver (PSCRIPT5.dll), forming a virtual printer that supports the PS format; the PCLPrinter Stub in the diagram is the virtual printer icon corresponding to the XPS printer, which corresponds to the PCL printer driver (PCLXL.dll), forming a virtual printer that supports the PS format.
[0123] In addition, Others Priter Stubs are virtual printer icons corresponding to other printer formats, and there can be one or more of them; each corresponds to a format conversion driver (for example, it can be PSCRIPT5.dll, or a PDF format conversion driver), forming a virtual printer that supports other formats.
[0124] When a user needs to print through local software (such as WPS), the cloud receives the print request (including printer type information) triggered by the terminal and selects the target virtual printer that matches the printer type information based on the print request.
[0125] In one example, assuming an XPS virtual printer, the file to be printed is converted into a structured data stream in XPS format (denoted as a .xps stream), transmitted to a custom virtual port, and then the port monitor sends the .xps stream to the terminal cloud agent, which then forwards it to the matching physical printer (such as an XPS Printer) on the terminal to complete the printing task. A similar process also applies to .ps and .pcl formats.
[0126] In another example, for printers using a custom description language (i.e., not standard .xps, .ps, or .pcl formats), a specific driver for that printer can be installed locally on the terminal. The cloud can then use this specific driver to convert the data into the corresponding data stream. Taking PSCRIPT5.dll as an example, the data is converted into a structured data stream in PS format (denoted as a .ps stream) and sent to the terminal. After format conversion by the terminal, the data is printed by other printers. For example, the open-source library gsdll64.dll can be used to convert the .ps format file to PDF format, and then processed concurrently by grouping pages. If the PDF format is still not suitable for the physical printer, each page can be converted to .bmp format (a format common to all printers). Finally, the .bmp file is sent to the physical printer for printing.
[0127] In another example, for printers using a custom description language (i.e., not standard .xps, .ps, or .pcl formats), a specific driver for that printer can be installed locally on the terminal. The cloud can then use this specific driver to convert the data into the corresponding data stream. Taking a PDF driver as an example, the data is converted into a PDF file and grouped. The grouped sub-files are then sent to the terminal. The terminal distributes each PDF sub-file to the physical printer for printing. If the PDF format is still not suitable for the physical printer, each page can be converted to .bmp format, and finally, the .bmp file is sent to the physical printer for printing.
[0128] Figure 4 This is a schematic diagram of the structure of a printing device provided in an embodiment of the present disclosure; as shown below. Figure 4 As shown, the device includes:
[0129] The acquisition module is used to acquire a print request triggered by terminal-based triggering information, wherein the print request includes printer type information;
[0130] A determination module is used to identify a target virtual printer from at least one virtual printer based on the print request, wherein the target virtual printer corresponds to the printer type information;
[0131] The first processing module is used to convert the file to be printed into printable information in the target format using the target virtual printer;
[0132] The first transmission module is used to send the information to be printed to a terminal using a virtual port, wherein the terminal is connected to a target physical printer corresponding to the printer type information.
[0133] In some embodiments, the first transmission module is further configured to receive device information from at least one physical printer from the terminal;
[0134] The first processing module is further configured to establish the at least one virtual printer based on the device information of the at least one physical printer.
[0135] In some embodiments, the first transmission module is used to send the information to be printed to the virtual port, wherein the virtual port can match virtual printers of different printer types;
[0136] The data stream of the information to be printed received by the virtual port is collected using a port monitor;
[0137] The collected data stream is sent to the terminal in real time.
[0138] In some embodiments, the first processing module is configured to determine that the printer type corresponding to the printer type information is the target type, and convert the file to be printed into printable information in a first target format, wherein the first target format is the format corresponding to the target virtual printer.
[0139] In some embodiments, the first processing module is further configured to determine that the printer type corresponding to the printer type information is not the target type, and convert the file to be printed into the print information of the second target format, wherein the second target format is a format that supports file splitting and is supported by multiple physical printers.
[0140] In some embodiments, the first transmission module is further configured to group the printable information in the second target format by page to obtain at least one sub-file to be sent;
[0141] The at least one sub-file to be sent is sent to the terminal in parallel using multiple threads.
[0142] It is understood that, when implementing the corresponding printing method, the printing apparatus provided in the above embodiments can allocate the above processing to different modules as needed to complete all or part of the processing described above. Furthermore, the apparatus and the corresponding method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process is detailed in the method embodiments, which will not be repeated here.
[0143] Figure 5 This is a schematic diagram of another printing apparatus provided in an embodiment of the present disclosure; as shown below. Figure 5 As shown, the device includes:
[0144] The second transmission module is used to send trigger information to the cloud, the trigger information being used to trigger a print request on the cloud; and to receive printable information in a target format from the cloud.
[0145] The second processing module is used to select a target physical printer from at least one physical printer connected to the terminal according to the target format; and to print the information to be printed using the target physical printer.
[0146] In some embodiments, the second transmission module is further configured to send device information of at least one physical printer to the cloud, the device information being used to establish at least one virtual printer in the cloud, the virtual printer being used to convert the file to be printed into printable information in a target format corresponding to the virtual printer's own device type.
[0147] It is understood that, when implementing the corresponding printing method, the printing apparatus provided in the above embodiments can allocate the above processing to different modules as needed to complete all or part of the processing described above. Furthermore, the apparatus and the corresponding method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process is detailed in the method embodiments, which will not be repeated here.
[0148] This application provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform a printing method.
[0149] This application provides a computer-readable storage medium storing executable instructions, wherein the executable instructions are stored and when executed by a processor, the processor will execute the printing method provided in this application.
[0150] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.
[0151] In some embodiments, executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a standalone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0152] As an example, executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple collaborating files (e.g., a file that stores one or more modules, subroutines, or code sections).
[0153] As an example, executable instructions can be deployed to execute on a single computing device, or on multiple computing devices located in one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network.
[0154] Figure 6This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure; as shown below. Figure 6 As shown, the electronic device 60 includes: a processor 601, and a memory 602 communicatively connected to the processor 601; the memory 602 stores instructions that can be executed by the processor 601.
[0155] When the electronic device is configured as a cloud, the instructions are executed by the processor 601 to enable the processor 601 to perform the following:
[0156] Obtain a print request triggered by terminal-based triggering information, wherein the print request includes printer type information;
[0157] Based on the print request, a target virtual printer is identified from at least one virtual printer, and the target virtual printer corresponds to the printer type information;
[0158] The target virtual printer is used to convert the document to be printed into printable information in the target format;
[0159] The information to be printed is sent to a terminal using a virtual port, and the terminal is connected to a target physical printer that corresponds to the printer type information.
[0160] When the electronic device functions as a terminal, the instructions are executed by the processor 601, enabling the processor 601 to perform the following:
[0161] Send trigger information to the cloud, the trigger information being used to trigger a print request in the cloud;
[0162] Receive printable information in the target format from the cloud;
[0163] According to the target format, select a target physical printer from at least one physical printer connected to the terminal;
[0164] The information to be printed is printed using the target physical printer.
[0165] Here, the electronic device and the corresponding method embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.
[0166] In practical applications, the electronic device 60 may further include at least one network interface 603. The various components of the electronic device 60 are coupled together via a bus system 604. It is understood that the bus system 604 is used to implement communication between these components. In addition to a data bus, the bus system 604 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 6All buses are labeled as bus system 604. The number of processors 601 and the number of memories 602 can be at least one. The network interface 603 is used for wired or wireless communication between the electronic device 60 and other devices.
[0167] The memory 602 in this embodiment is used to store various types of data to support the operation of the electronic device 60.
[0168] The methods disclosed in the above embodiments of this disclosure can be applied to or implemented by processor 601. Processor 601 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 601 or by instructions in software form. The processor 601 may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 601 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this disclosure. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this disclosure can be directly manifested as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium, which is located in memory 602. Processor 601 reads the information in memory 602 and, in conjunction with its hardware, completes the steps of the aforementioned printing method.
[0169] In some embodiments, the electronic device 60 may be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to perform the aforementioned methods.
[0170] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0171] In the above description, the term "some embodiments" refers to a subset of all possible embodiments. However, it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0172] Unless otherwise defined, all technical and scientific terms used in this disclosure have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure belongs. The terminology used in this disclosure is for the purpose of describing embodiments of this disclosure only and is not intended to be limiting of this disclosure.
[0173] It should be understood that in the various embodiments of this disclosure, the sequence number of each implementation process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this disclosure.
[0174] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this disclosure, "a plurality of" means two or more, unless otherwise explicitly specified.
[0175] The above description is merely a specific embodiment of this disclosure, but the scope of protection of this disclosure is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this disclosure should be included within the scope of protection of this disclosure. Therefore, the scope of protection of this disclosure should be determined by the scope of the claims.
Claims
1. A printing method, the method comprising: Obtain a print request triggered by terminal-based triggering information, wherein the print request includes printer type information; Based on the print request, a target virtual printer is identified from at least one virtual printer, and the target virtual printer corresponds to the printer type information; The target virtual printer is used to convert the document to be printed into printable information in the target format; The information to be printed is sent to a terminal using a virtual port, and the terminal is connected to a target physical printer that corresponds to the printer type information.
2. The method according to claim 1, further comprising: Receive device information from at least one physical printer from the terminal; Based on the device information of the at least one physical printer, establish the at least one virtual printer.
3. The method according to claim 1 or 2, wherein sending the information to be printed to the terminal using a virtual port includes: The information to be printed is sent to the virtual port, which can match virtual printers of different printer types. The data stream of the information to be printed received by the virtual port is collected using a port monitor; The collected data stream is sent to the terminal in real time.
4. The method according to claim 1, wherein converting the file to be printed into printable information in the target format using the target virtual printer includes: The printer type corresponding to the printer type information is determined as the target type. The file to be printed is converted into printable information in a first target format, where the first target format is the format corresponding to the target virtual printer.
5. The method according to claim 4, further comprising: If the printer type corresponding to the printer type information is determined to be different from the target type, the file to be printed is converted into the print information in the second target format, which is a format that supports file splitting and can be printed by multiple physical printers.
6. The method according to claim 5, wherein sending the information to be printed to the terminal using a virtual port includes: The information to be printed in the second target format is grouped by page to obtain at least one sub-file to be sent; The at least one sub-file to be sent is sent to the terminal in parallel using multiple threads.
7. A printing method, the method comprising: Send trigger information to the cloud, the trigger information being used to trigger a print request in the cloud; Receive printable information in the target format from the cloud; According to the target format, select a target physical printer from at least one physical printer connected to the terminal; The information to be printed is printed using the target physical printer.
8. The method according to claim 7, further comprising: Send device information of at least one physical printer to the cloud. The device information is used to establish at least one virtual printer in the cloud. The virtual printer is used to convert the document to be printed into a target format corresponding to the virtual printer's own device type.
9. An electronic device, comprising: At least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform: A print request is obtained based on terminal-triggered information, the print request including printer type information; a target virtual printer is identified from at least one virtual printer according to the print request, the target virtual printer corresponding to the printer type information; the file to be printed is converted into printable information in a target format using the target virtual printer; the printable information is sent to the terminal using a virtual port, the terminal being connected to a target physical printer corresponding to the printer type information; or, Send trigger information to the cloud, the trigger information being used to trigger a print request on the cloud; receive printable information in a target format from the cloud; select a target physical printer from at least one physical printer connected to the terminal according to the target format; and print the printable information using the target physical printer.
10. A non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform: A print request is obtained based on terminal-triggered information, the print request including printer type information; a target virtual printer is identified from at least one virtual printer according to the print request, the target virtual printer corresponding to the printer type information; the file to be printed is converted into printable information in a target format using the target virtual printer; The information to be printed is sent to a terminal using a virtual port, and the terminal is connected to a target physical printer that corresponds to the printer type information. or, Send trigger information to the cloud, the trigger information being used to trigger a print request in the cloud; receive printable information in a target format from the cloud; select a target physical printer from at least one physical printer connected to the terminal according to the target format; The information to be printed is printed using the target physical printer.
