Printer control method, electronic equipment and system

CN121866532APending Publication Date: 2026-04-14HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

In the prior art, users need to download multiple applications for printers from different printer manufacturers to configure networks and control printing tasks, resulting in cumbersome storage space occupation and operation, and prone to the problem of sending target files to incorrect printers.

Method used

By presetting the Mopria protocol package in an electronic device and determining its protocol type using the printer's product identification, it automatically obtains matching tripartite protocol packages, and implements a single application to control printers of different protocols, automatically configures the network and performs printing tasks.

Benefits of technology

Reduces the number of applications users need to download, saves storage space and operation steps, improves the user experience, and ensures that target files are accurately sent to the selected printer.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121866532A_ABST
    Figure CN121866532A_ABST
Patent Text Reader

Abstract

The invention provides a printer control method, electronic equipment and a printer control system. The printer control method can be applied to systems of mobile terminals and printers such as mobile phones and tablet personal computers. And the terminal equipment can obtain the product identifier of the printer in the process of finding the printer. On the basis of the product identifier, the terminal equipment can determine the protocol type of the printer so as to obtain a protocol packet matched with the protocol type of the printer, configuration information of the current local area network is sent to the printer through the protocol packet, and the printer is controlled to access the network. And then, the terminal equipment can control the printer to execute a printing task by printing a standard mopria protocol packet or a protocol packet provided by a printer manufacturer. Wherein when the mopria protocol packet is not provided by the printer manufacturer, the terminal equipment can control the printer to execute the printing task through the mopria protocol packet.
Need to check novelty before this filing date? Find Prior Art

Description

Printer control method, electronic device, and system

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on December 28, 2023, with application number 202311854523.8 and application name “Printer Control Method, Electronic Device and System”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of terminals, and in particular to a printer control method, electronic device, and system. Background Art

[0003] After purchasing a printer, users typically download a specific application from the printer manufacturer onto their mobile device. This application then configures the printer's network and controls its printing. Furthermore, when purchasing multiple printers from different manufacturers, or switching from one manufacturer to another, users need to download multiple applications. Each application is used to control a single manufacturer's printer.

[0004] This not only redundantly consumes storage space on the terminal device but also increases user effort. After deciding on a printer, the user must open the corresponding application and use it to send the target file to the desired printer. If the application does not match the desired printer, the target file may be mistakenly sent to another printer, severely impacting the user experience.

[0005] Summary of the Invention

[0006] In a first aspect, the present application provides a printing method, which is applied to an electronic device, and the method includes: displaying a first interface of a first application, wherein the first interface includes a first icon and a second icon, the first icon corresponds to a first printer, the second icon corresponds to a second printer, the first printer corresponds to a first protocol, and the second printer corresponds to a second protocol; before detecting a user operation on the first icon, loading a first protocol package, the first protocol package corresponds to the first protocol; after detecting a user operation on the first icon, sending a target file selected by the user to the first printer through the first protocol package; after detecting a user operation on the second icon, loading a second protocol package, and sending the target file selected by the user to the second printer through the second protocol package, the second protocol package corresponds to the second protocol.

[0007] By implementing the method provided in the first aspect, an electronic device can control printers using different protocols to perform printing tasks through one application (the first application), so that users do not need to download multiple applications. They can control printers using different protocols to perform printing tasks through different applications, saving user operations and improving user experience.

[0008] In some embodiments, before displaying the first interface of the first application, the method further includes: starting the first application; loading the first protocol package, specifically: loading the first protocol package during the startup process of the first application. Wherein, when the first application is not running, that is, there is no process of the first application in the electronic device, the electronic device can start the first application upon receiving the user's operation corresponding to the icon of the first application. It can be understood that the process of the electronic device running the program code of the first application before displaying the main interface of the first application after receiving the user's operation corresponding to the icon of the first application is called the process of starting the first application.

[0009] The electronic device can load a protocol package (first protocol package) when starting the application. In this way, when the user selects a printer that corresponds to the first protocol package, the electronic device can directly use the first protocol package to send the target file to the printer without temporarily loading it.

[0010] Preferably, the first protocol is the printing standard Mopria, and the first protocol package is the Mopria protocol package.

[0011] In some embodiments, before displaying the first interface of the first application, the method also includes: discovering the first printer; after discovering the first printer, loading the third protocol package, and sending the first configuration information to the first printer through the third protocol package, the first configuration information including the name and password of the local area network in which the electronic device is currently located.

[0012] Electronic devices can configure the network for the printer and control the printer to perform printing tasks through different protocol packages.

[0013] In some embodiments, before loading the third protocol package, the method further includes: downloading the third protocol package from the first server, where the third protocol package is different from the first protocol package.

[0014] The electronic device can download the required protocol package from the server (first server). Preferably, the first server is a developer platform. In this way, the electronic device does not need to pre-install multiple protocol packages, avoiding encroachment on the storage space of the electronic device.

[0015] In combination with the method provided in the first aspect, in some embodiments, discovering the first printer specifically includes: detecting a detection frame emitted by the first printer, the detection frame carrying the product identification of the first printer; before loading the third protocol package, the method also includes: determining based on the product identification that the first printer also corresponds to the third protocol, and the third protocol package corresponds to the third protocol package.

[0016] The electronic device can discover the printer through the printer's detection frame, and determine which protocol the printer uses through the product identification carried in the detection frame, and then determine which protocol packet to use to communicate with the printer.

[0017] In some embodiments, determining that the first printer also corresponds to the third protocol based on the product identification specifically includes: sending the product identification to a fourth server; receiving a first type sent by the first server, the first type indicating that the first printer also corresponds to the third protocol, and the first type is sent by the first server to the electronic device after receiving the product identification sent by the electronic device.

[0018] The electronic device can determine the protocol type corresponding to the product identification through the server (fourth server). Preferably, the fourth server is a developer platform.

[0019] In some embodiments, before displaying the first interface of the first application, the method also includes: discovering a second printer; after discovering the second printer, downloading a second protocol package corresponding to the second protocol from a second server, loading the second protocol package, and sending the first configuration information to the second printer through the second protocol package, the first configuration information including the name and password of the local area network in which the electronic device is currently located.

[0020] The electronic device can configure the network for the printer and control the printer to perform printing tasks through a protocol package.

[0021] In some embodiments, before displaying the first interface of the first application, the method also includes: discovering a second printer; after discovering the second printer, downloading a fourth protocol package corresponding to the fourth protocol from a third server, loading the fourth protocol package, and sending the first configuration information to the second printer through the fourth protocol package. The fourth protocol is different from the second protocol, and the first configuration information includes the name and password of the local area network in which the electronic device is currently located.

[0022] In some embodiments, after detecting a user operation on the first icon, the method further includes: determining a first protocol package according to a protocol type of the first printer.

[0023] In some embodiments, after detecting a user operation on the second icon, the method further includes: determining a second protocol package based on the protocol type of the second printer; loading the second protocol package, specifically including: after determining that the second protocol package is stored in the local memory, loading the second protocol package from the local memory.

[0024] In some embodiments, after detecting a user operation on a first icon, sending a target file selected by the user to the first printer via a first protocol package, specifically including: displaying a first floating control after detecting a user operation on the first icon; receiving a second operation from the user after displaying the first floating control; displaying a second interface in response to the second operation, the second interface including the first file, and keeping the position of the first floating control unchanged from receiving the second operation to displaying the second interface; detecting a first operation on the first floating control when displaying the first file; determining the first file as a target file in response to the first operation, and sending the target file to the first printer via a first protocol package.

[0025] The electronic device can determine the target file that the user wants to print based on the file displayed when the user clicks the floating control, providing the user with a new printing experience.

[0026] In some embodiments, after sending the target file to the first printer via the first protocol packet, the method further includes: displaying the progress of the first printer printing the target file in the first floating control.

[0027] In some embodiments, before detecting the first operation on the first floating control, the method also includes: detecting a third operation on the first floating control; displaying the first control in the first floating control in response to the third operation; detecting the first operation on the first floating control specifically includes: detecting the first operation on the first control in the first floating control.

[0028] In some embodiments, before loading the second protocol package, the method further includes: confirming that the second protocol package is not stored in the local memory, and downloading the second protocol package from the second server.

[0029] When the protocol package matching the printer is not stored locally, the electronic device may download it from the server (second server) again.

[0030] In some embodiments, the electronic device includes a system setting module, the system setting module stores the first configuration information, and the first application reads the first configuration information from the system setting module.

[0031] The electronic device can automatically read the name, password and other configuration information of the current local area network without user input, thereby saving user operations and helping users quickly configure the network for the printer.

[0032] In some embodiments, the electronic device includes a printing service. Before displaying the first interface of the first application, the method further includes: the first application obtains a printer list from the printing service, where the printer list includes the first printer and the second printer.

[0033] In some embodiments, the electronic device includes a printing service, the printing service includes a first protocol package, and in response to a first operation, the first file is determined as a target file, and the target file is sent to the first printer through the first protocol package, specifically including: in response to the first operation, the first file is determined as the target file, and a first request is sent to the printing service; in response to the first request, the printing service creates a first channel; the first application sends the target file to the printing service through the first channel; the printing service sends the target file to the first printer through the first protocol package.

[0034] In some embodiments, the first request also carries the device identification and printing parameters of the first printer. The printing service determines the first protocol package according to the device identification of the first printer. The printing service also sends the printing parameters to the first printer via the first protocol package.

[0035] In a second aspect, the present application provides a printing method, which is applied to an electronic device, the method comprising: displaying a first interface of a first application, the first interface including a second icon and a third icon, the second icon corresponding to a second printer, the third icon corresponding to a third printer, the second printer corresponding to a second protocol, and the third printer corresponding to a fifth protocol; after detecting a user operation on the second icon, loading a second protocol package, and sending a target file selected by the user to the second printer through the second protocol package, the second protocol package corresponding to the second protocol; after detecting a user operation on the third icon, loading a fifth protocol package, and sending a target file selected by the user to the third printer through the fifth protocol package, the fifth protocol package corresponding to the fifth protocol.

