An automatic printing method and an electronic device

By automatically identifying the front-end application interface and obtaining the printed content on electronic devices, the problem of cumbersome operation of existing mobile printing technology is solved, and an efficient experience of printing can be achieved without additional operations.

CN115268802BActive Publication Date: 2025-06-10HUAWEI TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110485882.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-30
Publication Date
2025-06-10
Estimated Expiration
2041-04-30

AI Technical Summary

Technical Problem

The existing mobile printing technology has cumbersome operations, long time, low user experience, and difficult to achieve automatic and fast printing.

Method used

By implementing the automatic printing method on the electronic device, after detecting the printing device, it automatically recognizes the front desk application interface to obtain the printed content, and prints without additional user operations.

Benefits of technology

It enables users to automatically complete printing tasks without multiple operations, improving user experience and printing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115268802B_ABST
    Figure CN115268802B_ABST
Patent Text Reader

Abstract

The present application provides an automatic printing method and an electronic device, relating to the field of terminal technologies. The present application enables a user to only bring the electronic device close to a printing device, and then automatically and quickly print according to the current interface of the electronic device. The entire process requires no additional operation by the user or only a small amount of operation by the user; the user experience is relatively high. The method includes: when the electronic device detects the printing device within a certain distance from the printing device, if it determines that the foreground application is a non-desktop application and is an application in the whitelist library, it can automatically determine the printing content and automatically send the printing content to the printing device for printing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to the technical field of terminals, and in particular, to an automatic printing method and an electronic device. Background Art

[0002] With the popularization of online education and remote work, users' demand for mobile printing is becoming stronger and stronger. Currently, mobile printing mainly relies on two solutions. One is to perform printing through the printing service provided by the operating system of the electronic device, and the other is to perform printing through a third-party printing application or printing mini-program. However, this requires users to perform more steps, resulting in inconvenient use, long time consumption, and low user experience. Therefore, how to provide a convenient and fast automatic printing method and an electronic device has become our need. Summary of the Invention

[0003] To solve the above technical problems, the present application provides an automatic printing method and an electronic device. The technical solution provided by the present application enables users to only need to bring the electronic device close to the printing device, and then automatically and quickly print according to the current interface of the electronic device; this process only requires a small amount of operation by the user or no additional operation by the user; the user experience is high.

[0004] To achieve the above technical purpose, the embodiments of the present application provide the following technical solutions:

[0005] In a first aspect, an automatic printing method is provided, which is applied to an electronic device. The method includes: within a certain distance of the printing device, the electronic device detects the printing device and establishes a communication connection with the printing device. After the foreground application of the electronic device is a non-desktop application and belongs to a preset whitelist library, the electronic device automatically obtains the printing content according to the current interface of the foreground application. In response to the received user input, all or part of the printing content is selected, and the electronic device sends all or part of the selected printing content to the printing device; or, in response to the received user input, the electronic device sends the printing content to the printing device. Or, the electronic device automatically sends the printing content to the printing device.

[0006] Wherein, the foreground application is the application corresponding to the current interface of the electronic device. Exemplarily, the application whose interface is currently displayed on the display screen of the electronic device is the foreground application.

[0007] In some embodiments, if the electronic device determines, using the queried application package name, that the application package name is included in the registered whitelist, then it determines that the foreground application is a whitelist application. Wherein, the whitelist is a list of applications registered to support the printing service.

[0008] In some embodiments, the electronic device and the printing device can support one or more of the NFC touch-to-discover function, the Bluetooth proximity discovery function, the proximity discovery function based on the IEEE 802.11 protocol, the general intelligent sensing hub discovery function, etc.; based on one or more of the above functions supported by both, the electronic device and the printing device can discover each other. After the electronic device detects the printing device and automatically obtains the printing content according to the foreground application interface, in response to the user's operation, it can determine some or all of the content selected by the user as the content to be printed and send it to the printing device. Or, in response to the user's operation, it determines to send the interface screenshot file as the content to be printed to the printing device. Or, the electronic device directly sends the obtained printing content to the printing device for printing.

[0009] In this way, after the electronic device detects the printing device, it can automatically identify the foreground application interface, determine the content to be printed, and realize printing without additional operation by the user or only with a small amount of operation by the user.

[0010] According to the first aspect, after the foreground application of the electronic device is a desktop application, the method further includes: in response to another user input received, at least one display element supported for printing in the current interface of the desktop application is selected, and the electronic device sends the selected display element to the printing device; or, the electronic device automatically sends a screenshot of the current interface of the desktop application to the printing device.

[0011] In some embodiments, if the electronic device determines that the foreground application is the system desktop (i.e., the desktop application) according to the package name of the foreground application, it cannot directly determine the content that the user needs to print and needs to receive the user's operation of selecting the printing content on the display interface of the desktop application. The printing content selected by the user is at least one display element supported for printing in the current display interface of the desktop application, and the display element can be a control, an icon, etc. displayed on the interface. Or, detect the user's operation of opening other applications and selecting files on the desktop application to determine the content to be printed. Or, the electronic device takes a screenshot of the display interface of the current foreground application and determines the screenshot file as the content to be printed.

[0012] In this way, in the case where the foreground application is a desktop application, the electronic device can also automatically obtain the printing content, ensuring that the user can achieve convenient printing with fewer operations in multiple scenarios.

[0013] According to the first aspect, or any implementation manner of the above first aspect, the electronic device automatically obtains the printing content according to the current interface of the foreground application; including: after the current interface supports the printing service, determining the printing content corresponding to the current interface and automatically obtaining the printing content; the printing content is at least one display content supported for printing included in the current interface.

[0014] In some embodiments, the number of print contents supported by the foreground application display interface is one or more. For example, the foreground application is a music application, and the current display interface is a music playback interface. Assume that the music playback interface supports displaying lyric pictures and album cover pictures. Then, the print contents that the electronic device can obtain are lyric pictures and / or album cover pictures. Further, the print contents obtained by the electronic device can be the display contents currently being displayed on the current interface, or the display contents that are not currently displayed on the current interface but support printing.

[0015] In this way, the electronic device can automatically obtain all or part of the display contents supported by the display interface according to the display interface, meeting the user's printing requirements.

[0016] According to the first aspect, or any implementation manner of the above first aspect, the electronic device automatically obtains print contents according to the current interface of the foreground application, including: after the current interface does not support the printing service, determining a screenshot of the current interface as the print content and automatically obtaining the print content.

[0017] In this way, when the electronic device determines that the current interface does not support the printing service, it can also obtain the print content by taking a screenshot, realizing automatic printing and meeting the user's printing requirements.

[0018] According to the first aspect, or any implementation manner of the above first aspect, the method further includes: the electronic device sends a query message to the foreground application through the printing service running on the electronic device. The printing service receives a query response sent by the foreground application. According to the query response, the electronic device obtains the print content.

[0019] In some embodiments, after detecting a printing device, the electronic device calls the printing service to determine the print content. A communication connection for transmitting signals is established between the printing service and the foreground application, and based on this communication connection, information interaction between the printing service and the foreground application is realized, such as obtaining the print content and related information of the print content.

[0020] According to the first aspect, or any implementation manner of the above first aspect, after the query response contains the identifier of the display content in the current interface, the current interface supports the printing service, and the identifier is used to indicate at least one display content supported by the current interface for printing. After the query response does not contain the identifier of the display content in the current interface, the current interface does not support the printing service.

[0021] In some embodiments, after receiving and parsing the query response sent by the foreground application, the printing service can determine whether the current display interface supports printing services and which printing services are supported. For example, the printing service determines that the foreground application supports printing the display content corresponding to the representation based on the identifier of the display content. If the query response contains the identifier of the lyrics picture (such as contentname), the printing service determines that the current interface supports printing the lyrics picture.

[0022] In this way, the electronic device can quickly determine the printing content to be printed according to the identifier carried in the query response, improving the efficiency of automatically identifying the printing content.

[0023] According to the first aspect, or any one of the above implementation manners of the first aspect, after the electronic device automatically obtains the printing content, the method further includes: the electronic device prompts the printing content.

[0024] In some embodiments, after the electronic device determines the printing content, a printing interface is displayed to prompt the user to check whether the printing content is correct and whether to confirm the printing, thus avoiding abnormal printing caused by misoperation. For example, if the user accidentally triggers the printing process (such as accidentally touching the NFC area of the printing device to establish a connection with the printing device), the current user can choose not to print. Or, after the electronic device determines the printing content, it prompts the printing content. For example, the electronic device uses voice prompts, vibration prompts, etc. to prompt the user that the current electronic device needs to print and confirm whether to execute the printing job.

[0025] According to the first aspect, or any one of the above implementation manners of the first aspect, the electronic device prompts the printing content; including: the electronic device displays a printing content confirmation interface.

[0026] In this way, the electronic device receives the confirmation operation of the user by displaying the confirmation interface, ensuring the security of the printing operation. Among them, the confirmation operation can include, for example, clicking the confirmation control (such as the "start printing" control), double-clicking the display screen and other preset gesture operations on the display screen, or can also include double-clicking the volume keys, double-clicking the back of the mobile phone and other preset operations, or can also include the operation of automatically confirming after waiting for a preset duration. The specific type of the confirmation operation is not specifically limited in the embodiments of the present application.

[0027] According to the first aspect, or any implementation of the above first aspect, in response to the received user input, all or part of the printed content is selected, and the electronic device sends all or part of the selected printed content to the printing device; including: the electronic device receives a first user input. In response to the first user input received by the electronic device, all or part of the printed content is selected. The electronic device receives a second user input. In response to the second user input received by the electronic device, the electronic device sends all or part of the selected printed content to the printing device. Wherein, the user input includes the first user input and the second user input.

