Printing method and electronic equipment
By realizing direct communication between the virtual operating system and the host operating system on electronic devices, the printing service of the virtual operating system is directly called to send printing tasks to the printing service of the host operating system through the virtual channel, which solves the problem of excessive virtual container resources occupancy when printing across systems and improves the user experience.
Patent Information
- Application Number
- CN202311128862.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-08-29
- Filing Date
- 2023-08-30
- Publication Date
- 2025-02-28
AI Technical Summary
The prior art occupies too much virtual container resources when printing across systems, resulting in poor user experience.
By realizing direct communication between the virtual operating system and the host operating system on the electronic device, the printing service of the virtual operating system is directly called and the printing service of the virtual operating system sends printing tasks to the printing service of the host operating system through the virtual channel, reducing the use of virtual container resources.
It simplifies the communication process between printing services, reduces the use of virtual container resources, and improves the user experience of cross-system printing.
Smart Images

Figure CN119536666A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of printing technology, and in particular to a printing method and electronic equipment. Background Art
[0002] 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 Hongmeng operating system.
[0003] At present, 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, 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.
[0004] 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. Summary of the invention
[0005] In view of this, the present specification provides a printing method and an electronic device to reduce virtual container resources occupied by cross-system printing and improve the user experience when printing across systems.
[0006] In order to achieve the above-mentioned purpose, in a first aspect, an embodiment of this specification provides a printing method, 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, and the printing method includes:
[0007] 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;
[0008] A print instruction is sent to a target printer through the second print service according to the print task.
[0009] In the printing method provided in the embodiments of the present 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 print tasks, 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, allowing 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 the present specification.
[0010] 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 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.
[0011] 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.
[0012] 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:
[0013] 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;
[0014] 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.
[0015] Through the above implementation, the user can independently select a printer, thereby further improving the user's cross-system printing experience without occupying too many resources of the virtual container.
[0016] 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.
[0017] 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.
[0018] In a possible implementation manner of the first aspect, the second print control operation is an operation of clicking a print button in the second print interface.
[0019] 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.
[0020] 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.
[0021] Through the above implementation, the user can independently select the desired printer.
[0022] In a possible implementation manner of the first aspect, the second printing control operation includes an operation of setting printing parameters in the second printing interface.
[0023] Through the above implementation, when the user wants to modify the printing parameters, he can directly reset the printing parameters he wants to modify in the second printing interface without deleting the current printing task and creating another one.
[0024] 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.
[0025] Through the above implementation, it is possible to reduce the transmitted printing parameters, reduce the amount of data transmitted across systems, and save communication resources.
[0026] In a possible implementation of the first aspect, the print file information includes a target file to be printed.
[0027] 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.
[0028] In a possible implementation of the first aspect, the print file information includes a storage path of a target file to be printed.
[0029] 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 fluency of cross-system printing, and improving user experience.
[0030] 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:
[0031] Mount the storage path of the target file to be printed to the set directory on the host operating system;
[0032] Read the target file to be printed in the set directory;
[0033] 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.
[0034] Through the above implementation, the target file to be printed can be directly read 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.
[0035] 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.
[0036] 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.
[0037] 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.
[0038] In the above implementation, since cupsd can support printing requests of most applications in the Linux operating system, the solution can support more Linux applications and expand the application scope of the solution.
[0039] 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.
[0040] Through the above implementation methods, the present solution can support cross-system compatibility scenarios when the host operating system is Hongmeng operating system, Windows operating system and Android operating system, thereby expanding the application scope of the present solution.
[0041] In a possible implementation of the first aspect, the host operating system is Hongmeng operating system, and the second printing service is Huawei printing.
[0042] In the above implementation, since Huawei Print can support rich printing parameter options, when there are fewer printing parameter options in the application in the virtual operating system, the user can use Huawei Print to set richer printing parameters, thereby improving the user experience.
[0043] In a possible implementation of the first aspect, the virtual channel is an RDP communication channel.
[0044] 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.
[0045] 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.
[0046] In a possible implementation of the first aspect, calling the first printing service to send a printing task to the second printing service through a virtual channel includes:
[0047] Calling the target backend in the cupsd to send the print task to the server of the RDP communication channel;
[0048] The server of the RDP communication channel is called to send the print task to the client of the RDP communication channel;
[0049] The client that calls the RDP communication channel sends the print task to the second print service.
[0050] 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, and the printing device includes:
[0051] A first sending module: used for responding 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;
[0052] A second sending module is used to send a print instruction to a target printer through the second print service according to the print task.
[0053] As an optional implementation, 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 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.
[0054] As an optional implementation manner, the second sending module is specifically configured to:
[0055] 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.
[0056] 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.
[0057] As an optional implementation, the second print control operation is an operation of clicking a print button in the second print interface.
[0058] As an optional implementation, the second print control operation includes an operation of selecting a target printer in the second print interface.
[0059] As an optional implementation, the second printing control operation includes an operation of setting printing parameters in the second printing interface.
[0060] As an optional implementation, the printing task includes printing file information and printing parameters, and the printing parameters do not include a printer identifier.
[0061] As an optional implementation manner, the print file information includes a target file to be printed.
[0062] As an optional implementation, the print file information includes a storage path of a target file to be printed.
[0063] As an optional implementation manner, the first sending module is specifically configured to:
[0064] Mount the storage path of the target file to be printed to the set directory on the host operating system;
[0065] Read the target file to be printed in the set directory;
[0066] 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.
[0067] 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.
[0068] As an optional implementation, the virtual operating system is a Linux operating system, and the first printing service is a printing system service cupsd.
[0069] As an optional implementation, the host operating system includes at least one of Hongmeng operating system, Windows operating system and Android operating system.
[0070] As an optional implementation, the host operating system is Hongmeng operating system, and the second printing service is Huawei printing.
[0071] As an optional implementation, the virtual channel is an RDP communication channel.
[0072] 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.
[0073] As an optional implementation manner, the first printing service is cupsd, and the first sending module is specifically used for:
[0074] Calling the target backend in the cupsd to send the print task to the server of the RDP communication channel;
[0075] The server of the RDP communication channel is called to send the print task to the client of the RDP communication channel;
[0076] The client that calls the RDP communication channel sends the print task to the second print service.
[0077] In a third aspect, an embodiment of this specification provides an electronic device, comprising: a memory and a processor, the memory being used to store a computer program; the processor being used to execute the method described in the first aspect or any one of the implementations of the first aspect when calling the computer program.
[0078] In a fourth aspect, an embodiment of this specification provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method described in the first aspect or any one of the implementations of the first aspect is implemented.
[0079] 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 implementation method of the first aspect.
[0080] In a sixth aspect, an embodiment of this specification provides a chip system, including a processor, the processor is coupled to a memory, and the processor executes 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 can be a single chip or a chip module composed of multiple chips.
[0081] 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
[0082] Figure 1 A schematic diagram of a printing method provided in an embodiment of this specification;
[0083] Figure 2 A schematic diagram of a first printing interface provided in an embodiment of this specification;
[0084] Figure 3 A schematic diagram of a printing process provided in an embodiment of this specification;
[0085] Figure 4 A schematic diagram of a printing process provided in another embodiment of this specification;
[0086] Figure 5 A schematic diagram of a second printing interface provided in an embodiment of this specification;
[0087] Figure 6 A schematic diagram of a second printing interface provided in another embodiment of the present specification;
[0088] Figure 7 A schematic diagram of a second printing interface provided in yet another embodiment of the present specification;
[0089] Figure 8A schematic diagram of a print task list provided in an embodiment of this specification;
[0090] Fig. 9 A schematic diagram of the software architecture of an electronic device provided in an embodiment of this specification;
[0091] Fig.10 A schematic diagram of the structure of a printing device provided in an embodiment of this specification;
[0092] Fig.11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this specification. DETAILED DESCRIPTION
[0093] The embodiments of this specification are described below in conjunction with the drawings in the embodiments of this specification. The terms used in the implementation method part 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.
[0094] 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 Hongmeng operating system and the Windows operating system through virtualization technology.
[0095] 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.
[0096] In some cases, applications on these other operating systems need to connect to a printer for printing operations. 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 (i.e., electronic device) across systems.
[0097] 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 choose from, and then send print files to the system print service (cupsd) in the virtual container (ie, the Linux operating system).
[0098] cupsd is a print management program developed based on the Common Unix operating system. cupsd can be applied to the Linux operating system. 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.
[0099] Specifically, cupsd can create a print task based on the received print file, and forward the print task to the virtual print proxy service through the port monitored by the virtual printer. The virtual print proxy service then uses the virtual channel to communicate across systems to send the print file to the print service of the host operating system. Finally, the print service of the host operating system selects a designated printer for printing based on the print file. However, this cross-system printing method will occupy more resources of the virtual container, resulting in a poor user experience when printing across systems.
[0100] 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.
[0101] 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, a Hongmeng operating system, an Android operating system, etc., and 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 take the electronic device as a tablet, the host operating system as the Hongmeng operating system, and the virtual operating system as the Linux operating system as an example for exemplary explanation.
[0102] Figure 1 A schematic diagram of a printing method provided in an embodiment of this specification, such as Figure 1 As shown, the printing method provided in this embodiment may include the following steps:
[0103] 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.
[0104] The target application can be any application with a print function in the Linux operating system, such as Caligra Office, LibreOffice, etc.
[0105] When a user wants to print a file through a target application, he or she may input a print request operation, where the print request operation may include one or more sub-operations. For example, the target application may provide a quick print option. After the user clicks on the option (ie, the print request operation), it may trigger the electronic device to perform cross-system printing.
[0106] 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 ease of explanation, the embodiments of this specification use click operations as an example for illustrative explanation.
[0107] 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.
[0108] The first print interface triggering operation may be an operation of clicking a print option in a target application.
[0109] The first printing interface can be Figure 2 As shown, it includes print setting options such as basic setting options, page range options, page size options, page setup options, as well as a print preview window and a print button.
[0110] 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 in other user interfaces, and this embodiment does not specifically limit this.
[0111] 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 prints to be printed through the print quantity option, and select color or black and white printing through the print color option.
[0112] Page range options include current page options, all pages options, current view options, page number options, and odd and even page options. Users can select the page range to be printed through page range options. For example, users can choose to print the current page, print all pages, print the current view, or customize the page numbers to be printed. In addition, users can further choose to print odd or even pages in the page numbers.
[0113] Page size options can include Fit to Margins, Actual Size, Reduce Oversized Pages, and Custom Scale. Users can select Fit to Margins to automatically adjust the print margins, or Actual Size to print according to the actual size of the file, or Reduce Oversized Pages to reduce oversized pages before printing, or Custom Scale to set the page scale according to actual needs.
[0114] Page setup options can include margin options and paper orientation options. Users can select appropriate margins through margin options, and set whether the printed paper is placed horizontally or vertically through paper orientation options.
[0115] The print preview window can display the target file to be printed, and the user can intuitively check whether the print format of the target file to be printed meets expectations through the print preview window.
[0116] The first print control operation may be an operation in which the user directly clicks a print button in the first print interface, or may be an operation in which the user first selects from various print options in the first print interface and then clicks a print button.
[0117] In response to the print request operation, the electronic device may call the first print service in the virtual operating system to send a print task to the second print service through a virtual channel.
[0118] When the virtual operating system is a Linux operating system, the first printing service may be cupsd, and when the host operating system is a Hongmeng operating system, the second printing service may be Huawei printing, and the virtual channel may be a virtual channel for interaction based on the Remote Desktop Protocol (RDP), the graphical remote management protocol (RFB), the Independent Computing Architecture (ICA), the command line interface remote management protocol (SSH), etc. In the embodiments of this specification, the first printing service is cupsd, the second printing service is Huawei printing, and the virtual channel is the RDP communication channel as an example for exemplary description.
[0119] Since the RDP communication channel can support cross-system communication between most operating systems, this solution can support more cross-system compatibility scenarios and expand the application scope of this solution. 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.
[0120] The specific printing process can be as follows Figure 3 As shown, the electronic device can respond to a print request from a target application in the Linux operating system, 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 Hongmeng 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 print service).
[0121] 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, and 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 occupancy of virtual container resources, enables users to perform cross-system printing more smoothly, improves user experience, and the target application does not need to be customized and adapted for the solution of this specification.
[0122] 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.
[0123] The printing task may include printing file information and printing parameters. The printing 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, picture, etc. The printing parameters may be generated according to the printing options selected by the user in the first printing interface. For example, if the user selects to print 3 copies and black and white printing in the printing options of the first printing interface, the printing parameters may include the number of copies and the printing color.
[0124] In some embodiments, the print file information may also be the storage path of the target file to be printed, such as Figure 4 As shown, cupsd can send the storage path and printing parameters of the target file to be printed to the server end of the RDP communication channel through the backend. Compared with transmitting the print file through the RDP communication channel, the transmission data corresponding to the storage path of the target file to be printed is much smaller, thereby reducing the data size transmitted by the first print service and the second print service through the RDP communication channel, saving communication resources, further improving the fluency of cross-system printing, and improving the user experience.
[0125] Since the printing parameters correspond to the user's selection of various printing options in the first printing interface, and the printer options displayed in the first printing interface are irrelevant to the printer connected to the host operating system, the printing parameters may not include a printer identifier. The printer identifier may be a printer ID, name, SN number, etc.
[0126] S120: Send a print instruction to a target printer through a second print service according to the print task.
[0127] 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.
[0128] 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.
[0129] 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.
[0130] 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.
[0131] The second print interface can be Figure 5 As shown, it includes 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.
[0132] The second print interface can also be Figure 6 As shown, it includes a preview window, printer options and a print button, so that the user can select a printer from the printer options in the second print interface according to actual needs, and then click the print button to print, thereby further improving the user's cross-system printing experience without occupying too much resources of the virtual container.
[0133] The second print interface can also be Figure 7 As shown, it includes a preview window, printer options, print setting options and a print button. The print setting options may include multiple options, such as the number of copies, print color, paper size, paper type, etc. In this way, when the user wants to modify the printing parameters, he can directly reset the printing parameters he wants to modify in the print setting options corresponding to the printing parameters in the second printing interface without deleting the current printing task and creating another one.
[0134] 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.
[0135] The specific parameters in 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.
[0136] In some embodiments, the second printing service can also display the received printing tasks in the printing task list. Since the first printing service directly sends the printing tasks to the second printing service through the RDP communication channel without the need for other communications with the second printing service, when the second printing service receives multiple printing tasks, it can directly send the multiple printing tasks to the second printing service of the host operating system without having to put the multiple printing tasks into the printing queue first and wait until the previous printing tasks are completed before sending the next printing task to the second printing service. In this way, the user can see all the created printing tasks in the printing task list corresponding to the second printing service, instead of only seeing the current printing task in the printing task list corresponding to the second printing service, thereby improving the user experience. In addition, the printing tasks do not need to wait in the queue of the virtual container, which can further reduce the resource consumption of the virtual container.
[0137] like Figure 8 As shown, 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.
[0138] 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 all those that do not deviate from the essence of the present specification fall within the protection scope of this specification.
[0139] In the printing method provided in the embodiments of the present 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 print tasks, 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, allowing 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 the present specification.
[0140] Based on the same concept, the embodiment of this specification also provides an electronic device, and the software system of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture or a cloud architecture. The embodiment of this specification takes the Hongmeng system with a layered architecture as an example to illustrate the software structure of the electronic device.
[0141] Fig. 9A schematic diagram of the software architecture of an electronic device provided in an embodiment of this specification, such as Fig. 9 As shown, 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, a system library, and a kernel layer from top to bottom. The application layer can include applications such as camera, gallery, calendar, call, WLAN, music, video, short message, printing, etc. on the host operating system.
[0142] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0143] like Fig. 9 As shown, the application framework layer on the host operating system may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, a print manager, and the like.
[0144] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0145] Content providers are used to store and retrieve data and make it accessible to applications.
[0146] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. The display interface can be composed of one or more views.
[0147] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0148] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of an icon or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0149] 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, and so on.
[0150] Harmony runtime includes core libraries and virtual machines. Harmony runtime is responsible for the scheduling and management of the Hongmeng system.
[0151] 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.
[0152] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0153] The system library may include multiple functional modules, such as surface manager, media libraries, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0154] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0155] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0156] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0157] A 2D graphics engine is a drawing engine for 2D drawings.
[0158] The kernel layer is the layer between hardware and software. The kernel layer can include display drivers, camera drivers, audio drivers, and sensor drivers.
[0159] The software architecture of the virtual operating system in the virtual container is similar to the software system of the host operating system and will not be described in detail here.
[0160] 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 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 all the contents of the above method embodiment.
[0161] Fig.10 A schematic diagram of the structure of the printing device provided in the embodiment of this specification is shown in FIG. Fig.10 As shown, the printing device provided in this embodiment includes:
[0162] The first system processing module 11 is used to respond 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; 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;
[0163] 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.
[0164] As an optional implementation, 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 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.
[0165] As an optional implementation manner, the second system processing module 12 is specifically used for:
[0166] 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.
[0167] 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.
[0168] As an optional implementation, the second print control operation is an operation of clicking a print button in the second print interface.
[0169] As an optional implementation, the second print control operation includes an operation of selecting a target printer in the second print interface.
[0170] As an optional implementation, the second printing control operation includes an operation of setting printing parameters in the second printing interface.
[0171] As an optional implementation, the printing task includes printing file information and printing parameters, and the printing parameters do not include a printer identifier.
[0172] As an optional implementation manner, the print file information includes a target file to be printed.
[0173] As an optional implementation, the print file information includes a storage path of a target file to be printed.
[0174] As an optional implementation manner, the first sending module is specifically configured to:
[0175] Mount the storage path of the target file to be printed to the set directory on the host operating system;
[0176] Read the target file to be printed in the set directory;
[0177] 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.
[0178] 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.
[0179] As an optional implementation, the virtual operating system is a Linux operating system, and the first printing service is a printing system service cupsd.
[0180] As an optional implementation, the host operating system includes at least one of Hongmeng operating system, Windows operating system and Android operating system.
[0181] As an optional implementation, the host operating system is Hongmeng operating system, and the second printing service is Huawei printing.
[0182] As an optional implementation, the virtual channel is an RDP communication channel.
[0183] 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.
[0184] As an optional implementation manner, the first printing service is cupsd, and the first sending module is specifically used for:
[0185] Calling the target backend in the cupsd to send the print task to the server end of the RDP communication channel;
[0186] The server of the RDP communication channel is called to send the print task to the client of the RDP communication channel;
[0187] The client that calls the RDP communication channel sends the print task to the second print service.
[0188] The device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0189] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be 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 in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in 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, which will not be repeated here.
[0190] Based on the same concept, this specification also provides an electronic device, see Fig.11 , Fig.11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this specification.
[0191] 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, a 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.
[0192] It is to be 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 in the figure, or combine certain components, or split certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0193] 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 processor (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), etc. Among them, different processing units may be independent devices or integrated in one or more processors.
[0194] The controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.
[0195] The processor 210 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. The memory may store instructions or data that the processor 210 has just used or cyclically used. If the processor 210 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 210, and thus improves the efficiency of the system.
[0196] In some embodiments, the processor 210 may include one or more interfaces. The interface 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, etc.
[0197] The I2C interface is a bidirectional synchronous serial bus, including 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 to sample, quantize and encode analog signals. The UART interface is a universal serial data bus used for asynchronous communication; the bus can be a bidirectional communication bus, which converts the data to be transmitted between serial communication and parallel communication. The MIPI interface can be used to connect the processor 210 with peripheral devices such as the display screen 294 and the camera 293; the MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. The GPIO interface can be configured by software, and the GPIO interface can be configured as a control signal or a data signal. The USB interface 230 is an interface that complies with the USB standard specification, and can specifically be a Mini USB interface, a MicroUSB interface, a USB Type C interface, etc. The USB interface 230 can be used to connect a charger to charge an electronic device, and can also be used to transmit data between an electronic device and a peripheral device. It can also be used to connect headphones and play audio through headphones. This interface can also be used to connect other electronic devices, such as AR devices, etc.
[0198] It is understandable that the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration 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 in the above embodiments, or a combination of multiple interface connection methods.
[0199] The charging management module 240 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 240 may receive charging input from a wired charger through the USB interface 230. In some wireless charging embodiments, the charging management module 240 may receive wireless charging input through a wireless charging coil of the electronic device. While the charging management module 240 is charging the battery 242, it may also power the electronic device through the power management module 241.
[0200] 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 supplies power to the processor 210, the internal memory 221, the external memory, the display screen 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 number, battery health status (leakage, impedance), etc. 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.
[0201] 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.
[0202] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0203] The mobile communication module 250 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., 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.
[0204] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent 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 the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 270A, a receiver 270B, etc.), or displays an image or video through a 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.
[0205] The wireless communication module 260 can provide wireless communication solutions 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., which are applied to electronic devices. The wireless communication module 260 can be one or more devices integrating at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 210. The wireless communication module 260 can also receive the signal to be sent from the processor 210, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0206] In some embodiments, the antenna 1 of the electronic device is coupled to the mobile communication module 250, and the antenna 2 is coupled to the wireless communication module 260, so that the electronic device can communicate with the network and other devices through wireless communication technology. The wireless communication technology 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, etc. 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).
[0207] The electronic device implements the display function through a GPU, a display screen 294, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 294 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 210 may include one or more GPUs that execute program instructions to generate or change display information.
[0208] The display screen 294 is used to display images, videos, etc. The 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 may include 1 or N display screens 294, where N is a positive integer greater than 1.
[0209] The electronic device can realize the shooting function through ISP, camera 293, video codec, GPU, display screen 294 and application processor.
[0210] The ISP is used to process data fed back by the camera 293. The camera 293 is used to capture static images or videos. The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. The video codec is used to compress or decompress digital videos.
[0211] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and continuously self-learn. NPU can realize applications such as intelligent cognition of electronic devices, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0212] The internal memory 221 can be used to store computer executable program codes, which include instructions. The processor 210 executes various functional applications and data processing of the electronic device by running the instructions stored in the internal memory 221. The internal memory 221 may include a program storage area and a data storage area. Among them, 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.
[0213] The external memory interface 220 can be used to connect an external memory, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 210 through the external memory interface 220 to implement a data storage function. For example, files such as music and videos can be stored in the external memory card.
[0214] The electronic device can implement audio functions such as music playing and recording through the audio module 270, the speaker 270A, the receiver 270B, the microphone 270C, the headphone jack 270D, and the application processor.
[0215] 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 signal. The audio module 270 can also be used to encode and decode audio signals. In some embodiments, the audio module 270 can be arranged in the processor 210, or some functional modules of the audio module 270 are arranged 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" and "microphone", is used to convert sound signals into electrical signals. The headphone interface 270D is used to connect wired headphones. The headphone interface 270D can be a USB interface 230, or it can be a 3.5mm open mobile electronic equipment platform (open mobile terminal platform, OMTP) standard interface, the American Cellular Telecommunications Industry Association (cellular telecommunications industry association of the USA, CTIA) standard interface.
[0216] The key 290 includes a power button, a volume button, etc. The key 290 can be a mechanical key. It can also be a touch key. The electronic device can receive key input and generate key signal input related to the user settings and function control of the electronic device. The motor 291 can generate a vibration prompt. The motor 291 can be used for incoming call vibration prompts, and can also be used 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.
[0217] The electronic device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0218] The embodiment of the present 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.
[0219] The embodiments of the present specification also provide a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method described in the above method embodiments is implemented.
[0220] The embodiments of the present 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 when executing the computer program product.
[0221] The embodiment of this specification also provides a chip system, including a processor, the processor is coupled to a memory, and the processor executes 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.
[0222] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part 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, the process or function described in the embodiment of this specification is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can 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. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk or a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.
[0223] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media can include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
[0224] The naming or numbering of the 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.
[0225] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0226] 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 only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, 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.
[0227] It should be understood that in the description of the present application specification and the appended claims, the terms "include", "comprises", "have" 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 device that includes a series of steps or modules is not necessarily limited to those steps or modules that are clearly listed, but may include other steps or modules that are not clearly listed or inherent to these processes, methods, products or devices.
[0228] In the description of this specification, unless otherwise specified, " / " means that the objects associated before and after are in an "or" relationship, for example, A / B can mean 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 mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural.
[0229] Furthermore, in the description of this specification, unless otherwise specified, "plurality" means 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 multiple.
[0230] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" 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 "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0231] In addition, in the description of the present 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 sequence, nor can they be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein; the features defined as "first" or "second" may explicitly or implicitly include at least one of the features.
[0232] In the embodiments of this specification, words such as "exemplarily" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of this specification should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a specific way.
[0233] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of this specification include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways.
[0234] 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, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some or all of the technical features therein may be replaced by 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
Cited By
Printing method and electronic device
EP4693016A1
Printing method and electronic device
WO2025044391A1