Network configuration method, electronic equipment and system
By scanning the printer detection frame to obtain model and protocol packages, and automatically configure the printer network, it solves the cumbersome problem of multiple printers configuring the network, realizes savings in storage space and operations, and improves user experience.
Patent Information
- Application Number
- CN202311855664.1
- 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
When users have multiple printers from different manufacturers at the same time, they need to download multiple applications to configure the network, resulting in cumbersome storage space and operation, which affects the user experience.
By scanning the printer's detection frame to obtain the model, determine the protocol type, obtain the matching protocol packet, and use the protocol packet to send the LAN configuration information to the printer to realize automatic network configuration.
No need to download specific applications from printer manufacturers, saving storage space and user operations, and improving user experience.
Smart Images

Figure CN120282241A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminals, and in particular to a network configuration 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. 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 configure the network for a printer of one manufacturer. This not only redundantly occupies the storage space of the terminal device, but also increases the user operation and affects the user experience. Summary of the Invention
[0003] In a first aspect, this application provides a network configuration method applied to an electronic device. The method includes: accessing a first network; after discovering a first printer, obtaining the model of the first printer; determining that the first printer corresponds to a first protocol according to the model; after determining that the first printer corresponds to the first protocol, obtaining a first protocol packet and obtaining first configuration information. The first protocol packet corresponds to the first protocol, and the first configuration information includes the name and password of the first network; sending the first configuration information to the first printer through the first protocol packet.
[0004] By implementing the method provided in the first aspect, the electronic device can obtain the model of the printer during the process of discovering the printer, and then determine which protocol the printer uses according to the above model, and then obtain a matching protocol packet, and use the above protocol packet to send information such as the local area network name and password to the printer to configure the network for the printer, so that the user does not need to download a specific application provided by the printer manufacturer, saving user operations and improving the user experience.
[0005] In some embodiments, the electronic device discovers the first printer through a probe frame sent by the first printer, and the model of the first printer is carried in the probe frame.
[0006] In some embodiments, determining that the first printer corresponds to the first protocol according to the model specifically includes: sending the model of the first printer to a first server; receiving a first type sent by the first server, where the first type indicates that the first printer corresponds to the first protocol, and the first type is sent by the first server to the electronic device after receiving the model of the first printer sent by the electronic device.
[0007] An electronic device can discover a printer through the probe frame of the printer, determine which protocol the printer uses based on the model of the printer carried in the probe frame, and then determine which protocol packet to use to communicate with the printer. Among them, the electronic device can determine the protocol type corresponding to the model through a server (the first server). Preferably, the first server is a developer platform.
[0008] In some embodiments, after determining that the first printer corresponds to the first protocol, the method further includes: displaying a second card, where the second card includes a second control for connecting to the first printer; detecting a first operation on the second control; after detecting the first operation on the second control, obtaining a first protocol packet and obtaining first configuration information, specifically including: after determining that the first printer corresponds to the first protocol and detecting the first operation, obtaining the first protocol packet and obtaining the first configuration information.
[0009] The electronic device can prompt the user to discover a new printer through the card and determine whether to connect to the new printer according to the user operation. In the case of determining to connect, the electronic device then obtains a protocol packet and local area network configuration information that matches the printer, and sends the local area network configuration information to the printer through the above-mentioned matching protocol packet.
[0010] In some embodiments, before obtaining the first configuration information after detecting the first operation on the second control, the method further includes: displaying a first card, where the first card includes a first control; detecting a second operation on the first control; obtaining the first configuration information, specifically including: in response to the second operation, reading the first configuration information from the system settings.
[0011] The electronic device can, after obtaining user authorization, read the configuration information of the currently connected local area network from the system settings by itself. In another specific implementation, the electronic device can also obtain the local area network configuration information through user input operations.
[0012] In some embodiments, the electronic device includes a first application and a second application. Among them, the first application is set not to be able to read the first configuration information from the system settings; the second application is set to be able to read the first configuration information from the system settings. Displaying the first card specifically includes: the first application displays the first card; detecting the second operation on the first control specifically includes: the first application detects the second operation on the first control; reading the first configuration information from the system settings specifically includes: the first application sends a first request to the second application; in response to the first request, the second application reads the first configuration information from the system settings; the first application receives the first configuration information from the second application.
[0013] In this way, when the first application that provides the power distribution network function does not have the permission to directly obtain the local area network configuration information from the system settings, the first application can obtain it through other applications installed on the electronic device that have the above permissions.
[0014] In some embodiments, obtaining the first protocol packet specifically includes: downloading the first protocol packet from the second server.
[0015] The electronic device can download the required protocol packet from the server (the second server). In this way, the electronic device does not need to pre-install multiple protocol packets, avoiding occupying the storage space of the electronic device. Preferably, the second server is a developer platform.
[0016] In some embodiments, the method further includes: sending the target file selected by the user to the first printer through the first protocol packet, instructing the first printer to print the target file.
[0017] The electronic device can configure the network for the printer and control the printer to execute the printing task through one protocol packet.
[0018] In some embodiments, the method further includes: sending the target file selected by the user to the first printer through the pre-installed second protocol packet, instructing the first printer to print the target file.
[0019] The electronic device can configure the network for the printer and control the printer to execute the printing task through different protocol packets.
[0020] In some embodiments, the second protocol packet is a printing standard mopria protocol packet.
[0021] In some embodiments, the method further includes: sending the account name of the first account currently logged in on the electronic device to the third server; receiving the second information returned by the third server, where the second information is used to indicate that the third server has successfully created a second account, and the second account is obtained based on the account name of the first account.
[0022] The electronic device can quickly and automatically create another account based on the currently logged-in account.
[0023] In some embodiments, sending the account name of the first account currently logged in on the electronic device to the third server specifically includes: sending a first authorization code to the third server, where the first authorization code is associated with the first account, and the first authorization code is used for the third server to obtain the account name of the first account from the fifth server.
[0024] The electronic device can send the authorization code associated with the currently logged-in account to the server. The server can obtain the relevant information of the account currently logged in on the electronic device from another server based on the above authorization code, thereby avoiding the direct transmission of account information between the server and the electronic device and enhancing security.
[0025] In some embodiments, the method further includes: accessing a second network; when the second network is accessed, logging in to a fourth server using a second account; after successful login, sending a target file selected by the user to the fourth server, and sending the target file to a first printer in a first network through the fourth server, where the second network is different from the first network.
[0026] When the electronic device and the printer are in different local area networks, the electronic device can obtain the service of the server forwarding the print task across local area networks through the second account, and thus control the printer to print when in different local area networks.
[0027] In some embodiments, the third server and the fourth server are provided by the manufacturer of the first printer.
[0028] In a second aspect, the present application provides an account registration method, which is applied to a system including an electronic device, a local account cloud, a local device cloud, and a third-party account cloud. The method includes: the electronic device obtains a first authorization code from the local account cloud, and the first authorization code is associated with a first account currently logged in on the electronic device; the electronic device sends the first authorization code to the third-party account cloud; the third-party account cloud obtains the account name of the first account from the local account cloud according to the first authorization code; the third-party account cloud creates a second account according to the account name of the first account; the third-party account cloud associates the first account and the second account; the local account cloud obtains the second account from the third-party account cloud; the local account cloud associates the first account and the second account.
[0029] In some embodiments, the system further includes a third-party device cloud, and the method further includes: the electronic device sends a target file selected by the user and the first authorization code to the third-party device cloud; the third-party device cloud sends the first authorization code to the third-party account cloud; after the third-party account cloud determines the second account according to the first authorization code, the third-party device cloud sends the target file to a printer designated by the user to instruct the printer to print the target file.
[0030] 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.
[0031] 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.
[0032] Fifth aspect, the present application provides a computer-readable storage medium, including a computer program, when the computer program runs on an electronic device, enabling the electronic device to execute the method described in the first aspect and any possible implementation manner of the first aspect.
[0033] Sixth aspect, the present application provides a computer program product containing instructions, when the computer program product runs on an electronic device, enabling the electronic device to execute the method described in the first aspect and any possible implementation manner of the first aspect.
[0034] It can be understood that the electronic device provided in the above 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, and will not be elaborated here. Description of the Drawings
[0035] Figure 1 is a schematic structural diagram of network 10 provided by an embodiment of the present application;
[0036] Figures 2A - 2C is a set of network configuration user interfaces for configuring a network for printer 202 through electronic device 201 provided by an embodiment of the present application;
[0037] Figure 3 is a schematic software architecture diagram of electronic device 201 provided by an embodiment of the present application;
[0038] Figure 4 is a flowchart of the network configuration method provided by an embodiment of the present application;
[0039] Figure 5 is a flowchart of a specific method for obtaining local area network configuration information provided by an embodiment of the present application;
[0040] Figure 6 is a flowchart of a specific method for distributing local area network configuration information using a target protocol packet provided by an embodiment of the present application;
[0041] Figure 7 is a flowchart of electronic device 201 controlling printer 202 to execute a printing task provided by an embodiment of the present application;
[0042] Figure 8 is a schematic structural diagram of a network supporting a far-field printing function provided by an embodiment of the present application;
[0043] Figure 9 is a flowchart of automatically registering a third-party account provided by an embodiment of the present application;
[0044] Figure 10It is a schematic diagram of an automatic registration and authorization interface provided by an embodiment of the present application;
[0045] Figure 11 It is a flowchart of an electronic device 201 controlling a printer 202 to execute a printing task in different local area network scenarios provided by an embodiment of the present application;
[0046] Figure 12 It is a schematic diagram of the structure of an electronic device 201 provided by an embodiment of the present application;
[0047] Figure 13 It is a schematic diagram of the structure of a printer 202 provided by an embodiment of the present application;
[0048] Figure 14 It is a schematic diagram of the hardware structure of a server A provided by an embodiment of the present application. Detailed implementation manners
[0049] 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.
[0050] Now, more and more electronic devices support network access to meet the user's remote control needs.
[0051] With the development of printing needs, such as printing children's homework, paintings, etc., printers are also increasingly set to support access to the home local area network, especially the home local area network based on high-fidelity wireless communication (Wi-Fi), that is, support network access through Wi-Fi configuration, so that users can remotely control the printer to execute printing tasks at any time and place through mobile terminals such as mobile phones and tablets around them.
[0052] Mopria is a mobile printing standard. The Mopria protocol package 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 package, and can control the printer to execute printing tasks through the Mopria protocol package.
[0053] However, before controlling the printer to execute printing tasks through Mopria, the user needs to configure the network for the printer to make it access the network. And the Mopria protocol package does not support configuring the network for the printer. At this time, each printer manufacturer needs to provide its own protocol package for network configuration (hereinafter referred to as the network configuration protocol package) 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 mobile terminals.
[0054] In some technologies, after purchasing a printer, a user can download a specific application provided by the printer manufacturer in a mobile terminal. A network configuration protocol packet is preset in the application. The mobile terminal can configure a network for the printer through the application preset with the network configuration protocol packet. In a 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, the user needs to download applications provided by multiple different manufacturers. This is neither conducive to saving the storage space of the mobile terminal nor convenient for the user as it requires cumbersome operations.
[0055] In view of this, the present application provides a network configuration method. This method can be applied to an electronic device 201 and a printer 202. 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 embodiments of the present application. The printer 202 is a printer to be network-configured.
[0056] 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 one model provided by a printer manufacturer can share one product identifier. The electronic device 201 can scan and obtain the above probe frame, and thus 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 network configuration protocol packet that matches the protocol type of the printer 202, and then send the configuration information of the current local area network to the printer 202 through the above network configuration protocol packet, controlling the printer 202 to access the local area network where the electronic device 201 is located, and completing the network configuration task of the printer 202.
[0057] In this way, the user does not need to manually download a specific application and does not need to configure a network for the printer 202 through the above application, which is both conducive to saving the storage space of the electronic device 201 and saving user operations, providing convenience for the user.
[0058] Figure 1 It is a schematic diagram of the network 10 structure provided by the embodiments of the present application.
[0059] As Figure 1 shown, the network 10 includes an access point (AP) device 100 (denoted as AP100).
[0060] AP100 is connected to an Access Controller (AC) and a Broadband Remote Application Server (BRAS) through wired transmission, and obtains the Internet Protocol (IP) address of the AP through the Dynamic Host Configuration Protocol (DHCP), and then accesses the Internet.
[0061] The terminal device can establish a connection with AP100 through wired or wireless means, and then access the Internet through AP100 to obtain network services. Preferably, AP100 is a Wi-Fi-based AP. The local area network formed by AP100 is also called the first network.
[0062] 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 the 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.
[0063] As Figure 1 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 (the first printer) is a newly purchased device of the user that has not been configured with a network. As Figure 1 shown, the printer 202 has not been connected to AP100.
[0064] After purchasing the printer 202, the user can connect the printer 202 to the power supply. The process of connecting the printer 202 to the power supply 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 (DevID) and a product identifier (PrdID). Among them, the device identifier is used to uniquely identify an electronic device. Exemplarily, the device identifier can be a Media Access Control (MAC) address.
[0065] The electronic device 201 can periodically obtain the detection frames in the environment. At this time, the electronic device 201 can obtain the detection frames of the printer 202, and then obtain the product identifier of the printer 202 from the above detection frames. According to the above product identifier, the electronic device 201 can determine the protocol type of the printer 202.
[0066] In one embodiment, as Figure 1 shown, server A is connected to AP100 through the Internet. 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 and configure the network for the printer 202.
[0067] The developer platform can also store the network configuration protocol packages provided by each printer manufacturer. After determining the protocol type of the printer 202, the electronic device 201 can also obtain the corresponding network configuration protocol package from the developer platform. The network configuration protocol package corresponding to the protocol type of the printer 202 can be called the target protocol package.
[0068] In some embodiments, the network configuration protocol packages provided by the printer manufacturers 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 network configuration protocol packages. After determining the target protocol package that matches the protocol type of the printer 202, the electronic device 201 queries the above configuration file to obtain the download address of the target protocol package, and then accesses the server corresponding to the above address to download the target protocol package.
[0069] 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 AP100, and complete the network configuration task of the printer 202.
[0070] In one embodiment, the matching relationship between the printer product identifier and the protocol type can also be preset in the electronic device 201. After obtaining the product identifier of the printer 202, the electronic device 201 can determine the protocol type of the printer 202 by itself through the preset matching relationship, and then determine the target protocol package, without sending the product identifier of the printer 202 to the developer platform to determine the protocol type of the printer 202 through the developer platform.
[0071] Exemplarily, the electronic device 201 can obtain the product identifier PrdID1 of the printer 202 from the probe frame of the printer 202. By querying the developer platform, the electronic device 201 can determine the protocol type X1 (the first type) of the printer 202. Then, the electronic device 201 can obtain from the developer platform or other servers a protocol packet for network configuration that matches protocol X1 (the first protocol), denoted as the network configuration protocol packet X1 (the first protocol packet). Then, the electronic device 201 can send the configuration information (the first configuration information) of the current local area network AP100 to the printer 202 through the network configuration protocol packet X1, and control the printer 202 to access AP100.
[0072] Figures 2A - 2C is a set of network configuration user interfaces for configuring the network of the printer 202 by the electronic device 201 provided in the embodiments of the present application.
[0073] 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.
[0074] The product identifier of the printer 202 is carried in the probe frame of the printer 202, such as PrdID1. Thus, the electronic device 201 can obtain the product identifier of the printer 202. Furthermore, the electronic device 201 can determine the protocol type of the printer 202, such as X1. Refer to Figure 1 for the introduction. The electronic device 201 can query the developer platform or other servers 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.
[0075] Then, the electronic device 201 can obtain a target protocol packet that matches the protocol type of the printer 202, such as the target protocol packet X1. Refer to Figure 1 for the introduction. The electronic device 201 can download the target protocol packet from the developer platform or other servers. In other embodiments, multiple network configuration protocol packets can also be pre-set in the electronic device 201. The above-mentioned multiple network configuration 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.
[0076] As Figure 2A shown, after discovering the printer 202, the electronic device 201 can display the card 211 (the second card).
[0077] Product information of the printer 202, such as the device name "H-P1 Printer" and the device icon 212, can be displayed in the card 211. The above device information can be obtained through a probe frame. In one implementation, the probe 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 probe 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, a matching relationship between the product identifier and the device information is stored in a developer platform or other server or the electronic device 201. The electronic device 201 can determine the device information of the printer 202 through the matching relationship preset in the developer platform or other server 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 determine whether the new device is a newly purchased printer 202 waiting to be configured with a network based on the device information displayed in the card 211.
[0078] The card 211 further includes a control 213 (second control). 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.
[0079] As Figure 2B shown, the electronic device 201 can display a card 221 (first card). A prompt message is displayed in the card 221, such as "Do you want to synchronize the local area network (Wi-Fi name) and password connected to the electronic device 201 to the printer 202 for networking?" for asking 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.
[0080] The card 221 further includes a control 222 (first control). 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 a target protocol packet (such as target protocol packet X1). The printer 202 can access the local area network AP100 according to the above configuration information.
[0081] Referring 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 is successfully configured with a network. The card 231 is also called a successful network configuration card.
[0082] After detecting a user operation on the above Figure 2A control 213, the electronic device 201 can launch a 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 connects to the AP100, referring to Figure 2C , the smart space can display an icon 232 in 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 connected to the local area network AP100 through the icon 232.
[0083] 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 a protocol packet matching the printer through the product identification, and then send network configuration information to the printer through the above protocol packet, without the user having to download a specific application program provided by the printer manufacturer additionally. This not only reduces user operations and provides convenience for the user to configure the printer network, but also helps to save the storage space of the electronic device 201.
[0084] At the same time, as Figure 2B shown, during the implementation of the above method, the user also does not need to manually set the local area network and input the local area network password, thus further saving user operations and providing convenience for the user to configure the printer network.
[0085] In some embodiments, after detecting a user operation on the control 213, the electronic device 201 can also display multiple network names. One network name corresponds to a local area network scanned by the electronic device 201. The electronic device 201 can determine the target local area network according to the user's operation on any one of the above multiple network names, and determine the password of the target local area network according to the user's input operation. Then, similarly, the electronic device 201 can 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 connect to the above target local area network.
[0086] Figure 3 is a schematic diagram of the software architecture of the electronic device 201 provided by an embodiment of the present application.
[0087] The software system of the electronic device 201 can adopt a layered architecture. In this embodiment of the present application, taking the Android system with a layered architecture as an example, the software structure of the electronic device 201 is exemplarily described.
[0088] The layered architecture divides 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: the application layer (i.e., the app layer), the application framework layer (i.e., the framework layer), the Android runtime, and the system libraries, as well as the kernel layer. Figure 3 Only the application layer and the framework layer are shown.
[0089] The application layer may include a series of applications. As Figure 3 shown, in the embodiments of the present application, the application layer may include the following applications: Smart Space, iConnect, Nearby, Basic Services, and other applications.
[0090] The applications in the application layer can be further divided into system applications and ordinary applications. System applications are trusted by the operating system. System applications can obtain the privacy information of the electronic device 201, such as local area network configuration information. While ordinary applications are not trusted by the operating system. The operating system usually rejects the requests of ordinary applications to obtain privacy information. Among the above-listed applications, Smart Space is an ordinary application, and iConnect, Nearby, and Basic Services are system applications.
[0091] Smart Space is used to manage other trusted devices in the local area network. Nearby is used to discover near-field devices. Among them, devices within a certain range of distance can be called near-field devices. iConnect is used to connect and authenticate near-field devices, making the newly discovered near-field devices become trusted devices of the electronic device 201, and then being uniformly managed through Smart Space. Basic Services can be regarded as a sub-application of Smart Space, providing some common capabilities for Smart Space to manage other trusted devices, such as sharing of trusted device capabilities, synchronization of local area network configuration information, etc.
[0092] The framework layer provides application programming interfaces (APIs) and programming frameworks for the applications in the application layer. The framework layer includes some predefined functions.
[0093] In the embodiments of the present application, the framework layer at least includes modules such as PowerManager, Wi-Fi discovery, and system settings. PowerManager is used to detect and broadcast unlock and screen-off events. Wi-Fi discovery is used to scan Wi-Fi probe frames to discover devices. System settings are used to store the configuration information of the currently connected local area network, such as the configuration information of AP100.
[0094] In an embodiment of the present application, the electronic device 201 can periodically scan for broadcast signals in the environment through Nearby and Wi-Fi discovery, thereby obtaining the probe frame of the printer 202 and discovering the printer 202. Subsequently, Nearby can transmit the obtained probe frame to iConnect. iConnect can identify the above-mentioned probe frame and obtain the product identification of the printer 202.
[0095] iConnect can send the above product identification to the developer platform. The developer platform can query the protocol type corresponding to the above product identification, that is, the protocol type of the printer 202. Thus, iConnect can obtain the protocol type of the printer 202 from the developer platform. At the same time, the developer platform can also determine product information such as the product name and product icon of the printer 202 based on the above product identification and send it back to iConnect.
[0096] On the one hand, iConnect can display the card 211 to show the user product information such as the product name and product icon of the new device (such as the printer 202) for the user to confirm. After detecting the user operation to connect to the printer 202, iConnect can send the product identification of the printer 202 to the smart space. The smart space can then display the card 221 and obtain from the user through the card 221 the permission to synchronize the configuration information of the currently connected local area network (AP100) to the printer 202.
[0097] After obtaining the user authorization, the smart space can obtain the local area network configuration information stored in the system settings through the basic service. The smart space is not a system application and does not have the ability to directly read the local area network configuration information. While the basic service is a system application and has the ability to directly read the local area network configuration information. At this time, the smart space can read the local area network configuration information from the system settings through the basic service.
[0098] On the other hand, the smart space can obtain the protocol type of the printer 202 from iConnect, download the corresponding protocol package according to the above protocol type, and store it in a specified location. The smart space can include a protocol shelf module. The protocol shelf module can manage various downloaded protocol packages. Then, the smart space can load the protocol package.
[0099] Finally, the smart space can obtain the local area network configuration information and write it into the above protocol package, and then send the local area network configuration information to the printer 202 through the above protocol package.
[0100] Preferably, iConnect can reduce the scanning frequency of Nearby according to the unlock and screen-off events broadcast by PowerManager, thereby reducing power consumption. For example, after receiving a screen-off event, iConnect can control Nearby to stop scanning; after receiving an unlock event, iConnect can control Nearby to resume scanning.
[0101] Figure 4 It is a flowchart of the network configuration method provided by an embodiment of the present application.
[0102] S401: Establish a protocol database to record the protocol types of devices.
[0103] Table 1 is a data structure provided by an embodiment of the present application.
[0104] Table 1
[0105] Product Identification Product Name Product Icon Protocol Type PrdID1 H - P1 H - P1.img X1 PrdID5 ABC - 01 ABC - 01.img X2 PrdID6 ABC - 02 ABC - 02.img X2 PrdID7 ABC - 03 ABC - 03.img X3 …… …… …… ……
[0106] The developer platform can establish a printer protocol database as shown in Table 1 to record relevant information such as the product identification, product name, product icon, and protocol type of the printer. The above-mentioned protocol database is also called a protocol shelf.
[0107] The product name usually indicates the provider and model of the product. For example, in "H-P1", "H" can indicate the provider and "P1" can indicate the model. Printers of the same model provided by a printer manufacturer can share a product identification. Usually, all models of printers provided by a printer manufacturer use the same printing protocol, that is, the protocol types are the same. For example, both "ABC-01" and "ABC-02" use protocol X2. Of course, optionally, printers of different models provided by a printer manufacturer can also use different printing protocols. For example, both "ABC-01" and "ABC-02" use protocol X2, while "ABC-03" uses protocol X3.
[0108] The developer platform can update the printer protocol database in real time. The above-mentioned update includes updating the relevant information of existing printers and adding new printers and their relevant information. For example, when PrdID1 (the "H-P0" printer) switches to protocol Y1, the developer platform can update the protocol type of PrdID1 in the printer protocol database as follows:
[0109] PrdID1 H - P0 H - P0.img Y1
[0110] 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:
[0111] PrdID8 ABC - 04 ABC - 04.img X2
[0112] Among them, when the updated or newly added content involves a new protocol type, the developer platform can also store the protocol package corresponding to the new protocol type.
[0113] S402: Periodically obtain protocol information from the protocol database.
[0114] A protocol shelf table can be maintained in iConnect. The protocol shelf table can record the product identifiers and protocol types of various devices that the electronic device 201 has discovered. Refer to Table 2, which is a protocol shelf table provided by an embodiment of the present application.
[0115] Table 2
[0116] Product Identification Protocol Type PrdID1001 X10 PrdID1002 X11 …… ……
[0117] When the protocol shelf table is not empty, iConnect can periodically obtain protocol information from the printer protocol database to update the protocol shelf table.
[0118] Exemplarily, iConnect can send a request to obtain the protocol type to the developer platform. The above request can carry the product identifiers: PrdID1001, PrdID1002. In response to the above request, the developer platform can obtain the protocols (such as X10, X11) corresponding to the above product identifiers from the printer protocol database, and then transmit them back to iConnect. iConnect can update the protocol shelf table according to the transmitted protocols, so that the electronic device 201 can obtain the latest protocol information whenever it queries the protocol shelf table.
[0119] S403: The printer 202 is powered on.
[0120] S404: The printer 202 broadcasts a probe frame (DevID1, PrdID1).
[0121] 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 an embodiment of the present application, the probe frame can also carry the product identifier of the printer 202, which is used to identify the merchant and model of the printer 202, such as PrdID1.
[0122] S405: The probe frame of the printer 202 is scanned.
[0123] After the printer 202 broadcasts the probe frame, Nearby can obtain the probe frame of the printer 202 by scanning. Subsequently, Nearby can send the above probe frame to iConnect.
[0124] S406: Identify the detection frame and obtain the device identifier and product identifier (DevID1, PrdID1).
[0125] iConnect can identify the detection frame reported by Nearby and obtain device information such as the device identifier and product identifier.
[0126] Taking the detection frame exemplified in S404 as an example, iConnect can obtain the device identifier DevID1 and product identifier PrdID1 of the printer 202 from the above detection frame. At this time, the electronic device 201 discovers the printer 202. At this time, the printer 202 is a newly discovered device by the electronic device 201, also called a new device.
[0127] Subsequently, iConnect can query the protocol shelf table to determine the protocol type of the new device (such as the printer 202).
[0128] If the product identifier of the device is recorded in the protocol shelf table, such as PrdID1, then iConnect can determine the protocol type of the device according to the protocol shelf table, that is, what protocol is used for network configuration. Then, iConnect can obtain the corresponding network configuration protocol packet. If the product identifier of the device is not recorded in the protocol shelf table, then iConnect can continue to execute S407 to confirm the protocol type of the device with the developer platform.
[0129] In some embodiments, after obtaining the product identifier, iConnect can also directly execute S407 to confirm the protocol type of the device with the developer platform. At this time, iConnect does not need to execute S402 either.
[0130] S407: Request to obtain the product information of the new device (PrdID1).
[0131] iConnect can send a request to obtain product information to the developer platform. The product identifier of the new device, such as PrdID1, can be carried in the request.
[0132] S408: Return the product information of the new device (product name, product icon, protocol type X1).
[0133] In response to the above request, the developer platform can search for the product identifier carried in the above request, such as PrdID1, in the protocol database shown in Table 1. After searching for 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 iConnect.
[0134] For example, the information corresponding to PrdID1 is as follows:
[0135] PrdID1 H - P1 H - P1.img X1
[0136] The developer platform can transmit the above H-P1, H-P1.img, and X1 back to the electronic device 201 iConnect.
[0137] S409: Display a prompt card.
[0138] After receiving the product information transmitted back by the developer platform, iConnect can generate a prompt card as shown in Figure 2A Card 211, and display information such as the product name and product icon of the new device (printer 202) to the user, so that the user can confirm whether the newly discovered device of the electronic device 201 is the printer 202 that is currently performing the network configuration operation.
[0139] S410: Detect a user operation to connect to a new device (printer 202).
[0140] As shown in Figure 2A Card 211 may also 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 to connect to a new device. The electronic device 201 can send the above operation event to iConnect. Then, iConnect can confirm that a user operation to connect to a new device has been detected.
[0141] S411: Start the smart space (DevID1, PrdID1, X1).
[0142] In response to the user operation of connecting to a new device, iConnect can send indication information to the smart space to start the smart space. The above indication information may include information such as the device identifier (such as DevID1), product identifier (such as PrdID1), and protocol type (such as protocol X1) of the new device. In response to the above indication information, the smart space can start obtaining local area network configuration information (S412 - S414), and downloading the target protocol package (S415 - S416).
[0143] S412: Display an authorization card.
[0144] As shown in Figure 2B After the smart space is started, the smart space can first control the electronic device 201 to display card 221. Card 221 is also called an authorization card. Card 221 displays a message asking the user whether to allow the electronic device 201 to synchronize the configuration information of the currently connected AP100 to the printer 202.
[0145] S413: Detect a user operation to confirm automatic network configuration.
[0146] As shown inFigure 2B As shown, the card 221 further includes a control 222. Similarly, the electronic device 201 can detect a user operation on the control 222 in the 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.
[0147] The intelligent space can sense 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 a new device (printer 202) for network configuration.
[0148] S414: Obtain local area network configuration information.
[0149] 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 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.
[0150] 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 local area network configuration information from the system settings module. At this time, the intelligent space can obtain local area network configuration information from the system settings module through other system-trusted applications.
[0151] As Figure 4 shown, the intelligent space can obtain local area network configuration information from the system settings module through the system-trusted basic service (second application). After obtaining the automatic network configuration permission, the intelligent space can send a request to obtain local area network configuration information to the basic service module. The above request carries the application identifier and signature of the intelligent space. The basic service module can set a whitelist for recording ordinary applications allowed to obtain local area network configuration information. After receiving the request from the intelligent space to obtain local area network configuration information, the basic service can query whether the whitelist includes the application identifier of the intelligent space to determine whether the intelligent space is in the whitelist, that is, confirm that the intelligent space is allowed to obtain local area network configuration information. After confirming that the intelligent space is in the whitelist, the basic service can immediately send a request to obtain local area network configuration information to the system settings. In the scenario where the basic service is a system-level application, in response to the above request, the system settings can return local area network configuration information, such as name, password, etc., to the basic service module.
[0152] Taking Figure 1 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, including the name and password of AP100, through the basic service.
[0153] In one embodiment, the intelligent space may also be set not to be in the whitelist of basic services. At this time, after S411, the intelligent space may display multiple network names. One network name corresponds to a local area network scanned by the electronic device 201. The intelligent space may determine the target local area network according to the user's operation on any one of the above multiple network names. Then, the intelligent space may receive the password of the target local area network manually input by the user.
[0154] S415: Obtain the target protocol packet (X1).
[0155] The intelligent space may 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 for network configuration, the intelligent space may determine the target protocol packet X1 that matches protocol X1.
[0156] The protocol packet configuration file is stored in the intelligent space. The download addresses of various network configuration protocol packets are recorded in the protocol packet configuration file. After determining the target protocol packet (such as target protocol packet X1), the intelligent space may query the protocol packet configuration file to determine the download address of the target protocol packet, and then download the target protocol packet from the corresponding server.
[0157] Exemplarily, the intelligent space may query the protocol packet configuration file to determine that the target protocol packet is stored in the developer platform. At this time, as Figure 4 shown, the intelligent space may send a request for obtaining the protocol packet to the developer platform. The protocol type, such as X1, is carried in the request. In response to the above request, the developer platform may return the matching target protocol packet X1 to the intelligent space.
[0158] Preferably, after each network configuration protocol packet is obtained, the electronic device 201 may record the local storage address of the network configuration protocol packet in the protocol shelf table. After determining the target protocol packet, the electronic device 201 may determine whether the target protocol packet is stored in the local memory through the protocol shelf table. If the target protocol packet is stored in the local memory, the electronic device 201 may directly obtain the target protocol packet from the local memory without downloading the target protocol packet again.
[0159] S416: Use the target protocol packet to send the local area network configuration information.
[0160] After obtaining the target protocol packet, the intelligent space can load the target protocol packet. Loading means writing the program code stored in the local memory into the memory to make it run. The loaded target protocol packet can communicate with the printer using the corresponding protocol. After loading the target protocol packet, the intelligent space can write the aforementioned obtained local area network configuration information into the target protocol packet. Subsequently, the target protocol packet 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.
[0161] S417: Configure the network according to the configuration information and access the local area network.
[0162] After the electronic device 201 executes the operation shown in S416, the printer 202 can receive the local area network configuration information sent by the electronic device 201. Taking Figure 1 the AP100 shown as an example, the printer 202 can receive the configuration information of the AP100. According to the above configuration information, the printer 202 can select the target local area network, that is, the AP100, and input the connection password, and then successfully access the AP100 to obtain network services through the AP100. At this time, the printer 202 completes the network configuration task.
[0163] After successful network configuration, the printer 202 can send a network configuration success notification back to the intelligent space through the target protocol packet. Referring 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 configured for the network. At the same time, referring to Figure 2C , after the printer 202 successfully accesses the AP100, the intelligent space can display the icon 232 in the main interface 29. 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.
[0164] Figure 5 is a flowchart of a specific method for obtaining local area network configuration information provided by an embodiment of the present application.
[0165] As Figure 5As shown, after executing S413, the intelligent space can register a call channel with the basic service based on interprocess communication (IPC) and bind to the basic service. Then, the intelligent space can send a request to the basic service to obtain the local area network configuration information. The application identifier of the intelligent space is also carried in this request. In response to the above request, the basic service can immediately send a request to the system settings to obtain the signature corresponding to the application identifier. The application identifier of the intelligent space is carried in this request. In response to the above request, the system settings can return the signature of the intelligent space to the basic service. Then, the basic service can confirm whether the intelligent space is within the call whitelist based on the signature of the intelligent space, that is, confirm that the intelligent space is a trusted application program allowed to obtain the local area network configuration information.
[0166] After confirming that the intelligent space is a whitelist application, the basic service can determine whether the location permission has been obtained. Under the Android system framework, only applications that have obtained the location permission have the ability to obtain the local area network configuration information. In the scenario where the location permission has been obtained, generally, the system settings will display a pop-up window for using the location permission to inform the user. In the embodiment of the present application, after confirming that the location permission has been obtained, the basic service can send an exemption instruction to the system settings. In response to the above exemption instruction, the system settings will no longer display the pop-up window for using the location permission to reduce user operations. If the basic service detects that the location permission has not been obtained currently, the basic service can send a location permission pop-up window instruction to the intelligent space. In response to the above instruction, the intelligent space can display a location permission pop-up window to obtain the location permission. After detecting the user operation of confirming authorization, the intelligent space can return the user authorization to the basic service. At this time, the basic scope obtains the location permission.
[0167] After confirming the location permission, the basic service can send a request to the system settings to obtain the WiFi list. In response to the above request, the system settings can return the WiFi list to the basic service. The WiFi list includes the names and passwords of all the WiFi networks that the electronic device 201 has connected to. Among them, depending on the Android system version, the interface for the basic service to request the system settings to obtain the WiFi list is different. When the Android system API version is API 33 and above, the basic service can obtain the high-privilege hidden interface of the system and obtain the WiFi list through the above hidden interface. When the Android system API version is lower than API 33, the basic service can directly obtain the WiFi list.
[0168] Then, the basic service can transmit the WiFi list back to the intelligent space. The intelligent space can send a request to the system settings to obtain the current WiFi name. By querying the WiFi list, the intelligent space can obtain the WiFi password that matches the current WiFi name. Exemplarily, in Figure 1In the network 10 shown, the current WiFi name available to the smart space is, for example, AP100. By querying the WiFi list, the smart space can obtain the WiFi password of AP100.
[0169] In the above embodiment, after obtaining the WiFi list, the smart space can also display the currently connectable WiFi hotspots to the user based on the above WiFi list. The user can select any one of the above connectable WiFi hotspots, such as AP200. Subsequently, the smart space can query the WiFi list to obtain the WiFi password of AP200.
[0170] In some embodiments, after the user selects a new WiFi hotspot, the electronic device 201 can switch the currently connected WiFi hotspot to be the same as the one that the printer 202 is going to connect to (i.e., the one selected by the above user). In other embodiments, after the user selects a new WiFi hotspot, the electronic device 201 can also keep the currently connected WiFi hotspot.
[0171] In some embodiments, after confirming the location permission, the basic service can also directly send a request to the system settings to obtain the current WiFi configuration information, and then transmit the obtained WiFi configuration information back to the smart space, saving processes and improving efficiency.
[0172] Figure 6 It is a flowchart of a specific method for using a target protocol packet to distribute local area network configuration information provided by an embodiment of the present application.
[0173] After executing S411, the smart space obtains the protocol type of the printer 202, such as protocol X1.
[0174] After executing S413, as Figure 6 shown, the smart space can first send a request to the protocol shelf to obtain the target protocol packet. The protocol type of the printer 202 can be carried in the request. In response to the above request, the protocol shelf can initialize the resource packet management class, and then determine the target protocol packet that matches the above protocol type through the resource packet management class, such as the target protocol packet X1 that matches protocol X1. If the above target protocol packet has been downloaded by the electronic device 100 before, the target protocol packet is stored in the local memory of the electronic device 100. At this time, the protocol shelf can determine that the target protocol packet is stored locally, so the protocol shelf can immediately load the target protocol packet, such as the target protocol packet X1.
[0175] When the target protocol packet is not stored in the local memory, the protocol shelf can return a matching failure to the smart space and instruct the smart space to download the target protocol packet. In response to the above instruction, the smart space can send a request to download the target protocol packet to the protocol shelf and register a callback pipe1. The above request can carry the protocol type of the printer 202. In response to the above request, the protocol shelf can download the target protocol packet from the developer platform. During the process of downloading the target protocol packet, the protocol shelf can return the download progress through the callback pipe1. After the download is completed, the protocol shelf can load the target protocol packet.
[0176] After the successful loading, the target protocol packet, such as the target protocol packet X1, can return a success notification to the protocol shelf. Subsequently, the protocol shelf can send a connection request request1 to the target protocol packet and register a callback pipe2. In response to request1, the target protocol packet can send a connection request request2 to the printer 202. In response to request2, the electronic device 201 can establish a communication connection with the printer 202 based on the target protocol packet. After receiving the connection success notification returned by the printer 202, the target protocol packet can pass the above notification back to the protocol shelf.
[0177] For security considerations, after confirming the successful connection, the protocol shelf can send a device verification request to the target protocol packet to confirm whether the device connected through request2 is the printer 202. When establishing the connection, the target protocol packet can obtain the device identifier of the peer device. The target protocol packet can detect whether the device identifier of the peer device is consistent with the device identifier previously obtained by the smart space (S411). When the two are consistent, the target protocol packet can confirm that the device connection is correct. The target protocol packet can return a notification of passing the verification to the protocol shelf through the previously registered callback pipe2. The protocol shelf can transmit the above notification to the smart space.
[0178] In response to the above notification, the smart space can send local area network configuration information (WiFi name, password) to the protocol shelf. The protocol shelf sends the above local area network configuration information to the target protocol packet through the network configuration interface provided by the target protocol packet. After being translated by the target protocol packet, the printer 202 can recognize the above local area network configuration information. Then, the printer 202 can select the target local area network, that is, AP100, according to the above local area network configuration information, and then input the password, and then successfully access AP100 to complete the network configuration.
[0179] After the network configuration is successful, the printer 202 can send a network configuration success notification to the target protocol packet. The target protocol packet immediately passes the above notification back to the smart space, thereby triggering the smart space to display a network configuration success card, prompting the user that the network configuration of the printer 202 is successful.
[0180] After successful network configuration, the electronic device 201 can send a printing task to the printer 202, controlling the printer 202 to execute the printing task to meet the user's printing needs.
[0181] Figure 7 It is a flowchart for an electronic device 201 provided by an embodiment of the present application to control a printer 202 to execute a printing task.
[0182] S701: Create a printing task according to user operations.
[0183] The intelligent space can detect the operation of the user selecting a file. The file to be printed selected by the user can be called the target file. The target file includes, but is not limited to, documents in formats such as.docx,.pdf,.pptx, etc., and pictures in formats such as.jpg,.png, etc. After determining the target file, the intelligent space can receive the printing parameters set by the user, such as the number of copies, single / double-sided, paper size, color, etc.
[0184] Then, the intelligent space can receive the user operation of confirming the print. In response to the user operation of confirming the print, the intelligent space can generate a printing task. The printing task includes a task identifier, a device identifier, a target file, and printing parameters. Among them, the device identifier includes the device identifier of the electronic device 201 and the device identifier of the printer 202.
[0185] S702: Send the printing task.
[0186] After creating the printing task, the intelligent space can send the printing task to the printer 202 through a pre-set Mopria protocol packet, controlling the printer 202 to print the target file according to the printing parameters set by the user.
[0187] Specifically, the intelligent space can obtain the call interface of the Mopria protocol packet. The call interface of the Mopria protocol packet includes a printing interface and a status registration interface. Through the printing interface, the intelligent space can send task information such as the task identifier, device identifier, target file, and printing parameters to the Mopria protocol packet. Then, the Mopria protocol packet can send task information such as the task identifier, target file, and printing parameters to the printer 202 according to the communication method and instruction format agreed upon by the Mopria protocol. Through the status registration interface, the Mopria protocol packet can set a callback interface.
[0188] S703: Print the target file according to the printing parameters.
[0189] S704: Return the printing status.
[0190] During the process of printing the target file, the printer 202 can return the printing progress to the Mopria protocol package through the callback interface set by the Mopria protocol package. Furthermore, the Mopria protocol package can report the printing progress to the intelligent space.
[0191] S705: Display the printing status.
[0192] The intelligent space can display the printing progress, such as "20% completed", "Printing the 1st / 5th copy", "Printing completed!", etc., for the user to check at any time.
[0193] For some printer manufacturers, on the basis of network configuration, they will also continue to develop program codes to control the printer to execute printing tasks. At this time, the protocol package provided by the printer manufacturer is not only used to configure the network for the printer, but also can be used to control the printer to execute printing tasks. When the protocol package provided by the printer manufacturer can be used to control the printer to execute printing tasks, preferably, the electronic device 201 can continue to control the printer to execute printing tasks through the protocol package provided by the printer manufacturer, instead of using the Mopria protocol package.
[0194] Exemplarily, when the electronic device 201 configures the network for another printer, the electronic device 201 can determine the protocol type X2 of the printer and obtain the matching target protocol package X2 according to the above protocol type. The target protocol package X2 includes a network configuration function (the network configuration function is used to control the printer to access the local area network) and a printing function (the printing function controls the printer to execute printing tasks). At this time, preferably, after creating the printing task, the electronic device 201 can determine to use the target protocol package X2 to send the printing task to the above printer, instead of using the Mopria protocol package.
[0195] When the electronic device 201 and the printer 202 are in the same local area network (such as AP100), the electronic device 201 can Figure 7 send the printing task to the printer 202 by the method shown, and control the printer to print the target file.
[0196] In some scenarios, the electronic device 201 will be connected to other local area networks. At this time, the electronic device 201 and the printer 202 are in different local area networks. When the electronic device 201 and the printer 202 are in different local area networks, the electronic device 201 cannot Figure 7 send the printing task to the printer 202 by the method shown.
[0197] This is because, for security reasons, the printer is set by the printer manufacturer to only receive print jobs sent by server C outside the local area network. Server C (also known as the third-party device cloud) is a server established by the printer manufacturer for forwarding print jobs. At the same time, the printer manufacturer will also set up server B (also known as the third-party account cloud) for managing user accounts. In some embodiments, the third-party account cloud and the third-party device cloud can also be the same server.
[0198] After the printer 202 completes network configuration, the user needs to register an account in the third-party account cloud provided by the printer manufacturer and associate the above account with the printer 202. Subsequently, the user can log in to the above account and obtain the forwarding service provided by the third-party device cloud through the above account to realize the function of controlling the printer 202 to print across the local area network. The function of controlling the printer to print across the local area network is also called the remote field printing function. Correspondingly, the function of controlling the printer to print within the same local area network can be called the near field printing function.
[0199] In the scenario of downloading a specific application program provided by the printer manufacturer, the user will register an account through the above application. The third-party account cloud will record the above account. When the electronic device 201 and the printer 202 are in different local area networks, the electronic device 201 can send the print job to the third-party device cloud through the above application and the above account.
[0200] The account registered in the third-party account cloud is also called a third-party account. When the electronic device 201 configures the network for the printer 202 using the Figure 4 method shown, since the specific application program provided by the printer manufacturer has not been downloaded, after successful network configuration, the electronic device 201 does not have a third-party account. At this time, the electronic device 201 cannot obtain the forwarding service provided by the third-party device cloud and cannot provide the near field printing function for the user unless the electronic device 201 downloads the above specific application program again and registers a third-party account.
[0201] In view of this, the embodiment of the present application also provides an automatic registration method.
[0202] Implementing this method, the electronic device 201 can obtain the user account currently logged in to itself, denoted as the device account. The device account is an account registered by the user with the manufacturer of the electronic device 201. For example, when the electronic device 201 is a mobile phone, the device account of the electronic device 201 is Account. Then, the electronic device 201 can automatically register a third-party account in the third-party account cloud using the device account. When the electronic device 201 and the printer 202 are in different local area networks, the electronic device 201 obtains the forwarding service provided by the third-party device cloud through the above third-party account, sends the print task to the printer 202, and controls the printer 202 to print the target file, meeting the user's need to remotely control the printer 202 for printing.
[0203] Figure 8 It is a schematic diagram of a network structure provided by an embodiment of the present application that supports the far-field printing function.
[0204] After discovering the printer 202, the electronic device 201 can enter the automatic registration process.
[0205] Such as Figure 8 As shown, the electronic device 201 can first obtain an authorization code from the server D (also known as the local account cloud). The local account cloud is a server provided by the manufacturer of the electronic device 201 for managing device accounts. An authorization code uniquely corresponds to a device account. Then, the electronic device 201 can send the above authorization code to the third-party account cloud for registration. After receiving the authorization code, the third-party account cloud can obtain the device account from the local account cloud based on the above authorization code. Then, the third-party account cloud can create a third-party account according to the obtained device account and associate the above third-party account with the above authorization code.
[0206] In the scenario where the electronic device 201 and the printer 202 are in different local area networks, after detecting the user's printing operation, the electronic device 201 can create a far-field printing task. At this time, the electronic device 201 can first send the authorization code to the third-party device cloud through the server E (also known as the local device cloud). The third-party device cloud can verify the received authorization code. After the verification passes, the electronic device 201 can send the print task (including the target file, print parameters, device identifier) to the third-party device cloud through the third-party device cloud. According to the device identifier, the third-party device cloud can determine the target printer (such as the printer 202) that performs the printing operation. Then, the third-party device cloud can send the specific printing content such as the target file and print parameters to the target printer, controlling the target printer to print the target file and realizing the far-field printing function.
[0207] Figure 9 It is a flowchart of automatically registering a third-party account provided by an embodiment of the present application.
[0208] In the embodiment of the present application, after performing the Figure 4 steps S410 - S411 shown, the smart space can also enter the automatic registration process and perform the operations shown in S911 - S918.
[0209] S911: Display the automatic registration authorization interface.
[0210] First, the intelligent space can display an automatic registration and authorization interface. Figure 10 It is a schematic diagram of an automatic registration and authorization interface provided by an embodiment of the present application.
[0211] As Figure 10 shown, the screen of the electronic device 201 can display a device account and a third-party account registration prompt. For example, "Device account: 111****1234", and "H account registration / login" can be called a third-party account registration prompt. At the same time, a control 711 is also displayed on the screen. The control 711 is used to receive the click operation of the user. A prompt is also displayed on the control 711, such as "Register / login with the device account".
[0212] S912: Detect a user operation to confirm automatic registration.
[0213] During the process of displaying Figure 10 the user interface shown, the intelligent space can detect a user operation acting on the control 711. The above operation is the user operation to confirm automatic registration.
[0214] S913: Obtain an authorization code.
[0215] In response to the above user operation, the intelligent space can obtain the permission to automatically register a third-party account with the printer 202 manufacturer.
[0216] First of all, the intelligent space can send a request to obtain an authorization code (AuthCode) to the local account cloud. The above request can carry the device identifier of the electronic device 201. The device identifier of the electronic device 201 and the currently logged-in device account are recorded in the local account cloud. In response to the above request, the local account cloud can first uniquely determine a device account according to the device identifier carried in the request. This account is the currently logged-in device account of the electronic device 201. Then, the local account cloud can generate an authorization code (the first authorization code) that is uniquely corresponding to the above device account, and record the corresponding relationship between the above device account and the above authorization code. Then, the local account cloud can return the above authorization code to the intelligent space.
[0217] S914: Transmit the authorization code to the third-party account cloud.
[0218] After obtaining the authorization code returned by the local account cloud, the intelligent space can send the above authorization code to the third-party front-end, and transmit the above authorization code to the third-party account cloud through the third-party front-end. Preferably, the third-party front-end is a web page established using Hypertext Markup Language (HTML) 5.0 (i.e., H5).
[0219] S915: Obtain the device account of the electronic device 201.
[0220] After receiving the authorization code, the third-party account cloud can send a request to obtain the device account to the local account cloud (the fifth server). The above request carries the above authorization code. In response to the above request, the local account cloud can determine the device account corresponding to the above authorization code, such as Figure 10 the account "111****1234" shown. Subsequently, the local account cloud can return the above device account to the third-party account cloud.
[0221] S916: Create a third-party account based on the device account.
[0222] Based on the device account (the first account) returned by the local account cloud, the third-party account cloud (the third server) can generate another account (i.e., the third-party account), and associate the above account with the above authorization code. Taking the above device account "111****1234" as an example, the third-party account cloud can automatically create a third-party account (the second account). Exemplarily, the name of the third-party account can be "111****1234@H" generated according to "111****1234". At the same time, the third-party account cloud can correspondingly generate the login password for the account. Preferably, the above password can be randomly generated by the third-party account cloud based on encryption requirements.
[0223] After the creation is completed, the third-party account cloud can send a notification message (the second message) indicating successful creation to the smart space.
[0224] S917: Associate the third-party account and the device account.
[0225] After the third-party account cloud creates the third-party account, the third-party account cloud can send the above third-party account and authorization code to the local account cloud. Subsequently, the local account cloud can record the association relationship between the third-party account and the authorization code, and then determine the third-party account and the device account associated with the same authorization code as a group of two-way associated accounts. Thereafter, the local account cloud can determine the corresponding third-party account according to the device account at any time.
[0226] S918: Obtain the device status.
[0227] After receiving the notification message indicating successful creation, the smart space can send a request to obtain the device status to the local device cloud. The above request carries the above authorization code and the device identifier of the printer 202. The local device cloud can forward the above request to the third-party device cloud.
[0228] The third-party device cloud can send the authorization code carried in the request to the third-party account cloud for identity verification. The third-party account cloud can query the third-party account that matches the above authorization code. After the query is successful, the third-party account cloud can return an indication of successful verification to the third-party device cloud. In response to the above indication, the third-party device cloud can determine the target printer 202 according to the device identifier carried in the request, and then obtain the device status of the printer 202, and then transmit the device status of the printer 202 back to the intelligent space of the electronic device 201.
[0229] After receiving the device status transmitted back by the third-party device cloud, the intelligent space can confirm that the third-party account registration is successful and successfully obtain the far-field forwarding capability provided by the third-party device cloud. Subsequently, in the scenario where the electronic device 201 and the printer 202 are in different local area networks, after creating a far-field printing task, the intelligent space can send the printing task to the printer 202 through the third-party account and the third-party device cloud, control the printer 202 to execute the operation, and meet the printing needs of the user.
[0230] Figure 11 It is a flowchart of an electronic device 201 controlling a printer 202 to execute a printing task in different local area network scenarios provided by an embodiment of the present application.
[0231] S1101: Create a printing task according to user operations.
[0232] An application program that supports the printing function such as the intelligent space can detect the user operation of selecting a file and setting printing parameters. According to the above operations, the application can determine the target file and printing parameters. After detecting the user operation of confirming printing, the intelligent space can generate a printing task. The printing task includes a task identifier, a device identifier, a target file, and printing parameters. The device identifier includes the device identifier of the electronic device 201 and the device identifier of the printer 202.
[0233] S1102: Send the printing task and the authorization code.
[0234] When the printer 202 is not in the same local area network as the electronic device 201, the electronic device 201 can determine to perform far-field printing.
[0235] The electronic device 201 can send the printing task to the local device cloud. Through a more secure channel between clouds, the local device cloud can forward the printing task of the electronic device 201 to the third-party device cloud. In an embodiment of the present application, the electronic device 201 will also carry an authorization code in the printing task.
[0236] S1103: Identity verification.
[0237] The third-party device cloud can first obtain the authorization code in the print task. Then, the third-party device cloud (the fourth server) can send the above authorization code to the third-party account cloud. The third-party account cloud can query the third-party account that matches the above authorization code. After the query is successful, the third-party account cloud can return an indication of successful verification to the third-party device cloud.
[0238] S1104: Forward the print task.
[0239] After the verification passes, the third-party device cloud can obtain the printer device identifier in the print task. According to the above printer device identifier, the third-party device cloud can determine the target printer that receives the print task, such as printer 202. Then, the third-party device cloud can forward the above print task to the target printer.
[0240] S1105: Print the target file based on the print parameters.
[0241] After receiving the print task, the target printer can obtain the target file and print parameters in the print task and print the above target file according to the print parameters.
[0242] S1106: Return the print status.
[0243] During the process of printing the target file, the target printer can set and return the print progress to the third-party device cloud through the callback interface. The third-party device cloud can transmit the above print progress back to the electronic device 201 through the local device cloud.
[0244] S1107: Display the print status.
[0245] It can be understood that the embodiments of the present application are mainly described by taking a printer as an example. Not limited to printers, the developer platform can also establish a protocol database for electronic devices 300 such as televisions, projectors, speakers, cameras, and floor-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 a matching protocol package, and configure the network for the electronic device 300 through the above matching protocol package to control the electronic device 300 to perform specific operations.
[0246] Figure 12 It is a schematic structural diagram of the electronic device 201 provided by the embodiments of the present application.
[0247] 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 button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. 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.
[0248] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors. The controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching instructions and executing instructions.
[0249] The USB interface 130 is an interface that conforms to 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 to transfer data between the electronic device 201 and peripheral devices.
[0250] 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 the input 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.
[0251] The wireless communication function of the electronic device 201 can be implemented through Antenna 1, Antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, and the baseband processor. The mobile communication module 150 can provide solutions for wireless communications such as 2G / 3G / 4G / 5G applied to the electronic device 201. The wireless communication module 160 can provide solutions for wireless communications applied to the electronic device 201, 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.
[0252] In the embodiments of the present application, the electronic device 201 can access the local area network through the solutions for wireless communications such as WLAN, BT, NFC, IR provided by the wireless communication module 160, and send the local area network configuration information to the printer 202.
[0253] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).
[0254] The random access memory can be directly read and written by the processor 110, and can be used to store the operating system or the executable programs (such as machine instructions) of other running programs, and can also be used to store the data of users and application programs. The non-volatile memory can also store executable programs and store the data of users and application programs. 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.
[0255] The program codes for implementing the network configuration method and the automatic registration method provided in the embodiments of the present application can be stored in the non-volatile memory. The electronic device 201 can read the above program codes from the non-volatile memory, write them into the processor 110 and execute them, so as to implement the functions of fast network configuration and automatic registration provided in the embodiments of the present application.
[0256] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the electronic device 201.
[0257] The electronic device 201 realizes the display function through the GPU, the display screen 194, the application processor, etc., such as displaying Figures 2A - 2C , Figure 10 the user interface shown.
[0258] The electronic device 201 can also realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, the application processor, etc.
[0259] The electronic device 201 can also realize 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. For example, music playback, recording, etc.
[0260] 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.
[0261] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. 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 the 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 the distance. The proximity light sensor 180G can be used to detect the infrared reflected light of nearby objects, and then used to determine the nearby objects detected by the electronic device 201. 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 the 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 the touch operation acting on it or nearby, such as Figures 2A - 2C , Figure 10 the click operation shown. The bone conduction sensor 180M can acquire the vibration signal.
[0262] The button 190 includes a power-on button, volume buttons, etc. The electronic device 201 can receive button 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 status, 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.
[0263] Figure 13 It is a schematic structural diagram of the printer 202 provided by an embodiment of the present application.
[0264] As Figure 13 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. For the specific descriptions of the above components, reference can be made to Figure 12 the descriptions of the corresponding components therein, which will not be elaborated here.
[0265] 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 realize various functions of the printer 202, such as broadcasting probe frames, receiving local area network configuration information, accessing the local area network, and receiving and executing target files and printing target files after accessing the network.
[0266] Similarly, Figure 13 the shown schematic structural diagram is only an example and should not constitute a specific limitation on the printer 202.
[0267] Figure 14 It is a schematic hardware structure diagram of a server A provided by an embodiment of the present application.
[0268] As Figure 14 shown, the server A may include one or more processors 411, a communication interface 412, and a memory 413. The processors 411, the communication interface 412, and the memory 413 can be connected through a bus or other means. In this embodiment of the present application, it is taken as an example of being connected through the bus 414. Among them:
[0269] The processor 411 can be composed of one or more general-purpose processors, such as a CPU. The processor 411 can be used to run program codes related to the device control method.
[0270] The communication interface 412 can be a wired interface (such as an Ethernet interface) or a wireless interface (such as a cellular network interface or a wireless local area network interface), and is used to communicate with other nodes. In this embodiment of the present application, the communication interface 412 can be specifically used to communicate with the electronic device 201.
[0271] The memory 413 may include volatile memory, such as RAM; the memory may also include non-volatile memory, such as ROM, flash memory, HDD or solid state disk (SSD); the memory 413 may further include a combination of the above types of memory. The memory 403 can be used to store a set of program codes, so that the processor 411 can call the program codes stored in the memory 413 to implement the implementation method of the present application embodiment on the server. In the embodiment of the present application, the memory 413 can also be a storage array, and so on.
[0272] In some embodiments, the server A may include multiple servers, for example, device cloud servers, far-field cloud servers, etc. The hardware structures of these multiple servers can all refer to the hardware structure of the server A Figure 14 shown above.
[0273] It should be noted that Figure 14 the server A shown above is only one implementation manner of the embodiment of the present application. In actual applications, the server A may further include more or fewer components, which are not limited here.
[0274] 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, extensible markup language (XML), etc. 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 is also called a widget, which is the basic element of the user interface. Typical controls include a toolbar, a menu bar, a text box, a button, a scrollbar, a picture and a text. The attributes and content of the controls in the interface are defined by tags or nodes. For example, XML passes through <textview> 、 <imgview> 、
[0275] <videoview>Nodes such as these are used to define 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 content visible to the user. In addition, in the interfaces of many applications, such as hybrid applications, there are usually also web pages. 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 content recognizable by 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.
[0276] A commonly used form of the user interface is the graphical user interface (GUI), which refers to the user interface related to computer operations displayed in a graphical manner. It can be an interface element such as an icon, window, control, etc. displayed on the display screen of an electronic device, where the control can include visible interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, Widgets, etc.
[0277] As used in the specification and the appended claims of this application, the singular forms "a", "an", "the", "above", "said", "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...", "after...", "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...", "in response to determining...", "when detecting (the stated condition or event)", or "in response to detecting (the stated condition or event)".
[0278] 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 a website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes one or more integrated available media. The available media can be magnetic media (such as floppy disks, hard disks, magnetic tapes), optical media (such as DVDs), or semiconductor media (such as solid-state drives), etc.
[0279] 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 the program is executed, it can include the processes of the above method embodiments. The foregoing storage media include: various media that can store program codes, such as ROM, random access memory (RAM), magnetic disks, or optical discs.< / canvas> < / video> < / videoview> < / imgview> < / textview>
Claims
1. A network configuration method, characterized in that, Applied to an electronic device, the method includes: Access a first network; After discovering a first printer, obtain the model of the first printer; Determine that the first printer corresponds to a first protocol according to the model; After determining that the first printer corresponds to the first protocol, obtain a first protocol packet and obtain first configuration information, where the first protocol packet corresponds to the first protocol, and the first configuration information includes the name and password of the first network; Send the first configuration information to the first printer through the first protocol packet.
2. The method according to claim 1, wherein The electronic device discovers the first printer through a probe frame sent by the first printer, and the model of the first printer is carried in the probe frame.
3. The method according to claim 1, characterized in that, The determining that the first printer corresponds to the first protocol according to the model specifically includes: Send the model of the first printer to a first server; Receive a first type sent by the first server, where the first type indicates that the first printer corresponds to the first protocol, and the first type is sent by the first server to the electronic device after receiving the model of the first printer sent by the electronic device.
4. The method according to claim 1, characterized in that, After determining that the first printer corresponds to the first protocol, the method further includes: Display a second card, where the second card includes a second control for connecting to the first printer; Detect a first operation on the second control; After detecting the first operation on the second control, obtain a first protocol packet and obtain first configuration information, specifically including: after determining that the first printer corresponds to the first protocol and detecting the first operation, obtain a first protocol packet and obtain first configuration information.
5. The method according to claim 4, characterized in that Before obtaining the first configuration information after detecting the first operation on the second control, the method further includes: Display a first card, where the first card includes a first control; Detect a second operation on the first control; The obtaining of the first configuration information specifically includes: in response to the second operation, read the first configuration information from the system settings.
6. The method according to claim 5, wherein The electronic device includes a first application and a second application. Among them, the first application is set not to be able to read the first configuration information from the system settings; the second application is set to be able to read the first configuration information from the system settings. The displaying of the first card specifically includes: the first application displays the first card; The detecting of the second operation on the first control specifically includes: the first application detects the second operation on the first control; The reading of the first configuration information from the system settings specifically includes: The first application sends a first request to the second application; In response to the first request, the second application reads the first configuration information from the system settings; The first application receives the first configuration information from the second application.
7. The method according to claim 1, characterized in that The obtaining of the first protocol packet specifically includes: download the first protocol packet from a second server.
8. The method according to claim 1, characterized in that The method further includes: send a user-selected target file to the first printer through the first protocol packet, and instruct the first printer to print the target file.
9. The method according to claim 1, characterized in that, The method further includes: sending a target file selected by a user to the first printer through a preset second protocol packet, instructing the first printer to print the target file.
10. The method according to claim 9, wherein The second protocol packet is a printing standard mopria protocol packet.
11. The method according to claim 1, characterized in that, The method further includes: sending the account name of the first account currently logged in on the electronic device to a third server; receiving second information returned by the third server, where the second information is used to indicate that the third server has successfully created a second account, and the second account is obtained based on the account name of the first account.
12. The method according to claim 11, wherein, The sending the account name of the first account currently logged in on the electronic device to the third server specifically includes: sending a first authorization code to the third server, where the first authorization code is associated with the first account, and the first authorization code is used for the third server to obtain the account name of the first account from a fifth server.
13. The method according to claim 11, wherein The method further includes: accessing a second network; when the second network is accessed, logging in to a fourth server through the second account; after the login is successful, sending a target file selected by the user to the fourth server, and sending the target file to the first printer in the first network through the fourth server, where the second network is different from the first network.
14. The method according to claim 13, wherein The third server and the fourth server are provided by the manufacturer providing the first printer.
15. An electronic device, characterized in that, including 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, and when the one or more processors execute the computer program, the electronic device executes the method according to any one of claims 1-14.
16. A chip system, which is applied to an electronic device, and the chip system includes one or more processors, characterized in that, The processor is used to call computer instructions to enable the electronic device to execute the method according to any one of claims 1-14.
17. 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-14.
Citation Information
Patent Citations
User account registering method and device of self-service printing equipment
CN106385403A
Network distribution method, device and equipment
CN111277441A
Network distribution method and device for smart home equipment, terminal equipment and storage medium
CN111464351A
Intelligent device communication method and system, computer device and readable storage medium
CN112532607A
Network distribution method and device, computer readable storage medium and terminal equipment
CN114466372A
