Printer control method, electronic equipment and system
By presetting the Mopria protocol package and dynamically loading the tripartite protocol package in electronic devices, the problem of users needing to download multiple applications to control printers of different protocols is solved, and a printer control method that simplifies operations and improves user experience is realized.
Patent Information
- Application Number
- CN202311854523.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-28
- Publication Date
- 2025-07-08
AI Technical Summary
Users need to download applications from multiple printer manufacturers to control printers of different protocols, resulting in increased storage space usage of terminal devices and cumbersome operations, and prone to file sending errors, affecting the user experience.
By presetting the Mopria protocol package in an electronic device, using the printer's detection frame to obtain product identification to determine the protocol type, and dynamically load the corresponding tripartite protocol package, implementing an application to control printers with different protocols, automatically configure the network and send printing tasks.
Reduces user operation steps, saves storage space on terminal devices, and improves user experience, ensuring that files are sent accurately to the target printer.
Smart Images

Figure CN120276688A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminals, and in particular to a printer control method, an electronic device, and a system. Background Art
[0002] After purchasing a printer, a user usually needs to download a specific application provided by the printer manufacturer in a mobile terminal, and then configure the network for the printer through this application to control the printer to perform a printing task. On this basis, when multiple printers of different manufacturers are purchased at the same time, or when changing from a printer of one manufacturer to a printer of another manufacturer, the user needs to download multiple applications. One application is used to control a printer of one manufacturer.
[0003] This not only causes redundant occupation of the storage space of the terminal device, but also increases user operations. After determining to use a certain printer, the user needs to open the corresponding application and send the target file that the user wants to print to the printer that the user wants to use through this application. If the opened application does not match the printer that the user wants to use, the target file will also be incorrectly sent to other printers, seriously affecting the user experience. Summary of the Invention
[0004] In a first aspect, this application provides a printing method applied to an electronic device. The method includes: displaying a first interface of a first application, where 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, loading a first protocol packet corresponding to the first protocol; after detecting a user operation on the first icon, sending a user-selected target file to the first printer through the first protocol packet; after detecting a user operation on the second icon, loading a second protocol packet and sending the user-selected target file to the second printer through the second protocol packet, where the second protocol packet corresponds to the second protocol.
[0005] By implementing the method provided in the first aspect, the electronic device can control printers using different protocols to perform printing tasks through one application (the first application), so that the user does not need to download multiple applications to control printers using different protocols to perform printing tasks through different applications, saving user operations and improving the user experience.
[0006] In some embodiments, before displaying the first interface of the first application, the method further includes: starting the first application; loading a first protocol package, specifically: loading the first protocol package during the startup process of the first application. Among them, when the first application is not running, that is, there is no process of the first application in the electronic device, and an operation corresponding to the icon of the first application is received by the user, the electronic device can start the first application. It can be understood that after the electronic device receives the operation corresponding to the icon of the first application, the process of running the program code of the first application before displaying the main interface of the first application is called the process of starting the first application.
[0007] The electronic device can load a protocol package (the first protocol package) when starting the application. In this way, when the user selects a printer and the printer corresponds to the above-mentioned first protocol package, the electronic device can directly use the above-mentioned first protocol package to send the target file to the above-mentioned printer without the need for temporary loading.
[0008] Preferably, the first protocol is the printing standard mopria, and the first protocol package is the mopria protocol package.
[0009] In some embodiments, before displaying the first interface of the first application, the method further includes: discovering a first printer; after discovering the first printer, loading a third protocol package, and sending first configuration information to the first printer through the third protocol package. The first configuration information includes the name and password of the local area network where the electronic device is currently located.
[0010] The electronic device can configure the network for the printer and control the printer to execute the printing task through different protocol packages.
[0011] In some embodiments, before loading the third protocol package, the method further includes: downloading the third protocol package from a first server, and the third protocol package is different from the first protocol package.
[0012] The electronic device can download the required protocol package from a server (the 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 occupying the storage space of the electronic device.
[0013] Combined with the method provided in the first aspect, in some embodiments, discovering the first printer specifically includes: detecting a probe frame sent by the first printer, and the product identifier of the first printer is carried in the probe frame; before loading the third protocol package, the method further includes: determining that the first printer also corresponds to a third protocol according to the product identifier, and the third protocol package corresponds to the third protocol package.
[0014] The electronic device can discover the printer through the probe frame of the printer, and determine which protocol the printer uses through the product identifier carried in the probe frame, and then determine which protocol package to use to communicate with the printer.
[0015] In some embodiments, determining that the first printer also corresponds to a third protocol according to the product identifier specifically includes: sending the product identifier to a fourth server; receiving a first type sent by a first server, where the first type indicates 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 identifier sent by the electronic device.
[0016] The electronic device can determine the protocol type corresponding to the product identifier through a server (fourth server). Preferably, the fourth server is a developer platform.
[0017] In some embodiments, before displaying the first interface of the first application, the method further includes: discovering a second printer; after discovering the second printer, downloading a second protocol packet corresponding to a second protocol from a second server, loading the second protocol packet, and sending first configuration information to the second printer through the second protocol packet, where the first configuration information includes the name and password of the local area network where the electronic device is currently located.
[0018] The electronic device can configure the network for the printer and control the printer to execute a printing task through a protocol packet.
[0019] In some embodiments, before displaying the first interface of the first application, the method further includes: discovering a second printer; after discovering the second printer, downloading a fourth protocol packet corresponding to a fourth protocol from a third server, loading the fourth protocol packet, and sending first configuration information to the second printer through the fourth protocol packet, where the fourth protocol is different from the second protocol, and the first configuration information includes the name and password of the local area network where the electronic device is currently located.
[0020] In some embodiments, after detecting a user operation on a first icon, the method further includes: determining a first protocol packet according to the protocol type of the first printer.
[0021] In some embodiments, after detecting a user operation on a second icon, the method further includes: determining a second protocol packet according to the protocol type of the second printer; loading the second protocol packet, specifically including: loading the second protocol packet from the local memory after determining that the local memory stores the second protocol packet.
[0022] In some embodiments, after detecting a user operation on the first icon, a target file selected by the user is sent to a first printer via a first protocol packet. Specifically, it includes: after detecting a user operation on the first icon, a first floating control is displayed; after the first floating control is displayed, a second operation of the user is received; in response to the second operation, a second interface is displayed, and the second interface includes a first file. During the process from receiving the second operation of the user to displaying the second interface, the position of the first floating control remains unchanged; when the first file is displayed, a first operation on the first floating control is detected; in response to the first operation, the first file is determined as the target file, and the target file is sent to the first printer via the first protocol packet.
[0023] The electronic device can determine the target file that the user wants to print through the file displayed when the user clicks the floating control, providing a new printing experience for the user.
[0024] 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.
[0025] In some embodiments, before detecting the first operation on the first floating control, the method further includes: detecting a third operation on the first floating control; in response to the third operation, a first control is displayed in the first floating control; detecting the first operation on the first floating control specifically includes: detecting the first operation on the first control in the first floating control.
[0026] In some embodiments, 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.
[0027] When the protocol packet matching the printer is not stored locally, the electronic device can download it again from the server (the second server).
[0028] In some embodiments, the electronic device includes a system settings module, and first configuration information is stored in the system settings module. The first application reads the first configuration information from the system settings module.
[0029] The electronic device can automatically read configuration information such as the name and password of the current local area network without the user input, thus saving user operations and helping the user quickly configure the network for the printer.
[0030] 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, and the printer list includes a first printer and a second printer.
[0031] In some embodiments, the electronic device includes a printing service. The printing service includes a first protocol packet. In response to a first operation, a first file is determined as a target file, and the target file is sent to a first printer through the first protocol packet. Specifically, 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 packet.
[0032] In some embodiments, the first request also carries a device identifier of the first printer and printing parameters. 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.
[0033] In a second aspect, the present application provides a printing method applied to an electronic device. The method includes: displaying a first interface of a 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 a second protocol, and the third printer corresponds to a fifth protocol. After detecting a user operation on the second icon, a second protocol packet is loaded, and the user-selected target file is sent 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, a fifth protocol packet is loaded, and the user-selected target file is sent to the third printer through the fifth protocol packet. The fifth protocol packet corresponds to the fifth protocol.
[0034] 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 the user does not need to download multiple applications to control printers using different protocols to perform printing tasks through different applications, saving user operations and improving the user experience.
[0035] In some embodiments, before displaying the first interface of the first application, the method further includes: discovering the second printer. After discovering the second printer, downloading a second protocol packet corresponding to the second protocol from a second server, loading the second protocol packet, and sending 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.
[0036] The electronic device can configure the network for the printer and control the printer to perform printing tasks through one protocol packet.
[0037] In some embodiments, 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 the second server.
[0038] When the protocol package matching the printer is not stored locally, the electronic device can download it again from the server (the second server).
[0039] In some embodiments, before displaying the first interface of the first application, the method further includes: discovering a second printer; after discovering the second printer, downloading a fourth protocol package corresponding to a 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, where the fourth protocol is different from the second protocol, and the first configuration information includes the name and password of the local area network where the electronic device is currently located.
[0040] The electronic device can configure the network for the printer and control the printer to perform printing tasks through different protocol packages.
[0041] In some embodiments, the electronic device includes a system settings module, and the first configuration information is stored in the system settings module, and the first application reads the first configuration information from the system settings module.
[0042] The electronic device can automatically read configuration information such as the name and password of the current local area network without user input, thereby saving user operations and helping the user quickly configure the network for the printer.
[0043] In a third aspect, the present application provides an electronic device, which includes 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 is caused to execute the methods described in the first aspect and any possible implementation manner in the first aspect, or execute the methods described in the second aspect and any possible implementation manner in the second aspect.
[0044] In a fourth aspect, an embodiment of the present application provides a chip system, which is applied to an electronic device. The chip system includes one or more processors, and the processors are used to call computer instructions to cause the electronic device to execute the methods described in the first aspect and any possible implementation manner in the first aspect, or execute the methods described in the second aspect and any possible implementation manner in the second aspect.
[0045] In a fifth aspect, the present application provides a computer-readable storage medium, including a computer program. When the computer program runs on an electronic device, the electronic device is caused to execute the methods described in the first aspect and any possible implementation manner in the first aspect, or execute the methods described in the second aspect and any possible implementation manner in the second aspect.
[0046] Sixth aspect, the present application provides a computer program product including instructions. When the computer program product runs on an electronic device, the electronic device is caused to execute the method described in the first aspect and any possible implementation manner in the first aspect, or execute the method described in the second aspect and any possible implementation manner in the second aspect.
[0047] It can be understood 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 execute the method provided in the present application. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1A is a schematic structural diagram of network 10 provided by an embodiment of the present application;
[0049] Figure 1B is a schematic structural diagram of network 10 in another scenario provided by an embodiment of the present application;
[0050] Figures 2A - 2C is a schematic diagram of a set of user interfaces for configuring a network for printer 202 through electronic device 201 provided by an embodiment of the present application;
[0051] Figure 3 is a flowchart of configuring a network for printer 202 through electronic device 201 provided by an embodiment of the present application;
[0052] Figures 4A - 4G is a set of user interfaces for controlling printer 202 to execute a printing task through electronic device 201 provided by an embodiment of the present application;
[0053] Figures 5A - 5J is another set of user interfaces for controlling printer 202 to execute a printing task through electronic device 201 provided in an embodiment of the present application;
[0054] Figure 6 Schematic software architecture diagram of an electronic device 201 provided by an embodiment of the present application;
[0055] Figure 7A is a flowchart of controlling a target printer to execute a printing task by an electronic device 201 provided by an embodiment of the present application;
[0056] Figure 7B is a flowchart of a specific process of loading a third-party protocol package provided by an embodiment of the present application;
[0057] Figure 8 is a schematic structural diagram of an electronic device 201 provided by an embodiment of the present application;
[0058] Figure 9 It is a schematic structural diagram of the printer 202 provided by an embodiment of the present application. Detailed implementation manners
[0059] 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.
[0060] Now, more and more electronic devices support network access to meet the remote control needs of users.
[0061] Taking a printer as an example, with the development of printing requirements, such as printing children's homework, paintings, etc., printers are increasingly set to support access to a home local area network, especially a home local area network based on high-fidelity wireless communication (Wi-Fi), that is, it supports network configuration through Wi-Fi for users to remotely control the printer to execute printing tasks at any time and place through mobile terminals such as mobile phones and tablets around them.
[0062] Mopria is a type of mobile printing standard. The Mopria protocol packet is a communication program code used to provide Mopria communication capabilities. Mobile terminals such as mobile phones and tablets are usually pre-installed with the Mopria protocol packet and can control the printer to execute printing tasks through the Mopria protocol packet.
[0063] However, before controlling the printer to execute a printing task through the Mopria protocol packet, the user first needs to configure the network for the printer. The Mopria protocol packet does not support configuring the network for the printer. At this time, each printer manufacturer needs to provide its own protocol packet for network configuration (hereinafter referred to as the network configuration protocol packet) for users to configure the network for the printer through mobile terminals such as mobile phones and tablets, so as to support users to control the printer to execute printing tasks through the mobile terminal.
[0064] In some technologies, after purchasing a printer, the user can download a specific application program provided by the printer manufacturer in the mobile terminal. The network configuration protocol packet is pre-installed in the application program. The mobile terminal can configure the network for the printer through the above application program and the network configuration protocol packet.
[0065] After successful network configuration, the mobile terminal can control the printer to execute printing tasks through the Mopria protocol packet.
[0066] For some printer manufacturers, on the basis of network configuration, they will also continue to develop program codes for controlling printers to execute printing tasks. At this time, the third-party protocol package provided by the printer manufacturer can be used not only to configure the network for the printer, but also to control the printer to execute printing tasks. The protocol package that can be used both to configure the network for the printer and to control the printer to execute printing tasks provided by the printer manufacturer can be called a printing protocol package.
[0067] In the scenario where the printer manufacturer provides a printing protocol package, after the network configuration operation is completed through the printing protocol package, preferably, the mobile terminal can continue to control the printer to execute printing tasks through the above-mentioned printing protocol package, without the need to use the Mopria protocol package to control the printer to execute printing tasks.
[0068] The method of downloading a specific application program to configure the network for the printer and control the printer to execute printing tasks through the specific application program is not only not conducive to saving the storage space of the mobile terminal, but also requires cumbersome user operations, especially in the scenario where the user purchases multiple printers from different manufacturers at the same time, or switches from a printer of one manufacturer to a printer of another manufacturer.
[0069] In view of this, an embodiment of the present application provides a device control method.
[0070] This method can be applied to an electronic device 201 and a printer 202. The electronic device 201 is pre-installed with a Mopria protocol package and can control the printer to execute printing tasks through the Mopria protocol package. Preferably, the electronic device 201 is a mobile terminal such as a mobile phone or a tablet computer. The specific type of the electronic device 201 is not particularly limited in the embodiment of the present application. The printer 202 is a printer to be network-configured.
[0071] When implementing the method provided by the present application, after the printer 202 is powered on, the printer 202 can broadcast a probe frame. The probe frame can carry the product identifier (PrdID) of the printer 202. Preferably, printers of the same model provided by a printer manufacturer can share a product identifier. The electronic device 201 can scan and obtain the above-mentioned probe frame, and then obtain the product identifier of the printer 202. The electronic device 201 can determine the protocol type of the printer 202 through the above product identifier. Then, the electronic device 201 can obtain a third-party protocol package that matches the protocol type of the printer 202, and then configure the network for the printer 202 through the above third-party protocol package. After the network configuration is successful, the electronic device 201 can control the printer 202 to execute printing tasks through the above third-party protocol package or the pre-installed Mopria protocol package.
[0072] In this way, the user does not need to manually download a specific application, nor does the user need to configure the network for the printer and control the printer to execute a printing task through the above specific application, which is beneficial to saving the storage space of the electronic device 201 and can also save the user's operation, providing convenience for the user to control the printer 202 through the electronic device 201.
[0073] Figure 1A It is a schematic structural diagram of a network 10 provided by an embodiment of the present application.
[0074] As Figure 1A shown, the network 10 includes an access point (AP) device 100 (denoted as AP100).
[0075] AP100 is connected to an access controller (AC) and a broadband remote access server (BRAS) by means of wired transmission, and obtains the Internet protocol (IP) address of the AP through the dynamic host configuration protocol (DHCP), and then accesses the Internet.
[0076] The terminal device can establish a connection with AP100 by means of wired or wireless, and then access the Internet through AP100 to obtain network services. Preferably, AP100 is a Wi-Fi-based AP.
[0077] AP100 includes configuration information such as a name and a password. The name is used to identify the AP. The password is used for device authentication. When connecting to AP100, the terminal device applying for connection needs to provide an access password to AP100. When the access password provided by the terminal device matches the password preset in AP100, AP100 will allow the terminal device to access and provide network services to the terminal device. Otherwise, AP100 will reject the connection request of the terminal device. At this time, the terminal device cannot obtain network services through AP100.
[0078] As Figure 1A shown, the electronic device 201 has established a communication connection with AP100 and can obtain network services through AP100. Preferably, the above connection is a wireless connection. The printer 202 is a newly purchased device of the user that has not been configured with a network. As Figure 1A shown, the printer 202 has not been connected to AP100.
[0079] After purchasing the printer 202, the user can connect the printer 202 to a power source. The process of connecting the printer 202 to a power source is also called the power-on process. After the printer 202 is powered on, the printer 202 can broadcast a probe frame. The device information of the printer 202 can be carried in the probe frame of the printer 202. The above device information includes but is not limited to a device identifier (denoted as DevID) and a product identifier (denoted as PrdID). Among them, the device identifier is used to uniquely identify an electronic device, such as a MAC address.
[0080] The electronic device 201 can periodically obtain probe frames in the environment. At this time, the electronic device 201 can obtain the probe frame of the printer 202, and then obtain the product identifier of the printer 202 from the above probe frame. Based on the above product identifier, the electronic device 201 can determine the protocol type of the printer 202.
[0081] In one embodiment, as Figure 1A shown, the server A is connected to the AP100 through the Internet. The server A is also called the developer platform. The matching relationship between the printer product identifier and the protocol type is recorded in the developer platform. After obtaining the product identifier of the printer 202, the electronic device 201 can send the above product identifier to the developer platform. The developer platform can query the protocol type corresponding to the above product identifier. This protocol type is the protocol type of the printer 202. The developer platform can send the above protocol type back to the electronic device 201. Thus, the electronic device 201 can determine the protocol type of the printer 202, that is, determine what protocol should be used to communicate with the printer 202, configure the network for the printer 202, and control the printer 202 to execute a printing task.
[0082] The developer platform also stores a third-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 third-party protocol package from the developer platform. The third-party protocol package corresponding to the protocol type of the printer 202 can be called the target protocol package.
[0083] In some embodiments, the third-party protocol package provided by the printer manufacturer can also be stored on other servers. A protocol package configuration file can be preset in the electronic device 201. This configuration file records the download addresses of various third-party protocol packages. After determining the target protocol package according to the protocol type of the printer 202, the electronic device 201 queries the above configuration file, obtains the download address of the target protocol package, and then accesses the server corresponding to the above address to download the target protocol package.
[0084] After obtaining the target protocol package, the electronic device 201 can send the configuration information of the currently connected local area network AP100 to the printer 202 through the above target protocol package, control the printer 202 to access the AP100, and complete the network configuration task of the printer 202.
[0085] In one embodiment, the matching relationship between the printer product identifier and the protocol type can also be preset in the electronic device 201. At this time, after obtaining the product identifier of the printer 202, the electronic device 201 can determine the protocol type of the printer 202 through the preset matching relationship, and then determine the target protocol packet, without sending the product identifier of the printer 202 to the developer platform to determine the protocol type of the printer 202.
[0086] The electronic device 201 can determine the target file that the user wants to print according to the user operation.
[0087] After successful network configuration, the electronic device 201 can send the target file to the printer 202 through the target protocol packet or the preset Mopria protocol packet to control the printer 202 to print the target file.
[0088] Among them, if the target protocol packet is a network configuration protocol packet (only used to configure the network for the printer 202), the electronic device 201 needs to send the print task and the target file to the printer 202 through the preset Mopria protocol packet to control the printer 202 to print the target file. If the target protocol packet provided by the printer manufacturer is a print protocol packet (which can be used to configure the network for the printer and also control the printer to execute the print task), the electronic device 201 can continue to send the print task and the target file to the printer 202 through the target protocol packet to control the printer 202 to print the target file.
[0089] According to Figure 1A the method described above, the electronic device 201 can successively configure the network for printers provided by multiple different manufacturers, and there is no need to download the specific application programs provided by each manufacturer separately, which not only saves the storage space of the electronic device 201 but also saves the user operation, and is beneficial to improving the user's printing experience.
[0090] Referring to Figure 1B , exemplarily, the electronic device 201 can also configure the network for the printer 203 and the printer 204 to control the printer 203 and the printer 204 to access the local area network AP100. Among them, the protocol types of any two printers can be the same or different.
[0091] Exemplarily, the printer 202 (the first printer) can use the protocol X1 (the third protocol), the printer 203 (the second printer) can use the protocol X2 (the second protocol), and the printer 204 (the third printer) can use the protocol X2 (the fifth protocol). Generally, the protocol types of printers from different manufacturers are different. The protocol types of printers from the same manufacturer are the same. Of course, the protocol types of different models of printers from the same manufacturer can also be different.
[0092] Assume that the tripartite protocol packet X1 provided by manufacturer A and matching protocol X1 is a network configuration protocol packet (only for network configuration), and the tripartite protocol packet X2 provided by manufacturer B and matching protocol X2 is a printing protocol packet (for network configuration and printing). After the printer 202 is successfully network-configured, the printer 202 needs to control the printer 202 to execute a printing task through the preset Mopria protocol packet; after the printer 203 / printer 204 is successfully network-configured, the printer 203 / printer 204 can continue to control the printer 202 to execute a printing task through the tripartite protocol packet X2.
[0093] In Figure 1B In the scenario shown, the electronic device 201 can determine the target printer that the user wants to use according to the user operation, such as the printer 202, the printer 203, or the printer 204. Then, the electronic device 201 can determine the target protocol packet that matches the target printer. When the target protocol packet is the Mopria protocol packet, the electronic device 201 sends the target file selected by the user to be printed to the target printer through the preset Mopria protocol packet, controlling the target printer to print the target file. When the target protocol packet is a tripartite protocol packet, the electronic device 201 can first load the tripartite protocol packet. After the loading is completed, the electronic device 201 can send the target file to the target printer through the above tripartite protocol packet, controlling the target printer to print the target file.
[0094] Exemplarily, when the user selects the printer 202 as the target printer to execute the printing task, the electronic device 201 can determine that the target protocol packet is the Mopria protocol packet. Then, the electronic device 201 sends the target file selected by the user to be printed to the printer 202 through the Mopria protocol packet, controlling the printer 202 to print the target file. When the user selects the printer 203 as the target printer to execute the printing task, the electronic device 201 can determine that the target protocol packet is the tripartite protocol packet X2. Then, the electronic device 201 sends the target file selected by the user to be printed to the printer 203 through the tripartite protocol packet X2, controlling the printer 203 to print the target file.
[0095] Figures 2A - 2C FIGs. are schematic diagrams of a user interface for configuring a network for the printer 202 by the electronic device 201 according to an embodiment of the present application.
[0096] Taking the printer 202 as an example, after the printer 202 broadcasts a probe frame, the electronic device 201 can detect the probe frame of the printer 202. When the electronic device 201 detects the probe frame of the printer 202, it means that the electronic device 201 discovers the printer 202.
[0097] The detection frame of the printer 202 carries the product identifier (PrdID) of the printer 202. The electronic device 201 can obtain the product identifier of the printer 202 through the detection frame of the printer 202. Furthermore, the electronic device 201 can determine the protocol type of the printer 202, such as protocol X1. Refer to Figure 1A For the introduction, the electronic device 201 can query the developer platform to determine the protocol type of the printer 202, or the electronic device 201 can determine the protocol type of the printer 202 by itself through the pre-set matching relationship, which will not be elaborated here.
[0098] Then, the electronic device 201 can obtain the target protocol packet that matches the protocol type of the printer 202, such as target protocol packet X1. Refer to Figure 1A For the introduction, the electronic device 201 can download the target protocol packet from the developer platform or other servers. In other embodiments, multiple third-party protocol packets can also be pre-set in the electronic device 201. The above multiple third-party protocol packets include the target protocol packet that matches the protocol type of the printer 202. At this time, the electronic device 201 can obtain the target protocol packet from the local memory.
[0099] Refer to Figure 2A , after discovering the printer 202, the electronic device 201 can display the card 211.
[0100] The device information of the printer 202 is displayed in the card 211, such as the device name "H-P1 Printer" and the device icon 212. The above device information can be obtained through the detection frame. In one implementation, the detection frame broadcast by the printer 202 directly carries device information such as the device name and the device icon. The electronic device 201 can directly obtain the device information of the printer 202 from the above detection frame. In another implementation, the electronic device 201 can determine the device information of the printer 202 through the product identifier of the printer 202. Exemplarily, the matching relationship between the product identifier and the device information is stored in the developer platform, other servers, or the electronic device 201. The electronic device 201 can determine the device information of the printer 202 through the matching relationship pre-set in the developer platform, other servers, or itself. Through the card 211, the user can quickly and intuitively perceive that the electronic device 201 has discovered a new device, and can judge whether the new device is the newly purchased printer 202 waiting to be configured with a network according to the device information displayed in the card 211.
[0101] The card 211 also includes a control 213. When the user determines that the new device discovered by the electronic device 201 is the printer 202 waiting to be configured with a network, the user can click the control 213. After detecting the user operation on the control 213, the electronic device 201 can display Figure 2B the user interface described above.
[0102] AsFigure 2B As shown, the electronic device 201 can display a card 221. A prompt message is displayed on the card 221, such as "Do you want to synchronize the configuration information (Wi-Fi name and password) of the local area network connected to the electronic device 201 to the printer 202 for networking with one key?", which is used to ask the user whether to allow the electronic device 201 to send the configuration information (including name and password) of the currently connected local area network AP100 to the printer 202.
[0103] The card 221 also includes a control 222. The user can grant the electronic device 201 the permission to synchronize the configuration information of the AP100 to the printer 202 through the control 222. After detecting the user operation on the control 222, the electronic device 201 can read the configuration information such as the name and password of the currently connected local area network AP100 from the system settings, and then send the above configuration information to the printer 202 through the target protocol packet.
[0104] Refer to Figure 2C , after the printer 202 successfully accesses the AP100, the electronic device 201 can display a card 231 to prompt the user that the printer 202 has been successfully configured with the network.
[0105] After detecting the user operation on the above Figure 2A control 213, the electronic device 201 can start the smart space application program (hereinafter referred to as smart space, also known as the first application). The smart space is used to manage other devices in the local area network, such as devices like TVs and speakers in a home local area network. As Figure 2B shown, the electronic device 201 can also display the main interface 29 of the smart space. After the printer 202 successfully accesses the AP100, refer to Figure 2C , the smart space can display an icon 232 (the first icon) on the main interface 29. The icon 232 corresponds to the printer 202. At this time, the user can also further confirm that the printer 202 has successfully accessed the local area network AP100 through the icon 232.
[0106] Implement Figures 2A - 2C the network configuration method shown, mobile terminals such as mobile phones and tablets (i.e., the electronic device 201) can automatically obtain the target protocol packet matching the printer with the product identifier, and send the network configuration information to the printer through the target protocol packet, without the user having to download the specific application program provided by the printer manufacturer additionally. This not only reduces the user operation, provides convenience for the user to configure the printer network, but also helps to save the storage space of the electronic device 201.
[0107] Among them, during the network configuration process, the user does not need to manually select the local area network and input the local area network password, further saving the user operation and providing convenience for the user to configure the printer network.
[0108] In some embodiments, the electronic device 201 may also display multiple network names. One network name corresponds to a local area network scanned by the electronic device 201. The electronic device 201 may determine a target local area network according to the operation of any one of the multiple network names by the user, and the user may manually input the password of the local area network. Then, the electronic device may determine the password of the target local area network according to the input operation of the user. Then, similarly, the electronic device 201 may send configuration information such as the network name and password of the target local area network to the printer 202 through the target protocol packet to control the printer 202 to successfully access the target local area network.
[0109] Figure 3 It is a flowchart of configuring a network for a printer 202 by an electronic device 201 provided by an embodiment of the present application.
[0110] S301: Establish a protocol database to record the protocol type of the printer.
[0111] Table 1 is a data structure provided by an embodiment of the present application.
[0112] Table 1
[0113] Product Identification Product Name Product Icon Protocol Type PrdID1 H - P1 H - P1.img X1 PrdID5 ABC - 01 ABC - 01.img X2 …… …… …… ……
[0114] The developer platform may establish a printer protocol database as shown in Table 1 to record relevant information such as the product identifier, product name, product icon, and protocol type of the printer. The above protocol database is also called a protocol shelf.
[0115] The product name usually indicates the provider and model of the product. For example, in "H-P1", "H" may indicate the provider and "P1" may indicate the model. Printers of one model provided by a printer manufacturer may share a product identifier. Further, generally, all models of printers provided by a printer manufacturer use the same printing protocol. Of course, optionally, different models of printers provided by a printer manufacturer may also use different printing protocols.
[0116] The developer platform may update the printer protocol database in real time. The above update includes updating the relevant information of existing printers and adding new printers and their relevant information.
[0117] For example, when PrdID1 ("H-P1" printer) changes to protocol Y1, the developer platform may update the protocol type of PrdID1 to protocol Y1 in the printer protocol database shown in Table 1 as follows:
[0118] PrdID1 H - P1 H - P1.img Y1
[0119] For another example, after the manufacturer "ABC" newly launches a printer using protocol X2, the developer platform can add a new record to the printer protocol database shown in Table 1 as follows:
[0120] PrdID8 ABC - 02 ABC - 02.img X2
[0121] Among them, when the updated or newly added content involves a new protocol type, the developer platform can also store the corresponding tripartite protocol package of the new protocol type.
[0122] S303: The printer 202 is powered on.
[0123] S304: The printer 202 broadcasts a probe frame (DevID1, PrdID1).
[0124] The probe frame is a piece of data in a specific format. The probe frame broadcast by the printer 202 can carry the device identifier (DevID) of the printer 202, which is used to uniquely identify the printer 202, such as DevID1. In the embodiments of the present application, the probe frame can also carry the product identifier of the printer 202, which is used to indicate the manufacturer and model of the printer 202, such as PrdID1.
[0125] S305: Obtain the device identifier DevID1 and product identifier PrdID1 of the printer 202 through the probe frame.
[0126] After the printer 202 broadcasts the probe frame, the electronic device 201 can obtain the probe frame of the printer 202 by scanning. Furthermore, the electronic device 201 can obtain the device identifier DevID1 and product identifier PrdID1 of the printer 202 through the above probe frame. At this time, the printer 202 can be called a newly discovered device by the electronic device 201, that is, a new device.
[0127] S307: Request to obtain the product information of the new device (PrdID1).
[0128] The electronic device 201 can send a request to obtain product information to the developer platform. At this time, the product identifier PrdID1 of the printer 202 can be carried in the request.
[0129] S308: Return the product information of the new device (product name, product icon, protocol type X1).
[0130] In response to the above request, the developer platform can search for the product identifier PrdID1 carried in the above request in the protocol database shown in Table 1. After finding the above product identifier, the developer platform can obtain product information such as the product name, product icon, and protocol type corresponding to the above product identifier. Then, the developer platform can transmit the above information back to the electronic device 201. The electronic device 201 can determine the product name, product icon, protocol type, etc. of the new device (i.e., the printer 202). Exemplarily, the protocol type of the printer 202 can be X1 (the first type), that is, the printer 202 uses protocol X1.
[0131] In some embodiments, a protocol shelf table can be set in the electronic device 201. After determining the protocol type of each printer, the electronic device 201 can record the product identifier and protocol type of the printer in the protocol shelf table. In this way, after executing S305, the electronic device 201 can also first check the protocol shelf table. If the product identifier of the new device is recorded in the protocol shelf table, the electronic device 201 can directly determine the product information of the new device according to the above protocol shelf table without obtaining the product information of the new device from the developer platform.
[0132] S309: Display a prompt card.
[0133] After obtaining the product information of the new device, the electronic device 201 can generate a prompt card as shown in Figure 2A the card 211, and display the product information such as the product name and product icon of the new device to the user, so that the user can confirm whether the new device discovered by the electronic device 201 is the printer 202 that is currently performing the network configuration operation.
[0134] S310: Detect a user operation for connecting to the new device (printer 202).
[0135] As Figure 2A shown, the card 211 may further include a control 213. The electronic device 201 can detect a user operation on the control 213, such as a click operation, through devices such as a display screen and a touch sensor. The above operation is the user operation for connecting to the new device.
[0136] S311: Start the smart space (DevID1, PrdID1, X1).
[0137] In response to the user operation for connecting to the new device, the electronic device 201 can send indication information to the smart space to trigger the start of the smart space. The above indication information may include information such as the device identifier DevID1, product identifier PrdID1, and protocol type X1 of the new device. After the smart space is started, the smart space can start to obtain local area network configuration information (S312 - S314), and download the target protocol package (S315 - S316).
[0138] S312: Display the authorization card.
[0139] As Figure 2B shown, after the intelligent space is started, the intelligent space can control the display of card 221. Card 221 is also called the authorization card. The prompt information asking the user whether to allow the electronic device 201 to synchronize the configuration information of the currently connected AP100 to the printer 202 is displayed on card 221.
[0140] S313: Detect the user operation to confirm automatic network configuration.
[0141] As Figure 2B shown, card 221 also includes a control 222. Similarly, the electronic device 201 can detect the user operation on the control 222 in card 221 through devices such as a display screen and a touch sensor. The above operation is the user operation to confirm automatic network configuration. The intelligent space can perceive the above user operation according to the event notification of the electronic device 201. In response to the above operation, the intelligent space can confirm that it has obtained the automatic network configuration permission, that is, the user allows the intelligent space to obtain the local area network configuration information by itself and send it to the new device for network configuration.
[0142] S314: Obtain the local area network configuration information.
[0143] In one implementation, the intelligent space can be set as an application trusted by the system. At this time, the intelligent space can directly send a request to obtain the local area network configuration information to the system settings module and obtain the configuration information of the currently connected local area network from the system settings module.
[0144] In another implementation, the intelligent space can be set as an application not trusted by the system. At this time, the intelligent space cannot directly obtain the local area network configuration information from the system settings module. Therefore, the intelligent space can obtain the local area network configuration information from the system settings module through other system-trusted applications.
[0145] Taking Figure 1A the network 10 shown as an example, the local area network currently connected by the electronic device 201 is AP100. At this time, the intelligent space can obtain the configuration information of AP100.
[0146] S315: Obtain the target protocol packet (X1).
[0147] The intelligent space can determine the target protocol packet that matches the protocol type of the new device according to the protocol type of the new device. For example, when the new device uses protocol X1, the intelligent space can determine the target protocol packet X1 that matches protocol X1.
[0148] The intelligent space stores a protocol package configuration file. The download addresses of various third-party protocol packages are recorded in the protocol package configuration file. After determining the target protocol package X1, the intelligent space can query the protocol package configuration file to determine the download address of the target protocol package X1, and then download the target protocol package X1 from the corresponding server.
[0149] Preferably, after obtaining each third-party protocol package, the electronic device 201 can record the local storage address of the third-party protocol package in the protocol shelf table. After determining the target protocol package X1, the electronic device 201 can 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 can directly obtain the target protocol package X1 from the local memory without having to download the target protocol package X1 again.
[0150] S316: Use the target protocol package X1 to send the local area network configuration information.
[0151] After obtaining the target protocol package (such as the target protocol package X1), the intelligent space can load the target protocol package. Loading means writing the program code stored in the local memory into the memory. After loading the target protocol package, the intelligent space can write the aforementioned obtained local area network configuration information into the target protocol package. Then, subsequently, the target protocol package can send the local area network configuration information to the printer 202 to be configured according to the communication method and instruction format agreed upon by its own protocol. The above communication methods include but are not limited to AP broadcast, Bluetooth Low Energy (BLE) transmission, and Near Field Communication (NFC) transmission.
[0152] S317: Configure the network according to the configuration information and access the local area network.
[0153] After the electronic device 201 performs the operation shown in S316, the printer 202 can receive the local area network configuration information sent by the electronic device 201, such as the configuration information of the AP100 shown in Figure 1A and then access the AP100 to complete the network configuration task.
[0154] After successful network configuration, the printer 202 can send a network configuration success notification back to the intelligent space through the target protocol package. Refer to Figure 2C After receiving the above notification, the intelligent space can display a network configuration success card to prompt the user that the printer 202 has been successfully networked.
[0155] After successful network configuration, 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.
[0156] Figures 4A - 4G This is a set of user interfaces provided by an embodiment of the present application for controlling a printer to execute a printing task through an electronic device 201.
[0157] Figure 4A This is the desktop 40 of the electronic device 201 provided by an embodiment of the present application. As Figure 4A shown, multiple application icons can be displayed on the desktop 40 of the electronic device 201, such as a weather application icon, an email application icon, a browser application icon, and so on. In an embodiment of the present application, the electronic device 201 is also installed with a smart space. At this time, Figure 4A the smart space application icon 311 (abbreviated as icon 311) is further included in the shown desktop 40.
[0158] The electronic device 201 can detect a user operation acting on the icon 311, such as a click operation. In response to the above operation, the electronic device 201 can display Figure 4B the main interface 29 of the smart space shown. Figure 4B The main interface 29 of the smart space shown 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 (the second icon), and icon 234 (the third icon). Icon 233 corresponds to the printer 203 in the local area network AP100. Icon 234 corresponds to the printer 204 in the local area network AP100. It can be understood that more electronic devices can also be included in the local area network AP100. Correspondingly, icons that are respectively matched with the above more electronic devices can also be displayed in the main interface 29.
[0159] In one embodiment, the electronic device 201 can discover the printers 203 and 204 according to the method shown in Figures 2A - 2C and then connect to the printers 203 and 204.
[0160] In another embodiment, the electronic device 201 can also add the printers 203 and 204 in the smart space. Exemplarily, the electronic device 201 can detect a user operation on the above Figure 2C central control component 235. In response to the above operation, the electronic device 201 can scan for devices in the nearby environment. Taking the printer 203 as an example, referring to the introduction of S303 - S305 in Figure 3 , the electronic device 201 can discover the printer 203. Then, the electronic device 201 can obtain a protocol packet that matches the protocol type of the printer 203 and the configuration information of the current local area network, and send the configuration information of the current local area network to the printer 203 through the above - matched protocol packet to control the printer 203 to access the local area network where the electronic device 201 is located. After the printer 203 accesses the local area network where the electronic device 201 is located, as Figure 4BAs shown, the electronic device 201 can display an icon 233 corresponding to the printer 203. Similarly, when obtaining the configuration information of the current local area network, the electronic device 201 can directly read it from the system settings according to the user's authorized operation, or determine the local area network configuration information according to manual input.
[0161] Exemplarily, as Figure 4B shown, the electronic device 201 can detect a user operation acting on the icon 232. In response to the above operation, the electronic device 201 can display Figure 4C the user interface shown. Multiple controls can be displayed in this interface. One control corresponds to a type of printing function, such as document printing, picture printing, and so on.
[0162] As Figure 4C shown, the electronic device 201 can detect a user operation acting on the picture printing control. In response to the above operation, the electronic device 201 can display the pictures saved locally. As Figure 4D shown, the user can click on the picture to be printed, such as picture 412. In response to the above operation, the electronic device 201 can display a print parameter setting interface 42. Figure 4E The interface shown can be referred to as the print parameter setting interface 42. The user can set print parameters such as the number of copies, single / double-sided, paper size, color, etc. in the above interface.
[0163] After the settings are completed, the electronic device 201 can detect a user operation acting on the start printing control 421. In response to the above operation, the electronic device 201 can send the picture 412 and the print parameters set by the user to the printer 202 corresponding to the icon 232. Subsequently, the printer 202 can print the picture 412 according to the above print parameters. Referring to Figures 4F - 4G , during the printing process, the printer 202 can return the printing progress to the electronic device 201 for the user to perceive in real time.
[0164] In the scenario where the target protocol packet X1 corresponding to the printer 202 is a network configuration protocol packet (only for network configuration), after detecting Figures 4B - 4E the user operation of selecting the printer 202 to execute the printing task, the electronic device 201 can send the picture 412 and the print parameters set by the user to the printer 202 through a pre-set Mopria protocol packet.
[0165] In Figure 4BFor the user interface shown, the electronic device 201 can also detect a user operation acting 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 packet X2 corresponding to the printer 203 is a printing protocol packet (for network configuration and printing), the electronic device 201 can load the target protocol packet X2 and send the target file (such as the picture 412) selected by the user to be printed and the printing parameters set by the user ( Figure 4E the printing parameters shown) to the printer 203.
[0166] Figures 5A - 5J is another set of user interfaces provided in the embodiments of the present application for controlling the printer to execute a printing task through the electronic device 201.
[0167] As Figure 5A shown, the electronic device 201 can detect a downward sliding operation acting on the screen. In response to this operation, the electronic device 201 can display a control center interface 50 as shown in Figure 5B . As shown in Figure 5B , the control center interface 50 can include one or more function controls (for example, a wireless local area network (WLAN) switch control, a Bluetooth switch control, a low power mode switch control, a brightness adjustment control, a sound adjustment control) and a smart interconnection control card 501.
[0168] The electronic device 201 can receive an operation (such as a click) of the user on the smart interconnection control card 501. In response to this operation, the electronic device 201 can display a smart interconnection interface 51 as shown in Figure 5C .
[0169] As Figure 5C shown, the smart interconnection interface 51 can include a device icon 511 of the electronic device 201.
[0170] During the process of displaying the smart interconnection interface 51 shown in Figure 5C , the electronic device 201 can search for nearby connected devices. As shown in Figure 5D , after the electronic device 201 configures the network for the printer 202 and controls the printer 202 to access the local area network AP100, it can display a device icon 512 (the first icon) of the printer 202 on the smart interconnection interface 51. Similarly, after the electronic device 201 configures the network for the printers 203 and 204 and controls the printers 203 and 204 to access the local area network AP100, it can display a device icon 513 (the second icon) of the printer 203 and a device icon 517 (the third icon) of the printer 204 on the smart interconnection interface 51. Figure 5D The smart interconnection interface 51 shown can be referred to as the first interface.
[0171] As Figure 5D , Figure 5E shown, the electronic device 201 can detect a drag operation in which the user drags the device icon 512 to the area where the device icon 511 is located. In response to this drag operation, as Figure 5F shown, the electronic device 201 can display a floating control 514 (the 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 operations of switching desktops and launching applications, the floating control 514 is floatingly displayed on top of other interfaces. The display position of the floating control 514 remains unchanged.
[0172] As Figure 5G shown, when displaying the picture browsing interface 52 (the second interface), the electronic device 201 can display the floating control 514 on top of the picture browsing interface 52. The user operation that controls the display of the picture browsing interface 52 can be referred to as the second operation. Among them, the picture browsing interface 52 may include a picture 521 (the 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 click, also referred to as the third operation). Referring to Figure 5H , in response to this operation, the electronic device 201 can expand the floating control 514.
[0173] The expanded floating control 514 may include controls 515 and 516. When a user operation on the control 515 is detected, the electronic device 201 can display Figure 4E the print parameter setting interface 42 shown. The electronic device 201 can receive the print parameters set by the user through the above print parameter setting interface 42. When a user operation (the first operation) on the control 516 is detected, the electronic device 201 can send the currently displayed picture 521 and the print parameters set by the user (for example, 5 copies, single-sided printing, paper size A4, 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 does not set the print parameters, the electronic device 201 can send the currently displayed picture 521 and the default print parameters to the printer 202.
[0174] During the process of the printer 202 printing the picture 521 with the target print parameters, the printer 202 can send the print status to the electronic device 201. As Figure 5I , Figure 5J shown, after receiving the print status, the electronic device 201 can display prompt messages in the floating control 514, such as "Printing page 1 / 5", "Printing completed!", etc., to prompt the user about the printing process.
[0175] In accordance withFigure 5D , Figure 5E After the drag operation shown displays the floating control 514, the electronic device 201 may start a timer. Preferably, the timer counts for 10 seconds. After the timer ends, the electronic device 201 may close the floating control 514. Thereafter, if the user needs to use the printer again, the user may Figures 5A - 5D The operation shown is to open a floating control corresponding to the printer again, and control the printer to print the target file through the control.
[0176] Figure 6 A schematic diagram of a software architecture of an electronic device 201 provided in an embodiment of the present application.
[0177] The software system of the electronic device 201 may adopt a layered architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 201.
[0178] The layered architecture divides the software into several layers. The layers communicate with each other through software interfaces. In some embodiments, the Android system includes four layers, from top to bottom, namely, the application layer (i.e., the application layer), the application framework layer (i.e., the framework layer), the Android runtime (Android runtime) and the system library, and the kernel layer. Figure 6 Only the application layer and the framework layer are shown.
[0179] The application layer includes some application packages, such as smart space, reader, printing assistant, smart interconnection, etc. The above applications can call the printing service of the framework layer to discover and control the printer to perform printing operations. Any of the above applications can be called the first application.
[0180] like Figure 6 As shown, 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 the upper-layer application with a service for discovering devices (discovery service); the configuration interface can be used to provide the upper-layer application with a service for modifying configuration information (configuration service); the printing interface can be used to provide the upper-layer application with a service for controlling the printer to print files (file printing service); the scanning interface can be used to provide the upper-layer application with a service for controlling the printer to scan files (scanning service); the status registration interface is used to provide the upper-layer application with a service for returning the progress of the printing task (status callback service). Here, the configuration information in the configuration service specifically refers to the configuration information of the protocol shelf, which will be specifically introduced in subsequent embodiments and will not be expanded here.
[0181] The upper-layer application can call the discovery module through the discovery interface to discover printers in the environment.
[0182] Specifically, the discovery module includes sub-modules such as Multicast DNS (mDNS) discovery and AP discovery. The mDNS discovery can use mDNS technology to obtain other electronic devices within the local area network from the AP 100, and then discover other electronic devices. The AP discovery can directly discover other electronic devices in the near-field environment based on Wi-Fi broadcast technology. After detecting that the upper-layer application calls the discovery interface, the discovery module can sequentially perform mDNS discovery and AP discovery to discover printers in the environment.
[0183] Reference Figures 4A - 4B , when the smart space is enabled, the smart space can call the discovery interface to query for printers in the local area network or the near-field environment. After discovering one or more printers, the smart space can display device icons of the above-mentioned one or more printers, such as icon 232, icon 233, and icon 234, for the user to select.
[0184] Reference Figures 5C - 5D , when entering the smart interconnection, the smart interconnection can call the discovery interface to query for printers in the local area network or the near-field environment. Similarly, after discovering one or more printers, the smart space can display device icons of the above-mentioned one or more printers, such as device icon 512, for the user to select.
[0185] Then, the upper-layer application can determine the target printer that the user wants to use according to the user operation. For example Figure 4B as shown, the smart space can detect the user operation on icon 232 and determine the target printer 202 according to the above operation; or for another example Figures 5C - 5D as shown, the smart interconnection can detect the user operation of dragging device icon 512 to device icon 511 and determine the target printer 202 according to the above operation.
[0186] The upper-layer application can also determine the target file and print parameters that the user wants to send to the target printer for printing according to the user operation, and then create a print task. Exemplarily, the smart space can determine the target file and print parameters through the user operation shown in reference Figures 4C - 4E and create a print task; or for another example, the smart interconnection can determine the target file and print parameters through the user operation shown in Figures 5F - 5G and create a print task.
[0187] After creating the 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 according to the device identifier carried in the print task. Then, the print service can determine the target protocol packet that matches the target printer.
[0188] The printing service includes a protocol shelf. The protocol shelf can determine the target printer based on the device identifier carried in the printing task of the target printer, as well as the target protocol package that matches the target printer.
[0189] The protocol shelf also includes a configuration management module, a storage management module, and a loading and invocation module. The configuration management module includes a protocol package configuration file. The upper-layer application can update the protocol package configuration file at any time through the configuration interface. The storage management module can be used to manage the third-party protocol packages stored in the local memory. The loading and invocation module can obtain the storage address of the target protocol package from the storage management module, and then read and load the target protocol package.
[0190] After determining the target protocol package, the protocol shelf can 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 printer 202), the protocol shelf can confirm to use the preset Mopria protocol package to send the printing 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 also control the printer to execute the printing task), the electronic device 201 can load the target protocol package and use the target protocol package to send the printing task to the target printer.
[0191] The protocol shelf can obtain the storage address of the target protocol package through the storage management module. Then, the loading and invocation module can read and load the target protocol package according to the above address.
[0192] In some scenarios, the target protocol package downloaded during the network configuration process may also be deleted due to some operations, such as a memory cleaning operation. At this time, the storage management module can return that it is not stored locally to the protocol shelf. At this time, 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.
[0193] As Figure 6 shown, the Mopria protocol package can include a status acquisition module, a connection module, a printing module, and a scanning module. Among them, the connection module can be used to establish a communication connection; the printing module can be used to control the printer to execute the printing task, and the scanning module is used to control the printer to execute the scanning task (such as scanning test papers, scanning ID cards, etc.); the status acquisition module is used to obtain the printing progress of the printer.
[0194] The tripartite 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, the connection module, the printing module, and the scanning module refer to the introduction of the above Mopria protocol package, which will not be elaborated here. It can be understood that the communication methods and instruction formats of the status acquisition module, the connection module, the printing module, and the 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 tripartite protocol packages including the discovery module, the printing service can also sequentially execute the discovery methods in the tripartite protocol packages to discover nearby devices for the user to connect and use.
[0195] The status acquisition module, the connection module, the printing module, the scanning module, and the discovery module are optional. When the tripartite protocol package includes the status acquisition module, the connection module, the printing module, and the scanning module, the tripartite protocol package is a printing protocol package, which can be used not only for network configuration but also for controlling the printer to execute printing tasks. When the tripartite protocol package does not include the status acquisition module, the connection module, the printing module, and the scanning module, the tripartite protocol package is a network configuration protocol package, which is only used for network configuration. After successful network configuration, the protocol shelf will control the corresponding printer to execute printing tasks through the preset Mopria protocol package.
[0196] It can be understood that when the protocol shelf has not downloaded any tripartite protocol packages, the printing service does not include tripartite protocol packages.
[0197] Figure 7A It is a flowchart for an electronic device 201 provided by an embodiment of the present application to control a target printer to execute a printing task.
[0198] S701: Open the application.
[0199] The target application includes application programs installed on the electronic device 201 that support the printing function, such as Smart Space, Reader, Print Assistant, Smart Interconnection, etc.
[0200] Taking Smart Space as an example, refer to Figure 4A , the electronic device 201 can detect a user operation in which the user clicks on the Smart Space application icon 311. In response to the above operation, the electronic device 201 can open Smart Space and display the Smart Space main interface 29. Taking Smart Interconnection as an example, the electronic device 201 can detect a user operation in which the user clicks on the Smart Interconnection control card 501. In response to the above operation, the electronic device 201 can open Smart Interconnection and the Smart Interconnection interface 51. The subsequent embodiments will be described taking Smart Space as an example, and other target applications refer to Smart Space and will not be elaborated here.
[0201] S702: Bind the printing service and obtain the printer list.
[0202] During the process of enabling the intelligent space, the intelligent space can send registration information to the printing service to bind the printing service. One application corresponds to one binding relationship. During the process of binding the printing service, the intelligent space can set a status callback through the status registration interface to receive the status information returned by the printing service at any time.
[0203] A printer list is set in the printing service. The printer list stores relevant information about the currently online printer devices, such as the device identifier, product identifier, access address, etc. of the printer. After each discovery operation performed by the discovery module (the discovery module in the printing service and / or the discovery module in the third-party protocol package), the printing service can update the above printer list. After detecting that the intelligent space binds the printing service, the printing service can return the printer list to the intelligent space.
[0204] S703: Determine the target printer.
[0205] The intelligent space can determine the currently online printer device according to the printer list, and then display the corresponding icons, such as Figure 4B the icons 232, icon 233, and icon 234 shown. The user can select a printer to execute a printing task through a touch operation on any of the icons. The intelligent space can determine the target printer through the above user operation.
[0206] For example, after detecting the user operation on icon 232, the intelligent space can determine that printer 202 corresponding to icon 232 is the target printer. After detecting the user operation on icon 233, the intelligent space can determine that printer 203 corresponding to icon 233 is the target printer.
[0207] S704: Create a printing task.
[0208] As Figures 4C - 4E , the intelligent space can determine the target file and printing parameters according to the user operation, and create a printing task through the user operation on the start printing control 421. The target file can be a document in formats such as.docx,.pdf,.pptx, etc., or a picture in formats such as.jpg,.png, etc.
[0209] S705: Send the printing task.
[0210] After creating the printing task, the intelligent space can send the printing task to the printing service.
[0211] Specifically, the intelligent space can send a printing task to the printing service through the printing interface. The intelligent space can send information such as a task identifier, a device identifier, and printing parameters to the printing service (the first request). After receiving the above information, the printing service can first create a data transmission channel and send the channel identifier of the above data transmission channel to the intelligent space. The intelligent space can determine the target channel (the first channel) based on the above channel identifier, and then send the target file to the printing service through the target channel corresponding to the channel identifier. The printing service saves the received target file to a specified address.
[0212] The intelligent space can create a printer scanning task according to user operations. It can be understood that after creating the scanning task, the intelligent space does not need to send the target file to the printing service. After the target printer completes the scanning, the target printer can return the scanning result to the printing service, and then return the scanning result to the intelligent space for the user to view and use.
[0213] S706: Determine the protocol type of the target printer.
[0214] The printing service can determine the target printer based on the device identifier, and the target protocol packet matching the target printer.
[0215] For example, after detecting a user operation on icon 232, the intelligent space can send the device identifier (DevID) of printer 202 to the printing service. The printing service can determine printer 202 as the target printer based on the device identifier of printer 202, and then determine the target protocol packet X1 matching the target printer 202. Then, the printing service can determine that the target protocol packet X1 is a network configuration protocol packet and is only used for network configuration. Therefore, the printing service can determine to use the Mopria protocol packet to send a printing task to the target printer 202 and control printer 202 to perform a printing operation. Then, execute step S707.
[0216] After detecting a user operation on icon 233, the intelligent space can determine that printer 203 corresponding to icon 233 is the target printer. At this time, the printing service can determine the target protocol packet X2 matching the target printer 203, and confirm that the target protocol packet X2 is a printing protocol packet, and can use the target protocol packet X2 to send a printing task to the target printer 203. Then, execute step S709.
[0217] S707: The printing service sends a printing task to the target printer through the Mopria protocol packet.
[0218] After confirming that the third-party protocol package matching the target printer cannot be used to control the printer to execute a printing task (i.e., this third-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 a printing task to the target printer (such as printer 202). For example, after confirming that the third-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 a printing task to the target printer.
[0219] Then, the printing service can obtain the printer call interface from the Mopria protocol package. Then, the printing service can send the target file and printing parameters to the Mopria protocol package through the above interface. Then, the Mopria protocol package can send the target file and printing parameters to the target printer through the printing module preset in the protocol package.
[0220] S708: Print the target file.
[0221] The target printer (such as printer 202) can print the target file according to the printing parameters.
[0222] Before the printing module in the Mopria protocol package sends the target file and printing parameters to the target printer, the Mopria protocol package can set a callback interface through the status acquisition module preset in the protocol package. During the process of the target printer printing the target file, the printer can return the printing progress to the printing service through the above interface, and then transmit the above printing progress back to the smart space through the status callback between the printing service and the smart space. The smart space can display the printing progress for the user to check at any time.
[0223] S709: The printing service loads the third-party protocol package matching the target printer and sends a printing task to the target printer through this third-party protocol package.
[0224] After confirming that the third-party protocol package matching the target printer can be used to control the printer to execute a printing task (i.e., this third-party protocol package is a printing protocol package that can be used for both network configuration and printing), the printing service can load this third-party protocol package. For example, after confirming that the third-party protocol package X2 matching the target printer 203 can be used to control the printer to execute a printing task, the protocol shelf can load the third-party protocol package X2.
[0225] The printing service can obtain the printing interface from the third-party protocol package. Then, the printing service can send the target file and printing parameters to the third-party protocol package through the above interface. The third-party protocol package can send the target file and printing parameters to the target printer through the printing module preset in the protocol package.
[0226] S710: Print the target file. For the target printer (such as printer 203), S710 can refer to S708, which will not be elaborated here.
[0227] Figure 7B It is a flowchart of a specific process for loading a third-party protocol package provided by an embodiment of this application.
[0228] Referring to the above step S706, after receiving the device identifier, printing can first determine the target printer according to the above device identifier. Then, the printing service can determine the protocol type of the target printer, such as protocol X1 or X2, etc.
[0229] Taking X2 as an example, after determining that the protocol type of the target printer is X2, the printing service can send the target protocol to the protocol shelf module. After receiving the target protocol, the protocol shelf can initialize the resource package management class, and match the protocol package of protocol X2 through the resource package management class, that is, the target protocol package X2. The protocol shelf can query the storage management module to confirm whether the target protocol package X2 is stored in the local memory.
[0230] 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. This process of writing the protocol package stored in the local memory into the memory is called loading.
[0231] Conversely, if the target protocol package X2 is not stored in the local memory, the protocol shelf can 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 can send a request to download the target protocol package X2 to the protocol shelf and register a callback pipe1. In response to the above request, the protocol shelf can query the configuration management module to obtain the download address of the target protocol package X2, such as the developer platform. Then, the protocol shelf can download the target protocol package X2 from the developer platform. During the process of downloading the target protocol package X2, the protocol shelf can return the download progress through the callback pipe1 registered by the printing service. After the download is completed, the protocol shelf can immediately load the target protocol package X2 (hereinafter referred to as protocol package X2) and perform initialization.
[0232] After the loading is completed, protocol package X2 can return a success notification to the protocol shelf. Then, referring to S709, the printing service can obtain various call interfaces of protocol package X2, such as a status acquisition interface, a connection interface, a printing interface, a scanning interface, etc.
[0233] First, the printing service can send a connection request to protocol packet X2 through a connection interface and register callback pipe2. Protocol packet X2 then matches the connection request function under protocol X2 and sends a connection request to the target printer (such as 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 packet X2. After receiving the connection success notification returned by the target printer, protocol packet X2 can pass the above notification back to the protocol shelf. Based on security requirements, the protocol shelf can first send a device inspection request to protocol packet X2. When establishing a connection, protocol packet X2 can obtain the device identifier of the peer device. Protocol packet X2 can detect that the device identifier of the peer device is consistent with the device identifier obtained by the previous printing service, that is, to check whether the device connecting is the target printer. When the two are consistent, protocol packet X2 can confirm that the device connection is correct. Protocol packet X2 can return a notification of passing the inspection to the protocol shelf through the previously registered callback pipe2. The protocol shelf can pass the above notification to the printing service.
[0234] Then, referring to S709, the printing service can obtain the printing interface of protocol packet X2, and the printing service can send the target file and printing parameters to the tripartite protocol packet X2 through the printing interface. After being translated by protocol packet X2, the target printer can receive and recognize the target file and printing parameters, and then print the target file according to the printing parameters.
[0235] Protocol packet X2 can register callback pipe3 through the status acquisition interface. During the process of the target printer printing the target file, the target printer can return the printing progress to protocol packet X2 through pipe3. Based on the callback between the printing service and the smart space, the smart space can obtain the printing progress and then display the printing progress for the user to check at any time.
[0236] In some embodiments, the protocol packet provided by the manufacturer of electronic device 201, denoted as BG1, can also be preset in electronic device 201. 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 electronic device 201 uses BG1, electronic device 201 can configure the network for the above printer through the preset BG1, and can control the above printer to execute the printing task through the preset BG1. When the newly discovered printer uses other protocol packets, such as the aforementioned Mopria, X1, X2, electronic device 201 obtains the matching protocol packet and configures the network for the above printer through the above matching protocol packet, and / or controls the above printer to execute the printing task.
[0237] In some embodiments, the protocol packet provided by the manufacturer of electronic device 201, denoted as BG2, can also be preset in electronic device 201. Among them, BG2 is only used to configure the network or only used to control the printer to print.
[0238] When BG2 is only used for configuring the network, during the network configuration process, after determining that the printer uses BG2, the electronic device 201 can configure the network for the above printer through the pre-set BG2; when the printer uses other protocol packets for network configuration, the electronic device 201 obtains the matching protocol packet and configures the network for the above printer through the above matching protocol packet. During the printing process, the electronic device 201 obtains the matching protocol packet for printing and controls the printer to print through the above matching protocol packet.
[0239] When BG2 is only used for controlling the printer to print, during the network configuration process, the electronic device 201 obtains the matching protocol packet for printing and configures the network for the above printer through the above matching protocol packet. During the printing process, after determining that the printer uses BG2, the electronic device 201 can control the printer to print through the pre-set BG2; when the printer uses other protocol packets, the electronic device 201 obtains the matching protocol packet and controls the printer to print through the above matching protocol packet.
[0240] Not limited to printers, the developer platform can also establish a protocol database for electronic devices 300 such as TVs, projectors, speakers, cameras, and sweeping robots, and record the protocol types of different models of devices. After the electronic device 300 is powered on, it can also broadcast its own product identifier. The electronic device 201 can determine the protocol type of the electronic device according to the above product identifier, and then obtain the matching protocol packet, and configure the network for the electronic device 300 through the above matching protocol packet to control the electronic device 300 to perform specific operations.
[0241] Figure 8 It is a schematic structural diagram of the electronic device 201 provided by the embodiment of the present application.
[0242] 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, a headphone interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. It can be understood that the structure illustrated in the embodiments 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 in the figure, or combine certain components, or split certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0243] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors. The controller may generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching instructions and executing instructions.
[0244] The USB interface 130 is an interface that complies with the USB standard specification, 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 for data transmission between the electronic device 201 and peripheral devices.
[0245] The charging management module 140 is used to receive a charging input from a charger. While charging the battery 142, the charging management module 140 can also supply power to the electronic device through the power management module 141. The power management module 141 receives inputs from the battery 142 and / or the charging management module 140 and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, the wireless communication module 160, etc.
[0246] 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, etc. The mobile communication module 150 can provide solutions for wireless communication including 2G / 3G / 4G / 5G, etc. applied to the electronic device 201. The wireless communication module 160 can provide solutions for wireless communication 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 (NFC), infrared technology (IR), etc. applied to the electronic device 201.
[0247] In the embodiment of this application, the electronic device 201 can access a local area network through solutions for wireless communication 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.
[0248] The internal memory 121 can include one or more random access memories (RAM) and one or more non-volatile memories (NVM).
[0249] The random access memory can be directly read and written by the processor 110, can be used to store the operating system or executable programs (such as machine instructions) of other running programs, and can also be used to store data of users and application programs, etc. The non-volatile memory can also store executable programs and store data of users and application programs, etc. The data stored in the non-volatile memory can be pre-loaded into the random access memory for the processor 110 to directly read and write.
[0250] The program code for implementing the printer control method provided by the embodiments of the present application can be stored in a non-volatile memory. The electronic device 201 can read the above program code from the non-volatile memory, write it into the processor 110 and execute it, thereby implementing the fast network configuration and calling functions provided by the embodiments of the present application.
[0251] The external memory interface 120 can be used to connect to an external non-volatile memory to implement the storage capacity expansion of the electronic device 201.
[0252] The electronic device 201 implements the display function through the GPU, the display screen 194, and the application processor, etc., such as displaying Figures 2A - 2C , Figures 4A - 4G , Figures 5A - 5J the user interface shown.
[0253] The electronic device 201 can also implement the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor, etc.
[0254] The electronic device 201 can also implement the audio function through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor, etc. Such as music playback, recording, etc.
[0255] The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric 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, etc.
[0256] The pressure sensor 180A is used to sense pressure signals and can convert the pressure signals into electrical signals. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. When a touch operation acts on the display screen 194, the electronic device 201 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic device 201 can also calculate the position of the touch according to the detection signal of 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 barometric pressure sensor 180C is used to measure barometric pressure. The magnetic sensor 180D can be used to detect the opening and closing of the flip cover and the opening and closing of the flip leather case. The distance sensor 180F is used to measure distance. The proximity light sensor 180G can be used to detect the infrared reflected light of nearby objects, and further used to determine that the electronic device 201 detects nearby objects. The ambient light sensor 180L is used to sense the ambient light brightness. The fingerprint sensor 180H is used to collect fingerprints. The temperature sensor 180J is used to detect temperature. The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also known as a "touch control screen". The touch sensor 180K is used to detect touch operations acting thereon or nearby, such as Figures 2A - 2C , Figures 4A - 4G , Figures 5A - 5J the click operations shown. The bone conduction sensor 180M can acquire vibration signals.
[0257] The keys 190 include a power-on key, volume keys, etc. The electronic device 201 can receive key inputs and generate key signal inputs related to the user settings and function controls of the electronic device 201. The motor 191 can generate vibration prompts. The indicator 192 can be an indicator light, which can be used to indicate the charging state, power change, and can also be used to indicate messages, missed calls, notifications, etc. The SIM card interface 195 is used to connect the SIM card.
[0258] Figure 9 is a schematic structural diagram of the printer 202 provided by an embodiment of the present application.
[0259] As Figure 9 shown, the printer 202 may include components such as a processor 311, a memory 312, a wireless communication module 313, a power switch 314, etc. Components in the electronic device are connected through a bus and communicate based on the bus. The descriptions of the above components can specifically refer to Figure 8 the corresponding components therein, and will not be elaborated here.
[0260] 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 AP 100 through the wireless communication module 313, so as to implement various functions of the printer 202, such as broadcasting a probe frame, receiving local area network configuration information, accessing the local area network, and receiving and executing a target file and printing the target file after accessing the network.
[0261] Similarly, Figure 9 The schematic structural diagram shown is only an example and should not constitute a specific limitation on the printer 202.
[0262] The term "user interface (UI)" in the specification, claims and drawings of the present application is a media interface for interaction and information exchange between an application program or an operating system and a user, and it realizes the conversion between the internal form of information and the form acceptable to the user. The user interface of an application program is source code written in a specific computer language such as Java or extensible markup language (XML). The interface source code is parsed and rendered on the terminal device and finally presented as content recognizable by the user, such as controls like pictures, texts, buttons, etc. A control (also known as a widget) is a basic element of the user interface. Typical controls include a toolbar, a menu bar, a text box, a button, a scrollbar, pictures, and texts. The attributes and content of the controls in the interface are defined through tags or nodes. For example, XML passes through <textview> 、 <imgview> 、
[0263] <videoview>Nodes such as these are used to specify the controls included in the interface. One node corresponds to one control or property in the interface, and after being parsed and rendered, the node presents visible content to the user. In addition, in the interfaces of many applications, such as hybrid applications, there are usually also web pages included. A web page, also known as a page, can be understood as a special control embedded in the application interface. A web page is source code written in a specific computer language, such as hyper text markup language (HTML), cascading stylesheets (CSS), JavaScript (JS), etc. The web page source code can be loaded and displayed as recognizable content to the user by a browser or a web page display component similar to the browser in function. The specific content included in the web page is also defined by tags or nodes in the web page source code. For example, HTML uses 、 、 <video> 、 <canvas>to define the elements and attributes of a web page.
[0264] A commonly used form of the user interface is the graphical user interface (GUI), which refers to the user interface related to computer operations presented in a graphical manner. It can be an icon, window, control, or other interface elements displayed on the display screen of an electronic device, where controls can include visible interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, Widgets, etc.
[0265] As used in the specification and the appended claims of this application, the singular forms "a", "an", "the", "above-mentioned", "said", and "this" are intended to also include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in this application refers to and includes any and all possible combinations of one or more of the listed items. As used in the above embodiments, depending on the context, the term "when..." can be interpreted to mean "if...", or "after...", or "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if detecting (the stated condition or event)" can be interpreted to mean "if determining...", or "in response to determining...", or "when detecting (the stated condition or event)", or "in response to detecting (the stated condition or event)".
[0266] 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 processes or functions described in the embodiments of this application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, fiber optic, digital subscriber line) or wirelessly (such as infrared, wireless, microwave, etc.). 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 integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid-state drive), etc.
[0267] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by relevant hardware instructed by a computer program. This program can be stored in a computer-readable storage medium. When this program is executed, it can include the processes of the above method embodiments. The aforementioned storage medium includes: various media that can store program codes such as ROM or random access memory RAM, magnetic disks, or optical discs.< / 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 package, 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 package; After detecting a user operation on the second icon, load a second protocol package, and send 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.
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 package is specifically: loading the first protocol package during the startup process of the first application.
3. The method according to claim 1, characterized in that, 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 package, and send first configuration information to the first printer through the third protocol package. 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, characterized in that, Before loading the third protocol package, the method further includes: downloading the third protocol package from a first server. The third protocol package is different from the first protocol package.
5. The method according to claim 3, wherein The discovery of the first printer specifically includes: Detect a probe frame emitted by the first printer. The probe frame carries the product identification of the first printer; Before loading the third protocol package, the method further includes: determining that the first printer also corresponds to a third protocol according to the product identification. The third protocol package corresponds to the third protocol.
6. 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 the second protocol package corresponding to the second protocol from a second server, load the second protocol package, and send first configuration information to the second printer through the second protocol package. 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, 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 a fourth protocol package corresponding to a fourth protocol from a third server, load the fourth protocol package, and send first configuration information to the second printer through the fourth protocol package. 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 package 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, wherein 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 from 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 from the user to displaying the second interface, the position of the first floating control remains unchanged; When displaying the first file, 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, characterized in that, Before loading the second protocol packet, the method further includes: confirm that the second protocol packet is not stored in the local memory, and download 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, wherein 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, wherein 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, characterized in that, 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, the third icon corresponds to a third printer. The second printer corresponds to the second protocol, and 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, the chip system is applied to an electronic device, the chip system includes one or more processors, characterized in that, The processor is used to call computer instructions to enable 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.
Citation Information
Cited By
Printer control method, electronic device, and system
EP4749427A1
Printer control method, electronic device, and system
WO2025138776A1