[0036] By implementing the method provided in the second aspect, the electronic device can control printers using different protocols to perform printing tasks through one application (the first application), so that users do not need to download multiple applications. They can control printers using different protocols to perform printing tasks through different applications, saving user operations and improving user experience.

[0037] In some embodiments, before displaying the first interface of the first application, the method also includes: discovering a second printer; after discovering the second printer, downloading a second protocol package corresponding to the second protocol from a second server, loading the second protocol package, and sending the first configuration information to the second printer through the second protocol package, the first configuration information including the name and password of the local area network in which the electronic device is currently located.

[0038] The electronic device can configure the network for the printer and control the printer to perform printing tasks through a protocol package.

[0039] In some embodiments, before loading the second protocol package, the method further includes: confirming that the second protocol package is not stored in the local memory, and downloading the second protocol package from the second server.

[0040] When the protocol package matching the printer is not stored locally, the electronic device may download it from the server (second server) again.

[0041] In some embodiments, before displaying the first interface of the first application, the method also includes: discovering a second printer; after discovering the second printer, downloading a fourth protocol package corresponding to the fourth protocol from a third server, loading the fourth protocol package, and sending the first configuration information to the second printer through the fourth protocol package. The fourth protocol is different from the second protocol, and the first configuration information includes the name and password of the local area network in which the electronic device is currently located.

[0042] Electronic devices can configure the network for the printer and control the printer to perform printing tasks through different protocol packages.

[0043] In some embodiments, the electronic device includes a system setting module, the system setting module stores the first configuration information, and the first application reads the first configuration information from the system setting module.

[0044] The electronic device can automatically read the name, password and other configuration information of the current local area network without user input, thereby saving user operations and helping users quickly configure the network for the printer.

[0045] In a third aspect, the present application provides an electronic device comprising one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer programs. When the one or more processors execute the computer programs, the electronic device executes the method described in the first aspect and any possible implementation of the first aspect, or executes the method described in the second aspect and any possible implementation of the second aspect.

[0046] In a fourth aspect, an embodiment of the present application provides a chip system, which is applied to an electronic device, and the chip system includes one or more processors, which are used to call computer instructions to enable the electronic device to execute the method described in the first aspect and any possible implementation of the first aspect, or execute the method described in the second aspect and any possible implementation of the second aspect.

[0047] In a fifth aspect, the present application provides a computer-readable storage medium comprising a computer program. When the computer program is run on an electronic device, the electronic device executes the method described in the first aspect and any possible implementation of the first aspect, or executes the method described in the second aspect and any possible implementation of the second aspect.

[0048] In a sixth aspect, the present application provides a computer program product comprising instructions, which, when the above-mentioned computer program product is run on an electronic device, enables the above-mentioned electronic device to execute the method described in the first aspect and any possible implementation of the first aspect, or execute the method described in the second aspect and any possible implementation of the second aspect.

[0049] It is understandable that the electronic device provided in the third aspect, the chip system provided in the fourth aspect, the computer storage medium provided in the fifth aspect, and the computer program product provided in the sixth aspect are all used to perform the methods provided in this application. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding methods and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] FIG1A is a schematic diagram of the structure of a network 10 provided in an embodiment of the present application;

[0051] FIG1B is a schematic diagram of the structure of a network 10 in another scenario provided by an embodiment of the present application;

[0052] 2A-2C are schematic diagrams of a set of user interfaces for configuring a network for a printer 202 via an electronic device 201, provided in an embodiment of the present application;

[0053] FIG3 is a flow chart of configuring a network for a printer 202 by an electronic device 201 according to an embodiment of the present application;

[0054] 4A-4G are a set of user interfaces for controlling a printer to execute a printing task through an electronic device 201, provided in an embodiment of the present application;

[0055] 5A-5J are another set of user interfaces for controlling a printer to execute a printing task through an electronic device 201 provided in an embodiment of the present application;

[0056] FIG6 is a schematic diagram of a software architecture of an electronic device 201 provided in an embodiment of the present application;

[0057] FIG7A is a flowchart of an electronic device 201 controlling a target printer to execute a printing task according to an embodiment of the present application;

[0058] FIG7B is a flowchart of a specific method of loading a tripartite agreement package provided by an embodiment of the present application;

[0059] FIG8 is a schematic structural diagram of an electronic device 201 provided in an embodiment of the present application;

[0060] FIG9 is a schematic diagram of the structure of the printer 202 provided in an embodiment of the present application. DETAILED DESCRIPTION

[0061] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application.

[0062] Nowadays, more and more electronic devices support network access to meet users' remote control needs.

[0063] Taking printers as an example, with the development of printing needs, such as printing children's homework and paintings, printers are increasingly being configured to support access to home LANs, especially home LANs based on high-fidelity wireless communication (wireless fidelity, Wi-Fi), that is, supporting network access via Wi-Fi, so that users can remotely control the printer to perform printing tasks anytime and anywhere through mobile terminals such as mobile phones and tablets.

[0064] Mopria is a mobile printing standard. The Mopria protocol package is a piece of communication code that provides Mopria-based communication capabilities. Mobile devices such as phones and tablets typically have the Mopria protocol package pre-installed, allowing them to control printers to print.

[0065] However, before controlling a printer to print using the Mopria protocol package, users must first configure the printer's network. The Mopria protocol package does not support network configuration for printers. Therefore, each printer manufacturer must provide its own network configuration protocol package (hereinafter referred to as the network configuration protocol package) to allow users to configure the printer's network using mobile devices such as phones and tablets, thereby enabling users to control the printer to print using mobile devices.

[0066] In some technologies, after purchasing a printer, a user can download a specific application provided by the printer manufacturer to a mobile terminal. This application has a pre-installed network configuration protocol package. The mobile terminal can use this application and the network configuration protocol package to configure the network for the printer.

[0067] After successful network configuration, the mobile terminal can control the printer to perform printing tasks through the Mopria protocol package.

[0068] Some printer manufacturers, beyond network configuration, also develop the program code to control the printer's printing tasks. In this case, the three-party protocol package provided by the printer manufacturer is used not only to configure the network for the printer but also to control the printer's printing tasks. This protocol package, which is used for both network configuration and printing control, is called a printing protocol package.

[0069] In the scenario where the printer manufacturer provides a printing protocol package, after completing the network configuration operation through the printing protocol package, preferably, the mobile terminal can continue to control the printer to perform printing tasks through the above printing protocol package without using the Mopria protocol package to control the printer to perform printing tasks.

[0070] The method of downloading a specific application, configuring the network for the printer, and controlling the printer to perform printing tasks through the specific application is not conducive to saving storage space of the mobile terminal, and requires cumbersome user operations, especially in scenarios where the user purchases printers from multiple different manufacturers at the same time, or changes from one manufacturer's printer to another manufacturer's printer.

[0071] In view of this, an embodiment of the present application provides a device control method.

[0072] This method can be applied to electronic device 201 and printer 202. Electronic device 201 is pre-installed with a Mopria protocol package, and can use the Mopria protocol package to control the printer to perform printing tasks. Preferably, electronic device 201 is a mobile terminal such as a mobile phone or tablet computer. This embodiment of the application does not impose any particular restrictions on the specific type of electronic device 201. Printer 202 is a printer to be networked.

[0073] When implementing the method provided in the present application, after the printer 202 is powered on, the printer 202 can broadcast a detection frame. The detection frame can carry the product identification (PrdID) of the printer 202. Preferably, a printer model provided by a printer manufacturer can share a product identification. The electronic device 201 can scan and obtain the above-mentioned detection frame, and then obtain the product identification of the printer 202. The electronic device 201 can determine the protocol type of the printer 202 through the above-mentioned product identification. Then, the electronic device 201 can obtain a three-party protocol package that matches the protocol type of the printer 202, and then configure the network for the printer 202 through the above-mentioned three-party protocol package. After the network configuration is successful, the electronic device 201 can control the printer 202 to perform the printing task through the above-mentioned three-party protocol package or the preset Mopria protocol package.

[0074] In this way, users do not need to manually download specific applications, nor do they need to configure the network for the printer and control the printer to perform printing tasks through the above-mentioned specific applications. This is beneficial for saving storage space of the electronic device 201, saving user operations, and providing convenience for users to control the printer 202 through the electronic device 201.

[0075] FIG1A is a schematic diagram of the structure of a network 10 provided in an embodiment of the present application.

[0076] As shown in FIG1A , a network 10 includes an access point (AP) device 100 (denoted as AP100 ).

[0077] AP100 is connected to the access controller (AC) and broadband remote application server (BRAS) through wired transmission, and obtains the AP's Internet Protocol (IP) address through the Dynamic Host Configuration Protocol (DHCP) to access the Internet.

[0078] The terminal device can establish a connection with the AP 100 in a wired or wireless manner, and then access the Internet through the AP 100 to obtain network services. Preferably, the AP 100 is a Wi-Fi-based AP.

[0079] The AP100 includes configuration information such as its name and password. The name identifies the AP. The password is used for device authentication. When connecting to the AP100, the terminal device requesting connection must provide the AP100 with the access password. Only when the access password provided by the terminal device matches the AP100's pre-set password will the AP100 allow the terminal device to access and provide network services. Otherwise, the AP100 will reject the terminal device's connection request, and the terminal device will not be able to obtain network services through the AP100.

[0080] As shown in FIG1A , electronic device 201 has established a communication connection with AP 100 and can access network services through AP 100. Preferably, the connection is a wireless connection. Printer 202 is a newly purchased device that has not yet been configured for network use. As shown in FIG1A , printer 202 has not yet been connected to AP 100.

