WO2022228076A1 - Automatic printing method and electronic device - Google Patents

Automatic printing method and electronic device Download PDF

Info

Publication number
WO2022228076A1
WO2022228076A1 PCT/CN2022/085616 CN2022085616W WO2022228076A1 WO 2022228076 A1 WO2022228076 A1 WO 2022228076A1 CN 2022085616 W CN2022085616 W CN 2022085616W WO 2022228076 A1 WO2022228076 A1 WO 2022228076A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
printing
print
print content
content
Prior art date
Application number
PCT/CN2022/085616
Other languages
French (fr)
Chinese (zh)
Inventor
成闻博
时锐
谢存
宋连祥
潘锦玲
高仲
刘建军
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022228076A1 publication Critical patent/WO2022228076A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1278Dedicated interfaces to print systems specifically adapted to adopt a particular infrastructure
    • G06F3/1285Remote printer device, e.g. being remote from client or server
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1223Dedicated interfaces to print systems specifically adapted to use a particular technique
    • G06F3/1237Print job management
    • G06F3/1238Secure printing, e.g. user identification, user rights for device usage, unallowed content, blanking portions or fields of a page, releasing held jobs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1223Dedicated interfaces to print systems specifically adapted to use a particular technique
    • G06F3/1237Print job management
    • G06F3/1268Job submission, e.g. submitting print job order or request not the print data itself