[0028] In some embodiments, the number of printed contents is multiple. After the electronic device obtains multiple printed contents, it displays selection information of the multiple printed contents for the user to select and confirm, that is, receives the first user input of the user. After determining that the user needs to print some or all of the printed contents, it obtains the corresponding printed content information, and then receives the second user input operation to determine to send the printed content to the printing device.

[0029] In this way, by detecting the user's input, it is ensured that the printed content meets the user's needs, the security of printing is ensured, and the final printing result can meet the user's expectations.

[0030] According to the first aspect, or any implementation of the above first aspect, in response to the received user input, the electronic device sends the printed content to the printing device; including: the electronic device receives a second user input. In response to the second user input received by the electronic device, the electronic device sends the printed content to the printing device. Wherein, the user input includes the second user input.

[0031] In some embodiments, the number of printed contents is one. After the electronic device obtains the printed content, it directly responds to the user's operation of determining printing and sends the obtained printed content to the printing device.

[0032] In other embodiments, the number of printed contents is one or more. After the electronic device obtains one or more printed contents and detects the user's operation of determining printing, it sends the one or more printed contents to the printing device for printing.

[0033] In this way, after the electronic device determines that it has received the user's confirmation operation, it then sends the printed content to the printing device for printing, which can ensure the security of printing.

[0034] According to the first aspect, or any implementation of the above first aspect, the method further includes: the electronic device runs a printing service and a printing module. The electronic device sends all or part of the selected printed content to the printing device; including: the electronic device sends all or part of the printed content to the printing device through the printing service and the printing module.

[0035] In some embodiments, the printing module may include plugins corresponding to one or more printing devices in the electronic device. After the printing service detects the printing device, it can automatically call the printing module corresponding to the printing device to process the printing service and achieve automatic printing.

[0036] In a second aspect, an electronic device is provided. The electronic device includes: a processor, a memory, and a computer program, where the computer program is stored in the memory. When the computer program is executed by the processor, the electronic device performs: within a certain distance of the printing device, the electronic device detects the printing device and establishes a communication connection with the printing device. When the foreground application of the electronic device is a non-desktop application and belongs to a preset whitelist library, according to the current interface of the foreground application, the electronic device automatically obtains the printing content. In response to a received user input, all or part of the printing content is selected, and the electronic device sends all or part of the selected printing content to the printing device; or, in response to a received user input, the electronic device sends the printing content to the printing device. Or, the electronic device automatically sends the printing content to the printing device.

[0037] According to the second aspect, the electronic device further performs: when the foreground application of the electronic device is a desktop application, in response to another received user input, at least one display element supporting printing in the current interface of the desktop application is selected, and the electronic device sends the selected display element to the printing device; or, the electronic device automatically sends a screenshot of the current interface of the desktop application to the printing device.

[0038] According to the second aspect, or any implementation manner of the above second aspect, according to the current interface of the foreground application, the electronic device automatically obtains the printing content; including: after the current interface supports the printing service, determining the printing content corresponding to the current interface and automatically obtaining the printing content; the printing content is at least one display content supporting printing included in the current interface.

[0039] According to the second aspect, or any implementation manner of the above second aspect, according to the current interface of the foreground application, the electronic device automatically obtains the printing content; including: after the current interface does not support the printing service, determining the screenshot of the current interface as the printing content and automatically obtaining the printing content.

[0040] According to the second aspect, or any implementation manner of the above second aspect, the electronic device further performs: the electronic device sends a query message to the foreground application through the printing service running on the electronic device. The printing service receives a query response sent by the foreground application. According to the query response, the electronic device obtains the printing content.

[0041] According to the second aspect, or any implementation manner of the above second aspect, after the query response contains the identifier of the content displayed in the current interface, the current interface supports the printing service, and the identifier is used to indicate at least one display content supported for printing included in the current interface. After the query response does not contain the identifier of the content displayed in the current interface, the current interface does not support the printing service.

[0042] According to the second aspect, or any implementation manner of the above second aspect, after the electronic device automatically obtains the print content, the electronic device further performs: the electronic device prompts the print content.

[0043] According to the second aspect, or any implementation manner of the above second aspect, the electronic device prompts the print content; including: the electronic device displays a print content confirmation interface.

[0044] According to the second aspect, or any implementation manner of the above second aspect, in response to the received user input, all or part of the print content is selected, and the electronic device sends all or part of the selected print content to the printing device; including: the electronic device receives a first user input. In response to the first user input received by the electronic device, all or part of the print content is selected. The electronic device receives a second user input. In response to the second user input received by the electronic device, the electronic device sends all or part of the selected print content to the printing device. Wherein, the user input includes the first user input and the second user input.

[0045] According to the second aspect, or any implementation manner of the above second aspect, in response to the received user input, the electronic device sends the print content to the printing device; including: the electronic device receives a second user input; in response to the second user input received by the electronic device, the electronic device sends the print content to the printing device; wherein, the user input includes the second user input.

[0046] According to the second aspect, or any implementation manner of the above second aspect, the electronic device further performs: the electronic device runs a printing service and a printing module. The electronic device sends all or part of the selected print content to the printing device; including: the electronic device sends all or part of the print content to the printing device through the printing service and the printing module.

[0047] For the technical effects corresponding to the second aspect and any implementation manner in the second aspect, reference may be made to the technical effects corresponding to the first aspect and any implementation manner in the first aspect above, which will not be elaborated here.

[0048] In a third aspect, an embodiment of the present application provides an electronic device, which has a function of implementing the automatic printing method described in the first aspect and any possible implementation manner thereof. This function can be implemented by hardware or by software executed by the hardware. The hardware or software includes one or more modules corresponding to the above functions.

[0049] For the technical effects corresponding to the third aspect and any implementation manner in the third aspect, reference can be made to the technical effects corresponding to the first aspect and any implementation manner in the first aspect, which will not be elaborated here.

[0050] In a fourth aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program (which can also be referred to as an instruction or code). When the computer program is executed by an electronic device, the electronic device is caused to execute the method of the first aspect or any implementation manner in the first aspect.

[0051] For the technical effects corresponding to the fourth aspect and any implementation manner in the fourth aspect, reference can be made to the technical effects corresponding to the first aspect and any implementation manner in the first aspect, which will not be elaborated here.

[0052] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device is caused to execute the method of the first aspect or any implementation manner in the first aspect.

[0053] For the technical effects corresponding to the fifth aspect and any implementation manner in the fifth aspect, reference can be made to the technical effects corresponding to the first aspect and any implementation manner in the first aspect, which will not be elaborated here.

[0054] In a sixth aspect, an embodiment of the present application provides a circuit system, which includes a processing circuit configured to execute the method of the first aspect or any implementation manner in the first aspect.

[0055] For the technical effects corresponding to the sixth aspect and any implementation manner in the sixth aspect, reference can be made to the technical effects corresponding to the first aspect and any implementation manner in the first aspect, which will not be elaborated here.

[0056] In a seventh aspect, an embodiment of the present application provides a chip system, which includes at least one processor and at least one interface circuit. The at least one interface circuit is used to perform a transceiver function and send instructions to the at least one processor. When the at least one processor executes the instructions, the at least one processor executes the method of the first aspect or any implementation manner in the first aspect.

[0057] For the seventh aspect and the technical effects corresponding to any implementation manner in the seventh aspect, reference may be made to the above-mentioned first aspect and the technical effects corresponding to any implementation manner in the first aspect, which will not be elaborated herein. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 Schematic diagram of the interface provided by the embodiment of the present application Figure 1 ;

[0059] Figure 2 Schematic diagram of the interface provided by the embodiment of the present application Figure 2 ;

[0060] Figure 3 Schematic diagram of the interface provided by the embodiment of the present application Figure 3 ;

[0061] Figure 4 Scenario schematic diagram of an automatic printing method provided by the embodiment of the present application;

[0062] Figure 5A Schematic diagram of the structure of the electronic device provided by the embodiment of the present application Figure 1 ;

[0063] Figure 5B Schematic block diagram of the software structure of the electronic device provided by the embodiment of the present application;

[0064] Figure 6 Flow chart of the automatic printing method provided by the embodiment of the present application Figure 1 ;

[0065] Figure 7 Flow chart of the automatic printing method provided by the embodiment of the present application Figure 2 ;

[0066] Figure 8 Schematic diagram of the interface provided by the embodiment of the present application Figure 4 ;

[0067] Figure 9 Schematic diagram of the interface five provided by the embodiment of the present application;

[0068] Figure 10 Schematic diagram of the communication framework provided by the embodiment of the present application;

[0069] Figure 11 Schematic diagram of the interface provided by the embodiment of the present application Figure 6 ;

[0070] Figure 12 Flow chart of the automatic printing method provided by the embodiment of the present application Figure 3 ;

[0071] Figure 13A Schematic diagram of the interface provided by the embodiment of the present applicationFigure 7 ;

[0072] Figure 13B This is the interface schematic diagram provided by the embodiment of the present application Figure 8 ;

[0073] Figure 14 This is the interface schematic diagram provided by the embodiment of the present application Figure 9 ;

[0074] Figure 15 This is the flowchart of the automatic printing method provided by the embodiment of the present application Figure 4 ;

[0075] Figure 16 This is the interface schematic diagram provided by the embodiment of the present application Figure 10 ;

[0076] Figure 17 This is the structural schematic diagram of the electronic device provided by the embodiment of the present application Figure 2 . Detailed implementation manners