[0081] After purchasing printer 202, the user can connect it to a power source. This process is also called the power-on process. After powering on, printer 202 can broadcast a probe frame. The probe frame from printer 202 can carry device information about printer 202. This device information includes, but is not limited to, a device identifier (denoted as DevID) and a product identifier (denoted as PrdID). The device identifier uniquely identifies an electronic device, such as a MAC address.

[0082] Electronic device 201 can periodically acquire detection frames from the environment. At this point, electronic device 201 can acquire the detection frame from printer 202 and, from the detection frame, obtain the product identification of printer 202. Based on the product identification, electronic device 201 can determine the protocol type of printer 202.

[0083] In one embodiment, as shown in FIG1A , server A is connected to AP 100 via the Internet. Server A is also referred to as a developer platform. The developer platform records the matching relationship between printer product identification and protocol type. After obtaining the product identification of printer 202, electronic device 201 may send the product identification to the developer platform. The developer platform may query the protocol type corresponding to the product identification. This protocol type is the protocol type of printer 202. The developer platform may transmit the protocol type back to electronic device 201. Electronic device 201 may then determine the protocol type of printer 202, i.e., determine which protocol should be used to communicate with printer 202, configure the network for printer 202, and control printer 202 to execute printing tasks.

[0084] The developer platform also stores a three-party protocol package provided by the printer manufacturer. After determining the protocol type of the printer 202, the electronic device 201 can also obtain the corresponding three-party protocol package from the developer platform. The three-party protocol package corresponding to the protocol type of the printer 202 can be called a target protocol package.

[0085] In some embodiments, the three-party protocol package provided by the printer manufacturer may also be stored on other servers. A protocol package configuration file may be pre-installed in the electronic device 201. This configuration file records the download addresses of various three-party protocol packages. After determining the target protocol package based on the protocol type of the printer 202, the electronic device 201 queries the configuration file to obtain the download address of the target protocol package, and then accesses the server corresponding to the address to download the target protocol package.

[0086] After acquiring the target protocol packet, the electronic device 201 may send the configuration information of the currently connected local area network AP100 to the printer 202 via the target protocol packet, control the printer 202 to access the AP100, and complete the network configuration task of the printer 202.

[0087] In one embodiment, the matching relationship between the printer product identification and the protocol type can also be preset in the electronic device 201. In this case, after obtaining the product identification of the printer 202, the electronic device 201 can determine the protocol type of the printer 202 based on the preset matching relationship, and then determine the target protocol package, without having to send the product identification of the printer 202 to the developer platform and let the developer platform determine the protocol type of the printer 202.

[0088] The electronic device 201 may determine the target file that the user wants to print according to the user operation.

[0089] After the network configuration is successful, the electronic device 201 may send the target file to the printer 202 via the target protocol package or the preset Mopria protocol package, and control the printer 202 to print the target file.

[0090] If the target protocol package is a network configuration protocol package (used only for configuring the network for printer 202), electronic device 201 needs to use the preset Mopria protocol package to send the print task and target file to printer 202 to control printer 202 to print the target file. If the target protocol package provided by the printer manufacturer is a printing protocol package (which can be used to configure the network for the printer and control the printer to execute the print task), electronic device 201 can continue to send the print task and target file to printer 202 using the target protocol package to control printer 202 to print the target file.

[0091] According to the method described in Figure 1A, the electronic device 201 can configure the network for printers provided by multiple different manufacturers in succession without having to download specific applications provided by each manufacturer separately. This saves storage space of the electronic device 201 and saves user operations, which is conducive to improving the user's printing experience.

[0092] 1B , illustratively, electronic device 201 may further configure a network for printers 203 and 204, and control printers 203 and 204 to access local area network AP 100. The protocol types of any two printers may be the same or different.

[0093] For example, printer 202 (the first printer) may use protocol X1 (the third protocol), printer 203 (the second printer) may use protocol X2 (the second protocol), and printer 204 (the third printer) may use protocol X2 (the fifth protocol). Generally, printers from different manufacturers have different protocol types. Printers from the same manufacturer have the same protocol type. Of course, different models of printers from the same manufacturer may also have different protocol types.

[0094] Assume that the three-party protocol package X1 provided by manufacturer A that matches protocol X1 is a network configuration protocol package (only used for network configuration), and the three-party protocol package X2 provided by manufacturer B that matches protocol X2 is a printing protocol package (used for network configuration and printing). After printer 202 is successfully configured with the network, printer 202 needs to control printer 202 to perform printing tasks through the preset Mopria protocol package; after printer 203 / printer 204 is successfully configured with the network, printer 203 / printer 204 can continue to control printer 202 to perform printing tasks through the three-party protocol package X2.

[0095] In the scenario shown in Figure 1B, the electronic device 201 can determine the target printer that the user wants to use based on the user operation, such as printer 202, printer 203 or printer 204. Then, the electronic device 201 can determine the target protocol package that matches the target printer. When the target protocol package is a Mopria protocol package, the electronic device 201 sends the target file selected by the user to be printed to the target printer through the preset Mopria protocol package, and controls the target printer to print the target file. When the target protocol package is a three-party protocol package, the electronic device 201 can first load the three-party protocol package. After the loading is complete, the electronic device 201 can send the target file to the target printer through the above-mentioned three-party protocol package, and control the target printer to print the target file.

[0096] For example, when the user selects printer 202 as the target printer for a print job, electronic device 201 may determine that the target protocol package is a Mopria protocol package. Electronic device 201 then sends the target file selected by the user to be printed to printer 202 via the Mopria protocol package, controlling printer 202 to print the target file. When the user selects printer 203 as the target printer for a print job, electronic device 201 may determine that the target protocol package is a three-party protocol package X2. Electronic device 201 then sends the target file selected by the user to be printed to printer 203 via the three-party protocol package X2, controlling printer 203 to print the target file.

[0097] 2A-2C are schematic diagrams of a set of user interfaces for configuring a network for a printer 202 via an electronic device 201 , according to an embodiment of the present application.

[0098] Taking the printer 202 as an example, after the printer 202 broadcasts the detection frame, the electronic device 201 can detect the detection frame of the printer 202. When the electronic device 201 detects the detection frame of the printer 202, the electronic device 201 discovers the printer 202.

[0099] The detection frame from printer 202 carries the product identifier (PrdID) of printer 202. Electronic device 201 can obtain the product identifier of printer 202 through the detection frame from printer 202. Furthermore, electronic device 201 can determine the protocol type of printer 202, such as protocol X1. Referring to FIG. 1A , electronic device 201 can query the developer platform to determine the protocol type of printer 202, or electronic device 201 can determine the protocol type of printer 202 independently based on its own pre-set matching relationship. This will not be further elaborated here.

[0100] Then, the electronic device 201 can obtain a target protocol package that matches the protocol type of the printer 202, such as the target protocol package X1. Referring to the introduction of FIG. 1A , the electronic device 201 can download the target protocol package from a developer platform or other server. In other embodiments, the electronic device 201 can also be pre-installed with multiple three-party protocol packages. These multiple three-party protocol packages include a target protocol package that matches the protocol type of the printer 202. In this case, the electronic device 201 can obtain the target protocol package from local storage.

[0101] 2A , after discovering the printer 202 , the electronic device 201 may display a card 211 .

[0102] Card 211 displays device information of printer 202, such as the device name "H-P1 Printer" and device icon 212. The above device information can be obtained through a detection frame. In one implementation, the detection frame broadcast by printer 202 directly carries device information such as the device name and device icon. Electronic device 201 can directly obtain the device information of printer 202 from the above detection frame. In another implementation, electronic device 201 can determine the device information of printer 202 through the product identification of printer 202. Exemplarily, the developer platform or other server or electronic device 201 stores a matching relationship between product identification and device information. Electronic device 201 can determine the device information of printer 202 through the matching relationship preset by the developer platform or other server or itself. Through card 211, the user can quickly and intuitively perceive that the electronic device 201 has discovered a new device, and can determine whether the new device is a newly purchased printer 202 waiting to be configured on the network based on the device information displayed in card 211.

[0103] Card 211 also includes a control 213. When the user determines that the new device discovered by electronic device 201 is printer 202 waiting to be configured on the network, the user can click control 213. After detecting the user operation on control 213, electronic device 201 can display the user interface shown in FIG. 2B.

[0104] As shown in FIG2B , the electronic device 201 may display a card 221. The card 221 may display a prompt message, such as "Do you want to synchronize the local area network (Wi-Fi name) and password that the electronic device 201 is connected to with the printer 202 to connect to the network?", which is used to ask the user whether to allow the electronic device 201 to send the configuration information (including the name and password) of the currently connected local area network AP100 to the printer 202.

[0105] Card 221 also includes a control 222. Through control 222, the user can grant electronic device 201 permission to synchronize AP 100 configuration information with printer 202. Upon detecting a user operation on control 222, electronic device 201 can read the name, password, and other configuration information of the currently connected LAN AP 100 from system settings and then send this configuration information to printer 202 via a target protocol packet.

[0106] 2C , after the printer 202 is successfully connected to the AP 100 , the electronic device 201 may display a card 231 to prompt the user that the printer 202 is successfully connected to the network.

[0107] After detecting the user operation of the control 213 in Figure 2A above, the electronic device 201 can start the smart space application (hereinafter referred to as the smart space, also referred to as the first application). The smart space is used to manage other devices in the local area network, such as TVs, speakers and other devices in the home local area network. As shown in Figure 2B, the electronic device 201 can also display the main interface 29 of the smart space. After the printer 202 is successfully connected to the AP100, referring to Figure 2C, the smart space can display an icon 232 (first icon) in the main interface 29. Icon 232 corresponds to the printer 202. At this time, the user can also further confirm through icon 232 that the printer 202 has successfully connected to the local area network AP100.

[0108] By implementing the network configuration method shown in Figures 2A-2C, a mobile terminal (i.e., electronic device 201) such as a mobile phone or tablet can automatically obtain a target protocol package that matches the printer based on the product identifier. This target protocol package then sends network configuration information to the printer without requiring the user to download a specific application provided by the printer manufacturer. This reduces user effort, facilitating printer network configuration, and also helps conserve storage space on electronic device 201.