Definitions

  • the embodiments of the present application relate to the technical field of terminals, and in particular, to an automatic printing method and an electronic device.
  • the present application provides an automatic printing method and electronic device.
  • the technical solution provided by the present application can enable the user to automatically and quickly print according to the current interface of the electronic device only by bringing the electronic device close to the printing device; this process requires only a small amount of user operation or no additional user operation; the user experience is relatively low. high.
  • 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.
  • 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 print content according to the current interface of the foreground application.
  • all or part of the print is selected and the electronic device sends all or part of the selected print to the printing device; alternatively, the electronic device automatically sends the print to the printing device.
  • the electronic device automatically sends the print content to the printing device.
  • the foreground application is an application corresponding to the current interface of the electronic device.
  • the interface of which application is currently displayed on the display screen of the electronic device is the foreground application.
  • the electronic device uses the queried application package name to determine the application package name included in the registered whitelist, and then determines that the foreground application is a whitelisted application.
  • the whitelist is a registered list of applications supporting printing services.
  • the electronic device and the printing device can support one or more of the NFC touch discovery function, the Bluetooth proximity discovery function, the proximity discovery function of the IEEE 802.11 protocol, the general smart sensor 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.
  • the electronic device detects the printing device and automatically obtains the printing content according to the foreground application interface
  • the electronic device can determine part or all of the content selected by the user as the content to be printed and send to the printing device.
  • the electronic device directly sends the acquired print content to the printing device for printing.
  • the electronic device can automatically identify the foreground application interface and determine the content to be printed, and printing can be realized without additional user operation or only a small amount of user operation.
  • the method further includes: in response to another user input received, at least one display element supporting printing in the current interface of the desktop application is selected, and the electronic device sends The printing device sends the selected display element; or, the electronic device automatically sends a screenshot of the current interface of the desktop application to the printing device.
  • the electronic device determines that the foreground application is the system desktop (that is, the desktop application) according to the package name of the determined foreground application, so it cannot directly determine the content that the user needs to print, and needs to receive a message that the user selects the print content on the desktop application display interface. operate.
  • the print content selected by the user is at least one display element that supports printing in the current desktop application display interface, and the display element may be a control, an icon, or the like displayed on the interface.
  • the electronic device screenshots the display interface of the current foreground application, and determines the screenshot file as the content to be printed.
  • the electronic device can also automatically obtain the print content, ensuring that the user can perform convenient printing with fewer operations in various scenarios.
  • the electronic device automatically obtains the print content; including: after the current interface supports the printing service, determining the print content corresponding to the current interface, and The print content is automatically acquired; the print content is at least one display content included in the current interface that supports printing.
  • the number of print contents supported by the display interface of the foreground application is one or more.
  • the foreground application is a music application
  • the current display interface is a music playback interface
  • the music playback interface supports displaying lyrics pictures and album cover pictures.
  • the printed content that can be acquired by the electronic device is the lyrics picture and/or the album cover picture.
  • the print content acquired by the electronic device may be the display content being displayed on the current interface, or may be the display content that is not displayed on the current interface but supports printing.
  • the electronic device can automatically obtain all or part of the display content supported by the display interface for printing according to the display interface, so as to meet the printing requirements of the user.
  • the electronic device automatically obtains the print content according to the current interface of the foreground application; including: after the current interface does not support the printing service, determining that the screenshot of the current interface is the print content , and get the print content automatically.
  • the electronic device determines that the current interface does not support the printing service, it can also obtain the printing content by taking a screenshot, realize automatic printing, and meet the printing demand of the user.
  • the method further includes: the electronic device sends a query message to the foreground application through a print service run by the electronic device.
  • the print service receives the query response sent by the foreground application.
  • the electronic device obtains the print content.
  • the electronic device invokes the printing service to determine the printing content.
  • a communication connection for transmitting signals is established between the printing service and the foreground application, and based on the communication connection, the information exchange between the printing service and the foreground application is realized. For example, obtain the print content and related information of the print content.
  • the current interface supports a printing service, and the identifier is used to indicate at least one display that supports printing included in the current interface. content.
  • 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.
  • the print service can determine whether the current display interface supports printing services, and which printing services are supported. For example, the print service determines, according to the identifier of the display content, that the foreground application supports printing the display content corresponding to the representation. For example, if the query response includes an identifier of the lyrics image (eg, contentname), the print service determines that the current interface supports printing the lyrics image.
  • the print service determines, according to the identifier of the display content, that the foreground application supports printing the display content corresponding to the representation. For example, if the query response includes an identifier of the lyrics image (eg, contentname), the print service determines that the current interface supports printing the lyrics image.
  • the lyrics image eg, contentname
  • the electronic device can quickly determine the print content to be printed according to the identifier carried in the query response, thereby improving the efficiency of automatically identifying the print content.
  • the method further includes: the electronic device prompts the print content.
  • the electronic device displays a print interface for prompting the user to check whether the print content is correct and whether to confirm the print, so as to avoid abnormal printing caused by misoperation. For example, if the user accidentally triggers the printing process (for example, accidentally touching the NFC area of the printing device to establish a connection with the printing device), the current user may choose not to print. Or, after determining the print content, the electronic device prompts the print content. For example, the electronic device prompts the user that the current electronic device needs to print by means of voice prompts, vibration prompts, etc., and confirms whether to execute the print job.
  • the electronic device prompts the print content; including: the electronic device displays a print content confirmation interface.
  • the electronic device receives the user's confirmation operation by displaying the confirmation interface, so as to ensure the security of the printing operation.
  • the determination operation may include, for example, a preset gesture operation on the display screen such as clicking on a confirmation control (such as a "start printing" control), double-clicking the display screen, etc., or may also include preset operations such as double-clicking the volume key, double-clicking the back shell of the mobile phone, etc., Alternatively, it may also include an operation of automatically confirming after waiting for a preset period of time.
  • the specific type of the determination operation is not specifically limited in this embodiment of the present application.
  • the electronic device 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 ; comprising: the electronic device receives the 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 the second user input. In response to the second user input received by the electronic device, the electronic device transmits all or part of the selected print content to the printing device.
  • the user input includes a first user input and a second user input.
  • the number of prints is plural.
  • the electronic device After acquiring the plurality of print contents, the electronic device displays selection information of the plurality of print contents for the user to select and confirm, that is, to receive the user's first user input. After it is determined that the user needs to print part or all of the print content, the corresponding print content information is obtained, and then a second user input operation of the user is received to determine to send the print content to the printing device.
  • the electronic device in response to the received user input, automatically sends the print content to the printing device; including: the electronic device receives the second user input. In response to the second user input received by the electronic device, the electronic device automatically sends the print content to the printing device.
  • the user input includes a second user input.
  • the number of prints is one.
  • the electronic device After acquiring the print content, the electronic device sends the acquired print content to the printing device directly in response to the user's operation for determining printing.
  • the number of print contents is one or more, and after acquiring the one or more print contents, the electronic device sends the one or more print contents to the printing device after detecting that the user has determined the printing operation. to print.
  • the electronic device determines that the user's determination operation is received, the electronic device sends the print content to the printing device for printing, which can ensure the security of printing.
  • 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 printing content to the printing device; including: the electronic device sends all or part of the printing content to the printing device through a printing service and a printing module.
  • the printing module may contain one or more plug-ins in the electronic device corresponding to the printing 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 business, so as to realize automatic printing.
  • an electronic device in a second aspect, includes: a processor, a memory and a computer program, wherein the computer program is stored in the memory, and when the computer program is executed by the processor, the electronic device executes: within a certain distance of the printing device, the electronic device detects the printing device , and establish a communication connection with the printing device.
  • 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 print content according to the current interface of the foreground application.
  • all or part of the print is selected and the electronic device sends all or part of the selected print to the printing device; alternatively, the electronic device automatically sends the print to the printing device.
  • the electronic device automatically sends the print content to the printing device.
  • the electronic device further performs: after the foreground application of the electronic device is a desktop application, in response to another user input received, at least one display element supporting printing in the current interface of the desktop application is selected, and the electronic device The selected display element is sent to the printing device; or, the electronic device automatically sends a screenshot of the current interface of the desktop application to the printing device.
  • the electronic device automatically obtains the print content; including: after the current interface supports the printing service, determining the print content corresponding to the current interface, and The print content is automatically acquired; the print content is at least one display content included in the current interface that supports printing.
  • the electronic device automatically obtains the print content; including: after the current interface does not support the printing service, determining that the screenshot of the current interface is the print content , and get the print content automatically.
  • the electronic device further executes: the electronic device sends a query message to the foreground application through a print service run by the electronic device.
  • the print service receives the query response sent by the foreground application.
  • the electronic device obtains the print content.
  • the current interface supports a printing service, and the identifier is used to indicate at least one display that supports printing included in the current interface. content.
  • 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.
  • the electronic device after the electronic device automatically acquires the print content, the electronic device further executes: the electronic device prompts the print content.
  • the electronic device prompts the print content; including: the electronic device displays a print content confirmation interface.
  • the electronic device 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 ; comprising: the electronic device receives the 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 the second user input. In response to the second user input received by the electronic device, the electronic device transmits all or part of the selected print content to the printing device.
  • the user input includes a first user input and a second user input.
  • the electronic device in response to the received user input, automatically sends the print content to the printing device; including: the electronic device receives the second user input; in response to the electronic device With the received second user input, the electronic device automatically sends the print content to the printing device; wherein the user input includes the second user input.
  • 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 printing content to the printing device; including: the electronic device sends all or part of the printing content to the printing device through a printing service and a printing module.
  • an embodiment of the present application provides an electronic device, the electronic device has the function of implementing the automatic printing method described in the first aspect and any of the possible implementation manners.
  • This function can be implemented by hardware, or can also be implemented by hardware executing corresponding software.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • a computer-readable storage medium stores a computer program (also referred to as instructions or codes), which when executed by an electronic device, causes the electronic device to perform the method of the first aspect or any one of the embodiments of the first aspect.
  • a computer program also referred to as instructions or codes
  • an embodiment of the present application provides a computer program product that, when the computer program product runs on an electronic device, enables the electronic device to execute the first aspect or the method of any one of the implementations of the first aspect.
  • an embodiment of the present application provides a circuit system, where the circuit system includes a processing circuit, and the processing circuit is configured to execute the method of the first aspect or any one of the implementation manners of the first aspect.
  • an embodiment of the present application provides a chip system, including at least one processor and at least one interface circuit, where the at least one interface circuit is configured to perform a transceiving function and send instructions to the at least one processor.
  • the at least one processor executes the instructions, at least one processor performs the method of the first aspect or any one of the embodiments of the first aspect.
  • FIG. 1 is a schematic diagram one of an interface provided by an embodiment of the present application.
  • FIG. 2 is a schematic diagram 2 of an interface provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram three of an interface provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a scene of an automatic printing method provided by an embodiment of the present application.
  • 5A is a schematic structural diagram 1 of an electronic device provided by an embodiment of the present application.
  • 5B is a schematic block diagram of a software structure of an electronic device provided by an embodiment of the present application.
  • FIG. 6 is a flowchart 1 of an automatic printing method provided by an embodiment of the present application.
  • FIG. 8 is a fourth schematic diagram of an interface provided by an embodiment of the present application.
  • FIG. 9 is a schematic diagram five of the interface provided by the embodiment of the present application.
  • FIG. 10 is a schematic diagram of a communication framework provided by an embodiment of the present application.
  • FIG. 11 is a sixth schematic diagram of an interface provided by an embodiment of the present application.
  • FIG. 12 is a flowchart three of the automatic printing method provided by the embodiment of the present application.
  • FIG. 13A is a seventh schematic diagram of an interface provided by an embodiment of the present application.
  • FIG. 13B is the eighth schematic diagram of the interface provided by the embodiment of the present application.
  • FIG. 14 is a schematic diagram 9 of an interface provided by an embodiment of the present application.
  • FIG. 16 is a schematic diagram ten of an interface provided by an embodiment of the present application.
  • FIG. 17 is a second schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • references in this specification to "one embodiment” or “some embodiments” and the like mean that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application.
  • appearances of the phrases “in one embodiment,” “in some embodiments,” “in other embodiments,” “in other embodiments,” etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean “one or more but not all embodiments” unless specifically emphasized otherwise.
  • the terms “including”, “including”, “having” and their variants mean “including but not limited to” unless specifically emphasized otherwise.
  • the term “connected” includes both direct and indirect connections unless otherwise stated. "First” and “second” are only for descriptive purposes, and cannot be understood as indicating or implying relative importance or implying the number of indicated technical features.
  • words such as “exemplarily” or “for example” are used to represent examples, illustrations or illustrations. Any embodiment or design described in the embodiments of the present application as “exemplarily” or “such as” should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as “exemplarily” or “such as” is intended to present the related concepts in a specific manner.
  • the electronic device can be connected to a printer to send the content to be printed to the printer for printing, and the electronic device needs to receive the user's selection to determine the content to be printed.
  • some applications (such as a gallery, etc.) in the electronic device are supported by an operating system (such as etc.) to print.
  • the user when a user wants to print an album cover image during the process of playing music by using a music application, the user needs to save the album cover image before printing.
  • the interface 101 shown in Fig. 1 (a) after the electronic device (such as a mobile phone) detects the user's long-pressing operation of the picture 11, the interface 102 shown in Fig. 1 (b) is displayed to determine whether the user saves the picture (ie album cover image). 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. As shown in the interface 201 in FIG.
  • the electronic device opens the gallery application in response to the user operation, and saves the album cover image to be printed (such as the image indicated by mark 21) in the gallery application.
  • the electronic device After detecting the operation of the user clicking on the picture indicated by the mark 21, the electronic device opens the album cover picture to display the interface 202 shown in (b) of FIG. 2 .
  • the print interface After detecting that the user clicks on the "more” control 22, more edit categories are displayed.
  • the print interface is invoked, and the interface 203 shown in FIG. 2(c) is displayed.
  • an interface 204 as shown in (d) of FIG. 2 is displayed.
  • a third-party printing application or applet is installed in the electronic device, and printing can be performed by using the application or applet.
  • the electronic device uses the method shown in FIG. 1 to save the album cover picture. Then, as shown in the interface 301 in (a) of FIG. 3, the electronic device starts the third-party printing application display interface 301 in response to the user's operation, and after detecting the user's operation of clicking the "Gallery Print" control 31, determines that the user needs After printing the picture, it is necessary to detect the content to be printed selected by the user.
  • FIG. 3(b) detects that the user clicks the “select picture” control 32 and clicks the “OK” control 33. After confirming that the user chooses to print the picture, the display is displayed as shown in FIG. 3(c). The display interface 303 is displayed, and after detecting that the user clicks on the "printer A" control 34, it is determined that the user selects the printer A for picture printing, and the picture selected by the user is sent to the printer A for printing.
  • the embodiments of the present application provide an automatic printing method, in which the electronic device can automatically identify the content displayed in the foreground, and automatically determine whether the content displayed in the foreground supports printing. User experience.
  • FIG. 4 is a schematic scene diagram of an automatic printing method provided by an embodiment of the present application.
  • the electronic device 100 has established a communication connection with the printing device 200 .
  • the electronic device 100 establishes a wireless communication connection with the printing device 200 .
  • the electronic device 100 may send the to-be-printed file on the electronic device 100 to the printing device 200 for printing through the wireless communication connection with the printing device 200 .
  • the electronic device 100 may establish a wireless communication connection with the printing device 200 through a wireless communication technology.
  • the wireless communication technologies include, but are not limited to, at least one of the following: near field communication (NFC), Bluetooth (BT) (for example, traditional Bluetooth or bluetooth low energy (BLE) Bluetooth) ), wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Zigbee (Zigbee), frequency modulation (FM), infrared (IR), etc.
  • both the electronic device 100 and the printing device 200 support the proximity discovery function.
  • both the electronic device 100 and the printing device 200 can realize the proximity discovery function through NFC sensing.
  • 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 and a Bluetooth connection.
  • P2P Wi-Fi peer-to-peer
  • the electronic device 100 identifies the current interface, automatically determines the print content according to the current interface, and sends the print content to the printing device 200 for printing, which effectively reduces user operations.
  • the electronic device 100 and the printing device 200 establish a wireless communication connection through a local area network.
  • both the electronic device 100 and the printing device 200 are connected to the same router.
  • the electronic device 100 and the printing device 200 establish a wireless communication connection through a cellular network, the Internet, or the like.
  • the printing device 200 is connected to the Internet through a router, and the electronic device 100 is connected to the Internet through a cellular network; further, the electronic device 100 and the printing device 200 establish a wireless communication connection.
  • the electronic device 100 includes, but is not limited to, smartphones, tablet computers, wearable devices (eg, smart watches, smart bracelets, smart glasses), laptop computers (Laptops), and personal digital assistants (PDAs). ), in-vehicle devices, virtual reality (VR) devices, augmented reality (AR) devices, artificial intelligence (AI) devices, etc.
  • the operating system installed on the electronic device 100 includes but is not limited to or other operating systems.
  • the electronic device 100 may be a stationary device or a portable device. This application does not limit the specific type of the electronic device 100 and the installed operating system.
  • the printing device 200 may be an electronic device having a printing function.
  • the printing apparatus 200 may install an operating system.
  • the operating system installed on the printing device 200 includes but is not limited to or other operating systems.
  • the printing apparatus 200 may not have an operating system installed. This application does not limit the specific type of the printing apparatus 200, whether an operating system is installed, or the type of the operating system when the operating system is installed.
  • FIG. 5A shows a schematic structural diagram of the electronic device 100 .
  • 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 charge management module 140 , a power management module 141 , and a battery 142 , Antenna 1, Antenna 2, Mobile Communication Module 150, Wireless Communication Module 160, Audio Module 170, Sensor Module 180, Key 190, Motor 191, Indicator 192, Camera 193, Display Screen 194, and Subscriber Identification Module , SIM) card interface 195 and so on.
  • a processor 110 may include a processor 110 , an external memory interface 120 , an internal memory 121 , a universal serial bus (USB) interface 130 , a charge management module 140 , a power management module 141 , and a battery 142 , Antenna 1, Antenna 2, Mobile Communication Module 150, Wireless Communication Module 160, Audio Module 170, Sensor Module 180, Key 190, Motor 191, Indicator
  • the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100 .
  • the electronic device 100 may include more or less components than shown, or combine some components, or separate some components, or arrange different components.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • Processor 110 may include one or more processing units.
  • 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, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (neural-network processing unit, NPU), etc.
  • AP application processor
  • GPU graphics processing unit
  • ISP image signal processor
  • controller a video Codec
  • digital signal processor digital signal processor
  • DSP digital signal processor
  • baseband processor baseband processor
  • neural-network processing unit neural-network processing unit
  • NPU neural-network processing unit
  • different processing units may be independent devices, or may be integrated in one or more processors.
  • the controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 110 for storing instructions and data.
  • the processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transceiver (universal asynchronous transmitter) receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and / or universal serial bus (universal serial bus, USB) interface, etc.
  • the USB interface 130 is an interface that conforms to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
  • the charging management module 140 is used to receive charging input from the charger.
  • the charger may be a wireless charger or a wired charger. While the charging management module 140 charges the battery 142 , it can also supply power to the electronic device through the power management module 141 .
  • the power management module 141 may also be provided in the processor 110 . In other embodiments, the power management module 141 and the charging management module 140 may also be provided in the same device.
  • the wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, the baseband processor, and the like.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in electronic device 100 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • the antenna 1 can be multiplexed as a diversity antenna of the wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
  • the mobile communication module 150 may provide a wireless communication solution including 2G/3G/4G/5G etc. applied on the electronic device 100.
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA) and the like.
  • the mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify 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 then turn it into an electromagnetic wave for radiation through the antenna 1 .
  • at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110 .
  • at least part of the functional modules of the mobile communication module 150 may be provided in the same device as at least part of the modules of the processor 110 .
  • the wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellites System (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication (near field communication, NFC), Zigbee (ZigBee), infrared (infrared, IR) and other wireless communication solutions.
  • WLAN wireless local area networks
  • BT wireless fidelity
  • GNSS global navigation satellites System
  • frequency modulation frequency modulation, FM
  • near field communication near field communication
  • NFC near field communication
  • Zigbee Zigbee
  • ZigBee Zigbee
  • infrared infrared
  • IR infrared
  • 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 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor
  • the antenna 1 of the electronic device 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband 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 (global positioning system, GPS), global navigation satellite system (global navigation satellite system, GLONASS), Beidou navigation satellite system (beidou navigation satellite system, BDS), quasi-zenith satellite system (quasi -zenith satellite system, QZSS) and/or satellite based augmentation systems (SBAS).
  • global positioning system global positioning system, GPS
  • global navigation satellite system global navigation satellite system, GLONASS
  • Beidou navigation satellite system beidou navigation satellite system, BDS
  • quasi-zenith satellite system quadsi -zenith satellite system, QZSS
  • SBAS satellite based augmentation systems
  • 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.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
  • Display screen 194 is used to display images, videos, and the like.
  • 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 or an active-matrix organic light-emitting diode (active-matrix organic light).
  • emitting diode AMOLED
  • flexible light-emitting diode flex light-emitting diode, FLED
  • MiniLed MicroLed, Micro-oLed
  • quantum dot light-emitting diode quantum dot light emitting diodes, QLED
  • the electronic device 100 may include one or M display screens 194 , where M is a positive integer greater than one.
  • the display screen 194 of the electronic device 100 displays an interface, and the electronic device 100 can use the processor 110 to automatically identify the display content, and display the content according to the internal memory 121 , the external memory connected to the external memory interface 120 , or the processor 110 .
  • the application whitelist stored in the memory determines whether the currently displayed application supports automatic identification printing.
  • the electronic device 100 can determine the print content selected by the user according to the user's voice input and/or touch input, and use the wireless communication module 160 to send the print content to the printing device 200 for printing.
  • 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 realize the data storage function. For example to save files like music, video etc in external memory card.
  • Internal memory 121 may be used to store computer executable program code, which includes instructions.
  • the internal memory 121 may include a storage program area and a storage data area.
  • the storage program area can store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), and the like.
  • the storage data area may store data (such as audio data, phone book, etc.) created during the use of the electronic device 100 and the like.
  • P of the SIM card interface 195 is a positive integer greater than 1.
  • the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
  • the embodiments of the present application take an Android system with a layered architecture as an example to exemplarily describe the software structure of the electronic device 100 .
  • FIG. 5B shows a software structural block diagram of the electronic device 100 provided by the embodiment of the present application.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate with each other through software interfaces.
  • the Android system is divided into four layers, which are, from top to bottom, an application layer, an application framework layer, an Android runtime (Android runtime) and a system library, and a kernel layer.
  • the application layer can include a series of application packages.
  • the application package may include applications such as printing service, printing module, WLAN, camera, gallery, calling, navigation, Bluetooth, video, etc.
  • the printing service may be provided by a Huawei Hilink-enabled application (eg, a smart life application (application, APP)).
  • the printing service can also be a separate Huawei Hilink-enabled application. After the electronic device discovers the printing device by means of proximity discovery, it automatically invokes the printing service to process the printing business.
  • Huawei Hilink provides a way to join the open ecosystem of smart hardware for various smart devices. Electronic devices can be added to the Huawei Hilink ecosystem through hardware access or cloud access to realize interconnection of electronic devices and interconnection between applications within electronic devices.
  • the embodiment of the present application uses the Huawei Hilink ecosystem as an example to describe the automatic printing method provided by the embodiment of the present application.
  • the automatic printing method can also be applied in other ecological environments that support intelligent communication between applications.
  • the printing module may contain one or more plug-ins in the electronic device corresponding to the printing 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 business, so as to realize automatic printing.
  • the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
  • the application framework layer includes some predefined functions.
  • the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, and a notification manager, among others.
  • a window manager is used to manage window programs. The window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, take screenshots, etc.
  • Content providers are used to store and retrieve data and make these data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone book, etc.
  • the view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on. View systems can be used to build applications.
  • a display interface can consist of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
  • the phone manager is used to provide the communication function of the electronic device 100 .
  • the resource manager provides various resources for the application, such as localization strings, icons, pictures, layout files, video files and so on.
  • the notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages, and can disappear automatically after a brief pause without user interaction.
  • the notification manager is used to notify download completion, message reminders, etc.
  • the notification manager can also display notifications in the status bar at the top of the system in the form of graphs or scroll bar text, such as notifications of applications running in the background, and notifications on the screen in the form of dialog windows. For example, text information is prompted in the status bar, a prompt sound is issued, the electronic device vibrates, and the indicator light flashes.
  • Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system.
  • the core library consists of two parts: one is the function functions that the java language needs to call, and the other is the core library of Android.
  • the application layer and the application framework layer run in virtual machines.
  • the virtual machine executes the java files of the application layer and the application framework layer as binary files.
  • the virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, safety and exception management, and garbage collection.
  • a system library can include multiple functional modules. For example: surface manager (surface manager), media library (Media Libraries), 3D graphics processing library (eg: OpenGL ES), 2D graphics engine (eg: SGL), etc.
  • the Surface Manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files.
  • the media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
  • a 2D graphics engine is a drawing engine for 2D drawing.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer contains at least display drivers, camera drivers, audio drivers, and sensor drivers.
  • the following embodiments are all described by taking the printing device 200 as a printer as an example.
  • FIG. 6 is a schematic diagram of an automatic printing method provided by an embodiment of the present application. As shown in Figure 6, the method may include S601-S609:
  • the electronic device detects a printing device.
  • the electronic device and the printer can support NFC touch discovery function, Bluetooth proximity discovery function, proximity discovery function of Institute of Electrical and Electronics Engineers (IEEE) 802.11 protocol, general smart sensor One or more of a hub (sensorHub) discovery function, etc.; the electronic device and the printing device can discover each other based on one or more of the above-mentioned functions supported by both.
  • IEEE Institute of Electrical and Electronics Engineers 802.11 protocol
  • general smart sensor One or more of a hub (sensorHub) discovery function etc.
  • the electronic device and the printing device can discover each other based on one or more of the above-mentioned functions supported by both.
  • the electronic device and/or the printer turns on the NFC function, and the electronic device discovers the printer after the electronic device approaches or touches the NFC sensing area on the printer.
  • the electronic device identifies the foreground application.
  • the foreground application is an application corresponding to the current interface of the electronic device.
  • the interface of which application is currently displayed on the display screen of the electronic device is the foreground application.
  • 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 print content in the current scenario.
  • the UsageStatsManager class is a tool in the Android system for statistical management of the usage of electronic devices; it can query the usage history of electronic devices (such as an application currently opened) and statistical information, and then obtain the current foreground application.
  • Package name to identify different foreground applications.
  • the package name of the application is unique in the Android system and can be used as the unique identifier of the application.
  • the electronic device may include, for example, a printing service, a foreground application, and a printing module.
  • the printing service is started.
  • the print 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. Among them, the printing service can be called through the startService method.
  • the electronic device determines that the application is a foreground application by detecting the application corresponding to the position where the user operation was most recently received. For example, the electronic device displays Application 1 and Application 2 on a split screen, and the electronic device determines that the foreground application is Application 1 if the most recent user's operation is a touch operation on the display area corresponding to Application 1 .
  • the electronic device determines whether the foreground application is the system desktop. If yes, that is, the foreground application is the system desktop, then go to S604; if not, that is, the foreground application is not the system desktop, go to S605.
  • the electronic device uses the queried application package name to determine whether the application package name is the system desktop package name, and then determines whether the foreground application is the system desktop. That is, it is determined whether the foreground application is a desktop application.
  • the electronic device can determine whether the foreground application is the system desktop by invoking the print service. As shown in FIG. 8 , 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 performed.
  • the electronic device can automatically identify the content displayed on the front-end interface, and select different ways of processing the printing service according to the content displayed on the different interface, thereby providing the user with a more flexible printing method.
  • the electronic device detects the print content selected by the user.
  • 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 user's operation of selecting print content on the desktop application display interface.
  • the print content selected by the user is at least one display element that supports printing in the current desktop application display interface, and the display element may be a control, an icon, or the like displayed on the interface. Therefore, as shown in FIG. 7 , the electronic device needs to execute S703 and S704.
  • the print service invokes the print module.
  • the printing module receives the print content to be printed selected by the user.
  • the printing service calls or starts the printing module, and the printing module receives the printing content determined by the user.
  • the print service can call the print 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 apps to hold the same AIDL file at the same time, and by binding the services of both parties, the cross-process interface call can be realized.
  • the electronic device directly takes a screenshot of the current desktop application display interface, and uses the screenshot of the display interface as the print content to be printed.
  • the electronic device determines whether the foreground application is a whitelisted application. If no, that is, the foreground application is not a whitelisted application, execute S606; if yes, that is, the foreground application is a whitelisted application, execute S607.
  • the electronic device determines that the foreground application is not the system desktop, it needs to further determine whether the foreground application is a whitelisted application, that is, whether to support automatic identification and printing.
  • the whitelist may be a whitelist library for storing registered application package names, and the whitelist may be preset in the electronic device; or the electronic device may request the server to download the whitelist when inquiring.
  • the whitelist can include the package name of the registered application.
  • the electronic device can check whether the whitelist contains the package name of the current foreground application to determine whether the current foreground application is a registered application that supports automatic identification and printing.
  • whether the foreground application is a whitelisted application may be determined by the print service. Specifically, the print service uses the package name of the foreground application obtained in S701 to perform configuration file 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.
  • the application before S605, the application needs to perform whitelist registration. For example, in the process of configuring the configuration file on the developer website, the application developer registers the package name to determine that the current application is allowed to support the automatic identification printing service.
  • the server receives the registration information and generates a white list for the electronic device to download.
  • the electronic device may periodically update the download whitelist, or query the whitelist online, or periodically download the registration information of newly registered applications.
  • an application whitelist is shown as follows, and the registered applications in the application whitelist include: applications and word processing systems application.
  • the electronic device determines that the print content is the content of the screenshot of the display interface.
  • the electronic device determines that the foreground application is not an application in the whitelist, determines that the foreground application does not support automatic identification and printing, and further determines that a screenshot of the current display interface needs to be printed.
  • S705 and S706 are shown in FIG. 7 .
  • the print service determines whether the foreground application is a whitelisted application.
  • the print service sends the screenshot of the current display interface to the print module.
  • the print service determines that the foreground application is not a whitelisted application, and uses the SurfaceControl.screenshot interface in the Android system to take a screenshot and save the screenshot file. After that, send the uniform resource identifier (URI) of the saved screenshot file to the printing module through the AIDL cross-process call.
  • URI uniform resource identifier
  • the URI is used to represent the corresponding data reference to be operated.
  • the printing module can determine the corresponding screenshot file storage location according to the URI, that is, obtain the access authority of the screenshot file, and then obtain the screenshot file for printing.
  • content: ⁇ / ⁇ /cn.netease.cloudmusic.fileprovider ⁇ /external_storage_root ⁇ /test ⁇ /Test1.png is an example of a URI.
  • the electronic device is displaying
  • the printing service is invoked to execute the above S701-S705.
  • the print service determines that the foreground application corresponding to the current interface 901 is application, and it is not a whitelisted application, a screenshot 91 is generated, and the URI of the saved location of the screenshot 91 is sent to the printing module, so that the printing module can print the current display interface.
  • the user does not need to perform multiple operations to achieve automatic printing, which reduces the difficulty of the user's operation.
  • 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 go to S606; if yes, that is, the display interface supports the printing service, go to S608.
  • the foreground application is a whitelisted application and supports the printing service, but the foreground application may include multiple display interfaces, and the display content of some display interfaces may support the printing service, and the display content of some display interfaces may not support the printing service, then The electronic device needs to further obtain the specific print content supported by the display interface of the foreground application to realize printing.
  • the print service determines that the foreground application is a whitelisted application, it needs 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 supported print content information.
  • S707 is shown in FIG. 7 .
  • the print service establishes a communication connection with the foreground application.
  • the print service and the foreground application may establish a communication connection for transmitting signals based on the Android lightweight messenger inter-process communication method.
  • the Binder entity 1011 and the Binder entity 1012 are used to establish a communication connection between the two, so as to transmit the interaction information in the subsequent steps.
  • a handler (Handle) 1013 for processing interactive information is configured on the print service 101 side, for example, for processing messages that can be sent to the foreground application 102 or the printing module.
  • the foreground application 102 is provided with a handler (Handle) 1014 for processing interactive information, for example, for processing messages that can be sent to the print service 101 .
  • the electronic device realizes the information interaction between the printing service and the foreground application by establishing the communication connection as shown in FIG. 10 .
  • the above S607 may be implemented as S708-S711 as shown in FIG. 7 .
  • the print service sends query information to the foreground application.
  • the printing service uses the communication connection with the foreground application to send query information to the foreground application, where the query information is used to query whether the current display 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 business ID (businessID).
  • the package name of the print service is used to notify the foreground application of the current request message, and the print service identifier may be 0 (or described as 0x00) by default.
  • the query information can also be described as an APP page print business (APPB) request message.
  • the print service encapsulates the APPB request message in a preset encapsulation manner, and through the communication connection established in the above S707, encapsulates the encapsulated APPB Request messages to be transmitted across processes.
  • the foreground application receives the APPB request message.
  • the preset encapsulation manner may include, for example, encapsulating in sequence with JSON object (or XML), Bundle and Message.
  • an APPB request message is shown as follows.
  • the foreground application parses the query information, and determines the supported printing service.
  • the foreground application parses the query information. For example, parse Message, Bundle, and JSON Object in turn to obtain the package name and print service ID of the print service. According to the package name of the print service and the print service identifier, the foreground application determines a list of print services supported by the content displayed on the current display interface, and generates a query response.
  • the query response can also be described as an APPB response message, and the query response is used to notify the printing service of the printing services currently supported by the display interface.
  • the list of supported printing services may include, for example, a content code (contentId), a content name (contentname), and a content type (fileType).
  • the value of the content type field is used to indicate the format of the printed content.
  • the value of the fileType field is 0, which is used to indicate that the format of the print content is the image format.
  • the value of the fileType field is 1, which is used to indicate that the format of the print content is the document format.
  • the value of the above fileType field and its meaning are only exemplary descriptions, which are not specifically limited in this embodiment of the present application.
  • an APPB response message is shown as follows.
  • the foreground application sends a query response to the print service.
  • the query response is encapsulated in a preset encapsulation manner (such as JSON Object, Bundle and Message encapsulation manner), and is transmitted across processes through the communication connection established in the above S707. Accordingly, the print service receives the query response.
  • a preset encapsulation manner such as JSON Object, Bundle and Message encapsulation manner
  • the print service determines whether the display interface supports the print service.
  • the print service parses the query response. For example, by analyzing Message, Bundle, and JSON Object in turn, and according to the length of the contentlist field, it can be determined whether the current display interface supports printing services, and which printing services are supported. For example, if the length of the contentlist field is 0, it means that the display interface does not support printing services. Or, the print service determines whether the current interface supports the print service according to whether the query response contains the identifier of the displayed content. For example, after the query response includes 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 included in the current interface that supports printing. 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.
  • the print service parses the query response in the example in S709, and determines, according to the content of the contentlist field, that the display interface of the current foreground application supports printing lyrics pictures.
  • the electronic device determines whether the display interface supports the printing service through the above-mentioned S708-S711. If the printing service is supported, the electronic device can further obtain the printing content, that is, execute the following S608; if the printing service is not supported, the electronic device executes the above-mentioned S606, That is, take a screenshot of the display interface, and determine that the print content is the content of the screenshot.
  • S712 is the same as S706 above, and the print service determines that the current display interface does not support the printing service, and sends a screenshot of the current display interface to the printing module.
  • the printing module determines that the print content to be printed is the screenshot content.
  • the electronic device determines the print content of the display interface.
  • the electronic device after determining the printing service supported by the current display interface, the electronic device needs to further determine the printing content corresponding to the printing service supported by the current display interface, and the printing content is at least one display content that supports printing included in the current display interface. For example, if the printing service supported by the current display interface is lyric pictures, the electronic device needs to further obtain the lyrics and picture information of the song being played on the current display interface to realize printing.
  • S608 may be implemented as the following S713-S716.
  • the print service sends a print content request to the foreground application.
  • the print service uses the communication connection with the foreground application to send a print content request to the foreground application, where the print content request is used to request print content information of the print service supported by the current interface of the foreground application.
  • the print content request may include, for example, the package name of the print service (clientName), the print service ID (businessID), the print content ID (contIdId), the print content type (fileType), and the maximum supported print quantity (maxFileNum).
  • the print service ID can be 0 by default.
  • the print content request can also be described as an application interface data (APP page data, APPD) request message.
  • the print service encapsulates the APPD request message in a preset encapsulation method (such as JSON Object, Bundle and Message encapsulation methods), and passes the above S707
  • a preset encapsulation method such as JSON Object, Bundle and Message encapsulation methods
  • the communication connection established in the process is transmitted across the process.
  • the foreground application receives the APPD request message.
  • an APPD request message is shown as follows.
  • S714 The foreground application parses the print content request, and determines the print content information.
  • the foreground application parses the print content request. For example, parse Message, Bundle, and JSON Object in turn to obtain the package name (clientName), printing business ID (businessID), printing content ID (contIdId), printing content type (fileType), and maximum supported print quantity (maxFileNum) of the printing service. . Further, the print content information to be printed is determined, and a print content response is generated.
  • the print content information includes, for example, URI data of the print content.
  • the print content response can also be described as an APPD response message, the print content response is used to inform the print service of URI data of the current print content, ie, the print service is allowed to access the print content.
  • the print content response may include, for example, a foreground application package name (serverName), a print service ID (businessID), a print content ID (contIdId), a print content type (fileType), a print content number (maxFileNum), and a print content file list (fileList).
  • the print content file list may include, for example, a file number (index), a file format (format), a file status (status), a file URI (fileUriStr), a file path (filePath), and a file size (fileSize).
  • an APPD response message is shown as follows.
  • the foreground application sends a print content response to the print service.
  • the print content response is encapsulated in a preset encapsulation method (such as JSON Object, Bundle and Message encapsulation methods), and cross-process transmission is performed through the communication connection established in the above S707 . Accordingly, the print service receives the print content response.
  • a preset encapsulation method such as JSON Object, Bundle and Message encapsulation methods
  • the print service parses the print content response, and obtains print content information.
  • the print service after receiving the print content response, parses the print content response. For example, parse Message, Bundle, and JSON Object in turn to obtain print content information, such as the information in the file list.
  • the electronic device determines the print content information to be printed on the display interface of the foreground application through the above S713-S716, and obtains the access authority, so as to be able to execute subsequent printing tasks.
  • the electronic device displays a print interface, detects a user's determination operation, and prints the corresponding print content.
  • the electronic device displays a print interface for prompting the user to check whether the print content is correct and whether to confirm the print, so as to avoid abnormal printing caused by misoperation. For example, if the user accidentally triggers the above S601, the current user may choose not to print. Or, after determining the print content, the electronic device prompts the print content. For example, the electronic device prompts the user that the current electronic device needs to print by means of voice prompts, vibration prompts, etc., and confirms whether to execute the print job.
  • the print content determined in S609 is the print content included in the print content determined in the above S604 , S606 , or S608 . That is, the electronic device executes S604 and then executes S609, or the electronic device executes S606 and then executes S609, or the electronic device executes S608 and then executes S609.
  • S609 may be implemented as the following S717 and S718.
  • the print service sends print content information to the print module.
  • the printing service after acquiring the printing information, the printing service sends the printing information to the printing module, so that the printing module obtains the permission to access the printing content, thereby realizing printing.
  • the print service takes the URI of the data information content to be printed as a parameter, and passes it to the print module through AIDL cross-process calls.
  • the print module prints the corresponding print content in response to the user's determination operation.
  • the print module accesses the print content, displays a confirmation interface, and receives a user's confirmation operation on the print content. If the confirmation operation is received, the corresponding print content will be sent to the printer for printing.
  • the interface 1101 is used to display the contents of the gallery.
  • the printing service is invoked, and the methods shown in FIG. 6 and FIG. 7 are executed.
  • the icon 111 on the interface 1101 the user has selected a picture, that is, the current print content is the picture indicated by the icon 111, and the print content information is the URI data of the picture indicated by the icon 111.
  • the printing module obtains the printing content information, it causes the electronic device to display an interface 1102 as shown in (b) in FIG. 11 , which is used to prompt the user to determine the printing content. If the electronic device determines to print the current print content after detecting that the user clicks the "start printing" control 112, the printing module sends the picture to the printer for printing.
  • the determination operation may include, for example, a preset gesture operation on the display screen such as clicking on a confirmation control (such as a "start printing" control), double-clicking the display screen, etc., or may also include preset operations such as double-clicking the volume key, double-clicking the back shell of the mobile phone, etc., Alternatively, it may also include an operation of automatically confirming after waiting for a preset period of time.
  • a preset gesture operation on the display screen such as clicking on a confirmation control (such as a "start printing" control), double-clicking the display screen, etc.
  • preset operations such as double-clicking the volume key, double-clicking the back shell of the mobile phone, etc.
  • it may also include an operation of automatically confirming after waiting for a preset period of time.
  • the specific type of the determination operation is not specifically limited in this embodiment of the present application.
  • the print content is the print content obtained by taking a screenshot of the print service in S706 or S712 as shown in FIG. 7 . If the printing module determines to cancel the printing in response to the user's operation, the electronic device can automatically delete the printing content of the screenshot to save storage space. Alternatively, the electronic device may delete the printed content of the corresponding screenshot in response to the user's operation.
  • the electronic device can automatically identify the display content and realize automatic printing, without the need for the user to manually jump through multiple applications repeatedly to find the print content. Thereby, the difficulty of printing is reduced, the printing efficiency is improved, and the user's fast and convenient mobile printing needs are met.
  • the electronic device can predefine printing strategies for different display interfaces of different applications through query responses (ie, APPB response messages), or predefine printing strategies for different printing contents supported by the same display interface, so as to meet the flexible printing requirements of users.
  • query responses ie, APPB response messages
  • the print module can directly send the print content to the printer for printing without user confirmation, further reducing user operations and ensuring automatic printing without additional user operations.
  • the printing module automatically sends the print content to the printer for printing after waiting for a preset period of time, so that the electronic device can also ensure that automatic printing can be realized without any additional operation by the user. .
  • the division of the printing service, the foreground application, and the printing module shown in FIG. 7 is only an exemplary illustration, and there may be other divisions for implementing the above automatic printing method.
  • the current display interface of the foreground application supports multiple print contents, and the electronic device needs to confirm the print contents that the user needs to print.
  • the music playback interface supports printing lyrics pictures and album cover pictures, and the electronic device cannot directly determine the print content, so it needs to receive the user's selection operation to determine the print content to be printed.
  • FIG. 12 is yet another automatic printing method provided by this embodiment of the present application. As shown in FIG. 12 , after S711 shown in FIG. 7 , S1201 and S1202 may also be included.
  • the print service determines whether multiple print contents are supported. If yes, that is, multiple print contents are supported, then go to S1202; if not, that is, only one print content is supported, go to S713.
  • the display interface of the foreground application can support one or more print contents.
  • the print service parses the query response, and determines the foreground application according to the length of the supported print service list (contentlist) field. Indicates whether the display interface supports multiple print contents. If the length of the supported print service list (contentlist) field is greater than 1, it means that the display interface of the foreground application supports multiple print contents.
  • the printing service determines that the printing content data supported by the foreground application is 1, that is, the printing of lyrics pictures is supported.
  • the interface 1301 is a music playing interface, which has a music playing function and displays a music album cover picture.
  • the electronic device detects that the user clicks on a blank position on the interface 1301, and can switch the displayed content.
  • the interface 1302 shown in (b) of FIG. 13A is displayed.
  • the display content is switched to a picture of the lyrics of the music being played.
  • the interface 1302 is also a music playing interface and has a music playing function.
  • the current music playing interface can implement different printing strategies. For example, three printing strategies can be implemented: printing lyrics pictures and/or printing album cover pictures. That is, the music playback function page supports multiple print contents.
  • the electronic device detects the printer and determines that the current interface supports multiple printing contents, and then executes S1202, and the user determines which printing strategy is specifically implemented.
  • the APPB response message under the current scene is shown as follows, and the print service determines that the print content data supported by the foreground application is 2 according to the length of the print service list (contentlist) field supported in the APPB response message, that is, supports printing lyrics pictures and album cover pictures. .
  • the print content corresponding to different printing strategies includes the display content visible to the user on the current interface of the electronic device, and may also include the display content that is invisible to the user on the current interface of the electronic device.
  • the electronic device detects a printer in the process of displaying the interface 1301 shown in (a) in FIG. 13A, and 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 Print the display content that is invisible to the user (the lyrics picture displayed on the interface 1302 as shown in FIG. 13A (b)).
  • this embodiment of the present application does not limit the execution order of S711 and S1201.
  • the printing service can simultaneously determine whether the display interface of the foreground application supports the printing service and the number of supported printing contents according to the query response.
  • the print service displays a plurality of supported print contents, and receives the print contents selected by the user.
  • a print content selection interface needs to be displayed to receive the print content selected by the user. For example, the print service generates prompt information according to the list of supported print contents in the parsed APPB response message, uses a custom session (Dialog) or activity (Activity) in Android for interface prompts, and receives the print contents selected by the user.
  • the print service generates prompt information according to the list of supported print contents in the parsed APPB response message, uses a custom session (Dialog) or activity (Activity) in Android for interface prompts, and receives the print contents selected by the user.
  • a pop-up box displays a prompt box 131 for displaying prompt information generated by the print service.
  • the print service determines the print content selected by the user, and then can execute S713 to request the corresponding print content from the foreground application. information.
  • the electronic device displays an interface 1304 as shown in (b) in FIG. 13B , and prompts the user to select print content by displaying notification information 133 .
  • the number of print contents supported by the display interface of the foreground application is multiple, and the print service can obtain the print content information of the multiple print contents from the foreground application, and then send all the print content information of the multiple print contents to the printing module. .
  • the print module directly determines the print content in the process of receiving the user's operation of determining the print. That is, the print service does not execute the above S1201 and S1202, and in the method flow shown in FIG. 7, the specific print content is directly determined in S718.
  • the print content response obtained by the print service in S715 shown in FIG. 7 includes 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 printing module, and the printing module has the permission to access the pictures 141 and 142 (ie, can print the pictures 141 and 142).
  • the printing module receives the printing content selected by the user.
  • the current "Page 1" control 143 and the “Page 2" control 144 are both selected, and both the picture 141 and the picture 142 can be printed (that is, both print contents can be printed).
  • the user clicks the "2nd page” control 144 and deselects the state it is determined that the user does not print the picture corresponding to the "2nd page” control 144, but only prints the picture corresponding to the "1st page” control 143.
  • the electronic device can flexibly determine the print contents according to the user's selection.
  • FIG. 15 is a schematic flowchart of another automatic printing method provided by an embodiment of the present application. As shown in FIG. 15, after S711 shown in FIG. 7, the print service may execute S1501.
  • the print service determines print content information.
  • the print service determines whether the query response carries print content information.
  • the print content information determined by the print service may be print content information of all print contents supported by the display interface of the foreground application.
  • the print content information determined by the print service can also determine the print content information of the print content selected for printing by the user, that is, corresponding to the process shown in FIG. 15 , and after S1202 in the process shown in FIG. After the print service determines the print content information, there is no need to request the foreground application for print content information, that is, it is unnecessary to execute S713-S716, and it is unnecessary to exchange APPD messages with the foreground application.
  • the carried information includes the interface 1101 as shown in (a) in FIG. 11 supports printing services, printing The number of 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 print service can directly send the URI data of the picture indicated by the icon 111 to the print module for printing.
  • the electronic device can reduce the interactive information transmission steps between the printing service and the foreground application, and improve the printing efficiency.
  • the electronic device can receive user edits to whitelisted applications. For example, an application developer registers application A, application B, and application C on the developer website, and registers these three applications as whitelist applications that support automatic identification and printing. After obtaining the whitelist, the electronic device receives the user's editing of the whitelist. If the user does not allow printing of the content corresponding to application B, the whitelist permission of application B can be cancelled in the whitelist. Then, in S605 as shown in FIG. 6 , the electronic device determines that the application B is not a whitelisted application, and if printing is required, only screenshot printing can be performed.
  • the application developer registers the print content 1, print content 2, print content 3, print content 4, and print content 5 of application A on the developer website, that is, the number of print contents supported by the whitelisted application A is 5. .
  • 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 print content 1, the electronic device can cancel the print content 2, print content 3, and print content of application A in the white list in response to the user's selection. Whitelist permissions for print content 4 and print content 5. Then, in the subsequent process shown in FIG. 12 , the printing service can no longer execute S1201 and S1202 , that is, it is not necessary to receive the user's selection, which further reduces the user's operations and improves the printing efficiency.
  • the electronic device receives the editing of the whitelist application by the user on the interface 1601 .
  • the electronic device detects that the user clicks on the "switch editing" control 161, and can switch the editing whitelist application, such as the application A is currently being edited.
  • the electronic device detects that the user clicks the operation of the "select" control 162 corresponding to the print content option, and can determine whether the user selects or cancels the whitelist permission of the corresponding print content.
  • Whitelist permissions After detecting that the user clicks the "unselect all” control 163, the electronic device can determine that the user cancels the whitelist permission of application A (ie, cancels the whitelist permission of all printed contents of application A). After that, after detecting that the user clicks the "OK" control 164, the electronic device determines that the user has finished editing the whitelist application.
  • the electronic device can edit the whitelisted applications according to the user's personalized needs, so as to further improve the user's use experience.
  • the printing service can also perform the operations performed by the printing module in the foregoing method embodiments. For example, after determining the print content, the print service directly sends the print content to a printing device for printing.
  • FIG. 17 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • the electronic device 1700 may include: a display unit 1701 , a processing unit 1702 and a transceiver unit 1703 .
  • the electronic device 1700 may be used to implement the functions of the electronic device involved in the foregoing method embodiments.
  • the display unit 1701 is configured to support the electronic device 1700 to display interface content; and/or, support the electronic device 1700 to perform S609 in FIG. 6 .
  • the processing unit 1702 is configured to support the electronic device 1700 to perform S602, S603, S605, S606, S607 and S608 in FIG. 6 .
  • the transceiver unit 1703 is configured to support the electronic device 1700 to perform S601, S604 and S609 in FIG. 6 .
  • the transceiver unit may include a receiving unit and a sending unit, which may be implemented by a transceiver or a circuit component related to the transceiver, and may be a transceiver or a transceiver module.
  • Operations and/or functions of each unit in the electronic device 1700 In order to implement the corresponding flow 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 to the corresponding functional units For the sake of brevity, the function description will not be repeated here.
  • the electronic device 1700 shown in FIG. 17 may further include a storage unit (not shown in FIG. 17 ), in which programs or instructions are stored.
  • a storage unit not shown in FIG. 17
  • the processing unit 1701 and the transceiver unit 1702 execute the program or instruction
  • the electronic device 1700 shown in FIG. 17 can execute the automatic printing method described in the above method embodiments.
  • the technical solutions provided in this application can also be functional units or chips in the electronic device, or a device matched with the electronic device.
  • An embodiment of the present application further provides a chip system, including: a processor, where the processor is coupled with a memory, the memory is used to store a program or an instruction, and when the program or instruction is executed by the processor, the The chip system implements the method in any of the foregoing method embodiments.
  • the number of processors in the chip system may be one or more.
  • the processor can be implemented by hardware or by software.
  • the processor may be a logic circuit, an integrated circuit, or the like.
  • the processor may be a general-purpose processor implemented by reading software codes stored in memory.
  • the memory may be integrated with the processor, or may be provided separately from the processor, which is not limited in this embodiment of the present application.
  • the memory may be a non-transitory processor, such as a read-only memory ROM, which may be integrated with the processor on the same chip, or may be provided on different chips.
  • the arrangement of the memory and the processor is not particularly limited.
  • the system-on-chip may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), or a system on chip (SoC), It can also be a central processing unit (CPU), a network processor (NP), a digital signal processing circuit (DSP), or a microcontroller (microcontroller).
  • controller unit, MCU it can also be a programmable logic device (PLD) or other integrated chips.
  • each step in the above method embodiments may be implemented by a hardware integrated logic circuit in a processor or an instruction in the form of software.
  • the method steps disclosed in conjunction with the embodiments of the present application may be directly embodied as being executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.
  • Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program runs on a computer, the computer executes the above-mentioned relevant steps, so as to realize the above-mentioned embodiments. automatic printing method.
  • Embodiments of the present application further provide a computer program product, which, when the computer program product runs on a computer, causes the computer to execute the above-mentioned relevant steps, so as to realize the automatic printing method in the above-mentioned embodiments.
  • an embodiment of the present application further provides an apparatus.
  • the apparatus may be a component or a module, and the apparatus may include one or more processors and memories connected thereto.
  • the memory is used to store computer programs.
  • the computer program When the computer program is executed by one or more processors, it causes the apparatus to execute the automatic printing method in the above method embodiments.
  • the apparatus, computer-readable storage medium, computer program product, or chip provided in the embodiments of the present application are all used to execute the corresponding method provided above. Therefore, for the beneficial effects that can be achieved, reference may be made to the beneficial effects in the corresponding methods provided above, which will not be repeated here.
  • the steps of the method or algorithm described in conjunction with the disclosure of the embodiments of this application may be implemented in a hardware manner, or may be implemented in a manner in which a processor executes software instructions.
  • Software instructions can be composed of corresponding software modules, and software modules can be stored in random access memory (RAM), flash memory, read only memory (ROM), erasable programmable read only memory (erasable programmable ROM, EPROM), electrically erasable programmable read-only memory (electrically EPROM, EEPROM), registers, hard disk, removable hard disk, compact disk read only (CD-ROM) or any other form of storage medium well known in the art.
  • An exemplary storage medium is coupled to the processor, such that the processor can read information from, and write information to, the storage medium.
  • the storage medium can also be an integral part of the processor.
  • the processor and storage medium may reside in an application specific integrated circuit (ASIC).
  • ASIC application specific integrated circuit
  • the disclosed method may be implemented in other manners.
  • the apparatus embodiments described above are merely illustrative.
  • the division of the modules or units is only a logical function division, and there may be other division methods in actual implementation; for example, multiple units or components may be combined or integrated into another system, or some features may be ignored, or not.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of modules or units, and may be in electrical, mechanical or other forms.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
  • Computer-readable storage media include, but are not limited to, any of the following: U disk, removable hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, etc.
  • ROM read-only memory
  • RAM random access memory
  • magnetic disk or optical disk etc.
  • Various media that can store program code include, but are not limited to, any of the following: U disk, removable hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, etc.