[0077] Next, with reference to the accompanying drawings in the embodiments of the present application, the technical solutions in the embodiments of the present application will be described. Among them, in the description of the embodiments of the present application, the terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to limit the present application. As used in the specification and the appended claims of the present application, the singular forms "a", "an", "the", "above", "said", "this" are intended to include expressions such as "one or more", unless the context clearly indicates otherwise. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" means one or more than two (including two).

[0078] Describing with reference to "one embodiment" or "some embodiments" in this specification means that in one or more embodiments of the present application, specific features, structures or characteristics described in combination with that embodiment are included. Thus, statements such as "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments" etc. that appear 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. The terms "include", "comprise", "have" and their variants all mean "including but not limited to", unless otherwise specifically emphasized in other ways. The term "connection" includes direct connection and indirect connection, unless otherwise stated. "First", "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features.

[0079] In the embodiments of the present application, the words "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 the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a specific way.

[0080] In some scenarios, the electronic device can be connected to a printer and send the content to be printed to the printer for printing. The electronic device needs to receive the user's selection and determine the content to be printed.

[0081] In some embodiments, some applications (such as image galleries, etc.) in the electronic device support the use of an operating system (such as iOS) to ® 、Android ® 、Harmony ® Print using the printing service provided by .

[0082] For example, when a user wants to print an album cover image while playing music using a music application, he needs to save the album cover image first and then print it. Figure 1 In the interface 101 shown in (a), after the electronic device (such as a mobile phone) detects that the user has long pressed the image 11, the following is displayed: Figure 1 In the interface 102 shown in (b), it is determined whether the user saves the picture (i.e., the album cover picture). After detecting that the user clicks the "Save Picture" control 12, it is determined to save the album cover picture. After that, the user needs to find the save location of the album cover in the file system before printing. Figure 2 In the interface 201 shown in (a), the electronic device opens the gallery application in response to the user operation, and saves the album cover picture to be printed (such as the picture indicated by the mark 21) in the gallery application. After the electronic device detects that the user clicks the picture indicated by the mark 21, the album cover picture is opened and displayed as shown in FIG. Figure 2 After detecting that the user clicks the "More" control 22, more editing directories are displayed. After detecting that the user clicks the "Print or Generate PDF" control 23, the print interface is called and the following is displayed: Figure 2 After detecting that the user clicks the "Select Printer" control 24, the following is displayed: Figure 2 Interface 204 is shown in (d). Finally, after detecting that the user clicks the "Printer A" control 25, it is determined that the album cover image is sent to printer A for printing.

[0083] It can be seen that in the above printing solution, only some application programs that support the operating system printing interface can apply this printing solution. During the printing process, the user needs to perform multiple operations, and the user needs to clearly determine the saving location of the content to be printed, resulting in a relatively high operation difficulty for the user. Moreover, in the above printing process, personalized options such as picture editing, correction, and filters are not rich enough, and the printing function is single.

[0084] In some other embodiments, a third-party printing application program or applet is installed in the electronic device, and printing can be performed by using this application program or applet.

[0085] Exemplarily, similar to the above printing solution, when currently using a third-party printing application program or applet for printing, it is also necessary to first save the content to be printed. Assuming the scenario is still printing the album cover picture, the electronic device uses the method as Figure 1 shown to save the album cover picture. After that, as shown in the interface 301 in (a) of Figure 3 , in response to the user's operation, the electronic device starts the third-party printing application program to display the interface 301. After detecting the operation of the user clicking the "Gallery Printing" control 31, it is determined that the user needs to print a picture. Then, it is necessary to detect the content to be printed selected by the user. As shown in the interface 302 in (b) of Figure 3 , after detecting the operations of the user clicking the "Select Picture" control 32 and clicking the "OK" control 33 to determine that the user selects to print this picture, the interface 303 shown in (c) of Figure 3 is displayed. After detecting the operation of the user clicking the "Printer A" control 34, it is determined that the user selects Printer A to print the picture, and then the picture selected by the user is sent to Printer A for printing.

[0086] It can be seen that in this printing solution, the user needs to first download the corresponding application program and start this application program. Moreover, during the printing process, multiple operations also need to be performed, and the user needs to clearly determine the saving location of the content to be printed, resulting in a relatively high operation difficulty for the user.

[0087] Therefore, the embodiments of the present application provide an automatic printing method. The electronic device can automatically identify the foreground display content and automatically determine whether the foreground display content supports printing, and can achieve automatic printing without the user performing too many operations, reducing the printing difficulty and improving the user experience.

[0088] Figure 4 This is a schematic diagram of the scenario of an automatic printing method provided by the embodiments of the present application. As shown in Figure 4As shown, a communication connection is established between the electronic device 100 and the printing device 200. Exemplarily, a wireless communication connection is established between the electronic device 100 and the printing device 200. The electronic device 100 can send the file to be printed on the electronic device 100 to the printing device 200 for printing through the wireless communication connection with the printing device 200.

[0089] The electronic device 100 can establish a wireless communication connection with the printing device 200 through wireless communication technology. Among them, the wireless communication technology includes but is not limited to at least one of the following: Near Field Communication (NFC), Bluetooth (BT) (for example, traditional Bluetooth or Bluetooth Low Energy (BLE)), Wireless Local Area Networks (WLAN) (such as Wireless Fidelity (Wi-Fi) network), Zigbee, Frequency Modulation (FM), Infrared (IR), etc.

[0090] In some embodiments, both the electronic device 100 and the printing device 200 support the proximity discovery function. Exemplarily, both the electronic device 100 and the printing device 200 can achieve the proximity discovery function through NFC sensing. After the electronic device 100 approaches the printing device 200, the electronic device 100 and the printing device 200 can discover each other, and then establish a wireless communication connection such as a Wi-Fi peer-to-peer (P2P) connection or a Bluetooth connection. After that, the electronic device 100 identifies the current interface, automatically determines the printing content according to the current interface, and sends the printing content to the printing device 200 for printing, effectively reducing user operations.

[0091] In some embodiments, the electronic device 100 and the printing device 200 establish a wireless communication connection through a local area network. For example, both the electronic device 100 and the printing device 200 are connected to the same router.

[0092] In some embodiments, the electronic device 100 and the printing device 200 establish a wireless communication connection through a cellular network, the Internet, etc. For example, the printing device 200 accesses the Internet through a router, and the electronic device 100 accesses the Internet through a cellular network; furthermore, the electronic device 100 and the printing device 200 establish a wireless communication connection.

[0093] Exemplarily, the electronic device 100 includes, but is not limited to, a smart phone, a tablet computer, a wearable device (such as a smart watch, a smart bracelet, smart glasses), a laptop, a personal digital assistant (PDA), a vehicle-mounted device, a virtual reality (VR) device, an augmented reality (AR) device, an artificial intelligence (AI) device, etc. The operating systems installed on the electronic device 100 include, but are not limited to, iOS ® , Android ® , Harmony ® , Windows ® , Linux ® or other operating systems. In some embodiments, the electronic device 100 may be a fixed device or a portable device. This application does not limit the specific type of the electronic device 100 or the operating system installed thereon.

[0094] Exemplarily, the printing device 200 may be an electronic device with printing functions. The printing device 200 may install an operating system. The operating systems installed on the printing device 200 include, but are not limited to, iOS ® , Android ® , Harmony ® , Windows ® , Linux ® or other operating systems. The printing device 200 may also not install an operating system. This application does not limit the specific type of the printing device 200, whether it installs an operating system, or the type of the operating system if it installs one.

[0095] Exemplarily, Figure 5A shows a schematic structural diagram of the electronic device 100. As Figure 5A shown, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

[0096] It can be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than those illustrated, or combine certain components, or split certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0097] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, 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. The controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions. A memory may also be provided in the processor 110 for storing instructions and data.

[0098] In some embodiments, the processor 110 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, etc. The USB interface 130 is an interface that conforms to the USB standard specification, and specifically may be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc.

[0099] It can be understood that the interface connection relationships among the modules illustrated in the embodiments of the present application are only illustrative descriptions and do not constitute a structural limitation on the electronic device 100.

[0100] The charging management module 140 is configured to receive a charging input from a charger. Herein, the charger may be a wireless charger or a wired charger. While charging the battery 142, the charging management module 140 can also supply power to the electronic device through the power management module 141. In some other embodiments, the power management module 141 may also be disposed in the processor 110. In some other embodiments, the power management module 141 and the charging management module 140 may also be disposed in the same device.

[0101] The wireless communication function of the electronic device 100 can be implemented by the antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modulation and demodulation processor, baseband processor, etc.

[0102] The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example, the antenna 1 can be multiplexed 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.

[0103] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc. applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves through the antenna 1, filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor and convert it into electromagnetic waves through the antenna 1 for radiation. In some embodiments, at least some functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be disposed in the same device.

[0104] The wireless communication module 160 may provide solutions for wireless communications applied to the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite systems (GNSSs), frequency modulation (FM), near field communication (NFC), ZigBee, infrared (IR), etc. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 may also receive signals to be sent from the processor 110, perform frequency modulation and amplification on them, and convert them into electromagnetic waves through the antenna 2 for radiation.

[0105] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, such that the electronic device 100 can communicate with a network and other devices through 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 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 (GLONASS), beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS), and / or satellite based augmentation systems (SBAS).

[0106] The electronic device 100 implements a display function through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.

[0107] The display screen 194 is used to display images, videos, etc. The display screen 194 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 (AMOLED), a flexible light-emitting diode (FLED), a MiniLed, a MicroLed, a Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or M display screens 194, where M is a positive integer greater than 1.