[0109] Among them, during the network configuration process, users do not need to manually select the local area network and enter the local area network password, which further saves user operations and provides convenience for users to configure the printer network.

[0110] In some embodiments, the electronic device 201 may also display multiple network names. Each network name corresponds to a local area network scanned by the electronic device 201. The electronic device 201 may determine the target local area network based on a user's operation on any of the multiple network names. The user may manually enter the local area network password, and the electronic device may then determine the target local area network password based on the user's input operation. Similarly, the electronic device 201 may then send the target local area network's network name, password, and other configuration information to the printer 202 via a target protocol packet, thereby controlling the printer 202 to successfully access the target local area network.

[0111] FIG3 is a flowchart of configuring a network for a printer 202 through an electronic device 201 according to an embodiment of the present application.

[0112] S301: Establish a protocol database to record the protocol type of the printer.

[0113] Table 1 is a data structure provided in an embodiment of the present application.

[0114] Table 1

[0115] The developer platform can establish a printer protocol database as shown in Table 1, recording relevant information such as the printer's product identification, product name, product icon, protocol type, etc. The above protocol database is also called a protocol shelf.

[0116] The product name typically indicates the product's provider and model. For example, in "H-P1," "H" indicates the provider, and "P1" indicates the model. Printers of a single model provided by a single printer manufacturer may share a single product identifier. Furthermore, typically, all printer models provided by a single printer manufacturer use the same printing protocol. Alternatively, different printer models provided by a single printer manufacturer may use different printing protocols.

[0117] The developer platform can update the printer protocol database in real time. The above updates include updating the relevant information of existing printers and adding new printers and their relevant information.

[0118] For example, when PrdID1 ("H-P1" printer) changes to protocol Y1, the developer platform can update the protocol type of PrdID1 to protocol Y1 in the printer protocol database shown in Table 1 as follows:

[0119] For example, after manufacturer "ABC" launches a new printer using protocol X2, the developer platform can add a new record to the printer protocol database shown in Table 1, as follows:

[0120] Among them, when the updated or newly added content involves a new protocol type, the developer platform can also store the tripartite protocol package corresponding to the new protocol type.

[0121] S303: The printer 202 is powered on.

[0122] S304: The printer 202 broadcasts a probe frame (DevID1, PrdID1).

[0123] A probe frame is a piece of data in a specific format. The probe frame broadcast by printer 202 may carry the device identifier (DevID) of printer 202, which uniquely identifies printer 202, such as DevID1. In this embodiment of the present application, the probe frame may also carry the product identifier of printer 202, which indicates the manufacturer and model of printer 202, such as PrdID1.

[0124] S305: Obtain the device identifier DevID1 and product identifier PrdID1 of the printer 202 through the detection frame.

[0125] After printer 202 broadcasts a detection frame, electronic device 201 can obtain the detection frame of printer 202 by scanning. Then, electronic device 201 can obtain the device identifier DevID1 and product identifier PrdID1 of printer 202 through the detection frame. At this time, printer 202 can be called a newly discovered device by electronic device 201, that is, a new device.

[0126] S307: Request to obtain product information of the new device (PrdID1).

[0127] The electronic device 201 may send a request to the developer platform to obtain product information, wherein the request may carry the product identification PrdID1 of the printer 202 .

[0128] S308: Return the product information of the new device (product name, product icon, protocol type X1).

[0129] In response to the above request, the developer platform may search the protocol database shown in Table 1 for the product identifier PrdID1 carried in the above request. After searching for the above product identifier, the developer platform may obtain product information corresponding to the above product identifier, such as the product name, product icon, protocol type, etc. The developer platform may then transmit the above information back to the electronic device 201. The electronic device 201 may determine the product name, product icon, protocol type, etc. of the new device (i.e., printer 202). For example, the protocol type of the printer 202 may be X1 (first type), i.e., the printer 202 uses protocol X1.

[0130] In some embodiments, the electronic device 201 may be provided with a protocol shelf table. After determining the protocol type of each printer, the electronic device 201 may record the printer's product identification and protocol type in the protocol shelf table. Thus, after executing S305, the electronic device 201 may also first check the protocol shelf table. If the product identification of the new device is recorded in the protocol shelf table, the electronic device 201 may directly determine the product information of the new device based on the protocol shelf table, without having to obtain the new device's product information from the developer platform.

[0131] S309: Display a prompt card.

[0132] After obtaining the product information of the new device, the electronic device 201 can generate a prompt card as shown in card 211 in Figure 2A, showing the user the product name, product icon and other product information of the new device, so that the user can confirm whether the new device discovered by the electronic device 201 is the printer 202 that is undergoing network configuration operation.

[0133] S310: A user operation to connect a new device (printer 202) is detected.

[0134] As shown in FIG2A , the card 211 may further include a control 213. The electronic device 201 may detect a user operation, such as a click operation, on the control 213 through a display screen, a touch sensor, or other devices. The above operation is the user operation of connecting a new device.

[0135] S311: Start the smart space (DevID1, PrdID1, X1).

[0136] In response to a user action to connect a new device, electronic device 201 may send an instruction to the smart space, triggering its startup. This instruction may include information such as the new device's device identifier DevID1, product identifier PrdID1, and protocol type X1. After the smart space is started, it may begin acquiring local area network configuration information (S312-S314) and downloading the target protocol package (S315-S316).

[0137] S312: Display the authorization card.

[0138] As shown in FIG2B , after the smart space is activated, the smart space can control the display of card 221. Card 221 is also called an authorization card. Card 221 displays a prompt message asking the user whether to allow electronic device 201 to synchronize the configuration information of the currently connected AP 100 with printer 202.

[0139] S313: Detecting a user operation to confirm automatic network configuration.

[0140] As shown in Figure 2B, card 221 also includes a control 222. Similarly, electronic device 201 can detect user operations on control 222 in card 221 through devices such as a display screen and a touch sensor. This operation confirms the user operation for automatic network configuration. The smart space can detect this user operation based on event notifications from electronic device 201. In response to this operation, the smart space can confirm that it has obtained automatic network configuration permission, i.e., the user has authorized the smart space to independently obtain local area network configuration information and send it to the new device for network configuration.

[0141] S314: Obtain LAN configuration information.

[0142] In one implementation, the smart space can be set as a system-trusted application. In this case, the smart space can directly send a request for LAN configuration information to the system settings module and obtain the configuration information of the currently connected LAN from the system settings module.

[0143] In another implementation, the Smart Space can be set as an untrusted application. In this case, the Smart Space cannot directly obtain LAN configuration information from the system settings module. Instead, the Smart Space can obtain LAN configuration information from the system settings module through other applications that are trusted by the system.

[0144] Taking the network 10 shown in FIG1A as an example, the local area network to which the electronic device 201 is currently connected is AP 100. At this time, the smart space can obtain the configuration information of AP 100.

[0145] S315: Obtain the target protocol packet (X1).

[0146] Based on the protocol type of the new device, the Smart Space can determine the target protocol package that matches the protocol type of the new device. For example, if the new device uses protocol X1, the Smart Space can determine the target protocol package X1 that matches protocol X1.

[0147] The Smart Space stores a protocol package configuration file. This configuration file contains the download addresses for various third-party protocol packages. After determining the target protocol package X1, the Smart Space can query the protocol package configuration file, determine the download address for the target protocol package X1, and then download the target protocol package X1 from the corresponding server.

[0148] Preferably, after each tripartite protocol package is obtained, the electronic device 201 may record the local storage address of the tripartite protocol package in the protocol shelf table. After determining the target protocol package X1, the electronic device 201 may determine whether the target protocol package X1 is stored in the local memory through the protocol shelf table. If the target protocol package X1 is stored in the local memory, the electronic device 201 may directly obtain the target protocol package X1 from the local memory without downloading the target protocol package X1.

[0149] S316: Use the target protocol package X1 to issue the LAN configuration information.

[0150] After obtaining the target protocol package (for example, the target protocol package X1), the smart space can load the target protocol package. Loading refers to writing the program code stored in the local memory into the memory. After loading the target protocol package, the smart space can write the aforementioned local area network configuration information obtained into the target protocol package. Then, the target protocol package can send the local area network configuration information to the printer 202 to be configured in accordance with the communication method and instruction format agreed upon in its own protocol. The above-mentioned communication methods include but are not limited to AP broadcast, low-power Bluetooth (bluetooth low energy, BLE) transmission, and near field communication (near field communication, NFC) transmission.

[0151] S317: Configure the network according to the configuration information and access the local area network.

[0152] After the electronic device 201 executes the operation shown in S316 , the printer 202 can receive the LAN configuration information sent by the electronic device 201 , such as the configuration information of the AP 100 shown in FIG. 1A , and then access the AP 100 to complete the network configuration task.

[0153] After the network configuration is successful, the printer 202 can send a network configuration success notification back to the smart space via a target protocol packet. Referring to FIG2C , after receiving the above notification, the smart space can display a network configuration success card to prompt the user that the printer 202 has successfully configured the network.

[0154] After the network configuration is successful, the electronic device 201 can send a print task to the printer 202, and the printer 202 can execute the print task to meet the user's printing needs.

[0155] Figures 4A-4G are a set of user interfaces provided by an embodiment of the present application for controlling a printer to perform a printing task through an electronic device 201.

[0156] Figure 4A illustrates the desktop 40 of electronic device 201 according to an embodiment of the present application. As shown in Figure 4A , the desktop 40 of electronic device 201 may display multiple application icons, such as a weather application icon, an email application icon, a browser application icon, and so on. In this embodiment of the present application, electronic device 201 also includes a smart space. In this case, the desktop 40 shown in Figure 4A also includes a smart space application icon 311 (referred to as icon 311 ).