Abstract

The present application relates to the technical field of terminals, and provides an automatic printing method and an electronic device. The present application can enable a user to automatically and quickly print by simply putting the electronic device close to a printing device, i.e., according to a current interface of the electronic device. The whole process requires no additional operation of the user or requires only a few of operations of the user, and thus user experience is relatively high. The method comprises: when the electronic device detects that there is a printing device within a certain distance from the printing device, determining that a foreground application is a non-desktop application and is an application in a white list library, thereby automatically determining print content, and automatically sending the print content to the printing device for printing.

Description

一种自动打印方法及电子设备An automatic printing method and electronic device
本申请要求于2021年04月30日提交国家知识产权局、申请号为202110485882.5、发明名称为“一种自动打印方法及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202110485882.5 and the invention title "An automatic printing method and electronic device", which was submitted to the State Intellectual Property Office on April 30, 2021, the entire contents of which are incorporated herein by reference Applying.
技术领域technical field
本申请实施例涉及终端技术领域,尤其涉及一种自动打印方法及电子设备。The 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 technique
随着在线教育和远程办公的推广,用户对于移动打印的需求越来越强烈。目前的移动打印主要基于两种方案,一种是通过电子设备的操作系统提供的打印服务进行打印,另一种是通过第三方的打印应用或打印小程序进行打印。不过,这会使得用户需要操作较多步骤,导致用户使用不便,耗时较长,用户体验较低。因此,如何提供一种方便快捷的自动打印方法及电子设备,成为我们的需求。With the promotion of online education and telecommuting, users have an increasingly strong demand for mobile printing. The current mobile printing is mainly based on two schemes, one is to print through the printing service provided by the operating system of the electronic device, and the other is to print through a third-party printing application or printing applet. However, this will require the user to operate more steps, resulting in inconvenience for the user, time-consuming, and low user experience. Therefore, how to provide a convenient and quick automatic printing method and electronic equipment has become our demand.
发明内容SUMMARY OF THE INVENTION
为了解决上述的技术问题,本申请提供了一种自动打印方法及电子设备。本申请提供的技术方案,能够使得用户仅需将电子设备靠近打印设备,即可根据电子设备当前的界面,实现自动快捷地打印;该过程仅需用户少量操作或无需用户额外操作;用户体验较高。In order to solve the above technical problems, the present application provides an automatic printing method and electronic device. The technical solution provided by the present application can enable the user to automatically and quickly print according to the current interface of the electronic device only by bringing the electronic device close to the printing device; this process requires only a small amount of user operation or no additional user operation; the user experience is relatively low. high.
为了实现上述的技术目的,本申请实施例提供了如下技术方案:In order to achieve the above-mentioned technical purpose, the embodiments of the present application provide the following technical solutions:
第一方面,提供一种自动打印方法,应用于电子设备。该方法包括:在位于打印设备的一定距离内,电子设备检测到打印设备,并与打印设备建立通信连接。在电子设备的前台应用为非桌面应用,且属于预设的白名单库后,根据前台应用的当前界面,电子设备自动获取打印内容。响应于接收到的用户输入,打印内容的全部或部分被选择,并且电子设备向打印设备发送被选择的打印内容的全部或部分;或者,电子设备自动向打印设备发送打印内容。或者,电子设备自动向打印设备发送打印内容。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 print content according to the current interface of the foreground application. In response to the received user input, all or part of the print is selected and the electronic device sends all or part of the selected print to the printing device; alternatively, the electronic device automatically sends the print to the printing device. Alternatively, the electronic device automatically sends the print content to the printing device.
其中,前台应用为电子设备当前界面对应的应用。示例性地,电子设备的显示屏当前显示哪个应用的界面,该应用则为前台应用。The foreground application is an application corresponding to the current interface of the electronic device. Exemplarily, the interface of which application is currently displayed on the display screen of the electronic device is the foreground application.
在一些实施例中,电子设备利用查询到的应用包名,确定该应用包名为已注册的白名单中包含的应用包名,则确定该前台应用为白名单应用。其中,白名单为支持打印业务的应用注册的名单。In some embodiments, the electronic device uses the queried application package name to determine the application package name included in the registered whitelist, and then determines that the foreground application is a whitelisted application. Wherein, the whitelist is a registered list of applications supporting printing services.
在一些实施例中,电子设备与打印设备能够支持NFC碰一碰发现功能、蓝牙靠近发现功能、IEEE 802.11协议的靠近发现功能,通用智能传感集线器发现功能等中的一种或多种;基于两者都支持的上述功能中的一种或多种功能,电子设备和打印设备能够互相发现。电子设备在检测到打印设备,并根据前台应用界面自动获取打印内容后,能够响应于用户的操作,将用户选择的其中部分或全部内容确定为待打印的内容发送至打印设备。或者,响应于用户的操作,确定将界面截图文件作为待打印的内容发送至打印设备。或者,电子设备直接将获取到的打印内容发送至打印设备打印。In some embodiments, the electronic device and the printing device can support one or more of the NFC touch discovery function, the Bluetooth proximity discovery function, the proximity discovery function of the IEEE 802.11 protocol, the general smart sensor 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, the electronic device can determine part or all of the content selected by the user as the content to be printed and send to the printing device. Or, in response to the user's operation, it is determined to send the interface screenshot file to the printing device as the content to be printed. Alternatively, the electronic device directly sends the acquired print content to the printing device for printing.
这样电子设备在检测到打印设备后,能够自动识别前台应用界面,确定待打印的内容,无需用户额外操作或者仅需用户少量操作,即可实现打印。In this way, after detecting the printing device, the electronic device can automatically identify the foreground application interface and determine the content to be printed, and printing can be realized without additional user operation or only a small amount of user operation.
根据第一方面,在电子设备的前台应用为桌面应用后,方法还包括:响应于接收到的另一用户输入,桌面应用的当前界面中支持打印的至少一个显示元素被选择,并且电子设备向打印设备发送被选择的显示元素;或者,电子设备自动向打印设备发送桌面应用的当前界面的截图。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 supporting printing in the current interface of the desktop application is selected, and the electronic device sends The printing device sends the selected display element; or, the electronic device automatically sends a screenshot of the current interface of the desktop application to the printing device.
在一些实施例中,电子设备根据确定前台应用的包名确定前台应用为系统桌面(即桌面应用),则无法直接确定用户需要打印的内容,需要接收用户在桌面应用显示界面上选择打印内容的操作。其中用户选择的打印内容为当前桌面应用显示界面支持打印的至少一个显示元素,该显示元素可以为界面显示的控件、图标等。或者,检测用户在桌面应用上打开其他应用选择文件的操作,确定待打印的内容。又或者,电子设备截图当前前台应用的显示界面,将截图文件确定为待打印的内容。In some embodiments, the electronic device determines that the foreground application is the system desktop (that is, the desktop application) according to the package name of the determined foreground application, so it cannot directly determine the content that the user needs to print, and needs to receive a message that the user selects the print content on the desktop application display interface. operate. The print content selected by the user is at least one display element that supports printing in the current desktop application display interface, and the display element may be a control, an icon, or the like displayed on the interface. Or, detecting the user's operation of opening another application on the desktop application to select a file, and determining the content to be printed. Or, the electronic device screenshots the display interface of the current foreground application, and determines the screenshot file as the content to be printed.
这样在前台应用为桌面应用的情况下,电子设备也能够实现自动获取打印内容,保证用户在多种场景中均能够通过较少的操作,实现便捷打印。In this way, when the foreground application is a desktop application, the electronic device can also automatically obtain the print content, ensuring that the user can perform convenient printing with fewer operations in various scenarios.
根据第一方面,或者以上第一方面的任意一种实现方式,根据前台应用的当前界面,电子设备自动获取打印内容;包括:在当前界面支持打印业务后,确定当前界面对应的打印内容,并自动获取打印内容;打印内容为当前界面包括的支持打印的至少一个显示内容。According to the first aspect, or any implementation manner of the above first aspect, according to the current interface of the foreground application, the electronic device automatically obtains the print content; including: after the current interface supports the printing service, determining the print content corresponding to the current interface, and The print content is automatically acquired; the print content is at least one display content included in the current interface that supports printing.
在一些实施例中,前台应用显示界面支持的打印内容的数量为一个或多个。比如,前台应用为音乐应用,当前显示界面为音乐播放界面,假设音乐播放界面支持显示歌词图片和专辑封面图片。那么,电子设备能够获取的打印内容为歌词图片和/或专辑封面图片。进一步的,电子设备获取的打印内容可以为当前界面正在显示的显示内容,也可以为当前界面未显示但支持打印的显示内容。In some embodiments, the number of print contents supported by the display interface of the foreground application is one or more. For example, if the foreground application is a music application, and the current display interface is a music playback interface, it is assumed that the music playback interface supports displaying lyrics pictures and album cover pictures. Then, the printed content that can be acquired by the electronic device is the lyrics picture and/or the album cover picture. Further, the print content acquired by the electronic device may be the display content being displayed on the current interface, or may be the display content that is not displayed on the current interface but supports printing.
这样电子设备能够根据显示界面,自动获得显示界面支持打印的全部或部分显示内容,满足用户的打印需求。In this way, the electronic device can automatically obtain all or part of the display content supported by the display interface for printing according to the display interface, so as to meet the printing requirements of the user.
根据第一方面,或者以上第一方面的任意一种实现方式,根据前台应用的当前界面,电子设备自动获取打印内容;包括:在当前界面不支持打印业务后,确定当前界面的截图为打印内容,并自动获取打印内容。According to the first aspect, or any implementation manner of the above first aspect, the electronic device automatically obtains the print content according to the current interface of the foreground application; including: after the current interface does not support the printing service, determining that the screenshot of the current interface is the print content , and get the print content automatically.
这样电子设备在确定当前界面不支持打印业务的情况下,也能够通过截图的方式,获得打印内容,实现自动打印,满足用户的打印需求。In this way, in the case that the electronic device determines that the current interface does not support the printing service, it can also obtain the printing content by taking a screenshot, realize automatic printing, and meet the printing demand of the user.
根据第一方面,或者以上第一方面的任意一种实现方式,方法还包括:电子设备通过电子设备运行的打印服务,向前台应用发送查询消息。打印服务接收到前台应用发送的查询响应。根据查询响应,电子设备获取打印内容。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 a print service run by the electronic device. The print service receives the query response sent by the foreground application. According to the query response, the electronic device obtains the print content.
在一些实施例中,电子设备在检测到打印设备后,调用打印服务进行打印内容的确定。打印服务与前台应用之间建立用于传输信号的通信连接,基于该通信连接,实现打印服务与前台应用之间的信息交互。如获取打印内容以及打印内容的相关信息。In some embodiments, after detecting the printing device, the electronic device invokes the printing service to determine the printing content. A communication connection for transmitting signals is established between the printing service and the foreground application, and based on the communication connection, the information exchange between the printing service and the foreground application is realized. For example, obtain the print content and related information of the print content.
根据第一方面,或者以上第一方面的任意一种实现方式,在查询响应包含当前界面中显示内容的标识后,当前界面支持打印业务,标识用于指示当前界面包括的支持打印的至少一个显示内容。在查询响应不包含当前界面中显示内容的标识后,当前界 面不支持打印业务。According to the first aspect, or any one of the implementation manners of the above first aspect, after the query response includes an identifier of the content displayed in the current interface, the current interface supports a printing service, and the identifier is used to indicate at least one display that supports printing included in the current interface. content. 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.
在一些实施例中,打印服务接收并解析前台应用发送的查询响应后,能够确定当前显示界面是否支持打印业务,以及支持哪些打印业务。例如,打印服务根据显示内容的标识确定前台应用支持打印该表示对应的显示内容。如查询响应中包含歌词图片的标识(如contentname),打印服务则确定当前界面支持打印歌词图片。In some embodiments, after receiving and parsing the query response sent by the foreground application, the print service can determine whether the current display interface supports printing services, and which printing services are supported. For example, the print service determines, according to the identifier of the display content, that the foreground application supports printing the display content corresponding to the representation. For example, if the query response includes an identifier of the lyrics image (eg, contentname), the print service determines that the current interface supports printing the lyrics image.
这样电子设备能够根据查询响应中携带的标识,快速确定待打印的打印内容,提高自动识别打印内容的效率。In this way, the electronic device can quickly determine the print content to be printed according to the identifier carried in the query response, thereby improving the efficiency of automatically identifying the print content.
根据第一方面,或者以上第一方面的任意一种实现方式,在电子设备自动获取打印内容之后,方法还包括:电子设备提示打印内容。According to the first aspect, or any implementation manner of the above first aspect, after the electronic device automatically acquires the print content, the method further includes: the electronic device prompts the print content.
在一些实施例中,电子设备确定打印内容后,显示打印界面,用于提示用户检查打印内容是否正确,是否确认打印,从而避免误操作引起的异常打印。比如,用户不小心触发打印流程(如不小心触碰到打印设备的NFC区域,与打印设备建立连接),则当前用户可以选择不打印。或者,电子设备确定打印内容后,提示该打印内容。比如,电子设备通过语音提示、振动提示等方式,提示用户当前电子设备需要打印,确认是否执行打印作业。In some embodiments, after determining the print content, the electronic device displays a print interface for prompting the user to check whether the print content is correct and whether to confirm the print, so as to avoid abnormal printing caused by misoperation. For example, if the user accidentally triggers the printing process (for example, accidentally touching the NFC area of the printing device to establish a connection with the printing device), the current user may choose not to print. Or, after determining the print content, the electronic device prompts the print content. For example, the electronic device prompts the user that the current electronic device needs to print by means of voice prompts, vibration prompts, etc., and confirms whether to execute the print job.
根据第一方面,或者以上第一方面的任意一种实现方式,电子设备提示打印内容;包括:电子设备显示打印内容确认界面。According to the first aspect, or any implementation manner of the above first aspect, the electronic device prompts the print content; including: the electronic device displays a print content confirmation interface.
这样电子设备通过显示确认界面,接收用户的确认操作,保证打印操作的安全性。其中,确定操作例如可以包括点击确认控件(如“开始打印”控件)、双击显示屏等在显示屏上的预设手势操作,或者还可以包括双击音量键、双击手机背壳等预设操作,或者还可以包括等待预设时长后自动确认的操作。对于确定操作的具体类型,本申请实施例不做具体限定。In this way, the electronic device receives the user's confirmation operation by displaying the confirmation interface, so as to ensure the security of the printing operation. Wherein, the determination operation may include, for example, a preset gesture operation on the display screen such as clicking on a confirmation control (such as a "start printing" control), double-clicking the display screen, etc., or may also include preset operations such as double-clicking the volume key, double-clicking the back shell of the mobile phone, etc., Alternatively, it may also include an operation of automatically confirming after waiting for a preset period of time. The specific type of the determination operation is not specifically limited in this embodiment of the present application.
根据第一方面,或者以上第一方面的任意一种实现方式,响应于接收到的用户输入,打印内容的全部或部分被选择,并且电子设备向打印设备发送被选择的打印内容的全部或部分;包括:电子设备接收到第一用户输入。响应于电子设备接收到的第一用户输入,打印内容的全部或部分被选择。电子设备接收到第二用户输入。响应于电子设备接收到的第二用户输入,电子设备向打印设备发送被选择的打印内容的全部或部分。其中,用户输入包括第一用户输入和第二用户输入。According to the first aspect, or any implementation manner of the above first 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 ; comprising: the electronic device receives the 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 the second user input. In response to the second user input received by the electronic device, the electronic device transmits all or part of the selected print content to the printing device. Wherein, the user input includes a first user input and a second user input.
在一些实施例中,打印内容的数量为多个。电子设备在获取到多个打印内容后,显示多个打印内容的选择信息供用户选择确认,即接收用户的第一用户输入。在确定用户需要打印其中的部分或全部打印内容后,获取对应的打印内容信息,再接收用户的第二用户输入操作,确定向打印设备发送打印内容。In some embodiments, the number of prints is plural. After acquiring the plurality of print contents, the electronic device displays selection information of the plurality of print contents for the user to select and confirm, that is, to receive the user's first user input. After it is determined that the user needs to print part or all of the print content, the corresponding print content information is obtained, and then a second user input operation of the user is received to determine to send the print content to the printing device.
这样通过检测用户的输入,保证打印内容满足用户需求,确保打印的安全性,使得最终打印结果能够满足用户预期。In this way, by detecting the user's input, it is ensured that the print content meets the user's requirements, and the printing security is ensured, so that the final print result can meet the user's expectation.
根据第一方面,或者以上第一方面的任意一种实现方式,响应于接收到的用户输入,电子设备自动向打印设备发送打印内容;包括:电子设备接收到第二用户输入。响应于电子设备接收到的第二用户输入,电子设备自动向打印设备发送打印内容。其中,用户输入包括第二用户输入。According to the first aspect, or any implementation manner of the above first aspect, in response to the received user input, the electronic device automatically sends the print content to the printing device; including: the electronic device receives the second user input. In response to the second user input received by the electronic device, the electronic device automatically sends the print content to the printing device. Wherein, the user input includes a second user input.
在一些实施例中,打印内容的数量为一个。电子设备在获取到打印内容后,直接 响应于用户确定打印的操作,向打印设备发送获取到的打印内容。In some embodiments, the number of prints is one. After acquiring the print content, the electronic device sends the acquired print content to the printing device directly in response to the user's operation for determining printing.
在另一些实施例中,打印内容的数量为一个或多个,电子设备在获取到一个或多个打印内容,检测到用户确定打印的操作后,将该一个或多个打印内容发送至打印设备进行打印。In other embodiments, the number of print contents is one or more, and after acquiring the one or more print contents, the electronic device sends the one or more print contents to the printing device after detecting that the user has determined the printing operation. to print.
这样电子设备在确定接收到用户的确定操作后,再将打印内容发送至打印设备进行打印,能够保证打印的安全性。In this way, after the electronic device determines that the user's determination operation is received, the electronic device sends the print content to the printing device for printing, which can ensure the security of printing.
根据第一方面,或者以上第一方面的任意一种实现方式,方法还包括:电子设备运行有打印服务和打印模块。电子设备向打印设备发送被选择的打印内容的全部或部分;包括:电子设备通过打印服务、打印模块,向打印设备发送打印内容的全部或部分。According to the first aspect, or any implementation manner 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 printing content to the printing device; including: the electronic device sends all or part of the printing content to the printing device through a printing service and a printing module.
在一些实施例中,打印模块可以包含一个或多个打印设备对应的在电子设备中的插件。打印服务检测到打印设备后,能够自动调用该打印设备对应的打印模块处理打印业务,实现自动打印。In some embodiments, the printing module may contain one or more plug-ins in the electronic device corresponding to the printing 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 business, so as to realize automatic printing.
第二方面,提供一种电子设备。该电子设备包括:处理器、存储器以及计算机程序,其中计算机程序存储在存储器上,当计算机程序被处理器执行时,使得电子设备执行:在位于打印设备的一定距离内,电子设备检测到打印设备,并与打印设备建立通信连接。在电子设备的前台应用为非桌面应用,且属于预设的白名单库后,根据前台应用的当前界面,电子设备自动获取打印内容。响应于接收到的用户输入,打印内容的全部或部分被选择,并且电子设备向打印设备发送被选择的打印内容的全部或部分;或者,电子设备自动向打印设备发送打印内容。或者,电子设备自动向打印设备发送打印内容。In a second aspect, an electronic device is provided. The electronic device includes: a processor, a memory and a computer program, wherein the computer program is stored in the memory, and when the computer program is executed by the processor, the electronic device executes: within a certain distance of the printing device, the electronic device detects the printing device , and establish 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 print content according to the current interface of the foreground application. In response to the received user input, all or part of the print is selected and the electronic device sends all or part of the selected print to the printing device; alternatively, the electronic device automatically sends the print to the printing device. Alternatively, the electronic device automatically sends the print content to the printing device.
根据第二方面,电子设备还执行:在电子设备的前台应用为桌面应用后,响应于接收到的另一用户输入,桌面应用的当前界面中支持打印的至少一个显示元素被选择,并且电子设备向打印设备发送被选择的显示元素;或者,电子设备自动向打印设备发送桌面应用的当前界面的截图。According to the second aspect, the electronic device further performs: after the foreground application of the electronic device is a desktop application, in response to another user input received, at least one display element supporting printing in the current interface of the desktop application is selected, and the electronic device The selected display element is sent to the printing device; or, the electronic device automatically sends a screenshot of the current interface of the desktop application to the printing device.
根据第二方面,或者以上第二方面的任意一种实现方式,根据前台应用的当前界面,电子设备自动获取打印内容;包括:在当前界面支持打印业务后,确定当前界面对应的打印内容,并自动获取打印内容;打印内容为当前界面包括的支持打印的至少一个显示内容。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 print content; including: after the current interface supports the printing service, determining the print content corresponding to the current interface, and The print content is automatically acquired; the print content is at least one display content included in the current interface that supports printing.
根据第二方面,或者以上第二方面的任意一种实现方式,根据前台应用的当前界面,电子设备自动获取打印内容;包括:在当前界面不支持打印业务后,确定当前界面的截图为打印内容,并自动获取打印内容。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 print content; including: after the current interface does not support the printing service, determining that the screenshot of the current interface is the print content , and get the print content automatically.
根据第二方面,或者以上第二方面的任意一种实现方式,电子设备还执行:电子设备通过电子设备运行的打印服务,向前台应用发送查询消息。打印服务接收到前台应用发送的查询响应。根据查询响应,电子设备获取打印内容。According to the second aspect, or any implementation manner of the above second aspect, the electronic device further executes: the electronic device sends a query message to the foreground application through a print service run by the electronic device. The print service receives the query response sent by the foreground application. According to the query response, the electronic device obtains the print content.
根据第二方面,或者以上第二方面的任意一种实现方式,在查询响应包含当前界面中显示内容的标识后,当前界面支持打印业务,标识用于指示当前界面包括的支持打印的至少一个显示内容。在查询响应不包含当前界面中显示内容的标识后,当前界面不支持打印业务。According to the second aspect, or any implementation manner of the above second aspect, after the query response includes an identifier of the content displayed in the current interface, the current interface supports a printing service, and the identifier is used to indicate at least one display that supports printing included in the current interface. content. 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.
根据第二方面,或者以上第二方面的任意一种实现方式,在电子设备自动获取打印内容之后,电子设备还执行:电子设备提示打印内容。According to the second aspect, or any implementation manner of the above second aspect, after the electronic device automatically acquires the print content, the electronic device further executes: the electronic device prompts the print content.
根据第二方面,或者以上第二方面的任意一种实现方式,电子设备提示打印内容;包括:电子设备显示打印内容确认界面。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.
根据第二方面,或者以上第二方面的任意一种实现方式,响应于接收到的用户输入,打印内容的全部或部分被选择,并且电子设备向打印设备发送被选择的打印内容的全部或部分;包括:电子设备接收到第一用户输入。响应于电子设备接收到的第一用户输入,打印内容的全部或部分被选择。电子设备接收到第二用户输入。响应于电子设备接收到的第二用户输入,电子设备向打印设备发送被选择的打印内容的全部或部分。其中,用户输入包括第一用户输入和第二用户输入。According to the second aspect, or any one implementation 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 ; comprising: the electronic device receives the 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 the second user input. In response to the second user input received by the electronic device, the electronic device transmits all or part of the selected print content to the printing device. Wherein, the user input includes a first user input and a second user input.
根据第二方面,或者以上第二方面的任意一种实现方式,响应于接收到的用户输入,电子设备自动向打印设备发送打印内容;包括:电子设备接收到第二用户输入;响应于电子设备接收到的第二用户输入,电子设备自动向打印设备发送打印内容;其中,用户输入包括第二用户输入。According to the second aspect, or any implementation manner of the above second aspect, in response to the received user input, the electronic device automatically sends the print content to the printing device; including: the electronic device receives the second user input; in response to the electronic device With the received second user input, the electronic device automatically sends the print content to the printing device; wherein the user input includes the second user input.
根据第二方面,或者以上第二方面的任意一种实现方式,电子设备还执行:电子设备运行有打印服务和打印模块。电子设备向打印设备发送被选择的打印内容的全部或部分;包括:电子设备通过打印服务、打印模块,向打印设备发送打印内容的全部或部分。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 printing content to the printing device; including: the electronic device sends all or part of the printing content to the printing device through a printing service and a printing module.
第二方面以及第二方面中任意一种实现方式所对应的技术效果,可参见上述第一方面及第一方面中任意一种实现方式所对应的技术效果,此处不再赘述。For the technical effects corresponding to the second aspect and any implementation manner of the second aspect, reference may be made to the technical effects corresponding to the first aspect and any implementation manner of the first aspect, which will not be repeated here.
第三方面,本申请实施例提供一种电子设备,该电子设备具有实现如上述第一方面及其中任一种可能的实现方式中所述的自动打印方法的功能。该功能可以通过硬件实现,也可以通过硬件执行相应地软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块。In a third aspect, an embodiment of the present application provides an electronic device, the electronic device has the function of implementing the automatic printing method described in the first aspect and any of the possible implementation manners. This function can be implemented by hardware, or can also be implemented by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.
第三方面以及第三方面中任意一种实现方式所对应的技术效果,可参见上述第一方面及第一方面中任意一种实现方式所对应的技术效果,此处不再赘述。For the technical effects corresponding to the third aspect and any implementation manner of the third aspect, reference may be made to the technical effects corresponding to the first aspect and any implementation manner of the first aspect, which will not be repeated here.
第四方面,提供一种计算机可读存储介质。计算机可读存储介质存储有计算机程序(也可称为指令或代码),当该计算机程序被电子设备执行时,使得电子设备执行第一方面或第一方面中任意一种实施方式的方法。In a fourth aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program (also referred to as instructions or codes), which when executed by an electronic device, causes the electronic device to perform the method of the first aspect or any one of the embodiments of the first aspect.
第四方面以及第四方面中任意一种实现方式所对应的技术效果,可参见上述第一方面及第一方面中任意一种实现方式所对应的技术效果,此处不再赘述。For the technical effects corresponding to the fourth aspect and any implementation manner of the fourth aspect, reference may be made to the technical effects corresponding to the first aspect and any implementation manner of the first aspect, which will not be repeated here.
第五方面,本申请实施例提供一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行第一方面或第一方面中任意一种实施方式的方法。In a fifth aspect, an embodiment of the present application provides a computer program product that, when the computer program product runs on an electronic device, enables the electronic device to execute the first aspect or the method of any one of the implementations of the first aspect.
第五方面以及第五方面中任意一种实现方式所对应的技术效果,可参见上述第一方面及第一方面中任意一种实现方式所对应的技术效果,此处不再赘述。For the technical effects corresponding to the fifth aspect and any implementation manner of the fifth aspect, reference may be made to the technical effects corresponding to the first aspect and any implementation manner of the first aspect, which will not be repeated here.
第六方面,本申请实施例提供一种电路系统,电路系统包括处理电路,处理电路被配置为执行第一方面或第一方面中任意一种实施方式的方法。In a sixth aspect, an embodiment of the present application provides a circuit system, where the circuit system includes a processing circuit, and the processing circuit is configured to execute the method of the first aspect or any one of the implementation manners of the first aspect.
第六方面以及第六方面中任意一种实现方式所对应的技术效果,可参见上述第一方面及第一方面中任意一种实现方式所对应的技术效果,此处不再赘述。For the technical effects corresponding to the sixth aspect and any implementation manner of the sixth aspect, reference may be made to the technical effects corresponding to the first aspect and any implementation manner of the first aspect, which will not be repeated here.
第七方面,本申请实施例提供一种芯片系统,包括至少一个处理器和至少一个接口电路,至少一个接口电路用于执行收发功能,并将指令发送给至少一个处理器,当至少一个处理器执行指令时,至少一个处理器执行第一方面或第一方面中任意一种实施方式的方法。In a seventh aspect, an embodiment of the present application provides a chip system, including at least one processor and at least one interface circuit, where the at least one interface circuit is configured to perform a transceiving function and send instructions to the at least one processor. When executing the instructions, at least one processor performs the method of the first aspect or any one of the embodiments of the first aspect.
第七方面以及第七方面中任意一种实现方式所对应的技术效果,可参见上述第一方面及第一方面中任意一种实现方式所对应的技术效果,此处不再赘述。For the technical effects corresponding to the seventh aspect and any implementation manner of the seventh aspect, reference may be made to the technical effects corresponding to the first aspect and any implementation manner of the first aspect, which will not be repeated here.
附图说明Description of drawings
图1为本申请实施例提供的界面示意图一;1 is a schematic diagram one of an interface provided by an embodiment of the present application;
图2为本申请实施例提供的界面示意图二;FIG. 2 is a schematic diagram 2 of an interface provided by an embodiment of the present application;
图3为本申请实施例提供的界面示意图三;3 is a schematic diagram three of an interface provided by an embodiment of the present application;
图4为本申请实施例提供的一种自动打印方法的场景示意图;4 is a schematic diagram of a scene of an automatic printing method provided by an embodiment of the present application;
图5A为本申请实施例提供的电子设备的结构示意图一;5A is a schematic structural diagram 1 of an electronic device provided by an embodiment of the present application;
图5B为本申请实施例提供的电子设备的软件结构框图示意图;5B is a schematic block diagram of a software structure of an electronic device provided by an embodiment of the present application;
图6为本申请实施例提供的自动打印方法流程图一;FIG. 6 is a flowchart 1 of an automatic printing method provided by an embodiment of the present application;
图7为本申请实施例提供的自动打印方法流程图二;7 is a flowchart 2 of an automatic printing method provided by an embodiment of the present application;
图8为本申请实施例提供的界面示意图四;FIG. 8 is a fourth schematic diagram of an interface provided by an embodiment of the present application;
图9为本申请实施例提供的界面示意图五;FIG. 9 is a schematic diagram five of the interface provided by the embodiment of the present application;
图10为本申请实施例提供的通信框架示意图;10 is a schematic diagram of a communication framework provided by an embodiment of the present application;
图11为本申请实施例提供的界面示意图六;FIG. 11 is a sixth schematic diagram of an interface provided by an embodiment of the present application;
图12为本申请实施例提供的自动打印方法流程图三;FIG. 12 is a flowchart three of the automatic printing method provided by the embodiment of the present application;
图13A为本申请实施例提供的界面示意图七;13A is a seventh schematic diagram of an interface provided by an embodiment of the present application;
图13B为本申请实施例提供的界面示意图八;FIG. 13B is the eighth schematic diagram of the interface provided by the embodiment of the present application;
图14为本申请实施例提供的界面示意图九;14 is a schematic diagram 9 of an interface provided by an embodiment of the present application;
图15为本申请实施例提供的自动打印方法流程图四;15 is a fourth flowchart of the automatic printing method provided by the embodiment of the present application;
图16为本申请实施例提供的界面示意图十;FIG. 16 is a schematic diagram ten of an interface provided by an embodiment of the present application;
图17为本申请实施例提供的电子设备的结构示意图二。FIG. 17 is a second schematic structural diagram of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
下面结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在本申请实施例的描述中,以下实施例中所使用的术语只是为了描述特定实施例的目的,而并非旨在作为对本申请的限制。如在本申请的说明书和所附权利要求书中所使用的那样,单数表达形式“一个”、“一种”、“所述”、“上述”、“该”和“这一”旨在包括例如“一个或多个”这种表达形式,除非其上下文中明确地有相反指示。还应当理解,在本申请以下各实施例中,“至少一个”、“一个或多个”是指一个或两个以上(包含两个)。The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application. Wherein, 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 be used as limitations of the present application. As used in the specification of this application and the appended claims, the singular expressions "a," "an," "the," "above," "the," and "the" are intended to include Such expressions as "one or more" unless the context clearly dictates otherwise. It should also be understood that, in the following embodiments of the present application, "at least one" and "one or more" refer to one or more than two (including two).
在本说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。术语“连 接”包括直接连接和间接连接,除非另外说明。“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。References in this specification to "one embodiment" or "some embodiments" and the like mean that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in other embodiments," etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean "one or more but not all embodiments" unless specifically emphasized otherwise. The terms "including", "including", "having" and their variants mean "including but not limited to" unless specifically emphasized otherwise. The term "connected" includes both direct and indirect connections unless otherwise stated. "First" and "second" are only for descriptive purposes, and cannot be understood as indicating or implying relative importance or implying the number of indicated technical features.
在本申请实施例中,“示例性地”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性地”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性地”或者“例如”等词旨在以具体方式呈现相关概念。In the embodiments of the present application, words such as "exemplarily" or "for example" are used to represent examples, illustrations or illustrations. Any embodiment or design described in the embodiments of the present application as "exemplarily" or "such as" should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplarily" or "such as" is intended to present the related concepts in a specific manner.
在一些场景中,电子设备能够与打印机相连,将待打印的内容发送至打印机进行打印,电子设备需要接收用户的选择,确定待打印的内容。In some scenarios, the electronic device can be connected to a printer to send the content to be printed to the printer for printing, and the electronic device needs to receive the user's selection to determine the content to be printed.
在一些实施例中,电子设备中部分应用程序(如图库等)支持通过操作系统(如
Figure PCTCN2022085616-appb-000001
等)提供的打印服务进行打印。
In some embodiments, some applications (such as a gallery, etc.) in the electronic device are supported by an operating system (such as
Figure PCTCN2022085616-appb-000001
etc.) to print.
示例性地,用户在利用音乐应用程序播放音乐的过程中,想要打印专辑封面图片,则需要先保存专辑封面图片,再进行打印。如图1中(a)所示界面101,电子设备(如手机)检测到用户长按图片11的操作后,显示如图1中(b)所示界面102,确定用户是否保存该图片(即专辑封面图片)。检测到用户点击“保存图片”控件12的操作后,确定保存专辑封面图片。之后,用户需要先在文件系统中找到专辑封面的保存位置,再进行打印。如图2中(a)所示界面201,电子设备响应于用户操作,打开图库应用程序,在图库应用程序中保存有待打印的专辑封面图片(如标记21指示的图片)。电子设备检测到用户点击标记21指示的图片的操作后,打开专辑封面图片显示如图2中(b)所示界面202。检测到用户点击“更多”控件22的操作后,显示更多编辑目录。检测到用户点击“打印或生成PDF”控件23的操作后,调用打印接口,显示如图2中(c)所示界面203。检测到用户点击“选择打印机”控件24的操作后,显示如图2中(d)所示界面204。最后,检测到用户点击“打印机A”控件25的操作后,确定将专辑封面图片发送至打印机A进行打印。Exemplarily, when a user wants to print an album cover image during the process of playing music by using a music application, the user needs to save the album cover image before printing. The interface 101 shown in Fig. 1 (a), after the electronic device (such as a mobile phone) detects the user's long-pressing operation of the picture 11, the interface 102 shown in Fig. 1 (b) is displayed to determine whether the user saves the picture (ie album cover image). 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. As shown in the interface 201 in FIG. 2(a), the electronic device opens the gallery application in response to the user operation, and saves the album cover image to be printed (such as the image indicated by mark 21) in the gallery application. After detecting the operation of the user clicking on the picture indicated by the mark 21, the electronic device opens the album cover picture to display the interface 202 shown in (b) of FIG. 2 . After detecting that the user clicks on the "more" control 22, more edit categories are displayed. After detecting that the user clicks the "print or generate PDF" control 23, the print interface is invoked, and the interface 203 shown in FIG. 2(c) is displayed. After detecting that the user clicks on the "select printer" control 24, an interface 204 as shown in (d) of FIG. 2 is displayed. Finally, after detecting that the user clicks the "printer A" control 25, it is determined to send the album cover image to the printer A for printing.
可见,上述打印方案中,仅部分支持操作系统打印接口的应用程序能够应用该打印方案。在打印过程中用户需要进行多次操作,且需要用户明确确定待打印内容的保存位置,导致用户操作难度较大。并且,在上述打印过程中图片编辑、矫正、滤镜等个性化选项不够丰富,打印功能单一。It can be seen that, in the above printing scheme, only some application programs that support the printing interface of the operating system can apply the printing scheme. During the printing process, the user needs to perform multiple operations, and the user needs to clearly determine the storage location of the content to be printed, which makes the operation difficult for the user. Moreover, in the above printing process, personalized options such as image editing, correction, and filters are not rich enough, and the printing function is single.
另一些实施例中,电子设备中安装有第三方的打印应用程序或小程序,能够利用该应用程序或小程序进行打印。In other embodiments, a third-party printing application or applet is installed in the electronic device, and printing can be performed by using the application or applet.
示例性地,同上述打印方案,当前利用第三方的打印应用程序或小程序进行打印,同样需要先保存待打印的内容。假设仍为打印专辑封面图片的场景,电子设备利用如图1所示的方法,保存专辑封面图片。之后,如图3中(a)所示界面301,电子设备响应于用户的操作,启动第三方的打印应用程序显示界面301,检测到用户点击“图库打印”控件31的操作后,确定用户需要打印图片,之后需要检测用户选择的待打印的内容。如图3中(b)所示界面302,检测到用户点击“选择图片”控件32以及点击确定“确定”控件33的操作,确定用户选择打印该图片后,显示如图3中(c)所示界面303,检测到用户点击“打印机A”控件34的操作后,确定用户选择打印机A进行图片打印,则将用户选择的图片发送至打印机A进行打印。Exemplarily, as with the above printing solution, currently printing is performed using a third-party printing application or applet, and the content to be printed also needs to be saved first. Assuming that it is still the scene of printing the album cover picture, the electronic device uses the method shown in FIG. 1 to save the album cover picture. Then, as shown in the interface 301 in (a) of FIG. 3, the electronic device starts the third-party printing application display interface 301 in response to the user's operation, and after detecting the user's operation of clicking the "Gallery Print" control 31, determines that the user needs After printing the picture, it is necessary to detect the content to be printed selected by the user. The interface 302 shown in FIG. 3(b) detects that the user clicks the “select picture” control 32 and clicks the “OK” control 33. After confirming that the user chooses to print the picture, the display is displayed as shown in FIG. 3(c). The display interface 303 is displayed, and after detecting that the user clicks on the "printer A" control 34, it is determined that the user selects the printer A for picture printing, and the picture selected by the user is sent to the printer A for printing.
可见,该打印方案中,用户需要先下载相应地应用程序并启动该应用程序。并且, 在打印过程中同样需要进行多次操作,以及需要用户明确确定待打印内容的保存位置,导致用户操作难度较大。It can be seen that in this printing solution, the user needs to download a corresponding application program and start the application program first. In addition, multiple operations are also required during the printing process, and the user is required to clearly determine the storage location of the content to be printed, which makes the operation difficult for the user.
由此,本申请实施例提供一种自动打印方法,电子设备能够自动识别前台显示内容,自动确定前台显示内容是否支持打印,不必用户进行过多的操作即可实现自动打印,降低打印难度,提升用户使用体验。Therefore, the embodiments of the present application provide an automatic printing method, in which the electronic device can automatically identify the content displayed in the foreground, and automatically determine whether the content displayed in the foreground supports printing. User experience.
图4为本申请实施例提供的一种自动打印方法的场景示意图。如图4所示,电子设备100与打印设备200建立有通信连接。示例性地,电子设备100与打印设备200建立有无线通信连接。电子设备100可通过与打印设备200的无线通信连接,将电子设备100上的待打印文件发送至打印设备200上打印。FIG. 4 is a schematic scene diagram of an automatic printing method provided by an embodiment of the present application. As shown in FIG. 4 , the electronic device 100 has established a communication connection with the printing device 200 . Exemplarily, the electronic device 100 establishes a wireless communication connection with the printing device 200 . The electronic device 100 may send the to-be-printed file on the electronic device 100 to the printing device 200 for printing through the wireless communication connection with the printing device 200 .
电子设备100可以通过无线通信技术与打印设备200建立无线通信连接。其中,无线通信技术包括但不限于以下的至少一种:近距离无线通信(near field communication,NFC),蓝牙(bluetooth,BT)(例如,传统蓝牙或者低功耗(bluetooth low energy,BLE)蓝牙),无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),紫蜂(Zigbee),调频(frequency modulation,FM),红外(infrared,IR)等。The electronic device 100 may establish a wireless communication connection with the printing device 200 through a wireless communication technology. The wireless communication technologies include, but are not limited to, at least one of the following: near field communication (NFC), Bluetooth (BT) (for example, traditional Bluetooth or bluetooth low energy (BLE) Bluetooth) ), wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Zigbee (Zigbee), frequency modulation (FM), infrared (IR), etc.
在一些实施例中,电子设备100与打印设备200都支持靠近发现功能。示例性地,电子设备100与打印设备200都能够通过NFC感应,来实现靠近发现功能。电子设备100靠近打印设备200后,电子设备100和打印设备200能够互相发现对方,之后建立诸如Wi-Fi端到端(peer to peer,P2P)连接、蓝牙连接等无线通信连接。之后,电子设备100识别当前的界面,根据当前的界面,自动确定打印内容,将打印内容发送至打印设备200进行打印,有效减少用户操作。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 realize 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 and a Bluetooth connection. After that, the electronic device 100 identifies the current interface, automatically determines the print content according to the current interface, and sends the print content to the printing device 200 for printing, which effectively reduces user operations.
在一些实施例中,电子设备100与打印设备200通过局域网,建立无线通信连接。比如,电子设备100与打印设备200都连接至同一路由器。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.
在一些实施例中,电子设备100与打印设备200通过蜂窝网络、因特网等,建立无线通信连接。比如,打印设备200通过路由器接入因特网,电子设备100通过蜂窝网络接入因特网;进而,电子设备100与打印设备200建立无线通信连接。In some embodiments, the electronic device 100 and the printing device 200 establish a wireless communication connection through a cellular network, the Internet, or the like. For example, the printing device 200 is connected to the Internet through a router, and the electronic device 100 is connected to the Internet through a cellular network; further, the electronic device 100 and the printing device 200 establish a wireless communication connection.
示例性地,电子设备100包括但不限于智能手机、平板电脑、可穿戴设备(如智能手表、智能手环、智能眼镜)、膝上型计算机(Laptop)、个人数字助理(personal digital assistant,PDA)、车载设备、虚拟现实(virtual reality,VR)设备、增强现实(augmented reality,AR)设备、人工智能(artificial intelligence,AI)设备等。电子设备100安装的操作系统包括但不限于
Figure PCTCN2022085616-appb-000002
或者其它操作系统。在一些实施例中,电子设备100可以为固定式设备,也可以为便携式设备。本申请对电子设备100的具体类型、所安装的操作系统均不作限制。
Illustratively, the electronic device 100 includes, but is not limited to, smartphones, tablet computers, wearable devices (eg, smart watches, smart bracelets, smart glasses), laptop computers (Laptops), and personal digital assistants (PDAs). ), in-vehicle devices, virtual reality (VR) devices, augmented reality (AR) devices, artificial intelligence (AI) devices, etc. The operating system installed on the electronic device 100 includes but is not limited to
Figure PCTCN2022085616-appb-000002
or other operating systems. In some embodiments, the electronic device 100 may be a stationary device or a portable device. This application does not limit the specific type of the electronic device 100 and the installed operating system.
示例性地,打印设备200可以为具有打印功能的电子设备。打印设备200可以安装操作系统。打印设备200安装的操作系统包括但不限于于
Figure PCTCN2022085616-appb-000003
Figure PCTCN2022085616-appb-000004
或者其它操作系统。打印设备200也可以不安装有操作系统。本申请对打印设备200的具体类型、有无安装操作系统、在有安装操作系统下操作系统的类型均不作限制。
Exemplarily, the printing device 200 may be an electronic device having a printing function. The printing apparatus 200 may install an operating system. The operating system installed on the printing device 200 includes but is not limited to
Figure PCTCN2022085616-appb-000003
Figure PCTCN2022085616-appb-000004
or other operating systems. The printing apparatus 200 may not have an operating system installed. This application does not limit the specific type of the printing apparatus 200, whether an operating system is installed, or the type of the operating system when the operating system is installed.
示例性地,图5A示出了电子设备100的结构示意图。如图5A所示,电子设备 100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。Exemplarily, FIG. 5A shows a schematic structural diagram of the electronic device 100 . As shown in FIG. 5A , 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 charge management module 140 , a power management module 141 , and a battery 142 , Antenna 1, Antenna 2, Mobile Communication Module 150, Wireless Communication Module 160, Audio Module 170, Sensor Module 180, Key 190, Motor 191, Indicator 192, Camera 193, Display Screen 194, and Subscriber Identification Module , SIM) card interface 195 and so on.
可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structures illustrated in the embodiments of the present application do 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 less components than shown, or combine some components, or separate some components, or arrange different components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
处理器110可以包括一个或多个处理单元。例如,处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。处理器110中还可以设置存储器,用于存储指令和数据。 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, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (neural-network processing unit, NPU), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors. The controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions. A memory may also be provided in the processor 110 for storing instructions and data.
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。In some embodiments, the processor 110 may include one or more interfaces. The interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transceiver (universal asynchronous transmitter) receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and / or universal serial bus (universal serial bus, USB) interface, etc. The USB interface 130 is an interface that conforms to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。It can be understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration, and does not constitute a structural limitation of the electronic device 100 .
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。The charging management module 140 is used to receive charging input from the charger. The charger may be a wireless charger or a wired charger. While the charging management module 140 charges the battery 142 , it 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 provided in the processor 110 . In other embodiments, the power management module 141 and the charging management module 140 may also be provided in the same device.
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, the baseband processor, and the like.
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。 Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, the antenna 1 can be multiplexed as a diversity antenna of the wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通 信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。The mobile communication module 150 may provide a wireless communication solution including 2G/3G/4G/5G etc. applied on the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA) and the like. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify 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 then turn it into an electromagnetic wave for radiation through the antenna 1 . In some embodiments, at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110 . In some embodiments, at least part of the functional modules of the mobile communication module 150 may be provided in the same device as at least part of the modules of the processor 110 .
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信(near field communication,NFC),紫峰(ZigBee),红外(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellites System (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication (near field communication, NFC), Zigbee (ZigBee), infrared (infrared, IR) and other wireless communication solutions. 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 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 . The wireless communication module 160 can also receive the signal to be sent from the processor 110 , perform frequency modulation on it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2 .
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(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,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。In some embodiments, the antenna 1 of the electronic device 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband 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 (global positioning system, GPS), global navigation satellite system (global navigation satellite system, GLONASS), Beidou navigation satellite system (beidou navigation satellite system, BDS), quasi-zenith satellite system (quasi -zenith satellite system, QZSS) and/or satellite based augmentation systems (SBAS).
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。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. Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),MiniLed,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或M个显示屏194,M为大于1的正整数。Display screen 194 is used to display images, videos, and the like. 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 or an active-matrix organic light-emitting diode (active-matrix organic light). emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), MiniLed, MicroLed, Micro-oLed, quantum dot light-emitting diode (quantum dot light emitting diodes, QLED) and so on. In some embodiments, the electronic device 100 may include one or M display screens 194 , where M is a positive integer greater than one.
在一些实施例中,电子设备100的显示屏194显示界面,电子设备100能够利用 处理器110自动识别显示内容,并根据内部存储器121、外部存储器接口120连接的外部存储器、或者处理器110中的存储器所存储的应用白名单,确定当前显示的应用是否支持自动识别打印。在支持自动识别打印的情况下,电子设备100能够根据用户的语音输入和/或触摸输入,确定用户选择的打印内容,并利用无线通信模块160将打印内容发送至打印设备200进行打印。In some embodiments, the display screen 194 of the electronic device 100 displays an interface, and the electronic device 100 can use the processor 110 to automatically identify the display content, and display the content according to the internal memory 121 , the external memory connected to the external memory interface 120 , or the processor 110 . The application whitelist stored in the memory determines whether the currently displayed application supports automatic identification printing. When automatic identification printing is supported, the electronic device 100 can determine the print content selected by the user according to the user's voice input and/or touch input, and use the wireless communication module 160 to send the print content to the printing device 200 for printing.
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。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 realize the data storage function. For example to save files like music, video etc in external memory card.
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。Internal memory 121 may be used to store computer executable program code, which includes instructions. The internal memory 121 may include a storage program area and a storage data area. The storage program area can store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), and the like. The storage data area may store data (such as audio data, phone book, etc.) created during the use of the electronic device 100 and the like.
SIM卡接口195的P为大于1的正整数。P of the SIM card interface 195 is a positive integer greater than 1.
电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android系统为例,示例性地说明电子设备100的软件结构。示例性地,图5B示出了本申请实施例提供的电子设备100的一种软件结构框图。The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The embodiments of the present application take an Android system with a layered architecture as an example to exemplarily describe the software structure of the electronic device 100 . Exemplarily, FIG. 5B shows a software structural block diagram of the electronic device 100 provided by the embodiment of the present application.
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, which are, from top to bottom, an application layer, an application framework layer, an Android runtime (Android runtime) and a system library, and a kernel layer.
应用程序层可以包括一系列应用程序包。The application layer can include a series of application packages.
如图5B所示,应用程序包可以包括打印服务,打印模块,WLAN,相机,图库,通话,导航,蓝牙,视频等应用程序。As shown in Fig. 5B, the application package may include applications such as printing service, printing module, WLAN, camera, gallery, calling, navigation, Bluetooth, video, etc.
在一些实施例中,打印服务可以由支持Huawei Hilink的应用程序(比如,智慧生活应用程序(application,APP))提供。打印服务也可以为单独的支持Huawei Hilink的应用程序。电子设备通过靠近发现等方式,发现打印设备后,自动调用打印服务,处理打印业务。其中,Huawei Hilink为各种智能设备提供一种智能硬件开放生态的加入方式。电子设备能够通过硬件接入或云接入等方式加入到Huawei Hilink生态中,实现电子设备互联互通,并且能够实现电子设备内部应用程序间的互联互通。In some embodiments, the printing service may be provided by a Huawei Hilink-enabled application (eg, a smart life application (application, APP)). The printing service can also be a separate Huawei Hilink-enabled application. After the electronic device discovers the printing device by means of proximity discovery, it automatically invokes the printing service to process the printing business. Among them, Huawei Hilink provides a way to join the open ecosystem of smart hardware for various smart devices. Electronic devices can be added to the Huawei Hilink ecosystem through hardware access or cloud access to realize interconnection of electronic devices and interconnection between applications within electronic devices.
需要说明的是,本申请实施例是以Huawei Hilink生态为例,对本申请实施例提供的自动打印方法进行说明。该自动打印方法还可以应用于其他支持应用程序间智能通信的生态环境中。It should be noted that the embodiment of the present application uses the Huawei Hilink ecosystem as an example to describe the automatic printing method provided by the embodiment of the present application. The automatic printing method can also be applied in other ecological environments that support intelligent communication between applications.
在一些实施例中,打印模块可以包含一个或多个打印设备对应的在电子设备中的插件。打印服务检测到打印设备后,能够自动调用该打印设备对应的打印模块处理打印业务,实现自动打印。In some embodiments, the printing module may contain one or more plug-ins in the electronic device corresponding to the printing 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 business, so as to realize automatic printing.
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。The application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
如图5B所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器和通知管理器等。窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。As shown in FIG. 5B, the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, and a notification manager, among others. A window manager is used to manage window programs. The window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, take screenshots, etc. Content providers are used to store and retrieve data and make these data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone book, etc. The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on. View systems can be used to build applications. A display interface can consist of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如,通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如,在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。The phone manager is used to provide the communication function of the electronic device 100 . For example, the management of call status (including connecting, hanging up, etc.). The resource manager provides various resources for the application, such as localization strings, icons, pictures, layout files, video files and so on. The notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages, and can disappear automatically after a brief pause without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also display notifications in the status bar at the top of the system in the form of graphs or scroll bar text, such as notifications of applications running in the background, and notifications on the screen in the form of dialog windows. For example, text information is prompted in the status bar, a prompt sound is issued, the electronic device vibrates, and the indicator light flashes.
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system. The core library consists of two parts: one is the function functions that the java language needs to call, and the other is the core library of Android.
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。The application layer and the application framework layer run in virtual machines. The virtual machine executes the java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, safety and exception management, and garbage collection.
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),二维图形引擎(例如:SGL)等。表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。二维图形引擎是2D绘图的绘图引擎。A system library can include multiple functional modules. For example: surface manager (surface manager), media library (Media Libraries), 3D graphics processing library (eg: OpenGL ES), 2D graphics engine (eg: SGL), etc. The Surface Manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing. A 2D graphics engine is a drawing engine for 2D drawing.
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。The kernel layer is the layer between hardware and software. The kernel layer contains at least display drivers, camera drivers, audio drivers, and sensor drivers.
以下实施例均以打印设备200为打印机为例进行说明。The following embodiments are all described by taking the printing device 200 as a printer as an example.
示例性地,图6为本申请实施例提供的一种自动打印方法示意图。如图6所示,该方法可以包括S601-S609:Exemplarily, FIG. 6 is a schematic diagram of an automatic printing method provided by an embodiment of the present application. As shown in Figure 6, the method may include S601-S609:
S601、电子设备检测到打印设备。S601. The electronic device detects a printing device.
在一些实施例中,电子设备与打印机能够支持NFC碰一碰发现功能、蓝牙靠近发现功能、电气和电子工程师协会(institute of electrical and electronics engineers,IEEE)802.11协议的靠近发现功能,通用智能传感集线器(sensorHub)发现功能等中的一种或多种;基于两者都支持的上述功能中的一种或多种功能,电子设备和打印设备能够互 相发现。In some embodiments, the electronic device and the printer can support NFC touch discovery function, Bluetooth proximity discovery function, proximity discovery function of Institute of Electrical and Electronics Engineers (IEEE) 802.11 protocol, general smart sensor One or more of a hub (sensorHub) discovery function, etc.; the electronic device and the printing device can discover each other based on one or more of the above-mentioned functions supported by both.
比如,电子设备和/或打印机打开NFC功能,电子设备靠近或接触到打印机上的NFC感应区域后,发现打印机。For example, the electronic device and/or the printer turns on the NFC function, and the electronic device discovers the printer after the electronic device approaches or touches the NFC sensing area on the printer.
S602、电子设备识别前台应用。S602, the electronic device identifies the foreground application.
其中,前台应用为电子设备当前界面对应的应用。示例性地,电子设备的显示屏当前显示哪个应用的界面,该应用则为前台应用。The foreground application is an application corresponding to the current interface of the electronic device. Exemplarily, the interface of which application is currently displayed on the display screen of the electronic device is the foreground application.
在一些实施例中,电子设备需要确认当前显示界面显示的前台应用,以判断当前场景下电子设备是否能够自动确定打印内容。比如,利用UsageStatsManager类进行前台应用识别。该UsageStatsManager类为安卓(Android)系统中,用于对电子设备使用情况进行统计管理的工具;能够查询到电子设备使用历史(如当前打开某应用)和统计信息,进而可获取到当前前台应用的包名,以此识别出不同的前台应用。其中,应用程序的包名在Android系统中具备唯一性,可以作为应用程序的唯一标识。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 print content in the current scenario. For example, use the UsageStatsManager class for foreground application identification. The UsageStatsManager class is a tool in the Android system for statistical management of the usage of electronic devices; it can query the usage history of electronic devices (such as an application currently opened) and statistical information, and then obtain the current foreground application. Package name to identify different foreground applications. The package name of the application is unique in the Android system and can be used as the unique identifier of the application.
示例性地,如图7所示的自动打印方法,电子设备例如可以包括打印服务、前台应用以及打印模块。电子设备通过碰一碰发现、靠近发现等方式发现打印机后,开启打印服务。如S701所示,打印服务识别前台应用。如打印服务确定前台应用为系统桌面,或者确定前台应用为音乐应用等。其中,可以通过startService方法调用该打印服务。Exemplarily, as shown in the automatic printing method shown in FIG. 7 , 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 touch discovery, proximity discovery, etc., the printing service is started. As shown in S701, the print 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. Among them, the printing service can be called through the startService method.
需要说明的是,电子设备在分屏显示或悬浮窗显示的情况下,通过检测最近一次接收到用户操作的位置对应的应用,确定该应用为前台应用。比如,电子设备分屏显示应用1和应用2,电子设备最近一次检测到用户的操作为在应用1对应的显示区域上的触摸操作,则确定前台应用为应用1。It should be noted that, in the case of split-screen display or floating window display, the electronic device determines that the application is a foreground application by detecting the application corresponding to the position where the user operation was most recently received. For example, the electronic device displays Application 1 and Application 2 on a split screen, and the electronic device determines that the foreground application is Application 1 if the most recent user's operation is a touch operation on the display area corresponding to Application 1 .
S603、电子设备确定前台应用是否为系统桌面。若是,即前台应用为系统桌面,则执行S604;若否,即前台应用不是系统桌面,则执行S605。S603, the electronic device determines whether the foreground application is the system desktop. If yes, that is, the foreground application is the system desktop, then go to S604; if not, that is, the foreground application is not the system desktop, go to S605.
在一些实施例中,电子设备利用查询到的应用包名,确定该应用包名是否为系统桌面包名,进而确定前台应用是否为系统桌面。即确定该前台应用是否为桌面应用。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 then determines whether the foreground application is the system desktop. That is, it is determined whether the foreground application is a desktop application.
示例性地,如图7所示S702,电子设备能够通过调用打印服务,确定前台应用是否为系统桌面。如图8所示,电子设备显示主界面,则确定当前显示的前台应用为系统桌面,需要执行下述S604。Exemplarily, as shown in S702 in FIG. 7 , the electronic device can determine whether the foreground application is the system desktop by invoking the print service. As shown in FIG. 8 , 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 performed.
如此,电子设备能够通过自动识别前台界面显示内容,根据不同的界面显示内容,选择不同的处理打印业务的方式,进而为用户提供更加灵活的打印方法。In this way, the electronic device can automatically identify the content displayed on the front-end interface, and select different ways of processing the printing service according to the content displayed on the different interface, thereby providing the user with a more flexible printing method.
S604、电子设备检测用户选择的打印内容。S604, the electronic device detects the print content selected by the user.
在一些实施例中,电子设备确定前台应用为系统桌面,则无法直接确定用户需要打印的内容,需要接收用户在桌面应用显示界面上选择打印内容的操作。其中用户选择的打印内容为当前桌面应用显示界面支持打印的至少一个显示元素,该显示元素可以为界面显示的控件、图标等。因此如图7所示,电子设备需要执行S703和S704。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 user's operation of selecting print content on the desktop application display interface. The print content selected by the user is at least one display element that supports printing in the current desktop application display interface, and the display element may be a control, an icon, or the like displayed on the interface. Therefore, as shown in FIG. 7 , the electronic device needs to execute S703 and S704.
S703、打印服务调用打印模块。S703, the print service invokes the print module.
S704、打印模块接收用户选择的待打印的打印内容。S704. The printing module receives the print content to be printed selected by the user.
示例性地,在S703-S704中,打印服务在确定前台应用为系统桌面后,调用或启动打印模块,由打印模块接收用户确定的打印内容。其中,打印服务可以通过Android 接口定义语言(android interface definition language,AIDL)跨进程调用打印模块。AIDL跨进程调用为Android中常见的跨进程接口调用方式之一,需要通信双方App同时持有一份相同的AIDL文件,并通过绑定双方服务,即可实现跨进程接口调用。此外,由用户确定打印内容的方法可以参考上述图1-图3所述的方法,在此不再赘述。或者,在另一些场景中,电子设备直接截图当前桌面应用显示界面,将显示界面截图作为待打印的打印内容。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 print service can call the print 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 apps to hold the same AIDL file at the same time, and by binding the services of both parties, the cross-process interface call can be realized. In addition, for the method for determining the print content by the user, reference may be made to the methods described in FIG. 1 to FIG. 3 above, and details are not described herein again. Or, in 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 print content to be printed.
S605、电子设备确定前台应用是否为白名单应用。若否,即前台应用不是白名单应用,则执行S606;若是,即前台应用为白名单应用,则执行S607。S605. The electronic device determines whether the foreground application is a whitelisted application. If no, that is, the foreground application is not a whitelisted application, execute S606; if yes, that is, the foreground application is a whitelisted application, execute S607.
在一些实施例中,电子设备确定前台应用不是系统桌面,则需要进一步确定前台应用是否为白名单应用,即确定是否支持自动识别打印。其中,白名单可以为白名单库,用于保存已注册的应用包名,该白名单可以预置于电子设备中;或者电子设备在需要进行查询时,向服务器请求下载白名单。白名单可以包含已经注册的应用程序的包名,电子设备查询白名单中是否包含当前前台应用的包名,即可确定当前前台应用是否为已经注册的支持自动识别打印的应用。In some embodiments, if the electronic device determines that the foreground application is not the system desktop, it needs to further determine whether the foreground application is a whitelisted application, that is, whether to support automatic identification and printing. The whitelist may be a whitelist library for storing registered application package names, and the whitelist may be preset in the electronic device; or the electronic device may request the server to download the whitelist when inquiring. The whitelist can include the package name of the registered application. The electronic device can check whether the whitelist contains the package name of the current foreground application to determine whether the current foreground application is a registered application that supports automatic identification and printing.
示例性地,如图7所示S705,可以由打印服务确定前台应用是否为白名单应用。具体的,打印服务利用上述S701中获取到的前台应用的包名,在白名单中进行配置文件匹配,确定前台应用是否存在于白名单中,进而确定前台应用是否为白名单应用。Exemplarily, as shown in S705 in FIG. 7 , whether the foreground application is a whitelisted application may be determined by the print service. Specifically, the print service uses the package name of the foreground application obtained in S701 to perform configuration file 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.
在一些实施例中,在S605之前,应用程序需要进行白名单注册。例如,应用程序开发者在开发者网站进行配置文件配置的过程中,进行包名注册,确定允许当前应用支持自动识别打印业务。服务器接收注册信息,生成白名单供电子设备下载。电子设备可以周期性更新下载白名单,或者在线查询白名单,或者周期性下载新注册的应用程序注册信息。In some embodiments, before S605, the application needs to perform whitelist registration. For example, in the process of configuring the configuration file on the developer website, the application developer registers the package name to determine that the current application is allowed to support the automatic identification printing service. The server receives the registration information and generates a white list for the electronic device to download. The electronic device may periodically update the download whitelist, or query the whitelist online, or periodically download the registration information of newly registered applications.
示例性地,如下示出一种应用程序白名单,该应用程序白名单中已注册的应用包括
Figure PCTCN2022085616-appb-000005
应用以及文字处理系统
Figure PCTCN2022085616-appb-000006
应用。
Exemplarily, an application whitelist is shown as follows, and the registered applications in the application whitelist include:
Figure PCTCN2022085616-appb-000005
applications and word processing systems
Figure PCTCN2022085616-appb-000006
application.
Figure PCTCN2022085616-appb-000007
Figure PCTCN2022085616-appb-000007
S606、电子设备确定打印内容为显示界面截图内容。S606, the electronic device determines that the print content is the content of the screenshot of the display interface.
在一些实施例中,电子设备确定前台应用不是白名单中的应用,则确定前台应用不支持自动识别打印,进而确定需要将当前显示界面截图打印。In some embodiments, the electronic device determines that the foreground application is not an application in the whitelist, determines that the foreground application does not support automatic identification and printing, and further determines that a screenshot of the current display interface needs to be printed.
示例性地,如图7所示S705以及S706。Exemplarily, S705 and S706 are shown in FIG. 7 .
S705、打印服务确定前台应用是否为白名单应用。S705, the print service determines whether the foreground application is a whitelisted application.
S706、打印服务将当前显示界面截图发送至打印模块。S706, the print service sends the screenshot of the current display interface to the print module.
在一些实施例中,打印服务确定前台应用不是白名单应用,则利用Android系统中SurfaceControl.screenshot接口进行截图并保存截图文件。之后,将保存的截图文件的统一资源标识符(uniform resource identifier,URI)通过AIDL跨进程调用发送至打印模块。In some embodiments, the print service determines that the foreground application is not a whitelisted application, and uses the SurfaceControl.screenshot interface in the Android system to take a screenshot and save the screenshot file. After that, send the uniform resource identifier (URI) of the saved screenshot file to the printing module through the AIDL cross-process call.
其中,URI用于表示对应的待操作的数据引用,打印模块接收到URI后,能够根据URI确定对应的截图文件保存位置,即获得截图文件的访问权限,进而能够获得截图文件进行打印。比如,content:\/\/cn.netease.cloudmusic.fileprovider\/external_storage_root\/test\/Test1.png为一种URI示例。The URI is used to represent the corresponding data reference to be operated. After receiving the URI, the printing module can determine the corresponding screenshot file storage location according to the URI, that is, obtain the access authority of the screenshot file, and then 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.
示例性地,如图9所示界面901,电子设备在显示
Figure PCTCN2022085616-appb-000008
应用聊天界面901的过程中,检测到打印机,则调用打印服务执行上述S701-S705。打印服务确定当前界面901对应的前台应用为
Figure PCTCN2022085616-appb-000009
应用,且不是白名单应用,则生成截图91,并将截图91保存位置的URI发送至打印模块,从而使得打印模块能够打印当前显示界面。
Exemplarily, as shown in interface 901 in FIG. 9 , the electronic device is displaying
Figure PCTCN2022085616-appb-000008
In the process of using the chat interface 901, if a printer is detected, the printing service is invoked to execute the above S701-S705. The print service determines that the foreground application corresponding to the current interface 901 is
Figure PCTCN2022085616-appb-000009
application, and it is not a whitelisted application, a screenshot 91 is generated, and the URI of the saved location of the screenshot 91 is sent to the printing module, so that the printing module can print the current display interface.
如此,即使前台应用不是白名单应用,用户同样不必进行多次操作,即可实现自动打印,降低用户操作难度。In this way, even if the foreground application is not a whitelisted application, the user does not need to perform multiple operations to achieve automatic printing, which reduces the difficulty of the user's operation.
S607、电子设备确定显示界面是否支持打印业务。若否,即显示界面不支持打印业务,则执行S606;若是,即显示界面支持打印业务,则执行S608。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 go to S606; if yes, that is, the display interface supports the printing service, go to S608.
在一些实施例中,前台应用为白名单应用,支持打印业务,但是前台应用可能包含多个显示界面,可能部分显示界面的显示内容支持打印业务,部分显示界面的显示内容不支持打印业务,那么电子设备就需要进一步获取前台应用显示界面支持的具体打印内容,实现打印。In some embodiments, the foreground application is a whitelisted application and supports the printing service, but the foreground application may include multiple display interfaces, and the display content of some display interfaces may support the printing service, and the display content of some display interfaces may not support the printing service, then The electronic device needs to further obtain the specific print content supported by the display interface of the foreground application to realize printing.
在一些实施例中,打印服务确定前台应用是白名单应用,则需要与前台应用建立通信连接,用于确定前台应用当前显示界面是否支持打印业务,以及获取支持的打印内容信息。In some embodiments, if the print service determines that the foreground application is a whitelisted application, it needs 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 supported print content information.
示例性地,如图7所示S707。Exemplarily, S707 is shown in FIG. 7 .
S707、打印服务与前台应用建立通信连接。S707, the print service establishes a communication connection with the foreground application.
在一些实施例中,该打印服务与前台应用可以基于Android轻量级Messenger进程间通信方式,建立用于传输信号的通信连接。In some embodiments, the print service and the foreground application may establish a communication connection for transmitting signals based on the Android lightweight messenger inter-process communication method.
示例性地,如图10所示,在打印服务101和前台应用102之间,利用Binder实体1011以及Binder实体1012建立两者之间的通信连接,用于传输后续步骤中的交互信息。进一步地,在打印服务101侧配置有用于处理交互信息的处理者(Handle)1013,例如用于处理能够发送至前台应用102或打印模块的消息。前台应用102侧配置有用于处理交互信息的处理者(Handle)1014,例如用于处理能够发送至打印服务101的消息。Exemplarily, as shown in FIG. 10 , between the print service 101 and the foreground application 102 , the Binder entity 1011 and the Binder entity 1012 are used to establish a communication connection between the two, so as to transmit the interaction information in the subsequent steps. Further, a handler (Handle) 1013 for processing interactive information is configured on the print service 101 side, for example, for processing messages that can be sent to the foreground application 102 or the printing module. The foreground application 102 is provided with a handler (Handle) 1014 for processing interactive information, for example, for processing messages that can be sent to the print service 101 .
如此,电子设备通过建立如图10所示的通信连接,实现打印服务与前台应用之间的信息交互。In this way, the electronic device realizes the information interaction between the printing service and the foreground application by establishing the communication connection as shown in FIG. 10 .
可选地,上述S607可以实现为如图7所示S708-S711。Optionally, the above S607 may be implemented as S708-S711 as shown in FIG. 7 .
S708、打印服务向前台应用发送查询信息。S708, the print service sends query information to the foreground application.
在一些实施例中,打印服务利用与前台应用之间的通信连接,向前台应用发送查询信息,该查询信息用于查询前台应用当前显示界面是否支持打印业务。查询信息例如可以包括打印服务的包名(clientName)以及打印业务标识(bussinessID)。In some embodiments, the printing service uses the communication connection with the foreground application to send query information to the foreground application, where the query information is used to query whether the current display 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 business ID (businessID).
其中,打印服务的包名用于通知前台应用当前请求消息的目的,打印业务标识可以默认为0(或者描述为0x00)。查询信息也可以描述为应用界面打印业务(APP page print business,APPB)请求消息,打印服务将APPB请求消息以预设封装方式进行封装,并通过上述S707中建立的通信连接,将封装后的APPB请求消息进行跨进程传输。相应地,前台应用接收该APPB请求消息。其中,预设封装方式例如可以包括依次以JSON对象(或XML)、Bundle和Message进行封装。The package name of the print service is used to notify the foreground application of the current request message, and the print service identifier may be 0 (or described as 0x00) by default. The query information can also be described as an APP page print business (APPB) request message. The print service encapsulates the APPB request message in a preset encapsulation manner, and through the communication connection established in the above S707, encapsulates the encapsulated APPB Request messages to be transmitted across processes. Correspondingly, the foreground application receives the APPB request message. The preset encapsulation manner may include, for example, encapsulating in sequence with JSON object (or XML), Bundle and Message.
示例性地,如下示出一种APPB请求消息。Exemplarily, an APPB request message is shown as follows.
Figure PCTCN2022085616-appb-000010
Figure PCTCN2022085616-appb-000010
S709、前台应用解析查询信息,确定支持的打印业务。S709, the foreground application parses the query information, and determines the supported printing service.
在一些实施例中,前台应用接收到查询信息后,解析查询信息。例如,依次解析Message、Bundle和JSON Object,获取到打印服务的包名和打印业务标识。根据打印服务的包名以及打印业务标识,前台应用确定当前显示界面显示内容支持的打印业务列表,生成查询响应。In some embodiments, after receiving the query information, the foreground application parses the query information. For example, parse Message, Bundle, and JSON Object in turn to obtain the package name and print service ID of the print service. According to the package name of the print service and the print service identifier, the foreground application determines a list of print services supported by the content displayed on the current display interface, and generates a query response.
在一些实施例中,查询响应也可以描述为APPB响应消息,该查询响应用于通知打印服务当前显示界面支持的打印业务,查询响应例如可以包括前台应用包名(serverName)、打印业务标识(bussinessID)、前台应用界面名称(foregroundName)以及支持的打印业务列表(contentlist)。其中,支持的打印业务列表中例如可以包括内容编码(contentId)、内容名称(contentname)以及内容类型(fileType)。内容类型字段取值用于表示打印内容的格式。例如fileType字段取值为0,用于表示打印内容格式为图片格式。又比如,fileType字段取值为1,用于表示打印内容格式为文档格式。上述fileType字段取值及其含义仅为示例性说明,本申请实施例对此不做具体限定。In some embodiments, the query response can also be described as an APPB response message, and the query response is used to notify the printing service of the printing services currently supported by the display interface. ), the name of the foreground application interface (foregroundName), and the list of supported printing services (contentlist). The list of supported printing services may include, for example, a content code (contentId), a content name (contentname), and a content type (fileType). The value of the content type field is used to indicate the format of the printed content. For example, the value of the fileType field is 0, which is used to indicate that the format of the print content is the image format. For another example, the value of the fileType field is 1, which is used to indicate that the format of the print content is the document format. The value of the above fileType field and its meaning are only exemplary descriptions, which are not specifically limited in this embodiment of the present application.
示例性地,如下示出一种APPB响应消息。Exemplarily, an APPB response message is shown as follows.
Figure PCTCN2022085616-appb-000011
Figure PCTCN2022085616-appb-000011
Figure PCTCN2022085616-appb-000012
Figure PCTCN2022085616-appb-000012
S710、前台应用向打印服务发送查询响应。S710. The foreground application sends a query response to the print service.
在一些实施例中,前台应用生成查询响应后,将查询响应以预设封装方式(如JSON Object、Bundle和Message封装方式)进行封装,并通过上述S707中建立的通信连接进行跨进程传输。相应地,打印服务接收该查询响应。In some embodiments, after the foreground application generates the query response, the query response is encapsulated in a preset encapsulation manner (such as JSON Object, Bundle and Message encapsulation manner), and is transmitted across processes through the communication connection established in the above S707. Accordingly, the print service receives the query response.
S711、打印服务确定显示界面是否支持打印业务。S711, the print service determines whether the display interface supports the print service.
在一些实施例中,打印服务接收到查询响应后,解析查询响应。例如,依次解析Message、Bundle和JSON Object,根据contentlist字段长度,能够确定当前显示界面是否支持打印业务,以及支持哪些打印业务。例如,contentlist字段长度为0,则表示显示界面不支持打印业务。或者,打印服务根据查询响应中是否包含显示内容的标识,确定当前界面是否支持打印业务。比如,在查询响应包含当前界面中显示内容的标识后,当前界面支持打印业务,标识用于指示当前界面包括的支持打印的至少一个显示内容。在查询响应不包含当前界面中显示内容的标识后,当前界面不支持打印业务。In some embodiments, after receiving the query response, the print service parses the query response. For example, by analyzing Message, Bundle, and JSON Object in turn, and according to the length of the contentlist field, it can be determined whether the current display interface supports printing services, and which printing services are supported. For example, if the length of the contentlist field is 0, it means that the display interface does not support printing services. Or, the print service determines whether the current interface supports the print service according to whether the query response contains the identifier of the displayed content. For example, after the query response includes 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 included in the current interface that supports printing. 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.
示例性地,打印服务解析上述S709中示例的查询响应,根据contentlist字段内容,确定当前前台应用显示界面支持打印歌词图片。Exemplarily, the print service parses the query response in the example in S709, and determines, according to the content of the contentlist field, that the display interface of the current foreground application supports printing lyrics pictures.
如此,电子设备通过上述S708-S711确定显示界面是否支持打印业务,如果支持打印业务,则电子设备能够进一步获取打印内容,即执行下述S608;若不支持打印业务,则电子设备执行上述S606,即对显示界面进行截图,确定打印内容为截图内容。In this way, the electronic device determines whether the display interface supports the printing service through the above-mentioned S708-S711. If the printing service is supported, the electronic device can further obtain the printing content, that is, execute the following S608; if the printing service is not supported, the electronic device executes the above-mentioned S606, That is, take a screenshot of the display interface, and determine that the print content is the content of the screenshot.
示例性地,如图7所示,S712与上述S706相同,打印服务确定当前显示界面不支持打印业务,则将当前显示界面截图发送至打印模块。相应地,打印模块接收到截图后,确定待打印的打印内容为截图内容。Exemplarily, as shown in FIG. 7 , S712 is the same as S706 above, and the print service determines that the current display interface does not support the printing service, and sends a screenshot of the current display interface to the printing module. Correspondingly, after receiving the screenshot, the printing module determines that the print content to be printed is the screenshot content.
S608、电子设备确定显示界面的打印内容。S608, the electronic device determines the print content of the display interface.
在一些实施例中,电子设备确定当前显示界面支持的打印业务后,需要进一步确定当前显示界面支持的打印业务对应的打印内容,打印内容为当前显示界面包括的支持打印的至少一个显示内容。比如,当前显示界面支持的打印业务为歌词图片,则电子设备需要进一步获取当前显示界面正在播放的歌曲的歌词图片信息,实现打印。In some embodiments, after determining the printing service supported by the current display interface, the electronic device needs to further determine the printing content corresponding to the printing service supported by the current display interface, and the printing content is at least one display content that supports printing included in the current display interface. For example, if the printing service supported by the current display interface is lyric pictures, the electronic device needs to further obtain the lyrics and picture information of the song being played on the current display interface to realize printing.
可选地,如图7所示,S608可以实现为下述S713-S716。Optionally, as shown in FIG. 7 , S608 may be implemented as the following S713-S716.
S713、打印服务向前台应用发送打印内容请求。S713, the print service sends a print content request to the foreground application.
在一些实施例中,打印服务利用与前台应用之间的通信连接,向前台应用发送打印内容请求,该打印内容请求用于请求前台应用当前界面支持的打印业务的打印内容信息。打印内容请求例如可以包括打印服务的包名(clientName)、打印业务标识(bussinessID)、打印内容标识(contIdId)、打印内容类型(fileType)、支持的最大打印数量(maxFileNum)。其中,打印业务标识可以默认为0。打印内容请求也可以描述为应用界面数据(APP page data,APPD)请求消息,打印服务将APPD请求消息,以预设封装方式(如JSON Object、Bundle和Message封装方式)进行封装,并通过上述S707中建立的通信连接进行跨进程传输。相应地,前台应用接收该APPD请求消息。In some embodiments, the print service uses the communication connection with the foreground application to send a print content request to the foreground application, where the print content request is used to request print content information of the print service supported by the current interface of the foreground application. The print content request may include, for example, the package name of the print service (clientName), the print service ID (businessID), the print content ID (contIdId), the print content type (fileType), and the maximum supported print quantity (maxFileNum). The print service ID can be 0 by default. The print content request can also be described as an application interface data (APP page data, APPD) request message. The print service encapsulates the APPD request message in a preset encapsulation method (such as JSON Object, Bundle and Message encapsulation methods), and passes the above S707 The communication connection established in the process is transmitted across the process. Correspondingly, the foreground application receives the APPD request message.
示例性地,如下示出一种APPD请求消息。Exemplarily, an APPD request message is shown as follows.
Figure PCTCN2022085616-appb-000013
Figure PCTCN2022085616-appb-000013
Figure PCTCN2022085616-appb-000014
Figure PCTCN2022085616-appb-000014
S714、前台应用解析打印内容请求,确定打印内容信息。S714: The foreground application parses the print content request, and determines the print content information.
在一些实施例中,前台应用接收到打印内容请求后,解析打印内容请求。例如,依次解析Message、Bundle和JSON Object,获取打印服务的包名(clientName)、打印业务标识(bussinessID)、打印内容标识(contIdId)、打印内容类型(fileType)、支持的最大打印数量(maxFileNum)。进而确定待打印的打印内容信息,生成打印内容响应。其中,打印内容信息例如包括打印内容的URI数据。In some embodiments, after receiving the print content request, the foreground application parses the print content request. For example, parse Message, Bundle, and JSON Object in turn to obtain the package name (clientName), printing business ID (businessID), printing content ID (contIdId), printing content type (fileType), and maximum supported print quantity (maxFileNum) of the printing service. . Further, the print content information to be printed is determined, and a print content response is generated. The print content information includes, for example, URI data of the print content.
在一些实施例中,打印内容响应也可以描述为APPD响应消息,该打印内容响应用于通知打印服务当前打印内容的URI数据,即允许打印服务访问打印内容。打印内容响应例如可以包括前台应用包名(serverName)、打印业务标识(bussinessID)、打印内容标识(contIdId)、打印内容类型(fileType)、打印内容数量(maxFileNum)、打印内容文件列表(fileList)。其中,打印内容文件列表(fileList)中例如可以包括文件序号(index)、文件格式(format)、文件状态(status)、文件URI(fileUriStr)、文件路径(filePath)以及文件大小(fileSize)。In some embodiments, the print content response can also be described as an APPD response message, the print content response is used to inform the print service of URI data of the current print content, ie, the print service is allowed to access the print content. The print content response may include, for example, a foreground application package name (serverName), a print service ID (businessID), a print content ID (contIdId), a print content type (fileType), a print content number (maxFileNum), and a print content file list (fileList). The print content file list (fileList) may include, for example, a file number (index), a file format (format), a file status (status), a file URI (fileUriStr), a file path (filePath), and a file size (fileSize).
示例性地,如下示出一种APPD响应消息。Exemplarily, an APPD response message is shown as follows.
Figure PCTCN2022085616-appb-000015
Figure PCTCN2022085616-appb-000015
Figure PCTCN2022085616-appb-000016
Figure PCTCN2022085616-appb-000016
S715、前台应用向打印服务发送打印内容响应。S715. The foreground application sends a print content response to the print service.
在一些实施例中,前台应用生成打印内容响应后,将打印内容响应以预设封装方式(如JSON Object、Bundle和Message封装方式)进行封装,并通过上述S707中建立的通信连接进行跨进程传输。相应地,打印服务接收该打印内容响应。In some embodiments, after the front-end application generates the print content response, the print content response is encapsulated in a preset encapsulation method (such as JSON Object, Bundle and Message encapsulation methods), and cross-process transmission is performed through the communication connection established in the above S707 . Accordingly, the print service receives the print content response.
S716、打印服务解析打印内容响应,并获取打印内容信息。S716, the print service parses the print content response, and obtains print content information.
在一些实施例中,打印服务接收到打印内容响应后,解析打印内容响应。例如,依次解析Message、Bundle和JSON Object,获取打印内容信息,如文件列表中的信息等。In some embodiments, after receiving the print content response, the print service parses the print content response. For example, parse Message, Bundle, and JSON Object in turn to obtain print content information, such as the information in the file list.
如此,电子设备通过上述S713-S716确定前台应用显示界面待打印的打印内容信息,获得访问权限,从而能够执行后续的打印任务。In this way, the electronic device determines the print content information to be printed on the display interface of the foreground application through the above S713-S716, and obtains the access authority, so as to be able to execute subsequent printing tasks.
S609、电子设备显示打印界面,检测用户的确定操作,打印对应的打印内容。S609, the electronic device displays a print interface, detects a user's determination operation, and prints the corresponding print content.
在一些实施例中,电子设备确定打印内容信息后,显示打印界面,用于提示用户检查打印内容是否正确,是否确认打印,从而避免误操作引起的异常打印。比如,用户不小心触发上述S601,则当前用户可以选择不打印。或者,电子设备确定打印内容后,提示该打印内容。比如,电子设备通过语音提示、振动提示等方式,提示用户当前电子设备需要打印,确认是否执行打印作业。In some embodiments, after determining the print content information, the electronic device displays a print interface for prompting the user to check whether the print content is correct and whether to confirm the print, so as to avoid abnormal printing caused by misoperation. For example, if the user accidentally triggers the above S601, the current user may choose not to print. Or, after determining the print content, the electronic device prompts the print content. For example, the electronic device prompts the user that the current electronic device needs to print by means of voice prompts, vibration prompts, etc., and confirms whether to execute the print job.
需要说明的是,如图6所示,S609中确定的打印内容,为上述S604、或S606、或S608中确定的打印内容中包含的打印内容。即电子设备执行S604后执行S609,或者电子设备执行S606后执行S609,或者电子设备执行S608后执行S609。It should be noted that, as shown in FIG. 6 , the print content determined in S609 is the print content included in the print content determined in the above S604 , S606 , or S608 . That is, the electronic device executes S604 and then executes S609, or the electronic device executes S606 and then executes S609, or the electronic device executes S608 and then executes S609.
示例性地,如图7所示,S609可以实现为下述S717和S718。Exemplarily, as shown in FIG. 7 , S609 may be implemented as the following S717 and S718.
S717、打印服务向打印模块发送打印内容信息。S717, the print service sends print content information to the print module.
在一些实施例中,打印服务获取到打印信息后,将打印信息发送至打印模块,使得打印模块获得访问打印内容的权限,从而实现打印。In some embodiments, after acquiring the printing information, the printing service sends the printing information to the printing module, so that the printing module obtains the permission to access the printing content, thereby realizing printing.
比如,打印服务将要打印的数据信息内容的URI作为参数,通过AIDL跨进程调用传递给打印模块。For example, the print service takes the URI of the data information content to be printed as a parameter, and passes it to the print module through AIDL cross-process calls.
S718、打印模块响应于用户的确定操作,打印对应的打印内容。S718, the print module prints the corresponding print content in response to the user's determination operation.
在一些实施例中,打印模块接收到打印内容信息后,访问打印内容,并显示确认界面,接收用户对打印内容的确认操作。如接收到确定操作后,则将相应的打印内容发送至打印机进行打印。In some embodiments, after receiving the print content information, the print module accesses the print content, displays a confirmation interface, and receives a user's confirmation operation on the print content. If the confirmation operation is received, the corresponding print content will be sent to the printer for printing.
示例性地,如图11所示中(a)所示界面1101,界面1101用于显示图库内容。假设电子设备在显示界面1101的过程中,通过碰一碰发现的方式发现打印机,则调用打印服务,执行上述图6以及图7所示的方法。此时,如界面1101上图标111所示,用户已选中一张图片,即当前打印内容为图标111所指示的图片,打印内容信息为图标111所指示的图片的URI数据。打印模块获得打印内容信息后,使得电子设备显示 如图11中(b)所示界面1102,用于提示用户对打印内容进行确定。如电子设备检测到用户点击“开始打印”控件112的操作后,确定打印当前打印内容,则打印模块将该图片发送至打印机进行打印。Exemplarily, as shown in the interface 1101 shown in (a) of FIG. 11 , the interface 1101 is used to display the contents of the gallery. Assuming that the electronic device discovers the printer by touch to discover in the process of displaying the interface 1101 , the printing service is invoked, and the methods shown in FIG. 6 and FIG. 7 are executed. At this time, as shown by the icon 111 on the interface 1101, the user has selected a picture, that is, the current print content is the picture indicated by the icon 111, and the print content information is the URI data of the picture indicated by the icon 111. After the printing module obtains the printing content information, it causes the electronic device to display an interface 1102 as shown in (b) in FIG. 11 , which is used to prompt the user to determine the printing content. If the electronic device determines to print the current print content after detecting that the user clicks the "start printing" control 112, the printing module sends the picture to the printer for printing.
其中,确定操作例如可以包括点击确认控件(如“开始打印”控件)、双击显示屏等在显示屏上的预设手势操作,或者还可以包括双击音量键、双击手机背壳等预设操作,或者还可以包括等待预设时长后自动确认的操作。对于确定操作的具体类型,本申请实施例不做具体限定。Wherein, the determination operation may include, for example, a preset gesture operation on the display screen such as clicking on a confirmation control (such as a "start printing" control), double-clicking the display screen, etc., or may also include preset operations such as double-clicking the volume key, double-clicking the back shell of the mobile phone, etc., Alternatively, it may also include an operation of automatically confirming after waiting for a preset period of time. The specific type of the determination operation is not specifically limited in this embodiment of the present application.
在一些实施例中,假设打印内容为如图7所示的S706或S712中打印服务截图获得的打印内容。若打印模块响应于用户的操作,确定取消打印,则电子设备可以自动删除截图的打印内容,以节约存储空间。或者,电子设备可以响应于用户的操作,删除对应的截图的打印内容。In some embodiments, it is assumed that the print content is the print content obtained by taking a screenshot of the print service in S706 or S712 as shown in FIG. 7 . If the printing module determines to cancel the printing in response to the user's operation, the electronic device can automatically delete the printing content of the screenshot to save storage space. Alternatively, the electronic device may delete the printed content of the corresponding screenshot in response to the user's operation.
如此,本申请实施例提供的自动打印方法,电子设备能够自动识别显示内容,实现自动打印,不必用户手动在多个应用中反复跳转,查找打印内容。从而降低打印难度,提升打印效率,满足用户快速便捷的移动打印需求。In this way, with the automatic printing method provided by the embodiments of the present application, the electronic device can automatically identify the display content and realize automatic printing, without the need for the user to manually jump through multiple applications repeatedly to find the print content. Thereby, the difficulty of printing is reduced, the printing efficiency is improved, and the user's fast and convenient mobile printing needs are met.
此外,电子设备通过查询响应(即APPB响应消息),能够预先定义不同应用的不同显示界面的打印策略,或者预先定义同一显示界面支持的不同打印内容的打印策略,满足用户的灵活打印需求。In addition, the electronic device can predefine printing strategies for different display interfaces of different applications through query responses (ie, APPB response messages), or predefine printing strategies for different printing contents supported by the same display interface, so as to meet the flexible printing requirements of users.
在一些场景中,打印模块接收到打印内容信息后,无需用户确认操作即可直接将打印内容发送至打印机进行打印,进一步减少用户操作,保证无需用户进行额外的操作即可实现自动打印。或者,在另一些场景中,打印模块接收到打印内容信息后,等待预设时长后自动将打印内容发送至打印机进行打印,这样电子设备也能够保证在无需用户额外操作的情况下,实现自动打印。In some scenarios, after receiving the print content information, the print module can directly send the print content to the printer for printing without user confirmation, further reducing user operations and ensuring automatic printing without additional user operations. Or, in other scenarios, after receiving the print content information, the printing module automatically sends the print content to the printer for printing after waiting for a preset period of time, so that the electronic device can also ensure that automatic printing can be realized without any additional operation by the user. .
示例性地,如图11所示场景,电子设备在显示图11中(a)所示界面1101的过程中检测到打印机后,直接可以进行图片打印,不必再显示如图11中(b)所示界面1102,接收用户的确认操作。Exemplarily, in the scenario shown in FIG. 11 , after the electronic device detects the printer in the process of displaying the interface 1101 shown in (a) in FIG. The interface 1102 is displayed, and the confirmation operation of the user is received.
可以理解的是上述实施例中,图7所示的打印服务、前台应用、打印模块的划分仅为示例性说明,还可以存在其他划分方式用于实现上述自动打印方法。It can be understood that in the above embodiment, the division of the printing service, the foreground application, and the printing module shown in FIG. 7 is only an exemplary illustration, and there may be other divisions for implementing the above automatic printing method.
在一些场景中,前台应用当前显示界面支持多个打印内容,电子设备需要确认用户需要打印的打印内容。比如,音乐播放界面支持打印歌词图片和专辑封面图片,电子设备无法直接判断打印内容,则需要接收用户的选择操作,确定需要打印的打印内容。示例性地,图12为本申请实施例提供的又一种自动打印方法。如图12所示,在图7所示S711之后,还可以包括S1201和S1202。In some scenarios, the current display interface of the foreground application supports multiple print contents, and the electronic device needs to confirm the print contents that the user needs to print. For example, the music playback interface supports printing lyrics pictures and album cover pictures, and the electronic device cannot directly determine the print content, so it needs to receive the user's selection operation to determine the print content to be printed. Exemplarily, FIG. 12 is yet another automatic printing method provided by this embodiment of the present application. As shown in FIG. 12 , after S711 shown in FIG. 7 , S1201 and S1202 may also be included.
S1201、打印服务确定是否支持多个打印内容。若是,即支持多个打印内容,则执行S1202;若否,即只支持一个打印内容,则执行S713。S1201. The print service determines whether multiple print contents are supported. If yes, that is, multiple print contents are supported, then go to S1202; if not, that is, only one print content is supported, go to S713.
在一些实施例中,前台应用显示界面可以支持一个或多个打印内容,打印服务在接收到查询响应后,解析查询响应,根据支持的打印业务列表(contentlist)字段的长度,即可确定前台应用显示界面是否支持多个打印内容。如支持的打印业务列表(contentlist)字段的长度大于1,则表示前台应用显示界面支持打印内容数量为多个。In some embodiments, the display interface of the foreground application can support one or more print contents. After receiving the query response, the print service parses the query response, and determines the foreground application according to the length of the supported print service list (contentlist) field. Indicates whether the display interface supports multiple print contents. If the length of the supported print service list (contentlist) field is greater than 1, it means that the display interface of the foreground application supports multiple print contents.
示例性地,打印服务根据上述S709中所示的APPB响应消息中支持的打印业务 列表(contentlist)字段的长度,确定前台应用支持的打印内容数据为1,即支持打印歌词图片。Exemplarily, according to the length of the supported printing service list (contentlist) field in the APPB response message shown in the above S709, the printing service determines that the printing content data supported by the foreground application is 1, that is, the printing of lyrics pictures is supported.
又示例性地,如图13A中(a)所示界面1301为音乐播放界面,具有音乐播放功能,显示有音乐专辑封面图片。电子设备检测到用户点击界面1301上空白位置的操作,能够切换显示内容。比如,显示图13A中(b)所示界面1302。显示内容切换为正在播放的音乐的歌词图片。界面1302同样为音乐播放界面,具有音乐播放功能。那么当前音乐播放界面可以实现不同的打印策略。比如,可以实现三种打印策略:打印歌词图片和/或打印专辑封面图片。也即音乐播放功能页面支持多个打印内容。电子设备在显示界面1301或显示界面1302的过程中,检测到打印机,确定当前界面支持多个打印内容,则执行S1202,由用户确定具体实现哪一种打印策略。For another example, as shown in (a) in FIG. 13A, the interface 1301 is a music playing interface, which has a music playing function and displays a music album cover picture. The electronic device detects that the user clicks on a blank position on the interface 1301, and can switch the displayed content. For example, the interface 1302 shown in (b) of FIG. 13A is displayed. The display content is switched to a picture of the lyrics of the music being played. The interface 1302 is also a music playing interface and has a music playing function. Then the current music playing interface can implement different printing strategies. For example, three printing strategies can be implemented: printing lyrics pictures and/or printing album cover pictures. That is, the music playback function page supports multiple print contents. During the process of displaying the interface 1301 or the interface 1302, the electronic device detects the printer and determines that the current interface supports multiple printing contents, and then executes S1202, and the user determines which printing strategy is specifically implemented.
如下示出当前场景下APPB响应消息,打印服务根据该APPB响应消息中支持的打印业务列表(contentlist)字段的长度,确定前台应用支持的打印内容数据为2,即支持打印歌词图片和专辑封面图片。The APPB response message under the current scene is shown as follows, and the print service determines that the print content data supported by the foreground application is 2 according to the length of the print service list (contentlist) field supported in the APPB response message, that is, supports printing lyrics pictures and album cover pictures. .
Figure PCTCN2022085616-appb-000017
Figure PCTCN2022085616-appb-000017
可以看出,不同打印策略对应的打印内容包含电子设备当前界面用户可见的显示内容,也可以包含电子设备当前界面用户不可见的显示内容。比如,电子设备在显示如图13A中(a)所示界面1301的过程中检测到打印机,触发打印流程,当前界面1301支持打印用户可见的显示内容(如界面1301显示的专辑封面图片)以及支持打印用户不可见的显示内容(如图13A中(b)所示界面1302显示的歌词图片)。It can be seen that the print content corresponding to different printing strategies includes the display content visible to the user on the current interface of the electronic device, and may also include the display content that is invisible to the user on the current interface of the electronic device. For example, the electronic device detects a printer in the process of displaying the interface 1301 shown in (a) in FIG. 13A, and 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 Print the display content that is invisible to the user (the lyrics picture displayed on the interface 1302 as shown in FIG. 13A (b)).
需要说明的是,本申请实施例不限制S711和S1201的执行顺序。比如,打印服务在接收到查询响应后,能够根据查询响应同时确定前台应用显示界面是否支持打印业务以及支持的打印内容数量。It should be noted that this embodiment of the present application does not limit the execution order of S711 and S1201. For example, after receiving the query response, the printing service can simultaneously determine whether the display interface of the foreground application supports the printing service and the number of supported printing contents according to the query response.
S1202、打印服务显示多个支持的打印内容,接收用户选择的打印内容。S1202: The print service displays a plurality of supported print contents, and receives the print contents selected by the user.
在一些实施例中,打印服务确定前台应用支持的打印内容数据为多个,则需要显示打印内容选择界面,接收用户选择的打印内容。例如,打印服务根据解析后的APPB响应消息中的支持的打印内容列表,生成提示信息,使用Android中的自定义会话 (Dialog)或者活动(Activity)进行界面提示,接收用户选择的打印内容。In some embodiments, if the print service determines that there are multiple print content data supported by the foreground application, a print content selection interface needs to be displayed to receive the print content selected by the user. For example, the print service generates prompt information according to the list of supported print contents in the parsed APPB response message, uses a custom session (Dialog) or activity (Activity) in Android for interface prompts, and receives the print contents selected by the user.
示例性地,如图13B中(a)所示界面1303,假设音乐播放界面支持的打印内容数量为2,包括歌词图片以及专辑封面图片。电子设备在通过碰一碰发现等方式发现打印机后,弹框显示提示框131,用于显示打印服务生成的提示信息。电子设备检测到用户点击“歌词图片”控件132的操作后,确定当前需要打印的打印内容为歌词图片,则打印服务确定用户选择的打印内容,之后能执行S713,向前台应用请求对应的打印内容信息。或者,电子设备在通过碰一碰发现等方式发现打印机后,显示如图13B中(b)所示界面1304,通过显示通知信息133的方式提示用户选择打印内容。Exemplarily, as shown in interface 1303 in (a) of FIG. 13B , it is assumed that the number of print contents supported by the music playing interface is 2, including lyrics pictures and album cover pictures. After the electronic device discovers the printer by means of touch discovery, etc., a pop-up box displays a prompt box 131 for displaying prompt information generated by the print service. After the electronic device detects that the user clicks on the "Lyric Pictures" control 132, and determines that the print content that needs to be printed currently is the lyrics picture, the print service determines the print content selected by the user, and then can execute S713 to request the corresponding print content from the foreground application. information. Alternatively, after discovering the printer by touch discovery, the electronic device displays an interface 1304 as shown in (b) in FIG. 13B , and prompts the user to select print content by displaying notification information 133 .
在一些场景中,前台应用显示界面支持的打印内容数量为多个,打印服务可以从前台应用处获得多个打印内容的打印内容信息,之后将多个打印内容的打印内容信息全部发送至打印模块。打印模块在接收用户确定打印的操作的过程中,直接确定打印内容。即打印服务不执行上述S1201和S1202,在图7所示的方法流程中,直接在S718中确定具体的打印内容。In some scenarios, the number of print contents supported by the display interface of the foreground application is multiple, and the print service can obtain the print content information of the multiple print contents from the foreground application, and then send all the print content information of the multiple print contents to the printing module. . The print module directly determines the print content in the process of receiving the user's operation of determining the print. That is, the print service does not execute the above S1201 and S1202, and in the method flow shown in FIG. 7, the specific print content is directly determined in S718.
示例性地,如图14中(a)所示界面1401,假设电子设备在通过碰一碰发现等方式发现打印机时,如界面1401所示,电子设备已选中图片141以及图片142。那么,在上述打印内容自动识别过程中,打印服务在图7所示S715中获得的打印内容响应中包含图片141的URI数据以及图片142的URI数据。打印服务将图片141的URI数据以及图片142的URI数据发送至打印模块,打印模块此时具有访问图片141和图片142的权限(即能够打印图片141和图片142)。如图14中(b)所示界面1402,打印模块接收用户选择的打印内容。如界面1402所示,当前“第1页”控件143和“第2页”控件144均为选中状态,图片141和图片142均可打印(即两个打印内容均可打印),如电子设备检测到用户点击“第2页”控件144的操作,取消选中状态,则确定用户不打印“第2页”控件144对应的图片,仅打印“第1页”控件143对应的图片。Exemplarily, as shown in the interface 1401 in FIG. 14( a ), it is assumed that the electronic device has selected the picture 141 and the picture 142 as shown in the interface 1401 when the electronic device discovers the printer by means of touch and discovery. Then, in the above process of automatic identification of the print content, the print content response obtained by the print service in S715 shown in FIG. 7 includes 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 printing module, and the printing module has the permission to access the pictures 141 and 142 (ie, can print the pictures 141 and 142). As shown in the interface 1402 in (b) of FIG. 14 , the printing module receives the printing content selected by the user. As shown in the interface 1402, the current "Page 1" control 143 and the "Page 2" control 144 are both selected, and both the picture 141 and the picture 142 can be printed (that is, both print contents can be printed). When the user clicks the "2nd page" control 144 and deselects the state, it is determined that the user does not print the picture corresponding to the "2nd page" control 144, but only prints the picture corresponding to the "1st page" control 143.
如此,在前台应用显示界面支持多个打印内容的场景中,电子设备能够根据用户选择,灵活确定打印内容。In this way, in a scenario where the display interface of the foreground application supports multiple print contents, the electronic device can flexibly determine the print contents according to the user's selection.
在一些场景中,前台应用在接收并解析查询信息后,不仅能够确定支持的打印业务,还能够直接确定支持的打印业务对应的打印内容信息,那么在向打印服务发送查询响应时,能够在查询响应中直接携带打印内容信息。图15为本申请实施例提供的又一种自动打印方法流程示意图。如图15所示,在图7所示S711后,打印服务可以执行S1501。In some scenarios, after receiving and parsing the query information, the foreground application can not only determine the supported printing services, but also directly determine the printing content information corresponding to the supported printing services. The print content information is directly carried in the response. FIG. 15 is a schematic flowchart of another automatic printing method provided by an embodiment of the present application. As shown in FIG. 15, after S711 shown in FIG. 7, the print service may execute S1501.
S1501、打印服务确定打印内容信息。S1501. The print service determines print content information.
在一些实施例中,打印服务在接收到查询响应后,确定查询响应中是否携带有打印内容信息。其中,打印服务确定的打印内容信息可以为前台应用显示界面支持的全部打印内容的打印内容信息。打印服务确定的打印内容信息也可以为用户确定选择打印的打印内容的打印内容信息,即对应于图15所示流程,如图12所示流程中在S1202之后,也可以执行S1501。打印服务在确定打印内容信息后,则可以不必再向前台应用请求打印内容信息,即不必再执行S713-S716,不必再与前台应用交互APPD消息。In some embodiments, after receiving the query response, the print service determines whether the query response carries print content information. The print content information determined by the print service may be print content information of all print contents supported by the display interface of the foreground application. The print content information determined by the print service can also determine the print content information of the print content selected for printing by the user, that is, corresponding to the process shown in FIG. 15 , and after S1202 in the process shown in FIG. After the print service determines the print content information, there is no need to request the foreground application for print content information, that is, it is unnecessary to execute S713-S716, and it is unnecessary to exchange APPD messages with the foreground application.
示例性地,如图11所示场景中,在如图7所示的S710中,前台应用确定的查询 响应中,携带的信息包括如图11中(a)所示界面1101支持打印业务、打印内容数量为1(即打印内容为图标111所指示的图片)、以及图标111所指示的图片的URI数据。那么,打印服务在接收到查询响应后,能够直接将图标111所指示的图片的URI数据发送至打印模块,进行打印。Exemplarily, in the scenario shown in FIG. 11 , in S710 as shown in FIG. 7 , in the query response determined by the foreground application, the carried information includes the interface 1101 as shown in (a) in FIG. 11 supports printing services, printing The number of 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 print service can directly send the URI data of the picture indicated by the icon 111 to the print module for printing.
如此,电子设备能够减少打印服务与前台应用的交互信息传输步骤,提升打印效率。In this way, the electronic device can reduce the interactive information transmission steps between the printing service and the foreground application, and improve the printing efficiency.
在一些场景中,电子设备能够接收用户对白名单应用的编辑。比如,应用程序开发者在开发者网站对应用A、应用B以及应用C进行注册,将这三个应用注册为支持自动识别打印的白名单应用。电子设备获得白名单后,接收用户对白名单的编辑,如用户不允许打印应用B对应的内容,则可以在白名单中取消应用B的白名单权限。那么后续在如图6所示的S605中,电子设备则确定应用B不是白名单应用,如需打印只能进行截图打印。又比如,应用程序开发者在开发者网站对应用A的打印内容1、打印内容2、打印内容3、打印内容4以及打印内容5进行注册,即使得白名单应用A支持的打印内容数量为5。电子设备获得白名单后,接收用户对白名单的编辑,如用户常用打印需求为打印内容1,则电子设备可以响应于用户的选择,在白名单中取消应用A的打印内容2、打印内容3、打印内容4以及打印内容5的白名单权限。那么后续在如图12所示的流程中,打印服务能够不必再执行S1201和S1202,即不必在接收用户的选择,进一步减少用户的操作,提高打印效率。In some scenarios, the electronic device can receive user edits to whitelisted applications. For example, an application developer registers application A, application B, and application C on the developer website, and registers these three applications as whitelist applications that support automatic identification and printing. After obtaining the whitelist, the electronic device receives the user's editing of the whitelist. If the user does not allow printing of the content corresponding to application B, the whitelist permission of application B can be cancelled in the whitelist. Then, in S605 as shown in FIG. 6 , the electronic device determines that the application B is not a whitelisted application, and if printing is required, only screenshot printing can be performed. For another example, the application developer registers the print content 1, print content 2, print content 3, print content 4, and print content 5 of application A on the developer website, that is, the number of print contents supported by the whitelisted 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 print content 1, the electronic device can cancel the print content 2, print content 3, and print content of application A in the white list in response to the user's selection. Whitelist permissions for print content 4 and print content 5. Then, in the subsequent process shown in FIG. 12 , the printing service can no longer execute S1201 and S1202 , that is, it is not necessary to receive the user's selection, which further reduces the user's operations and improves the printing efficiency.
示例性地,如图16所示界面1601,电子设备在界面1601上接收用户对白名单应用的编辑。比如,电子设备检测到用户点击“切换编辑”控件161的操作,能够切换编辑白名单应用,如当前正在编辑应用A。电子设备检测到用户点击打印内容选项对应的“选择”控件162的操作,则可以确定用户是否选中或取消相应打印内容的白名单权限,如当前电子设备确定用户取消打印内容2和打印内容4的白名单权限。电子设备检测到用户点击“全不选”控件163的操作后,能够确定用户取消应用A的白名单权限(即取消应用A全部打印内容的白名单权限)。之后,电子设备检测到用户点击“确定”控件164的操作后,确定用户完成对白名单应用的编辑。Exemplarily, as shown in the interface 1601 in FIG. 16 , the electronic device receives the editing of the whitelist application by the user on the interface 1601 . For example, the electronic device detects that the user clicks on the "switch editing" control 161, and can switch the editing whitelist application, such as the application A is currently being edited. The electronic device detects that the user clicks the operation of the "select" control 162 corresponding to the print content option, and can determine whether the user selects or cancels the whitelist permission of the corresponding print content. Whitelist permissions. After detecting that the user clicks the "unselect all" control 163, the electronic device can determine that the user cancels the whitelist permission of application A (ie, cancels the whitelist permission of all printed contents of application A). After that, after detecting that the user clicks the "OK" control 164, the electronic device determines that the user has finished editing the whitelist application.
如此,电子设备能够根据用户的个性化需求,编辑白名单应用,进一步提升用户的使用体验。In this way, the electronic device can edit the whitelisted applications according to the user's personalized needs, so as to further improve the user's use experience.
在一些场景中,打印服务也能够执行上述方法实施例中打印模块执行的操作。例如打印服务在确定打印内容后,直接将打印内容发送至打印设备进行打印。In some scenarios, the printing service can also perform the operations performed by the printing module in the foregoing method embodiments. For example, after determining the print content, the print service directly sends the print content to a printing device for printing.
以上结合图6-图16详细说明了本申请实施例提供的自动打印方法。以下结合图17详细说明本申请实施例提供的自动打印装置。The automatic printing method provided by the embodiments of the present application has been described in detail above with reference to FIGS. 6 to 16 . The automatic printing apparatus provided by the embodiment of the present application will be described in detail below with reference to FIG. 17 .
在一种可能的设计中,图17为本申请实施例提供的电子设备的结构示意图。如图17所示,电子设备1700可以包括:显示单元1701、处理单元1702以及收发单元1703。电子设备1700可用于实现上述方法实施例中涉及的电子设备的功能。In a possible design, FIG. 17 is a schematic structural diagram of an electronic device provided by an embodiment of the present application. As shown in FIG. 17 , the electronic device 1700 may include: a display unit 1701 , a processing unit 1702 and a transceiver unit 1703 . The electronic device 1700 may be used to implement the functions of the electronic device involved in the foregoing method embodiments.
可选地,显示单元1701,用于支持电子设备1700显示界面内容;和/或,支持电子设备1700执行图6中的S609。Optionally, the display unit 1701 is configured to support the electronic device 1700 to display interface content; and/or, support the electronic device 1700 to perform S609 in FIG. 6 .
可选地,处理单元1702,用于支持电子设备1700执行图6中的S602、S603、S605、S606、S607以及S608。Optionally, the processing unit 1702 is configured to support the electronic device 1700 to perform S602, S603, S605, S606, S607 and S608 in FIG. 6 .
可选地,收发单元1703,用于支持电子设备1700执行图6中的S601、S604以及S609。Optionally, the transceiver unit 1703 is configured to support the electronic device 1700 to perform S601, S604 and S609 in FIG. 6 .
其中,收发单元可以包括接收单元和发送单元,可以由收发器或收发器相关电路组件实现,可以为收发器或收发模块。电子设备1700中的各个单元的操作和/或功能分别为了实现上述方法实施例中所述的自动打印方法的相应流程,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能单元的功能描述,为了简洁,在此不再赘述。The transceiver unit may include a receiving unit and a sending unit, which may be implemented by a transceiver or a circuit component related to the transceiver, and may be a transceiver or a transceiver module. Operations and/or functions of each unit in the electronic device 1700 In order to implement the corresponding flow 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 to the corresponding functional units For the sake of brevity, the function description will not be repeated here.
可选地,图17所示的电子设备1700还可以包括存储单元(图17中未示出),该存储单元中存储有程序或指令。当处理单元1701以及收发单元1702执行该程序或指令时,使得图17所示的电子设备1700可以执行上述方法实施例中所述的自动打印方法。Optionally, the electronic device 1700 shown in FIG. 17 may further include a storage unit (not shown in FIG. 17 ), in which programs or instructions are stored. When the processing unit 1701 and the transceiver unit 1702 execute the program or instruction, the electronic device 1700 shown in FIG. 17 can execute the automatic printing method described in the above method embodiments.
图17所示的电子设备1700的技术效果可以参考上述方法实施例中所述的自动打印方法的技术效果,此处不再赘述。For the technical effect of the electronic device 1700 shown in FIG. 17 , reference may be made to the technical effect of the automatic printing method described in the above method embodiments, which will not be repeated here.
除了以电子设备1700的形式以外,本申请提供的技术方案也可以为电子设备中的功能单元或者芯片,或者与电子设备匹配使用的装置。In addition to being in the form of the electronic device 1700, the technical solutions provided in this application can also be functional units or chips in the electronic device, or a device matched with the electronic device.
本申请实施例还提供一种芯片系统,包括:处理器,所述处理器与存储器耦合,所述存储器用于存储程序或指令,当所述程序或指令被所述处理器执行时,使得该芯片系统实现上述任一方法实施例中的方法。An embodiment of the present application further provides a chip system, including: a processor, where the processor is coupled with a memory, the memory is used to store a program or an instruction, and when the program or instruction is executed by the processor, the The chip system implements the method in any of the foregoing method embodiments.
可选地,该芯片系统中的处理器可以为一个或多个。该处理器可以通过硬件实现也可以通过软件实现。当通过硬件实现时,该处理器可以是逻辑电路、集成电路等。当通过软件实现时,该处理器可以是一个通用处理器,通过读取存储器中存储的软件代码来实现。Optionally, the number of processors in the chip system may be one or more. The processor can be implemented by hardware or by software. When implemented in hardware, the processor may be a logic circuit, an integrated circuit, or the like. When implemented in software, the processor may be a general-purpose processor implemented by reading software codes stored in memory.
可选地,该芯片系统中的存储器也可以为一个或多个。该存储器可以与处理器集成在一起,也可以和处理器分离设置,本申请实施例并不限定。示例性地,存储器可以是非瞬时性处理器,例如只读存储器ROM,其可以与处理器集成在同一块芯片上,也可以分别设置在不同的芯片上,本申请实施例对存储器的类型,以及存储器与处理器的设置方式不作具体限定。Optionally, there may also be one or more memories in the chip system. The memory may be integrated with the processor, or may be provided separately from the processor, which is not limited in this embodiment of the present application. Exemplarily, the memory may be a non-transitory processor, such as a read-only memory ROM, which may be integrated with the processor on the same chip, or may be provided on different chips. The arrangement of the memory and the processor is not particularly limited.
示例性地,该芯片系统可以是现场可编程门阵列(field programmable gate array,FPGA),可以是专用集成芯片(application specific integrated circuit,ASIC),还可以是系统芯片(system on chip,SoC),还可以是中央处理器(central processor unit,CPU),还可以是网络处理器(network processor,NP),还可以是数字信号处理电路(digital signal processor,DSP),还可以是微控制器(micro controller unit,MCU),还可以是可编程控制器(programmable logic device,PLD)或其他集成芯片。Exemplarily, the system-on-chip may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), or a system on chip (SoC), It can also be a central processing unit (CPU), a network processor (NP), a digital signal processing circuit (DSP), or a microcontroller (microcontroller). controller unit, MCU), it can also be a programmable logic device (PLD) or other integrated chips.
应理解,上述方法实施例中的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。结合本申请实施例所公开的方法步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。It should be understood that, each step in the above method embodiments may be implemented by a hardware integrated logic circuit in a processor or an instruction in the form of software. The method steps disclosed in conjunction with the embodiments of the present application may be directly embodied as being executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.
本申请实施例还提供一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,当该计算机程序在计算机上上运行时,使得计算机执行上述相关步骤,以实现上述实施例中的自动打印方法。Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program runs on a computer, the computer executes the above-mentioned relevant steps, so as to realize the above-mentioned embodiments. automatic printing method.
本申请实施例还提供一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关步骤,以实现上述实施例中的自动打印方法。Embodiments of the present application further provide a computer program product, which, when the computer program product runs on a computer, causes the computer to execute the above-mentioned relevant steps, so as to realize the automatic printing method in the above-mentioned embodiments.
另外,本申请实施例还提供一种装置。该装置具体可以是组件或模块,该装置可包括相连的一个或多个处理器和存储器。其中,存储器用于存储计算机程序。当该计算机程序被一个或多个处理器执行时,使得装置执行上述各方法实施例中的自动打印方法。In addition, an embodiment of the present application further provides an apparatus. Specifically, the apparatus may be a component or a module, and the apparatus may include one or more processors and memories connected thereto. Among them, the memory is used to store computer programs. When the computer program is executed by one or more processors, it causes the apparatus to execute the automatic printing method in the above method embodiments.
其中,本申请实施例提供的装置、计算机可读存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法。因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。The apparatus, computer-readable storage medium, computer program product, or chip provided in the embodiments of the present application are all used to execute the corresponding method provided above. Therefore, for the beneficial effects that can be achieved, reference may be made to the beneficial effects in the corresponding methods provided above, which will not be repeated here.
结合本申请实施例公开内容所描述的方法或者算法的步骤可以硬件的方式来实现,也可以是由处理器执行软件指令的方式来实现。软件指令可以由相应地软件模块组成,软件模块可以被存放于随机存取存储器(random access memory,RAM)、闪存、只读存储器(read only memory,ROM)、可擦除可编程只读存储器(erasable programmable ROM,EPROM)、电可擦可编程只读存储器(electrically EPROM,EEPROM)、寄存器、硬盘、移动硬盘、只读光盘(CD-ROM)或者本领域熟知的任何其它形式的存储介质中。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于专用集成电路(application specific integrated circuit,ASIC)中。The steps of the method or algorithm described in conjunction with the disclosure of the embodiments of this application may be implemented in a hardware manner, or may be implemented in a manner in which a processor executes software instructions. Software instructions can be composed of corresponding software modules, and software modules can be stored in random access memory (RAM), flash memory, read only memory (ROM), erasable programmable read only memory ( erasable programmable ROM, EPROM), electrically erasable programmable read-only memory (electrically EPROM, EEPROM), registers, hard disk, removable hard disk, compact disk read only (CD-ROM) or any other form of storage medium well known in the art. An exemplary storage medium is coupled to the processor, such that the processor can read information from, and write information to, the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and storage medium may reside in an application specific integrated circuit (ASIC).
通过以上的实施方式的描述,本领域技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明。实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成;即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。From the description of the above embodiments, those skilled in the art can clearly understand that, for the convenience and brevity of the description, only the division of the above functional modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional modules as required; 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 process of the system, apparatus and unit described above, reference may be made to the corresponding process in the foregoing method embodiments, and details are not described herein again.
在本申请所提供的几个实施例中,应该理解到,所揭露的方法,可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的。例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式;例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,模块或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed method may be implemented in other manners. The apparatus embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division, and there may be other division methods in actual implementation; for example, multiple units or components may be combined or integrated into another system, or some features may be ignored, or not. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of modules or units, and may be in electrical, mechanical or other forms.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
计算机可读存储介质包括但不限于以下的任意一种:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。Computer-readable storage media include, but are not limited to, any of the following: U disk, removable hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, etc. Various media that can store program code.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited to this, and any changes or substitutions within the technical scope disclosed in the present application should be covered within 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 (24)

  1. 一种自动打印方法,其特征在于,应用于电子设备,所述方法包括:An automatic printing method, characterized in that, applied to electronic equipment, the method comprising:
    在位于打印设备的一定距离内,所述电子设备检测到打印设备,并与所述打印设备建立通信连接;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 print content according to the current interface of the foreground application;
    响应于接收到的用户输入,In response to 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; alternatively, the electronic device automatically sends the print to the printing device content;
    或者,or,
    所述电子设备自动向所述打印设备发送所述打印内容。The electronic device automatically sends the print content to the printing device.
  2. 根据权利要求1所述的方法,其特征在于,在所述电子设备的前台应用为桌面应用后,所述方法还包括:The method according to claim 1, wherein after 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 in the current interface of the desktop application that supports printing is selected, and the electronic device sends the selected display element to the printing device; or, all The electronic device automatically sends a screenshot of the current interface of the desktop application to the printing device.
  3. 根据权利要求1所述的方法,其特征在于,所述根据所述前台应用的当前界面,所述电子设备自动获取打印内容;包括:在所述当前界面支持打印业务后,确定所述当前界面对应的打印内容,并自动获取所述打印内容;所述打印内容为所述当前界面包括的支持打印的至少一个显示内容。The method according to claim 1, wherein the electronic device automatically obtains the print content according to the current interface of the foreground application; comprising: after the current interface supports a printing service, determining the current interface The corresponding print content is obtained, and the print content is automatically acquired; the print content is at least one display content included in the current interface that supports printing.
  4. 根据权利要求1所述的方法,其特征在于,所述根据所述前台应用的当前界面,所述电子设备自动获取打印内容;包括:在所述当前界面不支持打印业务后,确定所述当前界面的截图为所述打印内容,并自动获取所述打印内容。The method according to claim 1, wherein the electronic device automatically obtains the print content according to the current interface of the foreground application; comprising: after the current interface does not support a printing service, determining the current interface The screenshot of the interface is the print content, and the print content is automatically acquired.
  5. 根据权利要求3或4所述的方法,其特征在于,所述方法还包括:The method according to claim 3 or 4, wherein the method further comprises:
    所述电子设备通过所述电子设备运行的打印服务,向所述前台应用发送查询消息;The electronic device sends a query message to the foreground application through a print service run by the electronic device;
    所述打印服务接收到所述前台应用发送的查询响应;The print service receives a query response sent by the foreground application;
    根据所述查询响应,所述电子设备获取所述打印内容。According to the query response, the electronic device acquires the print content.
  6. 根据权利要求5所述的方法,其特征在于,在所述查询响应包含所述当前界面中所述显示内容的标识后,所述当前界面支持打印业务,所述标识用于指示所述当前界面包括的支持打印的至少一个显示内容;The method according to claim 5, wherein after the query response includes an identifier of the displayed content in the current interface, the current interface supports a printing service, and the identifier is used to indicate the current interface Include at least one display that supports printing;
    在所述查询响应不包含所述当前界面中所述显示内容的标识后,所述当前界面不支持打印业务。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.
  7. 根据权利要求6所述的方法,其特征在于,在所述电子设备自动获取打印内容之后,所述方法还包括:所述电子设备提示所述打印内容。The method according to claim 6, wherein after the electronic device automatically acquires the print content, the method further comprises: the electronic device prompts the print content.
  8. 根据权利要求7所述的方法,其特征在于,所述电子设备提示所述打印内容;包括:The method according to claim 7, wherein the electronic device prompts the print content; comprising:
    所述电子设备显示打印内容确认界面。The electronic device displays a print content confirmation interface.
  9. 根据权利要求8所述的方法,其特征在于,响应于接收到的用户输入,所述打 印内容的全部或部分被选择,并且所述电子设备向所述打印设备发送被选择的所述打印内容的全部或部分;包括:9. The method of claim 8, wherein in response to the received user input, all or part of the print is selected and the electronic device sends the selected print to the print device in whole or in part; 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 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 transmits 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.
  10. 根据权利要求8所述的方法,其特征在于,响应于接收到的用户输入,所述电子设备自动向所述打印设备发送所述打印内容;包括:The method of claim 8, wherein, in response to the received user input, the electronic device automatically sends the print content to the printing device; comprising:
    所述电子设备接收到第二用户输入;the electronic device receives a second user input;
    响应于所述电子设备接收到的所述第二用户输入,所述电子设备自动向所述打印设备发送所述打印内容;in response to the second user input received by the electronic device, the electronic device automatically sends the print content to the printing device;
    其中,所述用户输入包括所述第二用户输入。Wherein, the user input includes the second user input.
  11. 根据权利要求1-4和6-10中任一项所述的方法,其特征在于,所述方法还包括:所述电子设备运行有打印服务和打印模块;The method according to any one of claims 1-4 and 6-10, wherein the method further comprises: 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 the print content to the printing device through the printing service and the printing module. in whole or in part.
  12. 一种电子设备,其特征在于,所述电子设备包括:An electronic device, characterized in that the electronic device comprises:
    处理器;processor;
    存储器;memory;
    以及计算机程序,其中所述计算机程序存储在所述存储器上,当所述计算机程序被所述处理器执行时,使得所述电子设备执行:and a computer program, wherein the computer program is stored on the memory and, when executed by the processor, causes the electronic device to execute:
    在位于打印设备的一定距离内,所述电子设备检测到打印设备,并与所述打印设备建立通信连接;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 print content according to the current interface of the foreground application;
    响应于接收到的用户输入,In response to 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; alternatively, the electronic device automatically sends the print to the printing device content;
    或者,or,
    所述电子设备自动向所述打印设备发送所述打印内容。The electronic device automatically sends the print content to the printing device.
  13. 根据权利要求12所述的电子设备,其特征在于,所述电子设备还执行:The electronic device according to claim 12, wherein the electronic device further executes:
    在所述电子设备的前台应用为桌面应用后,响应于接收到的另一用户输入,所述桌面应用的当前界面中支持打印的至少一个显示元素被选择,并且所述电子设备向所述打印设备发送所述被选择的显示元素;或者,所述电子设备自动向所述打印设备发 送所述桌面应用的当前界面的截图。After the foreground application of the electronic device is a desktop application, in response to another user input received, at least one display element that supports printing in the current interface of the desktop application is selected, and the electronic device sends the printing The device sends the selected display element; or, the electronic device automatically sends a screenshot of the current interface of the desktop application to the printing device.
  14. 根据权利要求12所述的电子设备,其特征在于,所述根据所述前台应用的当前界面,所述电子设备自动获取打印内容;包括:在所述当前界面支持打印业务后,确定所述当前界面对应的打印内容,并自动获取所述打印内容;所述打印内容为所述当前界面包括的支持打印的至少一个显示内容。The electronic device according to claim 12, wherein, according to the current interface of the foreground application, the electronic device automatically obtains the print content; comprising: after the current interface supports a printing service, determining the current interface print content corresponding to the interface, and automatically acquire the print content; the print content is at least one display content that supports printing included in the current interface.
  15. 根据权利要求12所述的电子设备,其特征在于,所述根据所述前台应用的当前界面,所述电子设备自动获取打印内容;包括:在所述当前界面不支持打印业务后,确定所述当前界面的截图为所述打印内容,并自动获取所述打印内容。The electronic device according to claim 12, wherein, according to the current interface of the foreground application, the electronic device automatically obtains the print content; comprising: after the current interface does not support a printing service, determining the The screenshot of the current interface is the print content, and the print content is automatically acquired.
  16. 根据权利要求14或15所述的电子设备,其特征在于,所述电子设备还执行:The electronic device according to claim 14 or 15, wherein the electronic device further executes:
    所述电子设备通过所述电子设备运行的打印服务,向所述前台应用发送查询消息;The electronic device sends a query message to the foreground application through a print service run by the electronic device;
    所述打印服务接收到所述前台应用发送的查询响应;The print service receives a query response sent by the foreground application;
    根据所述查询响应,所述电子设备获取所述打印内容。According to the query response, the electronic device acquires the print content.
  17. 根据权利要求16所述的电子设备,其特征在于,在所述查询响应包含所述当前界面中所述显示内容的标识后,所述当前界面支持打印业务,所述标识用于指示所述当前界面包括的支持打印的至少一个显示内容;The electronic device according to claim 16, wherein after the query response includes an identifier of the displayed content in the current interface, the current interface supports a printing service, and the identifier is used to indicate the current interface The interface includes at least one display content that supports printing;
    在所述查询响应不包含所述当前界面中所述显示内容的标识后,所述当前界面不支持打印业务。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.
  18. 根据权利要求17所述的电子设备,其特征在于,在所述电子设备自动获取打印内容之后,所述电子设备还执行:所述电子设备提示所述打印内容。The electronic device according to claim 17, wherein after the electronic device automatically acquires the print content, the electronic device further executes: the electronic device prompts the print content.
  19. 根据权利要求18所述的电子设备,其特征在于,所述电子设备提示所述打印内容;包括:所述电子设备显示打印内容确认界面。The electronic device according to claim 18, wherein the electronic device prompts the print content; comprising: the electronic device displays a print content confirmation interface.
  20. 根据权利要求19所述的电子设备,其特征在于,响应于接收到的用户输入,所述打印内容的全部或部分被选择,并且所述电子设备向所述打印设备发送被选择的所述打印内容的全部或部分;包括:20. The electronic device of claim 19, wherein, in response to a received user input, all or part of the print is selected, and the electronic device sends the selected print to the printing device All or part of the content; 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 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 transmits 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.
  21. 根据权利要求19所述的电子设备,其特征在于,响应于接收到的用户输入,所述电子设备自动向所述打印设备发送所述打印内容;包括:The electronic device of claim 19, wherein, in response to the received user input, the electronic device automatically sends the print content to the printing device; comprising:
    所述电子设备接收到第二用户输入;the electronic device receives a second user input;
    响应于所述电子设备接收到的所述第二用户输入,所述电子设备自动向所述打印设备发送所述打印内容;in response to the second user input received by the electronic device, the electronic device automatically sends the print content to the printing device;
    其中,所述用户输入包括所述第二用户输入。Wherein, the user input includes the second user input.
  22. 根据权利要求12-15和17-21中任一项所述的电子设备,其特征在于,所述电子设备还执行:所述电子设备运行有打印服务和打印模块;The electronic device according to any one of claims 12-15 and 17-21, wherein the electronic device further executes: 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 the print content to the printing device through the printing service and the printing module. in whole or in part.
  23. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质包括计算机程序,当所述计算机程序在电子设备上运行时,使得所述电子设备执行如权利要求1-11中任意一项所述的方法。A computer-readable storage medium, characterized in that the computer-readable storage medium comprises a computer program, which, when the computer program is run on an electronic device, causes the electronic device to execute any one of claims 1-11 method described in item.
  24. 一种计算机程序产品,其特征在于,当所述计算机程序产品在计算机上运行时,使得所述计算机执行如权利要求1-11中任意一项所述的方法。A computer program product, characterized in that, when the computer program product is run on a computer, the computer is caused to execute the method according to any one of claims 1-11.
