Printing method and electronic device
By establishing a virtual channel between the virtual operating system of an electronic device and the host operating system, and directly calling the virtual operating system's printing service to send printing tasks to the host operating system's printing service, it solves the problem of excessive virtual container resources occupancy when printing across systems, and improves the user experience.
Patent Information
- Application Number
- PCT/CN2024/098271
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-08-30
- Filing Date
- 2024-06-07
- Publication Date
- 2025-03-06
AI Technical Summary
The prior art occupies too much virtual container resources when printing across systems, resulting in poor user experience.
By establishing a virtual channel between the virtual operating system of the electronic device and the host operating system, directly calling the virtual operating system's printing service to send printing tasks to the host operating system's printing service, simplifying the communication process and reducing the use of virtual container resources.
Improves the fluency and user experience of cross-system printing, reduces the use of virtual container resources, and makes the target application not need to be customized to this solution.
Smart Images

Figure CN2024098271_06032025_PF_FP_ABST
Abstract
Description
Printing method and electronic device
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on August 29, 2023, with application number 202311102917.8 and application name “Printing method and electronic device”, as well as priority to the Chinese patent application filed with the State Intellectual Property Office on August 30, 2023, with application number 202311128862.8 and application name “Printing method and electronic device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of printing technology, and in particular to a printing method and electronic equipment. Background Art
[0003] In some compatible scenarios, virtualization technology can be used to run applications of other operating systems on the operating system of an electronic device, for example, running Linux applications on the HarmonyOS operating system.
[0004] At present, the printer drivers provided by most printer manufacturers are for some commonly used operating systems, such as Hongmeng operating system and Windows operating system, but do not provide printer drivers based on the Linux operating system. Therefore, in the above compatibility scenarios, Linux applications usually need to use the host machine's printing function across systems.
[0005] However, the current cross-system printing method will occupy more resources of the virtual container, resulting in a poor user experience when printing across systems.
[0006] Summary of the Invention
[0007] In view of this, the present disclosure provides a printing method and electronic device to reduce virtual container resources occupied by cross-system printing and improve the user experience when printing across systems.
[0008] To achieve the above objectives, in a first aspect, embodiments of this specification provide a printing method, applied to an electronic device, the electronic device including a host operating system and a virtual operating system deployed in a virtual container of the host operating system, the printing method comprising:
[0009] In response to a print request operation acting on a target application, calling a first print service to send a print task to a second print service through a virtual channel; wherein the target application is an application in the virtual operating system, the first print service is a print service in the virtual operating system, and the second print service is a print service in the host operating system;
[0010] A print instruction is sent to a target printer through the second print service according to the print task.
[0011] In the printing method provided in the embodiments of this specification, the electronic device directly calls the first printing service of the virtual operating system in response to the print request operation acting on the target application, and sends the print task to the second printing service of the host operating system through the virtual channel. In this way, there is no need to perform port monitoring, forwarding the print task, and communicating with the second printing service to obtain a printer list before sending the print task. Instead, direct communication is performed between the first printing service of the virtual operating system and the second printing service of the host operating system through the virtual channel, thereby simplifying the communication process between the first printing service and the second printing service, reducing the occupancy of virtual container resources, enabling users to perform cross-system printing more smoothly, improving user experience, and the target application does not need to be customized and adapted for the solution of this specification.
[0012] In a possible implementation of the first aspect, the print request operation includes: a first print interface trigger operation and a first print control operation acting on the first print interface; the first print interface trigger operation is used to trigger the display of the first print interface, and the printer in the printer options displayed in the first print interface is different from the printer connected to the host operating system.
[0013] Through the above implementation, the application in the virtual operating system no longer needs to communicate with the print service in the host operating system to obtain a printer list, thereby reducing the number of cross-system communications during cross-system printing, reducing the occupation of virtual container resources, and thus improving the user experience during cross-system printing.
[0014] In a possible implementation of the first aspect, sending a print instruction to a target printer through the second print service according to the print task includes:
[0015] In the host operating system, a second printing interface is displayed according to the printing task, where the second printing interface is used for the user to select a target printer;
[0016] In response to the second print control operation performed on the second print interface, a print instruction is sent to the target printer through the second print service.
[0017] Through the above implementation, users can independently select printers, thereby further improving the user's cross-system printing experience without excessively occupying virtual container resources.
[0018] In a possible implementation of the first aspect, the second printing interface includes a preview window, and the preview window is used to display the target file to be printed.
[0019] Through the above implementation, the user can view the target file to be printed in the preview window of the second printing interface and check the printing parameters set for the target file to be printed in the target application.
[0020] In a possible implementation of the first aspect, the second print control operation is an operation of clicking a print button in the second print interface.
[0021] Through the above implementation, when the user has no special requirements for the printer, the user can print the target file by directly clicking the print button in the second printing interface.
[0022] In a possible implementation manner of the first aspect, the second print control operation includes an operation of selecting a target printer in the second print interface.
[0023] Through the above embodiment, the user can independently select the desired printer.
[0024] In a possible implementation of the first aspect, the second print control operation includes an operation of setting print parameters in the second print interface.
[0025] Through the above implementation, when the user wants to modify the printing parameters, he or she can directly reset the printing parameters to be modified in the second printing interface without deleting the current printing task and creating another one.
[0026] In a possible implementation of the first aspect, the print task includes print file information and print parameters, and the print parameters do not include a printer identifier.
[0027] Through the above implementation, the printing parameters to be transmitted can be reduced, the amount of data transmitted across systems can be reduced, and communication resources can be saved.
[0028] In a possible implementation of the first aspect, the print file information includes a target file to be printed.
[0029] Through the above implementation, the target file to be printed can be directly sent to the host operating system, thereby simplifying the communication process between the virtual operating system and the host operating system and reducing the occupation of virtual container resources.
[0030] In a possible implementation of the first aspect, the print file information includes a storage path of a target file to be printed.
[0031] Through the above implementation, only the storage path of the target file to be printed can be transmitted without transmitting the target file to be printed itself. In this way, the amount of data transmitted will be much smaller, thereby reducing the size of data transmitted by the first printing service and the second printing service through the virtual channel, saving communication resources, further improving the smoothness of cross-system printing, and enhancing user experience.
[0032] In a possible implementation of the first aspect, sending a print instruction to a target printer through the second print service according to the print task includes:
[0033] Mount the storage path of the target file to be printed to the set directory on the host operating system;
[0034] Read the target file to be printed in the set directory;
[0035] According to the target file to be printed and the printing parameters, a printing instruction is sent to the target printer through the second printing service.
[0036] Through the above implementation, the target file to be printed can be read directly on the host operating system without transmitting the target file to be printed through the virtual channel, thereby simplifying the process of reading the target file to be printed on the virtual operating system and improving the smoothness of cross-system printing.
[0037] In a possible implementation of the first aspect, the virtual operating system includes at least one of a Linux operating system, a Unix operating system, and a macOS operating system.
[0038] Through the above implementation, the present solution can support cross-system compatibility scenarios when the virtual operating system is a Linux operating system, a Unix operating system, and a macOS operating system, thereby expanding the application scope of the present solution.
[0039] In a possible implementation of the first aspect, the virtual operating system is a Linux operating system, and the first printing service is a printing system service cupsd.
[0040] In the above implementation, since cupsd can support print requests of most applications in the Linux operating system, this solution can support more Linux applications and expand the application scope of this solution.
[0041] In a possible implementation of the first aspect, the host operating system includes at least one of a Hongmeng operating system, a Windows operating system, and an Android operating system.
[0042] Through the above implementation method, this solution can support cross-system compatibility scenarios when the host operating system is HarmonyOS, Windows operating system and Android operating system, thereby expanding the application scope of this solution.
[0043] In a possible implementation of the first aspect, the host operating system is HarmonyOS, and the second printing service is Huawei Print.
[0044] In the above implementation, since Huawei Print can support a wide range of printing parameter options, when there are fewer printing parameter options in the application in the virtual operating system, users can use Huawei Print to set richer printing parameters, thereby improving the user experience.
[0045] In a possible implementation of the first aspect, the virtual channel is an RDP communication channel.
[0046] In the above implementation, since the RDP communication channel can support cross-system communication between most operating systems, the solution can support more cross-system compatibility scenarios and expand the application scenarios of the solution.
[0047] In a possible implementation of the first aspect, the RDP communication channel includes a server and a client, the server is installed on the virtual operating system, and the client is installed on the host operating system.
[0048] In a possible implementation of the first aspect, calling the first print service to send the print task to the second print service through the virtual channel includes:
[0049] Calling the target backend in the cupsd to send the print task to the server end of the RDP communication channel;
[0050] Calling the server of the RDP communication channel to send the print task to the client of the RDP communication channel;
[0051] The client that calls the RDP communication channel sends the print task to the second print service.
[0052] In a second aspect, an embodiment of the present specification provides a printing device, which is applied to an electronic device, wherein the electronic device includes a host operating system and a virtual operating system deployed in a virtual container of the host operating system, the printing device comprising:
[0053] A first sending module is configured to, in response to a print request operation applied to a target application, call a first print service to send a print task to a second print service through a virtual channel; wherein the target application is an application in the virtual operating system, the first print service is a print service in the virtual operating system, and the second print service is a print service in the host operating system;
[0054] A second sending module is configured to send a print instruction to a target printer through the second print service according to the print task.
[0055] As an optional embodiment, the print request operation includes: a first print interface trigger operation and a first print control operation acting on the first print interface; the first print interface trigger operation is used to trigger the display of the first print interface, and the printer in the printer options displayed in the first print interface is different from the printer connected to the host operating system.
[0056] As an optional implementation manner, the second sending module is specifically configured to:
[0057] In the host operating system, a second printing interface is displayed according to the printing task, and the second printing interface is used for the user to select a target printer; in response to a second printing control operation acting on the second printing interface, a printing instruction is sent to the target printer through the second printing service.
[0058] As an optional implementation, the second printing interface includes a preview window, and the preview window is used to display the target file to be printed.
[0059] As an optional implementation, the second print control operation is an operation of clicking a print button in the second print interface.
[0060] As an optional implementation manner, the second print control operation includes an operation of selecting a target printer in the second print interface.
[0061] As an optional implementation, the second print control operation includes an operation of setting print parameters in the second print interface.
[0062] As an optional implementation, the print task includes print file information and print parameters, and the print parameters do not include a printer identifier.
[0063] As an optional implementation manner, the print file information includes a target file to be printed.
[0064] As an optional implementation, the print file information includes a storage path of the target file to be printed.
[0065] As an optional implementation manner, the first sending module is specifically configured to:
[0066] Mount the storage path of the target file to be printed to the set directory on the host operating system;
[0067] Read the target file to be printed in the set directory;
[0068] According to the target file to be printed and the printing parameters, a printing instruction is sent to the target printer through the second printing service.
[0069] As an optional implementation, the virtual operating system includes at least one of a Linux operating system, a Unix operating system, and a macOS operating system.
[0070] As an optional implementation, the virtual operating system is a Linux operating system, and the first printing service is a printing system service cupsd.
[0071] As an optional implementation, the host operating system includes at least one of Hongmeng operating system, Windows operating system and Android operating system.
[0072] As an optional implementation, the host operating system is HarmonyOS, and the second printing service is Huawei Print.
[0073] As an optional implementation, the virtual channel is an RDP communication channel.
[0074] As an optional implementation, the RDP communication channel includes a server and a client, the server is installed on the virtual operating system, and the client is installed on the host operating system.
[0075] As an optional implementation manner, the first printing service is cupsd, and the first sending module is specifically configured to:
[0076] Calling the target backend in the cupsd to send the print task to the server end of the RDP communication channel;
[0077] Calling the server of the RDP communication channel to send the print task to the client of the RDP communication channel;
[0078] The client that calls the RDP communication channel sends the print task to the second print service.
[0079] In a third aspect, an embodiment of this specification provides an electronic device, comprising: a memory and a processor, wherein the memory is used to store a computer program; and the processor is used to execute the method described in the first aspect or any embodiment of the first aspect when calling the computer program.
[0080] In a fourth aspect, an embodiment of this specification provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect or any embodiment of the first aspect.
[0081] In a fifth aspect, an embodiment of this specification provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the method described in the first aspect or any embodiment of the first aspect.
[0082] In a sixth aspect, embodiments of this specification provide a chip system, comprising a processor coupled to a memory, the processor executing a computer program stored in the memory to implement the method described in the first aspect or any embodiment of the first aspect. The chip system may be a single chip or a chip module composed of multiple chips.
[0083] It can be understood that the beneficial effects of the second to sixth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0084] FIG1 is a schematic diagram of a flow chart of a printing method provided in an embodiment of this specification;
[0085] FIG2 is a schematic diagram of a first printing interface provided in an embodiment of this specification;
[0086] FIG3 is a schematic diagram of a printing process provided in an embodiment of this specification;
[0087] FIG4 is a schematic diagram of a printing process provided by another embodiment of this specification;
[0088] FIG5 is a schematic diagram of a second printing interface provided in an embodiment of this specification;
[0089] FIG6 is a schematic diagram of a second printing interface provided in another embodiment of this specification;
[0090] FIG7 is a schematic diagram of a second printing interface provided in yet another embodiment of this specification;
[0091] FIG8 is a schematic diagram of a print task list provided in an embodiment of this specification;
[0092] FIG9 is a schematic diagram of the software architecture of an electronic device provided in an embodiment of this specification;
[0093] FIG10 is a schematic diagram of the structure of a printing device provided in an embodiment of this specification;
[0094] FIG11 is a schematic diagram of the structure of an electronic device provided in an embodiment of this specification. DETAILED DESCRIPTION
[0095] The following describes the embodiments of this specification in conjunction with the accompanying drawings. The terms used in the implementation methods of the embodiments of this specification are only used to explain the specific embodiments of this specification and are not intended to limit this specification. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0096] Compatibility scenarios generally refer to running applications of other operating systems on the operating system of an electronic device, for example, running applications of the Linux operating system on the Harmony operating system and the Windows operating system through virtualization technology.
[0097] In these compatibility scenarios, by adapting basic display and keyboard input, mouse input and other modules, users can operate applications of other operating systems just like operating applications of the host operating system, thereby achieving ecological compatibility of the operating system.
[0098] In some cases, applications on these other operating systems need to connect to a printer for printing. However, the printer drivers provided by most printer manufacturers are for some operating systems commonly used by users, such as Hongmeng operating system and Windows operating system, and rarely provide printer drivers based on the Linux operating system. Therefore, in this case, Linux applications usually need to use the printing function of the host machine (that is, the electronic device) across systems.
[0099] When a Linux application uses the printing function of an electronic device across systems, it can first communicate with the host operating system's print service across systems to obtain a list of printers for the user to select, and then send the print file to the system print service (cupsd) in the virtual container (i.e., the Linux operating system).
[0100] cupsd is a print management program developed based on the Common Unix operating system. cupsd can be applied to the Linux operating system.
[0101] cupsd can be used to receive and manage print files sent by various Linux applications. cupsd can put the received print files into a queue and send the print files to the corresponding printer.
[0102] Specifically, cupsd creates a print task based on the received print file and forwards it to the virtual print proxy service via the port monitored by the virtual printer. The virtual print proxy service then uses a virtual channel for cross-system communication to send the print file to the host operating system's print service. The host operating system's print service then selects a designated printer based on the print file for printing. However, this cross-system printing method consumes a large amount of virtual container resources, resulting in a poor user experience when printing across systems.
[0103] To this end, this specification provides a printing method to reduce the occupation of virtual container resources by cross-system printing and improve the user experience when printing across systems.
[0104] The printing method provided in the embodiments of this specification can be applied to electronic devices such as mobile phones, smart screens, tablets, and laptops. The electronic devices may include a host operating system and a virtual operating system deployed in a virtual container of the host operating system. The host operating system may be a Windows operating system, Hongmeng operating system, Android operating system, etc. The virtual operating system in the virtual container may be a Linux operating system, a Unix operating system, a macOS operating system, etc. For ease of explanation, the embodiments of this specification are described as follows: the electronic device is a tablet, the host operating system is Hongmeng operating system, and the virtual operating system is a Linux operating system.
[0105] FIG1 is a flow chart of a printing method provided in an embodiment of this specification. As shown in FIG1 , the printing method provided in this embodiment may include the following steps:
[0106] S110 : In response to a print request operation acting on a target application, call a first print service to send a print task to a second print service through a virtual channel.
[0107] The target application can be any application with a print function in the Linux operating system, such as Caligra Office, LibreOffice, etc.
[0108] When a user wants to print a file through a target application, he or she can enter a print request operation, where the print request operation can include one or more sub-operations. For example, the target application can provide a quick print option. After the user clicks the option (i.e., the print request operation), it can trigger the electronic device to perform cross-system printing.
[0109] It is understandable that users can input operations through external devices such as keyboards and mice, or through touch input operations; the operations input by users on electronic devices are not limited to click operations, but can also be voice control operations or gesture operations, etc. For the sake of convenience, the embodiments of this specification use click operations as an example for illustrative purposes.
[0110] In order to better meet user needs, the target application may also provide a printing interface (hereinafter referred to as the first printing interface) for users to set printing parameters. Correspondingly, the print request operation may include an operation for triggering the electronic device to display the first printing interface (here referred to as the first printing interface trigger operation) and a first printing control operation acting on the first printing interface.
[0111] The first print interface triggering operation may be an operation of clicking a print option in a target application.
[0112] The first printing interface may be as shown in FIG2 , including printing setting options such as basic setting options, page range options, page size options, page setting options, a print preview window, and a print button.
[0113] It will be understood that the user interface shown in the embodiment of the present application is merely an example and is not intended to limit the present application. In some embodiments, the user interface displayed by the electronic device may include more or fewer interface elements than shown in the figure to implement more or fewer functions; the position of each interface element may be adjusted as needed; each function may also be implemented using other interface elements, or may also be implemented in other user interfaces, and this embodiment does not specifically limit this.
[0114] Basic setting options may include printer options, print quantity options, print color options, etc. Printer options are used to display selectable printers. In order to reduce the number of cross-system communications and reduce the occupation of virtual container resources, the target application does not communicate with the second print service of the host operating system across the system to obtain a list of printers connected to the second print service. Therefore, the printer options displayed in the basic setting options are not related to the printers connected to the host operating system. The printer displayed in the basic setting options can be a printer with a fixed name, for example, HwPrinter. Users can select the number of copies to be printed using the print quantity option and select color or black and white printing using the print color option.
[0115] Page range options include current page, all pages, current view, page number, and even / odd pages. Users can use page range options to select the page range to print. For example, users can choose to print the current page, all pages, current view, or customize the page numbers to print. In addition, users can further choose to print odd or even pages.
[0116] Page size options include Fit to Margins, Actual Size, Reduce Oversized Pages, and Custom Scale. You can select Fit to Margins to automatically adjust the margins, Actual Size to print at the actual size of the document, Reduce Oversized Pages to reduce oversized pages before printing, and Custom Scale to set the page scale as needed.
[0117] Page setup options include margin options and paper orientation options. Users can use margin options to select appropriate margins, and use paper orientation options to set whether the printed paper is placed horizontally or vertically.
[0118] The print preview window can display the target file to be printed. The user can use the print preview window to visually check whether the print format of the target file to be printed meets expectations.
[0119] The first print control operation may be an operation in which the user directly clicks the print button in the first print interface, or an operation in which the user first selects from various print options in the first print interface and then clicks the print button.
[0120] In response to a print request operation, the electronic device may call a first print service in the virtual operating system to send a print task to a second print service through a virtual channel.
[0121] When the virtual operating system is a Linux operating system, the first print service can be cupsd. When the host operating system is a Hongmeng operating system, the second print service can be Huawei Print. The virtual channel can be a virtual channel for interaction based on the Remote Desktop Protocol (RDP), the Remote FrameBuffer (RFB), the Independent Computing Architecture (ICA), the Command Line Interface Remote Management Protocol (SSH), etc. In the embodiments of this specification, the first print service is cupsd, the second print service is Huawei Print, and the virtual channel is an RDP communication channel.
[0122] Because the RDP communication channel supports cross-system communication between most operating systems, this solution can support more cross-system compatibility scenarios and expand its application scope. The RDP communication channel can include a server and a client. The server can be installed on the virtual operating system, and the client can be installed on the host operating system.
[0123] The specific printing process can be shown in Figure 3. The electronic device can respond to the target application in the Linux operating system to issue a print request, call the target backend in cupsd, and send a print task to the server of the RDP communication channel. After receiving the print task, the server of the RDP communication channel can send the print task to the client of the RDP communication channel on the Harmony operating system. After receiving the print task, the client of the RDP communication channel can forward the print task to Huawei Print (i.e., the second printing service).
[0124] Since the target backend directly sends the print task to the second print service of the host operating system through the RDP communication channel, it does not perform port monitoring, forward the print task, or communicate with the second print service to obtain a printer list before sending the print task. This simplifies the communication process between the first print service and the second print service, reduces the occupation of virtual container resources, enables users to perform cross-system printing more smoothly, improves the user experience, and the target application does not need to be customized and adapted for the solution of this specification.
[0125] The print request may include a target file to be printed. After receiving the print request, cupsd may first store the target file to be printed in a set location on the Linux operating system, and then generate a print task according to the print request.
[0126] A print task may include print file information and print parameters. The print file information may be the target file to be printed by the user, so that the target file to be printed can be directly sent to the host operating system, thereby simplifying the communication process between the virtual operating system and the host operating system and reducing the occupation of virtual container resources. The format of the target file to be printed may be PDF, image, etc. The print parameters may be generated based on the print options selected by the user in the first print interface. For example, if the user selects to print 3 copies and black and white printing in the print options of the first print interface, the print parameters may include the number of copies and the print color, etc.
[0127] In some embodiments, the print file information can also be the storage path of the target file to be printed. As shown in Figure 4, cupsd can send the storage path and print parameters of the target file to be printed to the server end of the RDP communication channel via the backend. Compared to transmitting the print file via the RDP communication channel, transmitting the storage path of the target file to be printed requires much less data. This can reduce the amount of data transmitted by the first and second print services via the RDP communication channel, conserving communication resources, further improving the smoothness of cross-system printing, and enhancing the user experience.
[0128] Because the printing parameters correspond to the user's selections from the various printing options in the first printing interface, and the printer options displayed in the first printing interface are unrelated to the printers connected to the host operating system, the printing parameters do not need to include a printer identifier. The printer identifier can be a printer ID, name, SN number, etc.
[0129] S120: Send a print instruction to a target printer through a second print service according to the print task.
[0130] When the print file information in the print task is a target file to be printed, the electronic device can directly randomly select an idle printer connected to the second print service according to the print task, and send a print instruction to the idle printer.
[0131] When the print file information in the print task is the storage path of the target file to be printed, the electronic device can mount the storage path of the target file to be printed on the virtual operating system to the set directory on the host operating system, so that the second printing service can directly read the target file to be printed in the set directory on the host operating system, thereby simplifying the process of reading the target file to be printed on the virtual operating system and improving the fluency of cross-system printing.
[0132] After reading the target file to be printed, an idle printer connected to the second printing service may be randomly selected, and a print instruction may be sent to the idle printer according to the target file and the printing parameters in the print task.
[0133] In some embodiments, the electronic device may also first display a second printing interface according to the printing task in the host operating system, and then send a printing instruction to the target printer through the second printing service in response to a second printing control operation acting on the second printing interface.
[0134] The second printing interface can be shown in Figure 5, including a preview window and a print button. The preview window can display the target file to be printed. The user can intuitively check whether the printing format of the target file to be printed meets the expectations through the preview window. The corresponding second printing control operation can be the operation of the user clicking the print button in the second printing interface.
[0135] The second printing interface may also be shown in FIG6 , including a preview window, printer options, and a print button. In this way, the user can independently select a printer from the printer options in the second printing interface according to actual needs, and then click the print button to print. This can further improve the user's cross-system printing experience without occupying too many resources of the virtual container.
[0136] The second print interface may also include a preview window, printer options, print settings options, and a print button, as shown in FIG7 . The print settings options may include multiple options, such as the number of copies, print color, paper size, and paper type. Thus, when the user wishes to modify print parameters, they can directly reset the desired print parameters in the print settings options corresponding to the desired print parameters in the second print interface without having to delete the current print task and create another one.
[0137] The print setting options in the second print interface may be the same as the print setting options in the first print interface, or may include more or fewer print setting options than in the first print interface.
[0138] The specific parameters of each print setting option in the second print interface can be generated according to the print parameters in the print task received by the second print service. If a print option has no corresponding data in the print parameters, the specific parameters of the print option can be default values.
[0139] In some embodiments, the second print service can also display received print tasks in a print task list. Since the first print service directly sends print tasks to the second print service via the RDP communication channel without requiring any other communication with the second print service, upon receiving multiple print tasks, the second print service can directly send the multiple print tasks to the second print service of the host operating system, without first placing the multiple print tasks into a print queue and then waiting for the previous print tasks to complete before sending the next print task to the second print service. In this way, the user can see all created print tasks in the print task list corresponding to the second print service, rather than only seeing the current print task in the print task list corresponding to the second print service, thereby improving the user experience. In addition, print tasks do not need to wait in the virtual container's queue, further reducing resource consumption of the virtual container.
[0140] As shown in Figure 8, three print tasks are displayed in the print task list, and the three print tasks correspond to document 1, document 2 and document 3 respectively. The print task corresponding to document 1 is in the printing state, and the print tasks corresponding to document 2 and document 3 are in the processing and other printing states.
[0141] It should be noted that the above embodiments are exemplary and are not intended to limit this specification. Those skilled in the art can select and combine any of the above embodiments as needed, and any combination that does not depart from the essence of this specification falls within the scope of protection of this specification.
[0142] In the printing method provided in the embodiments of this specification, the electronic device directly calls the first printing service of the virtual operating system in response to the print request operation acting on the target application, and sends the print task to the second printing service of the host operating system through the virtual channel. In this way, there is no need to perform port monitoring, forwarding the print task, and communicating with the second printing service to obtain a printer list before sending the print task. Instead, direct communication is performed between the first printing service of the virtual operating system and the second printing service of the host operating system through the virtual channel, thereby simplifying the communication process between the first printing service and the second printing service, reducing the occupancy of virtual container resources, enabling users to perform cross-system printing more smoothly, improving user experience, and the target application does not need to be customized and adapted for the solution of this specification.
[0143] Based on the same concept, an embodiment of this specification also provides an electronic device, the software system of which can adopt a layered architecture, event-driven architecture, micro-kernel architecture, microservice architecture, or cloud architecture. This embodiment of the specification uses the layered architecture of the Hongmeng system as an example to illustrate the software structure of the electronic device.
[0144] Figure 9 is a schematic diagram of the software architecture of an electronic device provided in an embodiment of this specification. As shown in Figure 9, the software system of the host operating system of the electronic device can be divided into several layers. In some embodiments, the Hongmeng system can be divided into an application layer, an application framework layer, a Hongmeng runtime (Harmony runtime), a system library, and a kernel layer from top to bottom. The application layer may include applications such as the camera, gallery, calendar, call, WLAN, music, video, short message, and printing on the host operating system.
[0145] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0146] As shown in FIG9 , the application framework layer on the host operating system may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, a print manager, and the like.
[0147] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.
[0148] Content providers are used to store and retrieve data and make this data accessible to applications.
[0149] The view system includes visual controls, such as controls for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views.
[0150] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0151] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. For example, these can display text messages in the status bar, emit a sound, vibrate electronic devices, or flash indicator lights.
[0152] The Print Manager is used to install and configure printers, connect to network printers, check the status of print tasks, control the printing of files, etc.
[0153] Harmony runtime includes core libraries and a virtual machine. Harmony runtime is responsible for the scheduling and management of the Hongmeng system.
[0154] The core library consists of two parts: one is the functional functions that need to be called by the Java language, and the other is the core library of Hongmeng.
[0155] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.
[0156] The system library can include multiple functional modules, such as a surface manager, media libraries, a 3D graphics processing library (such as OpenGL ES), and a 2D graphics engine (such as SGL).
[0157] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
[0158] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0159] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0160] A 2D graphics engine is a drawing engine for 2D drawings.
[0161] The kernel layer is the layer between hardware and software. The kernel layer can include display drivers, camera drivers, audio drivers, and sensor drivers.
[0162] The software architecture of the virtual operating system in the virtual container is similar to that of the host operating system and will not be described in detail here.
[0163] Based on the same concept, as an implementation of the above method, an embodiment of this specification provides a printing device, which is applied to an electronic device, and the electronic device includes a host operating system and a virtual operating system deployed in a virtual container of the host operating system. The device embodiment corresponds to the above method embodiment. For ease of reading, the present device embodiment will no longer repeat the details of the above method embodiment one by one, but it should be clear that the device in this embodiment can correspond to and implement all the contents of the above method embodiment.
[0164] FIG10 is a schematic diagram of the structure of a printing device provided in an embodiment of this specification. As shown in FIG10 , the printing device provided in this embodiment includes:
[0165] The first system processing module 11 is configured to, in response to a print request operation applied to a target application, call a first print service to send a print task to a second print service through a virtual channel; wherein the target application is an application in the virtual operating system, the first print service is a print service in the virtual operating system, and the second print service is a print service in the host operating system;
[0166] The second system processing module 12 is configured to send a print instruction to a target printer through the second print service according to the print task.
[0167] As an optional embodiment, the print request operation includes: a first print interface trigger operation and a first print control operation acting on the first print interface; the first print interface trigger operation is used to trigger the display of the first print interface, and the printer in the printer options displayed in the first print interface is different from the printer connected to the host operating system.
[0168] As an optional implementation manner, the second system processing module 12 is specifically configured to:
[0169] In the host operating system, a second printing interface is displayed according to the printing task, and the second printing interface is used for the user to select a target printer; in response to a second printing control operation acting on the second printing interface, a printing instruction is sent to the target printer through the second printing service.
[0170] As an optional implementation, the second printing interface includes a preview window, and the preview window is used to display the target file to be printed.
[0171] As an optional implementation, the second print control operation is an operation of clicking a print button in the second print interface.
[0172] As an optional implementation manner, the second print control operation includes an operation of selecting a target printer in the second print interface.
[0173] As an optional implementation, the second print control operation includes an operation of setting print parameters in the second print interface.
[0174] As an optional implementation, the print task includes print file information and print parameters, and the print parameters do not include a printer identifier.
[0175] As an optional implementation manner, the print file information includes a target file to be printed.
[0176] As an optional implementation, the print file information includes a storage path of the target file to be printed.
[0177] As an optional implementation manner, the first sending module is specifically configured to:
[0178] Mount the storage path of the target file to be printed to the set directory on the host operating system;
[0179] Read the target file to be printed in the set directory;
[0180] According to the target file to be printed and the printing parameters, a printing instruction is sent to the target printer through the second printing service.
[0181] As an optional implementation, the virtual operating system includes at least one of a Linux operating system, a Unix operating system, and a macOS operating system.
[0182] As an optional implementation, the virtual operating system is a Linux operating system, and the first printing service is a printing system service cupsd.
[0183] As an optional implementation, the host operating system includes at least one of Hongmeng operating system, Windows operating system and Android operating system.
[0184] As an optional implementation, the host operating system is HarmonyOS, and the second printing service is Huawei Print.
[0185] As an optional implementation, the virtual channel is an RDP communication channel.
[0186] As an optional implementation, the RDP communication channel includes a server and a client, the server is installed on the virtual operating system, and the client is installed on the host operating system.
[0187] As an optional implementation manner, the first printing service is cupsd, and the first sending module is specifically configured to:
[0188] Calling the target backend in the cupsd to send the print task to the server end of the RDP communication channel;
[0189] Calling the server of the RDP communication channel to send the print task to the client of the RDP communication channel;
[0190] The client that calls the RDP communication channel sends the print task to the second print service.
[0191] The device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effects are similar, which will not be repeated here.
[0192] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this specification. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0193] Based on the same concept, an embodiment of this specification further provides an electronic device. Please refer to FIG11 , which is a schematic structural diagram of the electronic device provided in the embodiment of this specification.
[0194] The electronic device may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, a sensor module 280, a button 290, a motor 291, an indicator 292, a camera 293, a display screen 294, and a subscriber identification module (SIM) card interface 295, etc. The sensor module 280 may include a solid pressure sensor 280A, a gyroscope sensor 280B, an air pressure sensor 280C, a magnetic sensor 280D, an acceleration sensor 280E, a distance sensor 280F, a proximity light sensor 280G, a fingerprint sensor 280H, a temperature sensor 280J, a touch sensor 280K, an ambient light sensor 280L, a bone conduction sensor 280M, etc.
[0195] It is understood that the structures illustrated in the embodiments of the present application do not constitute specific limitations on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0196] The processor 210 may include one or more processing units. For example, the processor 210 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.
[0197] The controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals based on instruction operation codes and timing signals to complete the control of instruction fetching and execution.
[0198] Processor 210 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 210 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 210. If processor 210 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 210 latency, and thus improves system efficiency.
[0199] In some embodiments, the processor 210 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.
[0200] The I2C interface is a bidirectional synchronous serial bus consisting of a serial data line (SDA) and a serial clock line (SCL). The I2S interface can be used for audio communication. The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. The UART interface is a universal serial data bus used for asynchronous communication; this bus can be a bidirectional communication bus that converts the data to be transmitted between serial and parallel communication. The MIPI interface can be used to connect the processor 210 to peripheral devices such as the display 294 and the camera 293; MIPI interfaces include the camera serial interface (CSI) and the display serial interface (DSI). The GPIO interface can be configured through software and can be configured as either a control signal or a data signal. The USB interface 230 is an interface that complies with USB standards and can be specifically a Mini USB interface, a Micro USB interface, a USB Type-C interface, etc. The USB interface 230 can be used to connect a charger to charge the electronic device or to transfer data between the electronic device and peripheral devices. It can also be used to connect headphones to play audio through the headphones. This interface can also be used to connect other electronic devices, such as AR devices.
[0201] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is only for illustrative purposes and does not constitute a structural limitation on the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.
[0202] The charging management module 240 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 240 can receive charging input from the wired charger via the USB interface 230. In some wireless charging embodiments, the charging management module 240 can receive wireless charging input via the electronic device's wireless charging coil. While charging the battery 242, the charging management module 240 can also power the electronic device through the power management module 241.
[0203] The power management module 241 is used to connect the battery 242, the charging management module 240, and the processor 210. The power management module 241 receives input from the battery 242 and / or the charging management module 240 and provides power to the processor 210, the internal memory 221, the external memory, the display 294, the camera 293, and the wireless communication module 260. The power management module 241 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 241 can also be set in the processor 210. In other embodiments, the power management module 241 and the charging management module 240 can also be set in the same device.
[0204] The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, mobile communication module 250, wireless communication module 260, modem processor and baseband processor.
[0205] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in an electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.
[0206] The mobile communication module 250 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to electronic devices. The mobile communication module 250 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 250 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 250 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 250 can be set in the processor 210. In some embodiments, at least some of the functional modules of the mobile communication module 250 can be set in the same device as at least some of the modules of the processor 210.
[0207] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 270A, the receiver 270B, etc.) or displays an image or video through the display screen 294. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 210 and be set in the same device as the mobile communication module 250 or other functional modules.
[0208] The wireless communication module 260 can provide wireless communication solutions for electronic devices, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc. The wireless communication module 260 can be one or more devices that integrate at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 210. The wireless communication module 260 can also receive the signal to be sent from the processor 210, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0209] In some embodiments, antenna 1 of the electronic device is coupled to mobile communication module 250, and antenna 2 is coupled to wireless communication module 260, so that the electronic device can communicate with a network and other devices via wireless communication technologies. The wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time division-synchronous code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include global positioning system (GPS), global navigation satellite system (GNSS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS) and / or satellite based augmentation system (SBAS).
[0210] The electronic device implements display functionality through a GPU, display screen 294, and an application processor. A GPU is a microprocessor for image processing that connects display screen 294 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 210 may include one or more GPUs that execute program instructions to generate or modify display information.
[0211] Display screen 294 is used to display images, videos, etc. Display screen 294 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Mini LED, a Micro LED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device can include one or N display screens 294, where N is a positive integer greater than 1.
[0212] The electronic device can realize the shooting function through the ISP, the camera 293, the video codec, the GPU, the display 294 and the application processor.
[0213] The ISP processes data fed back by camera 293. Camera 293 is used to capture still images or videos. The digital signal processor processes digital signals, including digital image signals and other digital signals. The video codec compresses or decompresses digital video.
[0214] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU enables intelligent cognitive applications in electronic devices, such as image recognition, face recognition, speech recognition, and text comprehension.
[0215] The internal memory 221 can be used to store computer executable program codes, which include instructions. The processor 210 executes the instructions stored in the internal memory 221 to perform various functional applications and data processing of the electronic device.
[0216] The internal memory 221 may include a program storage area and a data storage area. The program storage area may store an operating system and at least one application required for a function (such as a sound playback function, an image playback function, etc.). The data storage area may store data created during the use of the electronic device (such as audio data, a phone book, etc.). In addition, the internal memory 221 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0217] The external memory interface 220 can be used to connect an external memory device, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 210 via the external memory interface 220 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0218] The electronic device can implement audio functions such as music playback and recording through the audio module 270, the speaker 270A, the receiver 270B, the microphone 270C, the headphone jack 270D, and the application processor.
[0219] The audio module 270 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 270 can also be used to encode and decode audio signals. In some embodiments, the audio module 270 can be set in the processor 210, or some functional modules of the audio module 270 can be set in the processor 210. The speaker 270A, also known as the "speaker", is used to convert audio electrical signals into sound signals. The receiver 270B, also known as the "earpiece", is used to convert audio electrical signals into sound signals. The microphone 270C, also known as the "microphone" or "microphone", is used to convert sound signals into electrical signals. The headphone jack 270D is used to connect wired headphones. The headphone jack 270D can be a USB interface 230, or it can be a 3.5mm open mobile terminal platform (OMTP) standard interface, or a standard interface of the Cellular Telecommunications Industry Association of the USA (CTIA).
[0220] The buttons 290 include a power button, a volume button, etc. The buttons 290 can be mechanical buttons. They can also be touch buttons. The electronic device can receive button inputs and generate key signal inputs related to the user settings and function controls of the electronic device. The motor 291 can generate vibration prompts. The motor 291 can be used for incoming call vibration prompts, or for touch vibration feedback. The indicator 292 can be an indicator light, which can be used to indicate the charging status, power changes, messages, missed calls, notifications, etc. The SIM card interface 295 is used to connect the SIM card. The SIM card can be inserted into the SIM card interface 295, or pulled out from the SIM card interface 295 to achieve contact and separation with the electronic device. The electronic device can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 295 can support Nano SIM cards, Micro SIM cards, SIM cards, etc.
[0221] The electronic device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effects are similar, which will not be repeated here.
[0222] An embodiment of this specification also provides a computer device, which includes a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to read the computer program to implement the method described in the above method embodiment.
[0223] The embodiments of this specification also provide a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method described in the above method embodiments is implemented.
[0224] The embodiments of this specification also provide a computer program product. When the computer program product is run on an electronic device, the electronic device implements the method described in the above method embodiments.
[0225] The present invention also provides a chip system, including a processor coupled to a memory, and executing a computer program stored in the memory to implement the method described in the above method embodiment. The chip system can be a single chip or a chip module composed of multiple chips.
[0226] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this specification are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted via the computer-readable storage medium. The computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated therein. The available medium may be a magnetic medium (e.g., a floppy disk, hard disk, or tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0227] Those skilled in the art will appreciate that all or part of the process steps in the above-described method embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program can include the process steps in the above-described method embodiments. The aforementioned storage medium can include various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
[0228] The naming or numbering of steps in this specification does not mean that the steps in the method flow must be executed in the time / logical sequence indicated by the naming or numbering. The execution order of the named or numbered process steps can be changed according to the technical purpose to be achieved, as long as the same or similar technical effects can be achieved.
[0229] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0230] In the embodiments provided in this specification, it should be understood that the disclosed devices / equipment and methods can be implemented in other ways. For example, the device / equipment embodiments described above are merely schematic. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0231] It should be understood that in the description of this application and the appended claims, the terms "comprises," "includes," "has," and any variations thereof are intended to cover non-exclusive inclusions and mean "including but not limited to," unless otherwise specifically emphasized. For example, a process, method, system, product, or apparatus that includes a series of steps or modules is not necessarily limited to those steps or modules explicitly listed, but may include other steps or modules not explicitly listed or inherent to the process, method, product, or apparatus.
[0232] In the description of this specification, unless otherwise specified, " / " indicates that the objects associated before and after are in an "or" relationship, for example, A / B can represent A or B; "and / or" in this specification is used to describe the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural.
[0233] Furthermore, in this specification, unless otherwise specified, "plurality" refers to two or more than two. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, "at least one of a, b, or c" can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or plural.
[0234] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0235] In addition, in the description of this application specification and the appended claims, the terms "first," "second," etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or precedence, nor should they be understood to indicate or imply relative importance or implicitly specify the number of technical features indicated. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein; and features specified as "first" or "second" may explicitly or implicitly include at least one of such features.
[0236] In the embodiments of this specification, words such as "exemplarily" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of this specification should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplarily" or "for example" is intended to present the relevant concepts in a concrete manner.
[0237] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with the embodiment is included in one or more embodiments of the specification. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in yet other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized.
[0238] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this specification, rather than to limit them. Although this specification has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this specification.
Claims
1. A printing method, applied to an electronic device, wherein the electronic device includes a host operating system and a virtual operating system deployed in a virtual container of the host operating system, characterized in that: include: In response to a print request operation acting on a target application, calling a first print service to send a print task to a second print service through a virtual channel; wherein the target application is an application in the virtual operating system, the first print service is a print service in the virtual operating system, and the second print service is a print service in the host operating system; A print instruction is sent to a target printer through the second print service according to the print task.
2. The method according to claim 1, characterized in that The print request operation includes: a first print interface trigger operation and a first print control operation acting on the first print interface; the first print interface trigger operation is used to trigger the display of the first print interface, and the printer in the printer options displayed in the first print interface is different from the printer connected to the host operating system.
3. The method according to claim 1 or 2, characterized in that: The printing task includes printing file information and printing parameters, and the printing parameters do not include a printer identifier.
4. The method according to claim 3, characterized in that The print file information includes a target file to be printed.
5. The method according to claim 3, characterized in that: The print file information includes a storage path of a target file to be printed.
6. The method according to claim 5, characterized in that The sending a print instruction to a target printer through the second print service according to the print task includes: Mount the storage path of the target file to be printed to the set directory on the host operating system; Read the target file to be printed in the set directory; According to the target file to be printed and the printing parameters, a printing instruction is sent to the target printer through the second printing service.
7. The method according to any one of claims 1 to 6, characterized in that: The virtual channel is a Remote Desktop Protocol RDP communication channel.
8. The method according to claim 7, characterized in that The RDP communication channel includes a server and a client, wherein the server is installed on the virtual operating system and the client is installed on the host operating system.
9. The method according to claim 8, characterized in that The first printing service is cupsd, and calling the first printing service to send a printing task to the second printing service through a virtual channel includes: Calling the target backend in the cupsd to send the print task to the server end of the RDP communication channel; The server of the RDP communication channel is called to send the print task to the client of the RDP communication channel; The client that calls the RDP communication channel sends the print task to the second print service.
10. The method according to any one of claims 1 to 9, characterized in that: The sending a print instruction to a target printer through the second print service according to the print task includes: In the host operating system, displaying a second printing interface according to the printing task, wherein the second printing interface is used for a user to select a target printer; In response to a second print control operation performed on the second print interface, a print instruction is sent to a target printer through the second print service.
11. The method according to claim 10, characterized in that The second printing interface includes a preview window, and the preview window is used to display the target file to be printed.
12. The method according to claim 10 or 11, characterized in that: The second print control operation is an operation of clicking a print button in the second print interface.
13. The method according to any one of claims 10 to 12, characterized in that: The second print control operation includes an operation of selecting a target printer in the second print interface.
14. The method according to any one of claims 10 to 13, characterized in that: The second printing control operation includes an operation of setting printing parameters in the second printing interface.
15. The method according to any one of claims 1 to 14, characterized in that: The virtual operating system includes at least one of a Linux operating system, a Unix operating system, and a macOS operating system.
16. The method according to claim 15, characterized in that The virtual operating system is a Linux operating system, and the first printing service is a printing system service cupsd.
17. The method according to any one of claims 1 to 16, characterized in that: The host operating system includes at least one of Hongmeng operating system, Windows operating system and Android operating system.
18. The method according to claim 17, characterized in that The host operating system is Hongmeng operating system, and the second printing service is Huawei printing.
19. An electronic device, characterized in that: include: A memory and a processor, wherein the memory is used to store a computer program; and the processor is used to execute the method according to any one of claims 1 to 18 when calling the computer program.
20. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 18 is implemented.
21. A computer program product, characterized in that When the computer program product runs on an electronic device, the electronic device is enabled to execute the method according to any one of claims 1 to 18.
22. A chip system, characterized in that: The chip system includes a processor, which is coupled to a memory, and the processor executes a computer program stored in the memory to implement the method according to any one of claims 1-18.
Citation Information
Patent Citations
Printing method and electronic equipment
CN119536666A
Print monitoring system and method for universal printer
CN103336923A
Printing control system and method and computing equipment
CN112181328A
Printing method based on Windows application virtualization
CN112612431A
Printing system, printing method and computing device
CN112764694A