[0108] In some embodiments, the display screen 194 of the electronic device 100 displays an interface, and the electronic device 100 can automatically identify the displayed content by using the processor 110, and determine whether the currently displayed application supports automatic recognition printing according to the application white list stored in the internal memory 121, the external memory connected through the external memory interface 120, or the memory in the processor 110. In the case of supporting automatic recognition printing, the electronic device 100 can determine the printing content selected by the user according to the user's voice input and / or touch input, and send the printing content to the printing device 200 through the wireless communication module 160 for printing.

[0109] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement the data storage function. For example, files such as music and videos are saved in the external memory card.

[0110] The internal memory 121 can be used to store computer-executable program code, and the executable program code includes instructions. The internal memory 121 can include a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.). The data storage area can store data created during the use of the electronic device 100 (such as audio data, phone book, etc.).

[0111] P of the SIM card interface 195 is a positive integer greater than 1.

[0112] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. In the embodiments of the present application, taking the Android system with a layered architecture as an example, the software structure of the electronic device 100 will be exemplarily described. Exemplarily, Figure 5B Fig. 2 shows a software structure block diagram of the electronic device 100 provided by the embodiments of the present application.

[0113] The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.

[0114] The application layer may include a series of application packages.

[0115] Such as Figure 5B shown, the application packages may include applications such as print service, print module, WLAN, camera, gallery, call, navigation, Bluetooth, video, etc.

[0116] In some embodiments, the print service may be provided by an application supporting Huawei Hilink (for example, the Smart Life application (APP)). The print service may also be a separate application supporting Huawei Hilink. After the electronic device discovers the printing device through methods such as proximity discovery, it automatically calls the print service to process the printing service. Among them, Huawei Hilink provides a way for various smart devices to join an intelligent hardware open ecosystem. The electronic device can join the Huawei Hilink ecosystem through hardware access or cloud access, etc., to achieve the interconnection of electronic devices, and can also achieve the interconnection between internal application programs of the electronic device.

[0117] It should be noted that in the embodiments of the present application, taking the Huawei Hilink ecosystem as an example, the automatic printing method provided by the embodiments of the present application is described. This automatic printing method can also be applied to other ecological environments that support intelligent communication between application programs.

[0118] In some embodiments, the print module may include plug-ins in the electronic device corresponding to one or more printing devices. After the print service detects the printing device, it can automatically call the print module corresponding to the printing device to process the printing service, realizing automatic printing.

[0119] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications in the application layer. The application framework layer includes some predefined functions.

[0120] As Figure 5B shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, and a notification manager, etc. 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. The content provider is used to store and obtain data, and enable this data to be accessible to applications. The data may include videos, images, audio, dialed and received calls, browsing history and bookmarks, phone books, etc. The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface including a short message notification icon may include a view for displaying text and a view for displaying pictures.

[0121] The phone manager is used to provide the communication function of the electronic device 100. For example, the management of call states (including connection, disconnection, etc.). The resource manager provides various resources for applications, such as localized strings, icons, pictures, layout files, video files, and so on. The notification manager enables applications to display notification information in the status bar, can be used to convey notification-type messages, and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to inform the completion of a download, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or a scroll bar text, such as a notification of a background-running application, and can also be a notification that appears on the screen in the form of a dialogue window. For example, prompt text information in the status bar, emit a prompt sound, the electronic device vibrates, the indicator light flashes, etc.

[0122] Android Runtime includes a core library and a virtual machine. Android runtime is responsible for the scheduling and management of the Android system. The core library contains two parts: one part is the functional functions that need to be called by the Java language, and the other part is the core library of Android.

[0123] The application layer and the application framework layer run in the 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 the management of object life cycles, stack management, thread management, security and exception management, and garbage collection.

[0124] The system library may include multiple functional modules. For example: the surface manager, Media Libraries, 3D graphics processing library (e.g., OpenGL ES), 2D graphics engine (e.g., SGL), etc. The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications. The Media Libraries support the playback and recording of multiple common audio and video formats, as well as static image files, etc. The Media Libraries can support multiple audio and video coding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc. The 2D graphics engine is the drawing engine for 2D drawing.

[0125] The kernel layer is the layer between hardware and software. The kernel layer at least includes a display driver, a camera driver, an audio driver, and a sensor driver.

[0126] In the following embodiments, the printing device 200 is taken as an example of a printer for illustration.

[0127] Exemplarily, Figure 6 This is a schematic diagram of an automatic printing method provided by an embodiment of the present application. As Figure 6 shown, the method may include S601 - S609:

[0128] S601. The electronic device detects the printing device.

[0129] In some embodiments, the electronic device and the printer can support one or more of the NFC touch - to - discover function, the Bluetooth proximity - discover function, the proximity - discover function of the Institute of Electrical and Electronics Engineers (IEEE) 802.11 protocol, the general intelligent sensor hub (sensorHub) discovery function, etc.; based on one or more of the above functions supported by both, the electronic device and the printing device can discover each other.

[0130] For example, when the NFC function of the electronic device and / or the printer is turned on, after the electronic device approaches or touches the NFC sensing area on the printer, the printer is discovered.

[0131] S602. The electronic device identifies the foreground application.

[0132] Among them, the foreground application is the application corresponding to the current interface of the electronic device. Exemplarily, which application's interface is currently displayed on the display screen of the electronic device, that application is the foreground application.

[0133] In some embodiments, the electronic device needs to confirm the foreground application displayed on the current display interface to determine whether the electronic device can automatically determine the printing content in the current scenario. For example, the UsageStatsManager class is used to identify the foreground application. The UsageStatsManager class is a tool in the Android system for statistical management of the usage of the electronic device; it can query the usage history of the electronic device (such as currently opening an application) and statistical information, and then obtain the package name of the current foreground application to identify different foreground applications. Among them, the package name of the application is unique in the Android system and can be used as the unique identifier of the application.

[0134] Exemplarily, as Figure 7 shown in the automatic printing method, the electronic device may include, for example, a printing service, a foreground application, and a printing module. After the electronic device discovers the printer through methods such as touch discovery and proximity discovery, the printing service is started. As shown in S701, the printing service identifies the foreground application. For example, the printing service determines that the foreground application is the system desktop, or determines that the foreground application is a music application, etc. Among them, the printing service can be called through the startService method.

[0135] It should be noted that in the case of split-screen display or floating window display of the electronic device, the application corresponding to the position where the user operation was last received is detected to determine that application as the foreground application. For example, the electronic device displays Application 1 and Application 2 in split screen. If the electronic device last detected a user operation as a touch operation on the display area corresponding to Application 1, then it is determined that the foreground application is Application 1.

[0136] S603. The electronic device determines whether the foreground application is the system desktop. If so, that is, the foreground application is the system desktop, then S604 is executed; if not, that is, the foreground application is not the system desktop, then S605 is executed.

[0137] In some embodiments, the electronic device uses the queried application package name to determine whether the application package name is the system desktop package name, and further determines whether the foreground application is the system desktop. That is, it determines whether the foreground application is a desktop application.

[0138] Exemplarily, as Figure 7 shown in S702, the electronic device can determine whether the foreground application is the system desktop by calling the printing service. As Figure 8 shown, when the electronic device displays the main interface, it is determined that the currently displayed foreground application is the system desktop, and the following S604 needs to be executed.

[0139] In this way, the electronic device can automatically identify the content displayed on the foreground interface, select different ways to process the printing service according to different interface display contents, and thus provide a more flexible printing method for the user.

[0140] S604. The electronic device detects the printing content selected by the user.

[0141] In some embodiments, if the electronic device determines that the foreground application is the system desktop, it cannot directly determine the content that the user needs to print, and needs to receive the operation of the user selecting the printing content on the display interface of the desktop application. The printing content selected by the user is at least one display element supported by the current desktop application display interface, and the display element can be a control, an icon, etc. displayed on the interface. Therefore, as Figure 7 shown, the electronic device needs to execute S703 and S704.

[0142] S703. The printing service calls the printing module.

[0143] S704. The printing module receives the printing content to be printed selected by the user.

[0144] Exemplarily, in S703 - S704, after determining that the foreground application is the system desktop, the printing service calls or starts the printing module, and the printing module receives the printing content determined by the user. Among them, the printing service can call the printing module across processes through the Android Interface Definition Language (AIDL). AIDL cross - process call is one of the common cross - process interface call methods in Android. It requires both communicating Apps to hold the same AIDL file at the same time, and cross - process interface call can be achieved by binding the services of both sides. In addition, the method for the user to determine the printing content can refer to the Figures 1 - 3 method described above, which will not be elaborated here. Or, in some other scenarios, the electronic device directly takes a screenshot of the current desktop application display interface and uses the screenshot of the display interface as the printing content to be printed.

[0145] S605. The electronic device determines whether the foreground application is a whitelist application. If not, that is, the foreground application is not a whitelist application, then execute S606; if so, that is, the foreground application is a whitelist application, then execute S607.

[0146] In some embodiments, if the electronic device determines that the foreground application is not the system desktop, it is necessary to further determine whether the foreground application is a whitelist application, that is, to determine whether automatic recognition printing is supported. Among them, the whitelist can be a whitelist library for storing the package names of registered applications. The whitelist can be pre-installed in the electronic device; or when the electronic device needs to query, it requests the server to download the whitelist. The whitelist can contain the package names of registered applications. The electronic device queries whether the whitelist contains the package name of the current foreground application, and then it can determine whether the current foreground application is a registered application that supports automatic recognition printing.

[0147] Exemplarily, as Figure 7 shown in S705, it can be determined by the printing service whether the foreground application is a whitelist application. Specifically, the printing service uses the package name of the foreground application obtained in S701 above to perform profile matching in the whitelist to determine whether the foreground application exists in the whitelist, and then determines whether the foreground application is a whitelist application.