[0157] Electronic device 201 can detect a user operation on icon 311, such as a click. In response to the operation, electronic device 201 can display the main interface 29 of the smart space shown in FIG4B . The main interface 29 of the smart space shown in FIG4B can be referred to as the first interface. The smart space can display one or more icons in the main interface 29, such as icon 232, icon 233 (second icon), and icon 234 (third icon). Icon 233 corresponds to printer 203 in local area network AP 100. Icon 234 corresponds to printer 204 in local area network AP 100. It is understood that local area network AP 100 may include more electronic devices, and accordingly, icons corresponding to the more electronic devices may be displayed in the main interface 29.

[0158] In one embodiment, the electronic device 201 may discover the printers 203 and 204 according to the method shown in FIG. 2A to FIG. 2C , and then connect to the printers 203 and 204 .

[0159] In another embodiment, electronic device 201 can also add printers 203 and 204 to the smart space. For example, electronic device 201 can detect a user operation on control 235 in FIG. 2C . In response to this operation, electronic device 201 can scan for devices in the surrounding environment. Taking printer 203 as an example, referring to steps S303-S305 in FIG. 3 , electronic device 201 can discover printer 203. Then, electronic device 201 can obtain a protocol packet that matches the protocol type of printer 203 and the configuration information of the current local area network (LAN). Using this matching protocol packet, it sends the configuration information of the current LAN to printer 203, controlling printer 203 to connect to the LAN of electronic device 201. After printer 203 connects to the LAN of electronic device 201, as shown in FIG. 4B , electronic device 201 can display an icon 233 corresponding to printer 203. Similarly, when determining the configuration information of the current LAN, electronic device 201 can directly retrieve it from system settings based on user authorization, or it can determine the LAN configuration information based on manual input.

[0160] For example, as shown in FIG4B , electronic device 201 may detect a user operation on icon 232. In response to the operation, electronic device 201 may display the user interface shown in FIG4C . This interface may display multiple controls. Each control corresponds to a type of printing function, such as document printing, image printing, etc.

[0161] As shown in Figure 4C , electronic device 201 can detect a user operation on a picture print control. In response to this operation, electronic device 201 can display locally stored pictures. As shown in Figure 4D , the user can click on a picture they wish to print, such as picture 412. In response to this operation, electronic device 201 can display print parameter setting interface 42. The interface shown in Figure 4E can be referred to as print parameter setting interface 42. In this interface, the user can set print parameters such as the number of prints, single / double pages, paper size, and color.

[0162] After the settings are complete, electronic device 201 can detect a user action on the start printing control 421. In response to this action, electronic device 201 can send image 412 and the user-set printing parameters to printer 202 corresponding to icon 232. Printer 202 can then print image 412 according to the above printing parameters. Referring to Figures 4F-4G , during the printing process, printer 202 can return printing progress to electronic device 201 for the user to perceive in real time.

[0163] In the scenario where the target protocol package X1 corresponding to the printer 202 is a network configuration protocol package (only used for network configuration), after detecting the user operation of selecting the printer 202 to perform the printing task as described in Figures 4B-4E, the electronic device 201 can send the image 412 and the user-set printing parameters to the printer 202 through the preset Mopria protocol package.

[0164] In the user interface shown in FIG4B , the electronic device 201 can also detect a user operation on the icon 233. In response to the above operation, the electronic device 201 can determine that the printer 203 is the target printer. In the scenario where the target protocol package X2 corresponding to the printer 203 is a printing protocol package (for network configuration and printing), the electronic device 201 can load the target protocol package X2 and send the target file selected by the user to be printed (such as image 412) and the printing parameters set by the user (the printing parameters shown in FIG4E ) to the printer 203 through the target protocol package X2.

[0165] Figures 5A-5J are another set of user interfaces provided in an embodiment of the present application for controlling a printer to perform a printing task through an electronic device 201.

[0166] As shown in Figure 5A, electronic device 201 can detect a swipe down operation on the screen. In response to this operation, electronic device 201 can display a control center interface 50 as shown in Figure 5B. As shown in Figure 5B, control center interface 50 can include one or more functional controls (e.g., wireless local area network (WLAN) switch control, Bluetooth switch control, low power mode switch control, brightness adjustment control, volume adjustment control) and smart interconnection control card 501.

[0167] The electronic device 201 may receive a user operation (eg, a single click) on the smart interconnection control card 501 . In response to the operation, the electronic device 201 may display the smart interconnection interface 51 as shown in FIG. 5C .

[0168] As shown in FIG. 5C , the smart interconnection interface 51 may include a device icon 511 of the electronic device 201 .

[0169] While displaying the smart interconnection interface 51 shown in FIG5C , electronic device 201 can search for nearby connected devices. As shown in FIG5D , after electronic device 201 configures a network for printer 202 and controls printer 202 to connect to local area network AP100, device icon 512 (first icon) for printer 202 can be displayed on the smart interconnection interface 51. Similarly, after electronic device 201 configures a network for printers 203 and 204 and controls printers 203 and 204 to connect to local area network AP100, device icon 513 (second icon) for printer 203 and device icon 517 (third icon) for printer 204 can be displayed on the smart interconnection interface 51. The smart interconnection interface 51 shown in FIG5D can be referred to as the first interface.

[0170] As shown in Figures 5D and 5E, the electronic device 201 can detect the user dragging the device icon 512 to the area where the device icon 511 is located. In response to the dragging operation, as shown in Figure 5F, the electronic device 201 can display a floating control 514 (a first floating control). At the same time, the electronic device 201 can display the desktop 50. The floating control 514 corresponds to the printer 202. Subsequently, according to the user's operation of switching desktops and opening applications, the floating control 514 is displayed in a floating layer above other interfaces. The display position of the floating control 514 remains unchanged.

[0171] As shown in Figure 5G, when displaying the picture browsing interface 52 (second interface), the electronic device 201 can display a floating control 514 on the upper layer of the picture browsing interface 52. The user operation of controlling the display of the picture browsing interface 52 can be referred to as a second operation. Among them, the picture browsing interface 52 may include a picture 521 (a first file). When displaying the picture browsing interface 52 and the floating control 514, the electronic device 201 can detect the user's operation on the floating control 514 (for example, a single click, also referred to as a third operation). Referring to Figure 5H, in response to this operation, the electronic device 201 can expand the floating control 514.

[0172] The expanded floating control 514 may include a control 515 and a control 516. When a user operation on the control 515 is detected, the electronic device 201 may display the print parameter setting interface 42 shown in FIG4E . The electronic device 201 may receive the print parameters set by the user through the above-mentioned print parameter setting interface 42. When a user operation on the control 516 (a first operation) is detected, the electronic device 201 may send the currently displayed picture 521 and the print parameters set by the user (for example, 5 copies, single-sided printing, A4 paper size, black and white printing, etc.) to the printer 202, and control the printer 202 to print the picture 521 with the target print parameters. If the user has not set the print parameters, the electronic device 201 may send the currently displayed picture 521 and the default print parameters to the printer 202.

[0173] While printer 202 is printing image 521 using the target printing parameters, printer 202 may send the printing status to electronic device 201. As shown in Figures 5I and 5J, after receiving the printing status, electronic device 201 may display a prompt message in floating control 514, such as "Printing 1 / 5 copy" or "Printing completed!", to inform the user of the printing progress.

[0174] After displaying the floating control 514 according to the dragging operation shown in Figures 5D and 5E, the electronic device 201 may start a timer. Preferably, the timer counts for 10 seconds. After the timer expires, the electronic device 201 may close the floating control 514. Thereafter, if the user needs to use the printer again, the user may, according to the operations shown in Figures 5A-5D, again open a floating control corresponding to the printer and use it to control the printer to print the target file.

[0175] FIG6 is a schematic diagram of a software architecture of an electronic device 201 provided in an embodiment of the present application.

[0176] The software system of the electronic device 201 may adopt a layered architecture. In the embodiment of the present application, the Android system with a layered architecture is used as an example to exemplify the software structure of the electronic device 201.

[0177] A layered architecture divides software into several layers. Layers communicate with each other via software interfaces. In some embodiments, the Android system includes four layers: the application layer (i.e., the application layer), the application framework layer (i.e., the framework layer), the Android runtime and system libraries, and the kernel layer. Figure 6 only shows the application layer and the framework layer.

[0178] The application layer includes several application packages, such as Smart Space, Reader, Print Assistant, and Smart Connect. These applications can call the print service of the framework layer to discover and control printers to perform printing operations. Any of these applications can be referred to as a first application.

[0179] As shown in Figure 6, the printing service includes an interface layer. The interface layer includes a discovery interface, a configuration interface, a printing interface, a scanning interface, and a status registration interface. The discovery interface can be used to provide upper-layer applications with a service for discovering devices (discovery service); the configuration interface can be used to provide upper-layer applications with a service for modifying configuration information (configuration service); the printing interface can be used to provide upper-layer applications with a service for controlling the printer to print files (file printing service); the scanning interface can be used to provide upper-layer applications with a service for controlling the printer to scan files (scanning service); and the status registration interface is used to provide upper-layer applications with a service for returning the progress of printing tasks (status callback service). Here, the configuration information in the configuration service specifically refers to the configuration information of the protocol shelf, which will be described in detail in subsequent embodiments and will not be expanded here.

[0180] Upper-layer applications can call the discovery module through the discovery interface to discover printers in the environment.

[0181] Specifically, the discovery module includes submodules such as multicast DNS (mDNS) discovery and AP discovery. mDNS discovery uses mDNS technology to obtain information about other electronic devices within the local area network from the AP 100, thereby enabling the discovery of these devices. AP discovery uses Wi-Fi broadcast technology to directly discover other electronic devices in the near field. Upon detecting that an upper-layer application has called a discovery interface, the discovery module sequentially executes mDNS discovery and AP discovery to discover printers in the environment.