PCT/CN2022/085616 2021-04-30 2022-04-07 Automatic printing method and electronic device WO2022228076A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110485882.5A CN115268802A (en) 2021-04-30 2021-04-30 Automatic printing method and electronic equipment
CN202110485882.5 2021-04-30

Publications (1)

Publication Number Publication Date
WO2022228076A1 true WO2022228076A1 (en) 2022-11-03

Family

ID=83744834

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/085616 WO2022228076A1 (en) 2021-04-30 2022-04-07 Automatic printing method and electronic device

Country Status (2)

Country Link
CN (1) CN115268802A (en)
WO (1) WO2022228076A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102541487A (en) * 2011-12-18 2012-07-04 上海量明科技发展有限公司 Method and system for printing screenshots
CN104038661A (en) * 2013-03-07 2014-09-10 兄弟工业株式会社 Mobile Terminal Device, And Method Thereof
CN107578579A (en) * 2017-08-08 2018-01-12 福州汇思博信息技术有限公司 A kind of method and POS terminal of shared printing device
CN108701010A (en) * 2016-07-08 2018-10-23 惠普打印机韩国有限公司 The print data processing method and mobile device of mobile device
US20190114129A1 (en) * 2017-10-18 2019-04-18 Oki Data Corporation Operation terminal, program, and printing system
CN112445433A (en) * 2019-08-29 2021-03-05 钉钉控股(开曼)有限公司 File printing method, device, equipment and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102541487A (en) * 2011-12-18 2012-07-04 上海量明科技发展有限公司 Method and system for printing screenshots
CN104038661A (en) * 2013-03-07 2014-09-10 兄弟工业株式会社 Mobile Terminal Device, And Method Thereof
CN108701010A (en) * 2016-07-08 2018-10-23 惠普打印机韩国有限公司 The print data processing method and mobile device of mobile device
CN107578579A (en) * 2017-08-08 2018-01-12 福州汇思博信息技术有限公司 A kind of method and POS terminal of shared printing device
US20190114129A1 (en) * 2017-10-18 2019-04-18 Oki Data Corporation Operation terminal, program, and printing system
CN112445433A (en) * 2019-08-29 2021-03-05 钉钉控股(开曼)有限公司 File printing method, device, equipment and system