[0148] In some embodiments, before S605, the application needs to perform whitelist registration. For example, during the process of configuring the profile on the developer website by the application developer, the package name is registered to determine that the current application is allowed to support the automatic recognition printing service. The server receives the registration information and generates a whitelist for the electronic device to download. The electronic device can update and download the whitelist periodically, or query the whitelist online, or periodically download the registration information of newly registered applications.

[0149] Exemplarily, the following shows an application whitelist. The registered applications in this application whitelist include NetEase Cloud Music ® application and the word processing system (WPS) ® application.

[0150] {

[0152] {

[0153] Application name: "NetEase Cloud Music",

[0154] Package name: "cn.netease.cloudmusic"

[0155] },

[0156] {

[0157] Application name: "WPS",

[0158] Package name: "cn.wps.moffice_eng"

[0159] }​

[0160] }

[0161] S606. The electronic device determines that the content to be printed is the content of the screenshot of the display interface.

[0162] In some embodiments, if the electronic device determines that the foreground application is not an application in the whitelist, it determines that the foreground application does not support automatic recognition printing, and further determines that it is necessary to print the screenshot of the current display interface.

[0163] Exemplarily, as Figure 7 shown in S705 and S706.

[0164] S705. The printing service determines whether the foreground application is an application in the whitelist.

[0165] S706. The printing service sends the screenshot of the current display interface to the printing module.

[0166] In some embodiments, if the printing service determines that the foreground application is not an application in the whitelist, it takes a screenshot and saves the screenshot file by using the SurfaceControl.screenshot interface in the Android system. Then, the uniform resource identifier (URI) of the saved screenshot file is sent to the printing module through AIDL cross-process call.

[0167] Among them, the URI is used to represent the corresponding data reference to be operated. After receiving the URI, the printing module can determine the saving location of the corresponding screenshot file according to the URI, that is, obtain the access permission of the screenshot file, and further can obtain the screenshot file for printing. For example, content:\ / \ / cn.netease.cloudmusic.fileprovider\ / external_storage_root\ / test\ / Test1.png is an example of a URI.

[0168] Exemplarily, as Figure 9 shown in interface 901, when the electronic device is displaying the chat interface 901 of the WeChat ® application and detects a printer, it calls the printing service to execute the above S701 - S705. The printing service determines that the foreground application corresponding to the current interface 901 is the WeChat ® application and is not an application in the whitelist, then generates a screenshot 91 and sends the URI of the saving location of the screenshot 91 to the printing module, so that the printing module can print the current display interface.

[0169] In this way, even if the foreground application is not an application in the whitelist, the user does not need to perform multiple operations to achieve automatic printing, reducing the user operation difficulty.

[0170] S607. The electronic device determines whether the display interface supports the printing service. If not, that is, the display interface does not support the printing service, then S606 is executed; if so, that is, the display interface supports the printing service, then S608 is executed.

[0171] In some embodiments, the foreground application is a whitelist application and supports the printing service. However, the foreground application may include multiple display interfaces, and the display content of some display interfaces may support the printing service while the display content of some display interfaces may not support the printing service. Then, the electronic device needs to further obtain the specific printing content supported by the display interface of the foreground application to implement printing.

[0172] In some embodiments, if the printing service determines that the foreground application is a whitelist application, it is necessary to establish a communication connection with the foreground application to determine whether the current display interface of the foreground application supports the printing service and obtain the information of the supported printing content.

[0173] Exemplarily, as Figure 7 shown in S707.

[0174] S707. The printing service establishes a communication connection with the foreground application.

[0175] In some embodiments, the printing service and the foreground application can establish a communication connection for transmitting signals based on the Android lightweight Messenger inter-process communication method.

[0176] Exemplarily, as Figure 10 shown, between the printing service 101 and the foreground application 102, a communication connection is established between the two using the Binder entity 1011 and the Binder entity 1012 for transmitting the interaction information in the subsequent steps. Further, on the side of the printing service 101, a handler (Handle) 1013 for processing the interaction information is configured, for example, for processing messages that can be sent to the foreground application 102 or the printing module. On the side of the foreground application 102, a handler (Handle) 1014 for processing the interaction information is configured, for example, for processing messages that can be sent to the printing service 101.

[0177] In this way, the electronic device realizes the information interaction between the printing service and the foreground application by establishing the communication connection as Figure 10 shown.

[0178] Optionally, the above S607 can be implemented as S708 - S711 as Figure 7 shown.

[0179] S708. The printing service sends query information to the foreground application.

[0180] In some embodiments, the printing service uses the communication connection with the foreground application to send query information to the foreground application. The query information is used to query whether the currently displayed interface of the foreground application supports the printing service. The query information may include, for example, the package name (clientName) of the printing service and the printing service identifier (bussinessID).

[0181] Among them, the package name of the printing service is used to notify the foreground application of the purpose of the current request message, and the printing service identifier may default to 0 (or described as 0x00). The query information may also be described as an application interface printing service (APP page printbusiness, APPB) request message. The printing service encapsulates the APPB request message in a preset encapsulation method and transmits the encapsulated APPB request message across processes through the communication connection established in S707 above. Accordingly, the foreground application receives the APPB request message. Among them, the preset encapsulation method may include encapsulating in a JSON object (or XML), Bundle, and Message in sequence, for example.

[0182] Exemplarily, an APPB request message is shown as follows.

[0183] {

[0184] " clientName":"com.test.smarthome ",

[0185] "bussinessID":0,

[0186] }

[0187] S709. The foreground application parses the query information to determine the supported printing service.

[0188] In some embodiments, after receiving the query information, the foreground application parses the query information. For example, it parses the Message, Bundle, and JSON Object in sequence to obtain the package name of the printing service and the printing service identifier. Based on the package name of the printing service and the printing service identifier, the foreground application determines the list of printing services supported by the content displayed on the current display interface and generates a query response.

[0189] In some embodiments, the query response can also be described as an APPB response message, which is used to notify the printing service of the printing services supported by the current display interface. The query response may include, for example, the foreground application package name (serverName), the printing service identifier (bussinessID), the foreground application interface name (foregroundName), and the list of supported printing services (contentlist). Among them, the list of supported printing services may include, for example, the content encoding (contentId), the content name (contentname), and the content type (fileType). The value of the content type field is used to represent the format of the printed content. For example, when the value of the fileType field is 0, it is used to indicate that the format of the printed content is a picture format. Another example is that when the value of the fileType field is 1, it is used to indicate that the format of the printed content is a document format. The above-mentioned value of the fileType field and its meaning are only for illustrative purposes, and the embodiments of the present application do not make specific limitations on this.

[0190] Exemplarily, an APPB response message is shown as follows.

[0191] {

[0192] "serverName": "cn.netease.cloudmusic",

[0193] "bussinessID": 0,

[0194] "foregroundName": "Music playing interface",

[0195] "contentlist": [{

[0196] "contentId": 1,

[0197] "contentname": "Lyric picture",

[0198] "fileType": 0

[0199] }]

[0200] }

[0201] S710. The foreground application sends a query response to the printing service.

[0202] In some embodiments, after generating the query response, the foreground application encapsulates the query response in a preset encapsulation method (such as JSONObject, Bundle, and Message encapsulation methods), and performs cross-process transmission through the communication connection established in S707 above. Correspondingly, the printing service receives the query response.

[0203] S711. The printing service determines whether the display interface supports the printing service.

[0204] In some embodiments, after receiving the query response, the printing service parses the query response. For example, it parses Message, Bundle, and JSON Object in sequence. According to the length of the contentlist field, it can determine whether the current display interface supports the printing service and which printing services it supports. For example, if the length of the contentlist field is 0, it means the display interface does not support the printing service. Alternatively, the printing service determines whether the current interface supports the printing service based on whether the query response contains the identifier of the displayed content. For example, after the query response contains the identifier of the displayed content in the current interface, the current interface supports the printing service, and the identifier is used to indicate at least one displayed content that supports printing included in the current interface. After the query response does not contain the identifier of the displayed content in the current interface, the current interface does not support the printing service.

[0205] Exemplarily, the printing service parses the query response exemplified in S709 above, and determines that the current foreground application display interface supports printing the lyrics picture according to the content of the contentlist field.

[0206] In this way, the electronic device determines whether the display interface supports the printing service through the above S708 - S711. If it supports the printing service, the electronic device can further obtain the printing content, that is, execute S608 below; if it does not support the printing service, the electronic device executes S606 above, that is, takes a screenshot of the display interface and determines that the printing content is the screenshot content.

[0207] Exemplarily, as Figure 7 shown, S712 is the same as S706 above. The printing service determines that the current display interface does not support the printing service, and then sends the screenshot of the current display interface to the printing module. Correspondingly, after receiving the screenshot, the printing module determines that the printing content to be printed is the screenshot content.

[0208] S608. The electronic device determines the printing content of the display interface.

[0209] In some embodiments, after the electronic device determines the printing service supported by the current display interface, it needs to further determine the printing content corresponding to the printing service supported by the current display interface. The printing content is at least one displayed content that supports printing included in the current display interface. For example, if the printing service supported by the current display interface is the lyrics picture, the electronic device needs to further obtain the lyrics picture information of the song currently playing on the current display interface to achieve printing.

[0210] Optionally, as Figure 7 shown, S608 can be implemented as S713 - S716 below.

[0211] S713. The printing service sends a printing content request to the foreground application.