[0182] 4A-4B , when the smart space is enabled, it can invoke a discovery interface to query printers in a local area network or near-field environment. After discovering one or more printers, the smart space can display device icons for the one or more printers, such as icons 232, 233, and 234, for the user to select.

[0183] Referring to Figures 5C-5D , upon entering the Smart Connect app, the Smart Connect app can invoke a discovery interface to query for printers in the local area network or near-field environment. Similarly, after discovering one or more printers, the Smart Space can display device icons for the one or more printers, such as device icon 512 , for the user to select.

[0184] The upper-layer application can then determine the target printer the user wants to use based on the user's operation. For example, as shown in Figure 4B, the smart space can detect the user's operation on icon 232 and determine the target printer 202 based on the operation. For another example, as shown in Figures 5C and 5D, the smart interconnection can detect the user's operation of dragging device icon 512 to device icon 511 and determine the target printer 202 based on the operation.

[0185] The upper-layer application can also determine the target file and printing parameters that the user wants to send to the target printer based on the user's operation, and then create a print task. For example, the smart space can determine the target file and printing parameters and create a print task by referring to the user operation shown in Figures 4C-4E; for another example, the smart interconnection can determine the target file and printing parameters and create a print task by referring to the user operation shown in Figures 5F-5G.

[0186] After creating a print task, the upper-layer application can send the print task to the print service through the print interface. The print service can determine the target printer based on the device identifier carried in the print task. Then, the print service can determine the target protocol package that matches the target printer.

[0187] The print service includes a protocol shelf, which can determine the target printer and the target protocol package that matches the target printer based on the device identifier carried in the print task.

[0188] The protocol shelf also includes a configuration management module, a storage management module, and a loading and calling module. The configuration management module includes protocol package configuration files. Upper-layer applications can update protocol package configuration files at any time through the configuration interface. The storage management module manages the three-party protocol packages stored in local memory. The loading and calling module obtains the storage address of the target protocol package from the storage management module and then reads and loads the target protocol package.

[0189] After determining the target protocol package, the protocol shelf may first determine whether the target protocol package is a network configuration protocol package or a printing protocol package. If the target protocol package is a network configuration protocol package (only used to configure the network for the printer 202), the protocol shelf may confirm the use of the preset Mopria protocol package to send the print task to the target printer. The electronic device 201 needs to control the printer 202 to print the target file through the printer 202 and the target file. If the target protocol package is a printing protocol package (which can be used to configure the network for the printer and to control the printer to perform the print task), the electronic device 201 may load the target protocol package and use the target protocol package to send the print task to the target printer.

[0190] The protocol shelf can obtain the storage address of the target protocol package through the storage management module. Then, the load calling module can read and load the target protocol package according to the above address.

[0191] In some scenarios, the target protocol package downloaded during network configuration may be deleted due to certain operations, such as memory cleanup. In this case, the storage management module can return the locally unstored data to the protocol shelf. In this case, the protocol shelf can obtain the download address of the target protocol package from the configuration management module, download the target protocol package, and then load the target protocol package.

[0192] As shown in Figure 6, the Mopria protocol package may include a status acquisition module, a connection module, a print module, and a scan module. The connection module is used to establish a communication connection; the print module is used to control the printer to perform print tasks; the scan module is used to control the printer to perform scan tasks (such as scanning test papers or ID cards); and the status acquisition module is used to obtain the printer's printing progress.

[0193] The three-party protocol package may include a network configuration module, a status acquisition module, a connection module, a printing module, a scanning module, and a discovery module. Among them, the network configuration module is used to control the printer to configure the network. The status acquisition module, connection module, printing module, and scanning module refer to the introduction of the above-mentioned Mopria protocol package and will not be repeated here. It can be understood that the communication methods and instruction formats of the status acquisition module, connection module, printing module, and scanning module in different protocol packages may be different. The discovery module can provide discovery methods other than mDNS discovery and AP discovery. After obtaining one or more three-party protocol packages including the discovery module, the printing service can also execute the discovery methods in the three-party protocol package in sequence to discover nearby devices for users to connect and use.

[0194] The status acquisition module, connection module, print module, scan module, and discovery module are optional. When the three-party protocol package includes the status acquisition module, connection module, print module, and scan module, the three-party protocol package is a print protocol package, which can be used to configure the network and control the printer to perform print tasks. When the three-party protocol package does not include the status acquisition module, connection module, print module, and scan module, the three-party protocol package is a network configuration protocol package, which is only used to configure the network. After the network configuration is successful, the protocol shelf will control the corresponding printer to perform print tasks through the preset Mopria protocol package.

[0195] It is understandable that when no tripartite agreement package is downloaded from the agreement shelf, the tripartite agreement package is not included in the printing service.

[0196] FIG7A is a flowchart of an electronic device 201 controlling a target printer to perform a printing task, provided by an embodiment of the present application.

[0197] S701: Start the application.

[0198] The target application includes applications installed on the electronic device 201 that support printing functions, such as smart space, reader, printing assistant, smart interconnection, etc.

[0199] Taking Smart Space as an example, referring to FIG4A , electronic device 201 can detect a user click on Smart Space application icon 311. In response to this action, electronic device 201 can open Smart Space and display Smart Space main interface 29. Taking Smart Connect as an example, electronic device 201 can detect a user click on Smart Connect control card 501. In response, electronic device 201 can open Smart Connect and Smart Connect interface 51. Subsequent embodiments will use Smart Space as an example for description; other target applications will be described with reference to Smart Space and will not be further elaborated.

[0200] S702: Bind the print service and obtain a printer list.

[0201] When enabling a smart space, it can send registration information to the print service to bind it. Each application corresponds to one binding relationship. During the print service binding process, the smart space can set a status callback through the status registration interface to receive status information returned by the print service at any time.