Also Published As

Publication number Publication date
CN115268802A (en) 2022-11-01

Similar Documents

Publication Publication Date Title
US11947974B2 (en) Application start method and electronic device
WO2021023220A1 (en) Content continuation method and system, and electronic device
CN111684778B (en) Implementation method of application function and electronic equipment
WO2021121052A1 (en) Multi-screen cooperation method and system, and electronic device
WO2021129264A1 (en) Communication connection method and electronic device
WO2024037032A1 (en) Account login method and electronic device
WO2022127661A1 (en) Application sharing method, and electronic device and storage medium
WO2021135734A1 (en) Method for transmitting file in application, and electronic device and system
WO2022228076A1 (en) Automatic printing method and electronic device
CN116089358B (en) Data migration method and electronic equipment
WO2023005711A1 (en) Service recommendation method and electronic device
EP4332756A1 (en) Application deployment method, distributed operation system, electronic device, and storage medium
CN115314427A (en) Protocol testing method, electronic equipment and chip system
CN113810857A (en) Beacon message processing method and system
WO2024083114A1 (en) Software distribution method, electronic device, and system
WO2023160217A1 (en) Method for detecting embedded subscriber identity module (esim) card, and terminal device
WO2023109607A1 (en) Application interface cross-device display method, device, and system
CN117216428B (en) Webpage resource request method, terminal equipment and computer readable storage medium
CN116700738B (en) Application management method, electronic equipment and system
WO2024067004A1 (en) Promotion method, electronic device, and system
WO2024022101A1 (en) Application program management method and electronic device
WO2023061298A1 (en) Picture backup system and method, and device
WO2023142941A1 (en) Playing record display method and related device
WO2024037346A1 (en) Page management method and electronic device
WO2023071590A1 (en) Input control method and electronic device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22794547

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22794547

Country of ref document: EP

Kind code of ref document: A1