[0212] In some embodiments, the printing service uses the communication connection with the foreground application to send a printing content request to the foreground application. The printing content request is used to request the printing content information of the printing service supported by the current interface of the foreground application. The printing content request may include, for example, the package name (clientName) of the printing service, the printing service identifier (bussinessID), the printing content identifier (contIdId), the printing content type (fileType), and the maximum number of prints supported (maxFileNum). Among them, the printing service identifier may default to 0. The printing content request may also be described as an application interface data (APP page data, APPD) request message. The printing service encapsulates the APPD request message in a preset encapsulation method (such as JSONObject, Bundle, and Message encapsulation methods) and performs cross-process transmission through the communication connection established in S707 above. Accordingly, the foreground application receives the APPD request message.

[0213] Exemplarily, an APPD request message is shown as follows.

[0214] {

[0215] " clientName":"com.test.smarthome ",

[0216] "bussinessId":0,

[0217] "contIdId":2,

[0218] "fileType":0,

[0219] "maxFileNum":10

[0220] }

[0221] S714. The foreground application parses the printing content request and determines the printing content information.

[0222] In some embodiments, after receiving a print content request, the foreground application parses the print content request. For example, it parses Message, Bundle, and JSON Object in sequence to obtain the package name (clientName) of the print service, the print service identifier (bussinessID), the print content identifier (contIdId), the print content type (fileType), and the maximum number of prints supported (maxFileNum). Then it determines the print content information to be printed and generates a print content response. The print content information includes, for example, the URI data of the print content.

[0223] In some embodiments, the print content response can also be described as an APPD response message, which is used to notify the print service of the URI data of the current print content, that is, to allow the print service to access the print content. The print content response can include, for example, the foreground application package name (serverName), the print service identifier (bussinessID), the print content identifier (contIdId), the print content type (fileType), the number of print contents (maxFileNum), and the print content file list (fileList). The print content file list (fileList) can include, for example, the file serial number (index), the file format (format), the file status (status), the file URI (fileUriStr), the file path (filePath), and the file size (fileSize).

[0224] Exemplarily, an APPD response message is shown as follows.