[0202] The Print Service provides a printer list. This list contains information about currently online printers, such as their device ID, product ID, and access address. The Print Service updates this list after each discovery operation by the discovery module (the Print Service's discovery module and / or the discovery module in the tripartite agreement package). Upon detecting that a Smart Space is bound to the Print Service, the Print Service returns the printer list to the Smart Space.

[0203] S703: Determine the target printer.

[0204] The Smart Space can identify currently online printers based on the printer list and display corresponding icons, such as icons 232, 233, and 234 shown in FIG4B . Users can select a printer to print to by touching any icon. The Smart Space determines the target printer based on these user actions.

[0205] For example, after detecting a user operation on icon 232, the smart space may determine that the printer 202 corresponding to icon 232 is the target printer. After detecting a user operation on icon 233, the smart space may determine that the printer 203 corresponding to icon 233 is the target printer.

[0206] S704: Create a print task.

[0207] As shown in Figures 4C-4E , the smart space can determine the target file and printing parameters based on user operations, and create a print task through user operations acting on the start print control 421. The target file can be a document in a format such as .dox, .pdf, or .pptx, or an image in a format such as .jpg or .png.

[0208] S705: Issue the printing task.

[0209] After creating a print task, Smart Space can send the print task to the print service.

[0210] Specifically, the smart space can issue a print task to the print service through the print interface. The smart space can send information such as the task identifier, device identifier, and print parameters to the print service (first request). After receiving the above information, the print service can first create a data transmission channel and send the channel identifier of the above data transmission channel to the smart space. The smart space can determine the target channel (first channel) based on the above channel identifier, and then send the target file to the print service through the target channel corresponding to the channel identifier. The print service saves the received target file to the specified address.

[0211] Smart Space can create printer scan tasks based on user operations. It's understood that after creating a scan task, Smart Space doesn't need to send the target file to the print service. After the target printer completes the scan, it returns the scan results to the print service, which then returns the scan results to Smart Space for the user to view and use.

[0212] S706: Determine the protocol type of the target printer.

[0213] The print service can determine the target printer and the target protocol package that matches the target printer based on the device identification.

[0214] For example, after detecting a user action on icon 232, the smart space can send the device identifier (DevID) of printer 202 to the print service. Based on the device identifier, the print service can determine that printer 202 is the target printer and then determine the target protocol package X1 that matches the target printer 202. The print service can then determine that the target protocol package X1 is a network configuration protocol package, used only for network configuration. Therefore, the print service can determine to use the Mopria protocol package to issue a print task to the target printer 202, controlling the printer 202 to perform the print operation. Step S707 is then executed.

[0215] After detecting a user action on icon 233, the smart space determines that printer 203 corresponding to icon 233 is the target printer. The print service then identifies target protocol package X2 that matches target printer 203, confirms that target protocol package X2 is a print protocol package, and uses target protocol package X2 to issue a print task to target printer 203. Step S709 is then executed.

[0216] S707: The print service sends the print task to the target printer via the Mopria protocol package.

[0217] After confirming that the three-party protocol package matching the target printer cannot be used to control the printer to execute the print task (i.e., the three-party protocol package is a network configuration protocol package and is only used for network configuration), the printing protocol can determine to use the Mopria protocol package to send the print task to the target printer (e.g., printer 202). For example, after confirming that the three-party protocol package X1 matching the target printer 202 is only used to configure the network for printer 202, the protocol shelf can use the Mopria protocol package to send the print task to the target printer.

[0218] The print service can then obtain a printer call interface from the Mopria protocol package. The print service can then use this interface to send the target file and print parameters to the Mopria protocol package. The Mopria protocol package can then send the target file and print parameters to the target printer via the print module pre-configured in the protocol package.

[0219] S708: Print the target file.

[0220] The target printer (eg, printer 202 ) may print the target file according to the printing parameters.

[0221] Before the print module in the Mopria protocol package sends the target file and print parameters to the target printer, the Mopria protocol package uses the pre-built status acquisition module to set up a callback interface. While the target printer is printing the target file, the printer uses this interface to return the print progress to the print service. This progress is then transmitted back to the smart space via a status callback between the print service and the smart space. The smart space can then display the print progress for users to review at any time.

[0222] S709: The print service loads a tripartite agreement package that matches the target printer, and sends a print task to the target printer through the tripartite agreement package.

[0223] After confirming that the three-party protocol package that matches the target printer can be used to control the printer to execute a print task (i.e., the three-party protocol package is a printing protocol package that can be used for both network configuration and printing), the print service can load the three-party protocol package. For example, after confirming that the three-party protocol package X2 that matches the target printer 203 can be used to control the printer to execute a print task, the protocol shelf can load the three-party protocol package X2.

[0224] The print service can obtain a print interface from the three-party protocol package. The print service can then send the target file and print parameters to the three-party protocol package through the interface. The three-party protocol package can then send the target file and print parameters to the target printer through the print module pre-installed in the protocol package.

[0225] S710: Print the target file to the target printer (e.g., printer 203). S710 can refer to S708 and will not be described in detail here.

[0226] FIG7B is a flowchart of a specific method of loading a tripartite agreement package provided in an embodiment of the present application.

[0227] Referring to step S706 above, after receiving the device identification, the printing service may first determine the target printer according to the device identification and then determine the protocol type of the target printer, such as protocol X1 or X2.

[0228] Taking X2 as an example, after determining that the target printer's protocol type is X2, the print service sends the target protocol to the protocol shelf module. Upon receiving the target protocol, the protocol shelf initializes the resource package management class and uses it to match the protocol package for protocol X2, i.e., the target protocol package X2. The protocol shelf then queries the storage management module to confirm whether the target protocol package X2 is stored in local storage.

[0229] In the scenario where the target protocol package X2 is stored in the local memory, the protocol shelf can read the target protocol package X2 according to the address provided by the storage management module and write it into the memory for initialization. The process of writing the protocol package stored in the local memory into the memory is called loading.

[0230] On the contrary, if the target protocol package X2 is not stored in the local memory, the protocol shelf may return a matching failure to the printing service and instruct the printing service to download the target protocol package X2. In response to the above instruction, the printing service may send a request to the protocol shelf to download the target protocol package X2 and register callback pipe1. In response to the above request, the protocol shelf may query the configuration management module to obtain the download address of the target protocol package X2, such as the developer platform, and then the protocol shelf may download the target protocol package X2 from the developer platform. During the process of downloading the target protocol package X2, the protocol shelf may return the download progress through the callback pipe1 registered by the printing service. After the download is completed, the protocol shelf may immediately load the target protocol package X2 (hereinafter referred to as protocol package X2) and initialize it.

[0231] After loading is complete, the protocol package X2 may return a success notification to the protocol shelf. Then, referring to S709, the print service may obtain various call interfaces of the protocol package X2, such as a status acquisition interface, a connection interface, a print interface, a scan interface, and the like.

[0232] First, the print service can send a connection request to protocol package X2 through the connection interface and register callback pipe2. Protocol package X2 then matches the connection request function under protocol X2 and then sends a connection request to the target printer (e.g., printer 203) through the connection request function under protocol X2. In response to the above connection request, electronic device 201 can establish a communication connection with the target printer based on protocol package X2. After receiving the connection success notification returned by the target printer, protocol package X2 can transmit the above notification back to the protocol shelf. Based on security requirements, the protocol shelf can first send a device verification request to protocol package X2. When establishing the connection, protocol package X2 can obtain the device identification of the other device. Protocol package X2 can detect whether the device identification of the other device is consistent with the device identification previously obtained by the print service, that is, verify whether the connected device is the target printer. If the two are consistent, protocol package X2 can confirm that the device connection is correct. Protocol package X2 returns a verification success notification to the protocol shelf through the previously registered callback pipe2. The protocol shelf can pass the above notification to the print service.

[0233] Then, referring to S709 , the print service obtains the print interface of protocol package X2. Through the print interface, the print service sends the target file and print parameters to the tripartite protocol package X2. After being translated by protocol package X2, the target printer receives and recognizes the target file and print parameters, and then prints the target file according to the print parameters.

[0234] Protocol package X2 can register a callback to pipe3 through the status acquisition interface. While the target printer is printing the target file, it can return the printing progress to protocol package X2 through pipe3. Based on the callback between the print service and the smart space, the smart space can obtain the printing progress and display it for users to review at any time.

[0235] In some embodiments, the electronic device 201 may also pre-install a protocol package provided by the manufacturer of the electronic device 201, which is denoted as BG1. Among them, BG1 can be used to configure the network and can also be used to control the printer to print. At this time, when the printer discovered by the electronic device 201 uses BG1, the electronic device 201 can configure the network for the above-mentioned printer through the preset BG1, and can control the above-mentioned printer to perform printing tasks through the preset BG1. When the newly discovered printer uses other protocol packages, such as the aforementioned Mopria, X1, and X2, the electronic device 201 obtains a matching protocol package, configures the network for the above-mentioned printer through the above-mentioned matching protocol package, and / or controls the above-mentioned printer to perform printing tasks.

[0236] In some embodiments, the electronic device 201 may also be pre-installed with a protocol package provided by the manufacturer of the electronic device 201, which is denoted as BG2. BG2 is only used to configure the network or to control the printer to print.

[0237] If BG2 is only used for network configuration, during the network configuration process, after determining that the printer uses BG2, the electronic device 201 can configure the network for the printer using the preset BG2. If the printer uses other protocol packages for network configuration, the electronic device 201 obtains the matching protocol package and uses the matching protocol package to configure the network for the printer. During the printing process, the electronic device 201 obtains the matching protocol package for printing and uses the matching protocol package to control the printer to print.

[0238] If BG2 is used only to control printer printing, during the network configuration process, the electronic device 201 obtains a matching protocol package for printing and configures the network for the printer using the matching protocol package. During the printing process, after determining that the printer uses BG2, the electronic device 201 can control the printer to print using the preset BG2. If the printer uses other protocol packages, the electronic device 201 obtains a matching protocol package and controls the printer to print using the matching protocol package.

[0239] The developer platform is not limited to printers; it can also establish a protocol database for electronic devices 300, such as televisions, projectors, speakers, cameras, and robot vacuums, recording the protocol types of different device models. After powering on, the electronic device 300 can also broadcast its own product identification. The electronic device 201 can determine the protocol type of the electronic device based on the product identification, and then obtain a matching protocol package. Using this matching protocol package, it configures the network for the electronic device 300 and controls the electronic device 300 to perform specific operations.

[0240] FIG8 is a schematic structural diagram of an electronic device 201 provided in an embodiment of the present application.

[0241] The electronic device 201 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195. It will be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 201. In other embodiments of the present application, the electronic device 201 may include more or fewer components than shown, or combine some components, or split some components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0242] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors. The controller may generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution.

[0243] The USB interface 130 is an interface that complies with USB standards, such as a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 201, and can also be used to transfer data between the electronic device 201 and peripheral devices.

[0244] The charging management module 140 is configured to receive charging input from a charger. While charging the battery 142, the charging management module 140 can also power the electronic device through the power management module 141. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, the internal memory 121, the display 194, the camera 193, and the wireless communication module 160.

[0245] The wireless communication function of the electronic device 201 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor and the baseband processor. The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied on the electronic device 201. The wireless communication module 160 can provide solutions for wireless communications including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc. applied on the electronic device 201.

[0246] In an embodiment of the present application, the electronic device 201 can access the local area network through wireless communication solutions such as WLAN, BT, NFC, IR, etc. provided by the wireless communication module 160, and send the local area network configuration information to the printer 202.

[0247] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).

[0248] The random access memory can be directly read and written by the processor 110 and can be used to store executable programs (e.g., machine instructions) of the operating system or other running programs, as well as user and application data. The non-volatile memory can also store executable programs and user and application data. Data stored in the non-volatile memory can be pre-loaded into the random access memory for direct reading and writing by the processor 110.

[0249] The program code for implementing the printer control method provided in the embodiment of the present application can be stored in a non-volatile memory. The electronic device 201 can read the program code from the non-volatile memory, write it into the processor 110 and execute it, thereby implementing the fast network configuration and call function provided in the embodiment of the present application.

[0250] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the electronic device 201 .

[0251] The electronic device 201 implements display functions through a GPU, a display screen 194 , and an application processor, for example, displaying the user interfaces shown in FIG. 2A-FIG . 4A-FIG . 4G . and FIG. 5A-FIG .

[0252] The electronic device 201 can also implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.

[0253] The electronic device 201 can also implement audio functions such as music playback and recording through the audio module 170 , the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0254] The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.

[0255] The pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, the pressure sensor 180A can be located on the display screen 194. When a touch operation is performed on the display screen 194, the electronic device 201 detects the intensity of the touch operation based on the pressure sensor 180A. The electronic device 201 can also calculate the location of the touch based on the detection signal from the pressure sensor 180A. The gyroscope sensor 180B and the acceleration sensor 180E can be used to determine the movement and posture of the electronic device 201. The air pressure sensor 180C is used to measure air pressure. The magnetic sensor 180D can be used to detect the opening and closing of the flip cover or the flip cover leather case. The distance sensor 180F is used to measure distance. The proximity light sensor 180G can be used to detect infrared light reflected from nearby objects, thereby determining whether the electronic device 201 detects nearby objects. The ambient light sensor 180L is used to sense the brightness of ambient light. The fingerprint sensor 180H is used to collect fingerprints. The temperature sensor 180J is used to detect temperature. Touch sensor 180K can be mounted on display screen 194. Together, they form a touch screen, also known as a "touch screen." Touch sensor 180K is used to detect touch operations applied to or near it, such as the click operations shown in Figures 2A-2C, 4A-4G, and 5A-5J. Bone conduction sensor 180M can also capture vibration signals.

[0256] Keys 190 include a power button and volume buttons. Electronic device 201 can receive key inputs and generate key signal inputs related to user settings and function control of electronic device 201. Motor 191 can generate vibration prompts. Indicator 192 can be an indicator light that can be used to indicate charging status, battery level changes, messages, missed calls, notifications, etc. SIM card interface 195 is used to connect a SIM card.