[0225] {

[0226] "serverName": "cn.netease.cloudmusic",

[0227] "bussinessID": 0,

[0228] "contIdId": 2,

[0229] "fileType": 0,

[0230] "maxFileNum": 2,

[0231] "fileList": [{

[0232] "index": 0,

[0233] "format": "jpg",

[0234] "status": 0,

[0235] "fileUriStr": "content: / / cn.netease.cloudmusic.fileprovider /

[0236] external_storage_root / test / Test0.jpg",

[0237] "filePath": "storage / emuolated / 0 / test / Test0.jpg",

[0238] "fileSize": 2488

[0239] ,

[0240] "index": 1,

[0241] "format": "png",

[0242] "status": 0,

[0243] "fileUriStr": "content: / / cn.netease.cloudmusic.fileprovider /

[0244] external_storage_root / test / Test1.png",

[0245] "filePath": "storage / emuolated / 0 / test / Test1.png",

[0246] "fileSize": 2466

[0247] }

[0248] }

[0249] S715. The foreground application sends a print content response to the print service.

[0250] In some embodiments, after the foreground application generates a print content response, it encapsulates the print content response in a preset encapsulation manner (such as JSON Object, Bundle, and Message encapsulation manners), and performs cross-process transmission through the communication connection established in S707 above. Correspondingly, the print service receives the print content response.

[0251] S716. The print service parses the print content response and obtains print content information.

[0252] In some embodiments, after the printing service receives the printing content response, it parses the printing content response. For example, it parses the Message, Bundle, and JSON Object in sequence to obtain the printing content information, such as the information in the file list, etc.

[0253] In this way, the electronic device determines the printing content information to be printed on the display interface of the foreground application through the above S713 - S716, obtains the access permission, and thus can execute the subsequent printing task.

[0254] S609. The electronic device displays a printing interface, detects the user's confirmation operation, and prints the corresponding printing content.

[0255] In some embodiments, after the electronic device determines the printing content information, it displays a printing interface to prompt the user to check whether the printing content is correct and whether to confirm the printing, so as to avoid abnormal printing caused by misoperation. For example, if the user accidentally triggers the above S601, the current user can choose not to print. Or, after the electronic device determines the printing content, it prompts the printing content. For example, the electronic device uses voice prompts, vibration prompts, etc. to prompt the user that the current electronic device needs to print and confirm whether to execute the printing job.

[0256] It should be noted that, as Figure 6 shown, the printing content determined in S609 is the printing content included in the printing content determined in the above S604, or S606, or S608. That is, the electronic device executes S609 after executing S604, or the electronic device executes S609 after executing S606, or the electronic device executes S609 after executing S608.

[0257] Exemplarily, as Figure 7 shown, S609 can be implemented as the following S717 and S718.

[0258] S717. The printing service sends the printing content information to the printing module.

[0259] In some embodiments, after the printing service obtains the printing information, it sends the printing information to the printing module, so that the printing module obtains the permission to access the printing content, thereby realizing printing.

[0260] For example, the printing service takes the URI of the data information content to be printed as a parameter and passes it to the printing module through AIDL cross - process call.

[0261] S718. The printing module responds to the user's confirmation operation and prints the corresponding printing content.

[0262] In some embodiments, after receiving the print content information, the printing module accesses the print content, displays a confirmation interface, and receives the user's confirmation operation on the print content. After receiving the confirmation operation, the corresponding print content is sent to the printer for printing.

[0263] Exemplarily, as Figure 11 shown in interface 1101 in (a) below, interface 1101 is used to display gallery content. Assume that during the display of interface 1101 on the electronic device, the printer is discovered by the tap-to-discover method, then the printing service is called to execute the above Figure 6 and Figure 7 shown method. At this time, as shown by icon 111 on interface 1101, the user has selected a picture, that is, the current print content is the picture indicated by icon 111, and the print content information is the URI data of the picture indicated by icon 111. After the printing module obtains the print content information, the electronic device is caused to display interface 1102 as shown in Figure 11 (b) below, which is used to prompt the user to confirm the print content. If the electronic device detects the operation of the user clicking the "Start Printing" control 112 and determines to print the current print content, the printing module sends the picture to the printer for printing.

[0264] Among them, the confirmation operation may include, for example, clicking a confirmation control (such as the "Start Printing" control), double-tapping the display screen and other preset gesture operations on the display screen, or may also include double-tapping the volume keys, double-tapping the back of the mobile phone and other preset operations, or may also include an operation of automatically confirming after waiting for a preset duration. The specific type of the confirmation operation is not specifically limited in the embodiments of the present application.

[0265] In some embodiments, assume that the print content is the print content obtained from the screenshot of the printing service in S706 or S712 as shown in Figure 7 below. If the printing module determines to cancel the printing in response to the user's operation, the electronic device can automatically delete the print content of the screenshot to save storage space. Or, the electronic device can respond to the user's operation and delete the print content of the corresponding screenshot.

[0266] In this way, for the automatic printing method provided by the embodiments of the present application, the electronic device can automatically identify the display content, realize automatic printing, without the user having to manually jump back and forth in multiple applications to find the print content. Thereby reducing the printing difficulty, improving the printing efficiency, and meeting the user's fast and convenient mobile printing needs.

[0267] In addition, through the query response (i.e., the APPB response message), the electronic device can pre-define the printing policies for different display interfaces of different applications, or pre-define the printing policies for different print contents supported by the same display interface, to meet the flexible printing needs of users.

[0268] In some scenarios, after the printing module receives the printing content information, it can directly send the printing content to the printer for printing without the user's confirmation operation, further reducing the user's operation and ensuring automatic printing without the user's additional operation. Or, in other scenarios, after the printing module receives the printing content information, it automatically sends the printing content to the printer for printing after waiting for a preset duration. In this way, the electronic device can also ensure automatic printing without the user's additional operation.

[0269] Exemplarily, as Figure 11 shown in the scenario, when the electronic device detects the printer during the process of displaying the interface 1101 shown in (a) in Figure 11 , it can directly perform picture printing without having to display the interface 1102 shown in (b) in Figure 11 and receive the user's confirmation operation.

[0270] It can be understood that in the above embodiments, Figure 7 the division of the printing service, the foreground application, and the printing module shown is only for exemplary illustration, and there may be other division methods to implement the above automatic printing method.

[0271] In some scenarios, the current display interface of the foreground application supports multiple printing contents, and the electronic device needs to confirm the printing content that the user needs to print. For example, the music playing interface supports printing lyric pictures and album cover pictures, and the electronic device cannot directly determine the printing content, so it needs to receive the user's selection operation to determine the printing content to be printed. Exemplarily, Figure 12 This is another automatic printing method provided by the embodiments of the present application. As Figure 12 shown, after S711 shown in Figure 7 , S1201 and S1202 may further be included.

[0272] S1201. The printing service determines whether it supports multiple printing contents. If so, that is, it supports multiple printing contents, then S1202 is executed; if not, that is, it only supports one printing content, then S713 is executed.

[0273] In some embodiments, the display interface of the foreground application may support one or more printing contents. After the printing service receives the query response, it parses the query response, and according to the length of the supported printing service list (contentlist) field, it can determine whether the display interface of the foreground application supports multiple printing contents. If the length of the supported printing service list (contentlist) field is greater than 1, it means that the display interface of the foreground application supports multiple printing contents.

[0274] Exemplarily, the printing service determines that the printing content data supported by the foreground application is 1 according to the length of the printing service list (contentlist) field supported in the APPB response message shown in S709 above, that is, it supports printing lyric pictures.

[0275] Also exemplarily, as Figure 13A shown in (a) below, the interface 1301 is a music playing interface with a music playing function and displays a music album cover picture. When the electronic device detects an operation of the user clicking on the blank position on the interface 1301, it can switch the displayed content. For example, it displays Figure 13A the interface 1302 shown in (b) below. The displayed content is switched to the lyric picture of the currently playing music. The interface 1302 is also a music playing interface with a music playing function. Then, different printing strategies can be implemented on the current music playing interface. For example, three printing strategies can be implemented: printing lyric pictures and / or printing album cover pictures. That is, the music playing function page supports multiple printing contents. When the electronic device detects a printer during the process of displaying the interface 1301 or the interface 1302 and determines that the current interface supports multiple printing contents, it executes S1202, and the user determines which printing strategy to specifically implement.

[0276] The following shows the APPB response message in the current scenario. The printing service determines that the printing content data supported by the foreground application is 2 according to the length of the printing service list (contentlist) field in the APPB response message, that is, it supports printing lyric pictures and album cover pictures.

[0277] {

[0278] "serverName": "cn.netease.cloudmusic",

[0279] "bussinessID": 0,

[0280] "foregroundName": "Music playing interface",

[0281] "contentlist": [{

[0282] "contentId": 1,

[0283] "contentname": "Lyric picture",

[0284] "fileType": 0

[0285] }, {

[0286] "contentId": 2,

[0287] "contentname": "Album cover picture",

[0288] "fileType": 0

[0289] }]

[0290] }

[0291] It can be seen that the printed content corresponding to different printing strategies includes the display content visible to the user of the current interface of the electronic device, and can also include the display content invisible to the user of the current interface of the electronic device. For example, when the electronic device detects a printer during the process of displaying the interface 1301 shown in (a) of Figure 13A , it triggers the printing process. The current interface 1301 supports printing the display content visible to the user (such as the album cover picture displayed on the interface 1301) and supports printing the display content invisible to the user (such as Figure 13A the lyric picture displayed on the interface 1302 shown in (b) of

[0292] It should be noted that the embodiments of the present application do not limit the execution order of S711 and S1201. For example, after receiving the query response, the printing service can simultaneously determine whether the foreground application display interface supports the printing service and the number of supported printed contents according to the query response.

[0293] S1202. The printing service displays multiple supported printed contents and receives the printed content selected by the user.

[0294] In some embodiments, if the printing service determines that the data of the printed contents supported by the foreground application is multiple, it is necessary to display a printed content selection interface and receive the printed content selected by the user. For example, the printing service generates a prompt message according to the list of supported printed contents in the parsed APPB response message, and uses a custom session (Dialog) or activity (Activity) in Android for interface prompting to receive the printed content selected by the user.

[0295] Exemplarily, as shown in interface 1303 in (a) of Figure 13B , assuming that the number of printed contents supported by the music playing interface is 2, including the lyric picture and the album cover picture. After the electronic device discovers the printer through methods such as tap-to-share discovery, a pop-up window displays a prompt box 131 for displaying the prompt message generated by the printing service. After the electronic device detects the operation of the user clicking on the "lyric picture" control 132, it determines that the current printed content to be printed is the lyric picture. Then the printing service determines the printed content selected by the user, and then can execute S713 to request the corresponding printed content information from the foreground application. Or, after the electronic device discovers the printer through methods such as tap-to-share discovery, it displays as shown in Figure 13BThe interface 1304 shown in (b) prompts the user to select the content to be printed by displaying the notification information 133.

[0296] In some scenarios, the number of print contents supported by the foreground application display interface is multiple. The print service can obtain the print content information of multiple print contents from the foreground application, and then send all the print content information of the multiple print contents to the print module. During the process of receiving the user's operation to confirm printing, the print module directly determines the print content. That is, the print service does not execute the above S1201 and S1202. In the Figure 7 method flow shown, the specific print content is directly determined in S718.

[0297] Exemplarily, as Figure 14 the interface 1401 shown in (a), assuming that the electronic device discovers the printer through methods such as tap-to-discover, as shown in the interface 1401, the electronic device has selected the picture 141 and the picture 142. Then, during the above automatic print content recognition process, the print content response obtained by the print service in Figure 7 the shown S715 contains the URI data of the picture 141 and the URI data of the picture 142. The print service sends the URI data of the picture 141 and the URI data of the picture 142 to the print module, and the print module has the permission to access the picture 141 and the picture 142 at this time (that is, it can print the picture 141 and the picture 142). As Figure 14 the interface 1402 shown in (b), the print module receives the print content selected by the user. As shown in the interface 1402, the current "Page 1" control 143 and "Page 2" control 144 are both in the selected state, and the picture 141 and the picture 142 can both be printed (that is, both print contents can be printed). If the electronic device detects the operation of the user clicking the "Page 2" control 144 and cancels the selected state, it is determined that the user does not print the picture corresponding to the "Page 2" control 144, and only prints the picture corresponding to the "Page 1" control 143.

[0298] In this way, in the scenario where the foreground application display interface supports multiple print contents, the electronic device can flexibly determine the print content according to the user's selection.

[0299] In some scenarios, after the foreground application receives and parses the query information, it can not only determine the supported print services, but also directly determine the print content information corresponding to the supported print services. Then, when sending the query response to the print service, it can directly carry the print content information in the query response. Figure 15 This is another schematic diagram of the automatic print method provided by the embodiment of the present application. As Figure 15 shown, after Figure 7 the shown S711, the print service can execute S1501.

[0300] S1501. The printing service determines the print content information.

[0301] In some embodiments, after receiving the query response, the printing service determines whether the query response carries the print content information. Among them, the print content information determined by the printing service can be the print content information of all the print contents supported by the foreground application display interface. The print content information determined by the printing service can also be the print content information of the print content determined and selected by the user to print, that is, corresponding to Figure 15 the process shown, such as Figure 12 in the process shown, after S1202, S1501 can also be executed. After the printing service determines the print content information, it does not have to request the print content information from the foreground application anymore, that is, it does not have to execute S713 - S716 anymore and does not have to interact with the foreground application for APPD messages.

[0302] Exemplarily, in the scenario shown, in S710 shown, in the query response determined by the foreground application, the information carried includes that the interface 1101 shown in Figure 11 supports the printing service, the number of print contents is 1 (that is, the print content is the picture indicated by the icon 111), and the URI data of the picture indicated by the icon 111. Then, after receiving the query response, the printing service can directly send the URI data of the picture indicated by the icon 111 to the printing module for printing. Figure 7 Figure 11 Figure 11 In (a), the interface 1101 supports the printing service, the number of print contents is 1 (that is, the print content is the picture indicated by the icon 111), and the URI data of the picture indicated by the icon 111. Then, after receiving the query response, the printing service can directly send the URI data of the picture indicated by the icon 111 to the printing module for printing.

[0303] In this way, the electronic device can reduce the interaction information transmission steps between the printing service and the foreground application and improve the printing efficiency.

[0304] In some scenarios, the electronic device can receive the user's editing of the whitelist applications. For example, the application developers register applications A, B, and C on the developer website and register these three applications as whitelist applications that support automatic print recognition. After the electronic device obtains the whitelist, it receives the user's editing of the whitelist. For example, if the user does not allow the content corresponding to application B to be printed, the whitelist permission of application B can be cancelled in the whitelist. Then, subsequently, in Figure 6In the S605 shown, the electronic device determines that application B is not a whitelist application. If printing is required, only screenshot printing can be performed. For another example, the application developer registers printing content 1, printing content 2, printing content 3, printing content 4, and printing content 5 of application A on the developer website, so that the number of printing contents supported by the whitelist application A is 5. After the electronic device obtains the whitelist, it receives the user's editing of the whitelist. For example, if the user's common printing requirement is printing content 1, the electronic device can, in response to the user's selection, cancel the whitelist permissions of printing content 2, printing content 3, printing content 4, and printing content 5 of application A in the whitelist. Then, in the subsequent process as shown in Figure 12 the printing service can no longer execute S1201 and S1202, that is, it does not need to receive the user's selection, further reducing the user's operation and improving the printing efficiency.

[0305] Exemplarily, as shown in Figure 16 interface 1601, the electronic device receives the user's editing of the whitelist application on interface 1601. For example, when the electronic device detects the operation of the user clicking the "Switch to Edit" control 161, it can switch to edit the whitelist application, such as currently editing application A. When the electronic device detects the operation of the user clicking the "Select" control 162 corresponding to the printing content option, it can determine whether the user selects or cancels the whitelist permission of the corresponding printing content. For example, currently the electronic device determines that the user cancels the whitelist permissions of printing content 2 and printing content 4. After the electronic device detects the operation of the user clicking the "Deselect All" control 163, it can determine that the user cancels the whitelist permission of application A (that is, cancels the whitelist permissions of all printing contents of application A). After that, after the electronic device detects the operation of the user clicking the "OK" control 164, it determines that the user has completed the editing of the whitelist application.

[0306] In this way, the electronic device can edit the whitelist application according to the user's personalized needs, further enhancing the user's experience.

[0307] In some scenarios, the printing service can also perform the operations executed by the printing module in the above method embodiments. For example, after determining the printing content, the printing service directly sends the printing content to the printing device for printing.

[0308] The above has described in detail the automatic printing method provided by the embodiments of the present application in combination with Figures 6 - 16 The following will describe in detail the automatic printing device provided by the embodiments of the present application in combination with Figure 17 In a possible design,

[0309] is a schematic structural diagram of the electronic device provided by the embodiments of the present application. As shown in Figure 17 Figure 17 ​As shown, the electronic device 1700 may include: a display unit 1701, a processing unit 1702, and a transceiver unit 1703. The electronic device 1700 can be used to implement the functions of the electronic device involved in the above method embodiments.

[0310] Optionally, the display unit 1701 is used to support the electronic device 1700 to display interface content; and / or, support the electronic device 1700 to execute Figure 6 S609 in

[0311] Optionally, the processing unit 1702 is used to support the electronic device 1700 to execute Figure 6 S602, S603, S605, S606, S607, and S608 in

[0312] Optionally, the transceiver unit 1703 is used to support the electronic device 1700 to execute Figure 6 S601, S604, and S609 in

[0313] Wherein, the transceiver unit may include a receiving unit and a transmitting unit, and can be implemented by a transceiver or transceiver-related circuit components, and can be a transceiver or a transceiver module. The operations and / or functions of each unit in the electronic device 1700 are respectively for implementing the corresponding processes of the automatic printing method described in the above method embodiments. All relevant contents of each step involved in the above method embodiments can be cited in the function descriptions of the corresponding functional units. For the sake of brevity, they will not be elaborated here.

[0314] Optionally, Figure 17 the electronic device 1700 shown may further include a storage unit ( Figure 17 not shown in Figure 17 ), and a program or instruction is stored in the storage unit. When the display unit 1701, the processing unit 1702, and the transceiver unit 1703 execute the program or instruction, the

[0315] Figure 17 electronic device 1700 shown can execute the automatic printing method described in the above method embodiments.

[0316] In addition to the form of the electronic device 1700, the technical solution provided by the present application can also be a functional unit or chip in the electronic device, or a device used in combination with the electronic device.

[0317] The embodiment of the present application further provides a chip system, including: a processor, the processor is coupled to a memory, and the memory is used to store programs or instructions. When the programs or instructions are executed by the processor, the chip system implements the methods in any of the above method embodiments.

[0318] Optionally, the processor in the chip system can be one or more. The processor can be implemented by hardware or by software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented by software, the processor can be a general-purpose processor that implements by reading software code stored in the memory.

[0319] Optionally, the memory in the chip system can also be one or more. The memory can be integrated with the processor or can be separately arranged from the processor, and the embodiment of the present application does not limit this. Exemplarily, the memory can be a non-transitory processor, such as a read-only memory ROM, which can be integrated with the processor on the same chip or can be separately arranged on different chips. The embodiment of the present application does not specifically limit the type of the memory and the setting manner of the memory and the processor.

[0320] Exemplarily, the chip system can be a field programmable gate array (FPGA), can be an application specific integrated circuit (ASIC), can also be a system on chip (SoC), can also be a central processor unit (CPU), can also be a network processor (NP), can also be a digital signal processing circuit (DSP), can also be a micro controller unit (MCU), can also be a programmable logic device (PLD) or other integrated chips.

[0321] It should be understood that each step in the above method embodiments can be completed by the integrated logic circuit in the hardware of the processor or by instructions in the form of software. The method steps disclosed in combination with the embodiments of the present application can be directly embodied as being executed and completed by the hardware processor, or can be executed and completed by a combination of the hardware and software modules in the processor.

[0322] An embodiment of the present application further provides a computer-readable storage medium. A computer program is stored in the computer-readable storage medium. When the computer program runs on a computer, the computer is enabled to execute the above-related steps to implement the automatic printing method in the above embodiment.

[0323] An embodiment of the present application further provides a computer program product. When the computer program product runs on a computer, the computer is enabled to execute the above-related steps to implement the automatic printing method in the above embodiment.

[0324] In addition, an embodiment of the present application further provides a device. The device may specifically be a component or a module. The device may include one or more processors and a memory connected to each other. Among them, the memory is used to store a computer program. When the computer program is executed by one or more processors, the device is enabled to execute the automatic printing method in each of the above method embodiments.

[0325] Among them, the device, computer-readable storage medium, computer program product, or chip provided in the embodiment of the present application are all used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be elaborated here.

[0326] The steps of the method or algorithm described in combination with the disclosed content of the embodiment of the present application can be implemented in a hardware manner or in a manner of a processor executing software instructions. The software instructions may be composed of corresponding software modules. The software modules may be stored in a random access memory (RAM), flash memory, read only memory (ROM), erasable programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), registers, hard disk, removable hard disk, compact disc read only memory (CD-ROM), or any other form of storage medium well known in the art. An exemplary storage medium is coupled to the processor, so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium may also be a component of the processor. The processor and the storage medium may be located in an application specific integrated circuit (ASIC).

[0327] Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and conciseness of description, only the division of the above functional modules is used as an example. In practical applications, the above functions can be allocated to different functional modules as needed; that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. For the specific working processes of the systems, devices, and units described above, reference can be made to the corresponding processes in the foregoing method embodiments, which will not be elaborated herein.

[0328] In several embodiments provided in the present application, it should be understood that the disclosed method can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division, and there can be other division methods in actual implementation; for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces, and the indirect couplings or communication connections of the modules or units can be in electrical, mechanical or other forms.

[0329] In addition, in each embodiment of the present application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.

[0330] The computer-readable storage medium includes, but is not limited to, any of the following: USB flash drive, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disc, etc., which can store program codes.

[0331] As described above, only the specific embodiments of the present application are provided, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. An automatic printing method, characterized in that, applied to an electronic device, the method comprising: after the electronic device approaches or touches the NFC sensing area on the printing device, the electronic device detects the printing device and establishes a wireless communication connection with the printing device; when the foreground application of the electronic device is a non-desktop application and the foreground application is a whitelist application, the electronic device automatically obtains the printing content according to the current interface of the foreground application and displays a printing content confirmation interface, the printing content is not a screenshot of the current interface, and the printing content includes at least one of the following: at least one display content supported by the current interface for printing, display content not displayed in the current interface but supported by printing; in response to receiving a confirmation operation from the user, the electronic device sends the printing content to the printing device.

2. The method according to claim 1, characterized in that, when the foreground application of the electronic device is a desktop application, the method further comprises: in response to receiving another user input, at least one display element supported by printing in the current interface of the desktop application is selected, and the electronic device sends the selected display element to the printing device.

3. The method according to claim 1 or 2, characterized in that, the method further comprises: the electronic device sends a query message to the foreground application through a printing service running on the electronic device; the printing service receives a query response sent by the foreground application; according to the query response, the electronic device obtains the printing content.

4. The method according to claim 3, characterized in that, after the query response contains an identifier of the display content in the current interface, the current interface supports the printing service, and the identifier is used to indicate at least one display content supported by printing included in the current interface; after the query response does not contain an identifier of the display content in the current interface, the current interface does not support the printing service.

5. The method according to claim 1, characterized in that, the wireless communication connection includes any one of the following: Wi-Fi P2P connection, Bluetooth connection, NFC connection, Zigbee connection, or infrared connection.

6. The method according to any one of claims 1-2 and 4-5, characterized in that, the method further comprises: the electronic device runs a printing service and a printing module; the electronic device sends the printing content to the printing device; including: the electronic device sends the printing content to the printing device through the printing service and the printing module.

7. An electronic device, characterized in that, the electronic device comprises: a processor; a memory; and a computer program, wherein the computer program is stored on the memory, and when the computer program is executed by the processor, the electronic device is caused to execute: after the electronic device approaches or touches the NFC sensing area on the printing device, the electronic device detects the printing device and establishes a wireless communication connection with the printing device; When the foreground application of the electronic device is a non-desktop application and the foreground application is a whitelist application, the electronic device automatically obtains the print content according to the current interface of the foreground application and displays a print content confirmation interface. The print content is not a screenshot of the current interface, and the print content includes at least one of the following: at least one display content supported by the current interface for printing, and display content that is not displayed on the current interface but is supported by printing. In response to receiving a confirmation operation from the user, the electronic device sends the print content to the printing device.

8. The electronic device according to claim 7, wherein, the electronic device further performs: When the foreground application of the electronic device is a desktop application, in response to another user input received, at least one display element supported by printing in the current interface of the desktop application is selected, and the electronic device sends the selected display element to the printing device.

9. The electronic device according to claim 7 or 8, wherein, the electronic device further performs: The electronic device sends a query message to the foreground application through a printing service running on the electronic device; The printing service receives a query response sent by the foreground application; According to the query response, the electronic device obtains the print content.

10. The electronic device according to claim 9, wherein, After the query response contains an identifier of the display content in the current interface, the current interface supports the printing service, and the identifier is used to indicate at least one display content supported by printing included in the current interface; After the query response does not contain an identifier of the display content in the current interface, the current interface does not support the printing service.

11. The electronic device according to claim 7, wherein, The wireless communication connection includes any one of the following: Wi-Fi P2P connection, Bluetooth connection, NFC connection, Zigbee connection, or infrared connection.

12. The electronic device according to any one of claims 7-8 and 10-11, wherein, the electronic device further performs: The electronic device runs a printing service and a printing module; The electronic device sending the print content to the printing device includes: The electronic device sends the print content to the printing device through the printing service and the printing module.

13. A computer-readable storage medium, wherein, The computer-readable storage medium includes a computer program, and when the computer program runs on an electronic device, it causes the electronic device to execute the method according to any one of claims 1-6.

14. A computer program product, wherein, When the computer program product runs on a computer, it causes the computer to execute the method according to any one of claims 1-6.

15. A printing system, wherein, comprising: a printing device and the electronic device according to any one of claims 7-12.

Citation Information

Patent Citations

  • Print data processing method of mobile device and the mobile device

    CN108701010A

  • Information processing apparatus and printing system

    JP2017204191A

  • Operation terminal, program, and printing system

    US20190114129A1