[0257] FIG9 is a schematic diagram of the structure of the printer 202 provided in an embodiment of the present application.

[0258] As shown in Figure 9 , printer 202 may include components such as a processor 311, a memory 312, a wireless communication module 313, and a power switch 314. Components in an electronic device are connected to each other via a bus and communicate over the bus. For details about these components, please refer to the descriptions of the corresponding components in Figure 8 and will not be repeated here.

[0259] In an embodiment of the present application, the printer 202 can store and execute program codes and / or instructions through the processor 311 and the memory 312, and communicate with electronic devices such as the electronic device 201 and the AP100 through the wireless communication module 313, thereby realizing various functions of the printer 202, such as broadcasting detection frames, receiving LAN configuration information, accessing the LAN, and receiving target files for execution and printing target files after accessing the network.

[0260] Likewise, the structural diagram shown in FIG9 is merely an example and should not constitute a specific limitation on the printer 202 .

[0261] The term "user interface (UI)" in the specification, claims and drawings of this application refers to the media interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The user interface of an application is a source code written in a specific computer language such as Java and Extensible Markup Language (XML). The interface source code is parsed and rendered on the terminal device, and finally presented as content that the user can recognize, such as pictures, text, buttons and other controls. Controls, also known as widgets, are the basic elements of the user interface. Typical controls include toolbars, menu bars, text boxes, buttons, scroll bars, pictures and text. The properties and contents of controls in the interface are defined by tags or nodes, such as XML through <textview> 、 <imgview> 、 <videoview>The controls contained in the interface are specified by nodes such as <head> and <body>. A node corresponds to a control or attribute in the interface, and the node is presented as user-visible content after parsing and rendering. In addition, many applications, such as hybrid applications, usually also contain web pages in their interfaces. A web page, also known as a page, can be understood as a special control embedded in the application interface. A web page is a source code written in a specific computer language, such as hypertext markup language (HTML), cascading style sheets (CSS), JavaScript (JS), etc. The web page source code can be loaded and displayed as user-recognizable content by a browser or a web page display component with similar functions to a browser. The specific content contained in a web page is also defined by tags or nodes in the web page source code, such as HTML through <body>. 、 、 <video> 、 <canvas>To define the elements and attributes of a web page.

[0262] A common form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operations that uses graphics. It can be an icon, window, control, or other interface element displayed on the display of an electronic device. Controls can include icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, and other visual interface elements.

[0263] As used in the specification and appended claims of the present application, the singular expressions "a", "an", "said", "above", "the" and "this" are intended to include plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in the present application refers to and includes any or all possible combinations of one or more listed items. As used in the above embodiments, the term "when..." can be interpreted to mean "if..." or "after..." or "in response to determining..." or "in response to detecting...". Similarly, the phrase "when determining..." or "if (stated condition or event) is detected" can be interpreted to mean "if determining..." or "in response to determining..." or "when (stated condition or event) is detected" or "in response to detecting (stated condition or event)", depending on the context.

[0264] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk).

[0265] Those skilled in the art will appreciate that all or part of the process steps in the above-described method embodiments can be implemented by a computer program instructing the relevant hardware. The program can be stored in a computer-readable storage medium, and when executed, the program can include the process steps in the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.< / canvas> < / video> < / videoview> < / imgview> < / textview>

Claims

1. A printing method, characterized in that, Applied to an electronic device, the method includes: Display a first interface of a first application. The first interface includes a first icon and a second icon. The first icon corresponds to a first printer, and the second icon corresponds to a second printer. The first printer corresponds to a first protocol, and the second printer corresponds to a second protocol; Before detecting a user operation on the first icon, load the first protocol packet, which corresponds to the first protocol; After detecting a user operation on the first icon, send a target file selected by the user to the first printer through the first protocol packet; After detecting a user operation on the second icon, load a second protocol packet, and send the target file selected by the user to the second printer through the second protocol packet. The second protocol packet corresponds to the second protocol.

2. The method according to claim 1, wherein Before displaying the first interface of the first application, the method further includes: starting the first application; The loading of the first protocol packet is specifically: loading the first protocol packet during the startup process of the first application.

3. The method according to claim 1, wherein Before displaying the first interface of the first application, the method further includes: Discover the first printer; After discovering the first printer, load a third protocol packet, and send first configuration information to the first printer through the third protocol packet. The first configuration information includes the name and password of the local area network where the electronic device is currently located.

4. The method according to claim 3, wherein Before loading the third protocol packet, the method further includes: downloading the third protocol packet from a first server. The third protocol packet is different from the first protocol packet.

5. The method according to claim 3, wherein The discovery of the first printer specifically includes: Detect a probe frame sent by the first printer. The product identifier of the first printer is carried in the probe frame; Before loading the third protocol packet, the method further includes: determining that the first printer also corresponds to a third protocol according to the product identifier. The third protocol packet corresponds to the third protocol.

6. The method according to claim 1, characterized in that Before displaying the first interface of the first application, the method further includes: Discover the second printer; After discovering the second printer, download the second protocol packet corresponding to the second protocol from a second server, load the second protocol packet, and send the first configuration information to the second printer through the second protocol packet. The first configuration information includes the name and password of the local area network where the electronic device is currently located.

7. The method according to claim 1, wherein Before displaying the first interface of the first application, the method further includes: Discover the second printer; After discovering the second printer, download a fourth protocol packet corresponding to a fourth protocol from a third server, load the fourth protocol packet, and send the first configuration information to the second printer. The fourth protocol is different from the second protocol. The first configuration information includes the name and password of the local area network where the electronic device is currently located.

8. The method according to claim 1, characterized in that, After detecting a user operation on the first icon, the method further includes: determining the first protocol packet according to the protocol type of the first printer.

9. The method according to claim 1, characterized in that After detecting a user operation on the second icon, the method further includes: Determine the second protocol packet according to the protocol type of the second printer; The loading of the second protocol packet specifically includes: After determining that the local memory stores the second protocol packet, load the second protocol packet from the local memory.

10. The method according to claim 1, characterized in that After detecting a user operation on the first icon, sending the target file selected by the user to the first printer through the first protocol packet specifically includes: After detecting a user operation on the first icon, display a first floating control; After displaying the first floating control, receive a second operation by the user; In response to the second operation, display a second interface, the second interface includes a first file, and during the process from receiving the second operation by the user to displaying the second interface, the position of the first floating control remains unchanged; When the first file is displayed, detect a first operation on the first floating control; In response to the first operation, determine the first file as the target file, and send the target file to the first printer through the first protocol packet.

11. The method according to claim 10, wherein After sending the target file to the first printer through the first protocol packet, the method further includes: displaying the progress of the first printer printing the target file in the first floating control.

12. The method according to claim 10, wherein Before detecting the first operation on the first floating control, the method further includes: Detect a third operation on the first floating control; In response to the third operation, display a first control in the first floating control; The detection of the first operation on the first floating control specifically includes: Detect a first operation on the first control in the first floating control.

13. The method according to claim 1, wherein Before loading the second protocol packet, the method further includes: confirming that the second protocol packet is not stored in the local memory, and downloading the second protocol packet from a second server.

14. The method according to claim 1, wherein The first protocol is the printing standard mopria.

15. The method according to claim 5, wherein The determining that the first printer also corresponds to a third protocol according to the product identifier specifically includes: Send the product identifier to a fourth server; Receive a first type sent by the first server, the first type corresponds to the third protocol, and the first type is sent by the first server to the electronic device after receiving the product identifier sent by the electronic device.

16. The method according to claim 3 or 6 or 7, characterized in that, The electronic device includes a system setting module, and the first configuration information is stored in the system setting module, and the first application reads the first configuration information from the system setting module.

17. The method according to claim 1, characterized in that, The electronic device includes a printing service. Before displaying the first interface of the first application, the method further includes: the first application obtains a printer list from the printing service, and the printer list includes the identifier of the first printer and the identifier of the second printer.

18. The method according to claim 10, characterized in that, The electronic device includes a printing service, and the printing service includes the first protocol packet. In response to the first operation, determining the first file as the target file and sending the target file to the first printer through the first protocol packet specifically includes: In response to the first operation, determine the first file as the target file and send a first request to the printing service; In response to the first request, the printing service creates a first channel; The first application sends the target file to the printing service through the first channel; The printing service sends the target file to the first printer through the first protocol packet.

19. The method according to claim 18, wherein The first request also carries the device identifier and printing parameters of the first printer, and the printing service determines the first protocol packet according to the device identifier of the first printer; the printing service also sends the printing parameters to the first printer through the first protocol packet.

20. A printing method, applied to an electronic device, characterized in that, The method includes: Display a first interface of the first application. The first interface includes a second icon and a third icon. The second icon corresponds to a second printer, and the third icon corresponds to a third printer. The second printer corresponds to the second protocol; The third printer corresponds to the fifth protocol; After detecting a user operation on the second icon, load a second protocol packet and send the user-selected target file to the second printer through the second protocol packet. The second protocol packet corresponds to the second protocol; After detecting a user operation on the third icon, load a fifth protocol packet and send the user-selected target file to the third printer through the fifth protocol packet. The fifth protocol packet corresponds to the fifth protocol.

21. An electronic device, characterized in that, Comprising one or more processors and one or more memories; wherein, the one or more memories are coupled to the one or more processors, and the one or more memories are used to store a computer program. When the one or more processors execute the computer program, the electronic device executes the method according to any one of claims 1-20.

22. A chip system, which is applied to an electronic device, and the chip system includes one or more processors, characterized in that, The processor is used to call computer instructions to cause the electronic device to execute the method according to any one of claims 1-20.

23. A computer-readable storage medium, comprising a computer program, characterized in that, When the computer program runs on the electronic device, the electronic device executes the method according to any one of claims 1-20.