WiFi access method, communication method, peripheral device and storage medium
By implementing broadcast state switching and network information reception on the Bluetooth module of the peripheral device, the problem of users having difficulty quickly selecting a printer configured on the network is solved, improving user experience and enhancing device compatibility.
Patent Information
- Application Number
- CN202210532260.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2021-10-27
- Filing Date
- 2022-04-27
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2042-04-27
AI Technical Summary
In the prior art, users cannot quickly select printers that need to be configured on the network, which can easily lead to selection errors and affect user experience.
By using the first Bluetooth module in the peripheral device to switch to the first broadcast state when entering the distribution state, sending a broadcast packet including service UUID, identification information and device ID to the control terminal, displaying the device ID first for users to quickly select, and Receive the router's distribution network information through Bluetooth connection to configure the WiFi network.
It enables users to quickly select and configure peripheral devices, improves user experience, and improves peripheral compatibility by supporting multiple Bluetooth protocols.
Smart Images

Figure CN114980266B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic technology, and in particular to a WiFi network access method, a communication method, a peripheral device and a storage medium. Background Art
[0002] As a peripheral device, the printer needs to be configured through a control terminal such as a PC or a mobile phone to connect the printer to a wireless network. In the prior art, the commonly used network configuration methods include: the control terminal uses Bluetooth to scan printers, and allows the user to select a target printer from the scanned printer list to configure the network. However, when there are multiple printers in the printer list, the user cannot quickly select the printer that needs to be configured, which may result in selection errors and a poor user experience. Summary of the invention
[0003] In view of this, the present application provides a WiFi access method, a communication method, a peripheral device and a storage medium, so as to solve the problem in the prior art that users cannot quickly select a printer that needs to be configured on the network, which may result in selection errors and lead to a poor user experience.
[0004] In a first aspect, an embodiment of the present application provides a WiFi network access method, which is applied to a peripheral device, wherein the peripheral device includes a first Bluetooth module and a WiFi module, and the method includes: when the peripheral device enters a network configuration state, the first Bluetooth module enters a first broadcast state;
[0005] Sending a first broadcast packet to the control terminal through the first Bluetooth module, wherein the first broadcast packet includes a service UUID, identification information of the peripheral device and a device ID, and the identification information of the peripheral device enables a user to preferentially select the peripheral device in a display interface of the control terminal to configure a network;
[0006] Establishing a Bluetooth connection between the peripheral device and the control terminal;
[0007] Receiving network configuration information of a router from the control terminal through the first Bluetooth module;
[0008] The WiFi module is connected to the WiFi network according to the network configuration information of the router.
[0009] In a possible implementation, when the peripheral device enters the network configuration state, the first Bluetooth module enters the first broadcast state including:
[0010] The user starts the network configuration operation in the peripheral device, and the first Bluetooth module switches from the second broadcast state to the first broadcast state. In the second broadcast state, the second broadcast packet sent by the first Bluetooth module is different from the first broadcast packet.
[0011] In a possible implementation, the identification information of the peripheral device enables the user to preferentially select the peripheral device in the display interface of the control terminal to configure the network, including:
[0012] The control terminal receives the first broadcast packet, and displays the device ID of the peripheral device at the first position of the device list on the display interface according to the identification information of the peripheral device.
[0013] In a possible implementation, receiving the network configuration information of the router from the control terminal through the first Bluetooth module includes: receiving a first data packet, the first data packet including the total number of packets and the check value of the sub-packets; receiving a second data packet, detecting whether the second data packet is correct based on the check value of the first data packet, and if correct, parsing the second data packet to obtain the network configuration information of the router.
[0014] In a second aspect, an embodiment of the present application provides a communication method, which is applied to a peripheral device, wherein the peripheral device includes a first Bluetooth module, and the first Bluetooth module has a function of cyclically broadcasting broadcast packets of different protocols, and the method includes cyclically executing the following steps:
[0015] Sending a first broadcast packet encapsulated according to a first Bluetooth protocol to a control terminal through the first Bluetooth module;
[0016] Sending a second broadcast packet encapsulated according to a second Bluetooth protocol to the control terminal through the first Bluetooth module;
[0017] The first Bluetooth protocol and the second Bluetooth protocol are different.
[0018] In a possible implementation, sending the first broadcast packet encapsulated according to the first Bluetooth protocol to the control terminal through the first Bluetooth module includes:
[0019] Encapsulating a first broadcast packet according to a first Bluetooth protocol;
[0020] Turning on Bluetooth broadcasting, and sending the first broadcasting packet to the control terminal through the first Bluetooth module;
[0021] The sending, through the first Bluetooth module, a second broadcast packet encapsulated according to a second Bluetooth protocol to the control terminal includes:
[0022] encapsulating a second broadcast packet according to a second Bluetooth protocol;
[0023] Turn on Bluetooth broadcasting and send the second broadcasting packet to the control terminal through the first Bluetooth module.
[0024] In a possible implementation, the first broadcast packet includes a service UUID, identification information of the peripheral device, and a device ID, wherein the identification information of the peripheral device enables a user to preferentially select the peripheral device in a display interface of the control terminal to configure a network;
[0025] Establishing a Bluetooth connection between the peripheral device and the control terminal;
[0026] Receiving network configuration information of a router from the control terminal through the first Bluetooth module;
[0027] Connecting the WiFi module to the WiFi network according to the network configuration information of the router;
[0028] The receiving the network configuration information of the router from the control terminal through the first Bluetooth module includes: receiving a first data packet, the first data packet including the total number of packets and the check value of the sub-packets; receiving a second data packet, detecting whether the second data packet is correct according to the check value of the first data packet, and if correct, parsing the second data packet to obtain the network configuration information of the router;
[0029] Also includes:
[0030] The user starts the network configuration operation in the peripheral device, and the first Bluetooth module switches from the second broadcast state to the first broadcast state. In the first broadcast state, the first broadcast packet encapsulated according to the first Bluetooth protocol is broadcast to the control terminal through the first Bluetooth module; the second broadcast packet sent by the first Bluetooth module in the second broadcast state is different from the first broadcast packet.
[0031] In a third aspect, an embodiment of the present application provides a WiFi network access method, which is applied to a control terminal, wherein the control terminal includes a second Bluetooth module, and the method includes:
[0032] Acquire identification information of a peripheral device through the second Bluetooth module;
[0033] Wherein, obtaining identification information of a peripheral device through the second Bluetooth module includes:
[0034] Controlling the control terminal to enter a scanning state, obtaining a first broadcast packet sent by the peripheral device, wherein the first broadcast packet includes a service UUID, identification information of the peripheral device, and a device ID, and the identification information of the peripheral device enables a user to preferentially select the peripheral device in a display interface of the control terminal to configure a network;
[0035] Parsing the first broadcast packet to obtain the identification information;
[0036] According to the identification information, the device ID of the peripheral device is displayed first in the device list of the display interface;
[0037] Establish a Bluetooth connection with the peripheral device according to the user's choice, and send the network configuration information of the router to the peripheral device.
[0038] In a possible implementation, the method further includes:
[0039] Receive a network access success message returned by the peripheral device, and send a disconnection instruction to the peripheral device to disconnect the Bluetooth connection with the peripheral device.
[0040] In a possible implementation, sending the network configuration information of the router to the peripheral device includes: sending a first data packet, the first data packet including the total number of packets and the check value of the sub-packets; sending a second data packet so that the peripheral device detects whether the second data packet is correct based on the check value of the first data packet, and if correct, parses the second data packet to obtain the network configuration information of the router.
[0041] In a possible implementation, the device list on the display interface includes a list of peripheral devices supporting Bluetooth and / or a list of networked devices;
[0042] Wherein, controlling the control terminal to enter the scanning state includes: controlling the second Bluetooth module of the control terminal to search for peripheral devices supporting Bluetooth, and / or controlling the control terminal to search for peripheral devices that have been connected to the network, and / or controlling the control terminal to search for peripheral devices that have communicated with the cloud server;
[0043] When the user selects a peripheral device that has been connected to the network or a peripheral device that has been communicating with the cloud server, the control terminal establishes a binding relationship with the peripheral device that has been connected to the network or the peripheral device that has been communicating with the cloud server.
[0044] In a possible implementation, the device list on the display interface also includes: a peripheral device that sends out an SSID. When the user selects a peripheral device that sends out an SSID, a direct communication is established with the peripheral device, and the network configuration information of the router is sent to the peripheral device.
[0045] In a fourth aspect, an embodiment of the present application provides a communication method, which is applied to a control terminal, wherein the control terminal includes a second Bluetooth module, and the method includes:
[0046] Acquire a first broadcast packet encapsulated by a peripheral device according to a first Bluetooth protocol;
[0047] If the first Bluetooth protocol is a protocol supported by the first application of the control terminal, using the first application to parse the first broadcast packet;
[0048] and / or,
[0049] Acquire a second broadcast packet encapsulated by the peripheral device according to a second Bluetooth protocol;
[0050] If the second Bluetooth protocol is a protocol supported by the second application of the control terminal, the second broadcast packet is parsed using the second application.
[0051] In a possible implementation manner, after obtaining the first broadcast packet encapsulated by the peripheral device according to the first Bluetooth protocol, the method further includes:
[0052] If the first Bluetooth protocol is not a protocol supported by the first application of the control terminal, the first application is not used to parse the first broadcast packet; after obtaining the second broadcast packet encapsulated by the peripheral device according to the second Bluetooth protocol, the method further includes:
[0053] If the second Bluetooth protocol is not a protocol supported by the second application of the control terminal, the second application is not used to parse the second broadcast packet.
[0054] In a possible implementation, the first broadcast packet includes a service UUID, identification information of the peripheral device, and a device ID, wherein the identification information of the peripheral device enables a user to preferentially select the peripheral device in a display interface of the control terminal to configure a network;
[0055] Establishing a Bluetooth connection between the peripheral device and the control terminal;
[0056] Sending the network configuration information of the router from the control terminal to the peripheral device through the second Bluetooth module, so that the peripheral device can access the WiFi network according to the network configuration information of the router;
[0057] The sending of the network configuration information of the router from the control terminal to the peripheral device through the second Bluetooth module includes: sending a first data packet, the first data packet including the total number of packets and the check value of the sub-packets; sending a second data packet, so that the peripheral device detects whether the second data packet is correct according to the check value of the first data packet, and if correct, the peripheral device parses the second data packet to obtain the network configuration information of the router;
[0058] Also includes:
[0059] The user starts the network configuration operation in the peripheral device, and the first Bluetooth module of the peripheral device switches from the second broadcast state to the first broadcast state. In the first broadcast state, a first broadcast packet encapsulated according to the first Bluetooth protocol is broadcast to the control terminal through the first Bluetooth module; the second broadcast packet sent by the first Bluetooth module in the second broadcast state is different from the first broadcast packet, and the first application is used to parse the first broadcast packet and the second broadcast packet.
[0060] In a fifth aspect, an embodiment of the present application provides a peripheral device, including a memory, a processor, and a computer program;
[0061] The computer program is stored in the memory and is configured to be executed by the processor to implement the method according to any one of the first aspect and the second aspect.
[0062] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed, implements the steps of the method described in any one of the first aspect and the second aspect.
[0063] The technical solution provided by the embodiments of the present application has the following technical effects:
[0064] 1. Users can press a button to change the Bluetooth broadcast status of peripheral devices;
[0065] 2. The first broadcast status of the peripheral device can be displayed preferentially by the control terminal, so that the user can quickly configure the wireless network of the peripheral device;
[0066] 3. Peripheral devices support multiple Bluetooth protocols, which can improve the compatibility of peripheral devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0068] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;
[0069] Figure 2 A schematic diagram of another application scenario provided for an embodiment of the present application;
[0070] Figure 3 A flowchart of a WiFi network access method provided in an embodiment of the present application;
[0071] Figure 4 A flowchart of a WiFi network access method provided in an embodiment of the present application;
[0072] Figure 5 A schematic diagram of data packet splitting provided in an embodiment of the present application;
[0073] Figure 6 A flowchart of a method for adding a peripheral device provided in an embodiment of the present application;
[0074] Figure 7 A communication method provided in an embodiment of the present application;
[0075] Figure 8 A schematic diagram of the structure of a peripheral device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0076] In order to better understand the technical solution of the present application, the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0077] It should be clear that the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0078] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0079] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0080] The peripheral device involved in the embodiment of the present application may be an image forming device, and of course, may also be a peripheral device with other functions, which is not specifically limited in the embodiment of the present application. Among them, the image forming device is a device having at least one function related to image formation, and the above-mentioned functions related to image formation may include but are not limited to: printing function, scanning function, copying function, and fax function. For example:
[0081] Single-function printer: An image forming device with only printing function.
[0082] Multifunction printer: An image forming device with printing, copying, scanning and / or faxing capabilities, and optionally with a set number of paper trays.
[0083] Digital MFP: Based on the copying function, it has standard or optional printing, scanning, and faxing functions. It uses digital principles to output documents in the form of laser printing. Images and text can be edited as needed. It has a large-capacity paper tray, high memory, large hard disk, powerful network support, and multi-task parallel processing capabilities.
[0084] The following examples illustrate the scenarios in which the WiFi network access method and communication method provided in the embodiments of the present application are applicable.
[0085] See also Figure 1 , is a schematic diagram of an application scenario provided by an embodiment of the present application. Figure 1 As shown, the application scenario includes: a control terminal 110 and an image forming device 120; wherein there is data communication between the control terminal 110 and the image forming device 120. The above-mentioned image forming device 120 may include but is not limited to the following devices: a single-function printer, a multi-function printer, a digital composite machine, etc.
[0086] The control terminal 110 may be an electronic device installed with a print driver, such as a computer, or may be an electronic device such as a mobile phone or a mobile tablet that can communicate with the image forming device 120 , and may also be generally referred to as a user end, a client end, or a host.
[0087] The embodiment of the present application does not limit the connection method between the control terminal 110 and the image forming device 120. In one possible implementation, the control terminal 110 and the image forming device 120 may be connected via a local area network; in another possible implementation, the image forming device 120 may be connected to the control terminal 110 via a USB cable; in another possible implementation, the image forming device 120 may be connected to the control terminal 110 via a wireless method, such as Bluetooth or Wi-Fi Direct.
[0088] In the embodiment of the present invention, the control terminal 110 may send a print job to the image forming device 120 to execute print output.
[0089] See also Figure 2 , is a schematic diagram of another application scenario provided by the embodiment of the present application. Figure 2As shown, in an embodiment of the present application, the peripheral device 120 includes a first Bluetooth module and a WiFi module, and the peripheral device 120 can establish communication with the router through the WiFi module. That is to say, the peripheral device 120 must support both WiFi and Bluetooth. The control terminal 110 includes a second Bluetooth module, and the control terminal 110 can establish a Bluetooth connection with the first Bluetooth module of the peripheral device 120 through the second Bluetooth module to achieve Bluetooth communication. It should be noted that the above-mentioned first Bluetooth module and the second Bluetooth module can be BLE (Bluetooth Low Energy, Bluetooth low energy consumption) modules, and of course can also be standard Bluetooth modules. Those skilled in the art can make adaptive modifications to the data transmission and reception between the peripheral device 120 and the control terminal 110, and the information processing within the peripheral device 120 and the control terminal 110 according to the difference between Bluetooth low energy consumption technology and standard Bluetooth technology, and such variations all belong to the protection scope of the present application.
[0090] First embodiment:
[0091] The present application embodiment provides a WiFi network access method, which improves the user's ability to quickly configure the network of peripheral devices, such as printers, so that the printer can quickly connect to the wireless network. Detailed description is given below in conjunction with the accompanying drawings.
[0092] See also Figure 3 , is a flow chart of a WiFi access method provided in an embodiment of the present application. The method can be applied to Figure 1 and Figure 2 The application scenarios shown are as follows: Figure 3 As shown, it mainly includes the following steps.
[0093] Step S301: When the peripheral device enters the network configuration state, the first Bluetooth module enters the first broadcast state.
[0094] In a possible implementation, the user starts the network configuration operation in the peripheral device, the first Bluetooth module switches from the second broadcast state to the first broadcast state, and the second broadcast packet sent by the first Bluetooth module in the second broadcast state is different from the first broadcast packet. In a specific implementation, the user can start the peripheral device to enter the network configuration state through the panel button of the peripheral device, and the first Bluetooth module switches from the second broadcast state to the first broadcast state.
[0095] In one possible implementation, when the peripheral device is turned on for the first time after leaving the factory, the first Bluetooth module is turned on and enters the first broadcast state, allowing the user to quickly configure the wireless network of the peripheral device; after the configuration is connected to the wireless network, the first Bluetooth module switches to the second broadcast state, which can be used for the interaction of other messages; when the user needs to reconfigure the wireless network of the peripheral device, the broadcast state of the first Bluetooth module can be switched by pressing a button to enter the first broadcast state.
[0096] In one possible implementation, if the user starts a key operation to operate the peripheral device to enter the network configuration state, then the first Bluetooth module of the peripheral device is in a working state and enters a second broadcast state, sending out a second broadcast packet, which does not include identification information. In the second broadcast state, the control terminal detects the peripheral device and establishes a Bluetooth connection for information interaction. Optionally, in the second broadcast state, only a Bluetooth connection can be established for other information interaction, and information interaction for configuring the network cannot be performed.
[0097] In one possible implementation, when the WiFi module of the peripheral device is turned on and connected to a router, the first Bluetooth module is in the second broadcast state; when the WiFi module of the peripheral device is turned on but not connected to a router, the first Bluetooth module can be set to automatically enter the first broadcast state, or can be set to enter the first broadcast state by pressing a user button.
[0098] In a possible implementation, a separate button may be set in the peripheral device to start the first Bluetooth module to enter the first broadcast state, or an existing button in the peripheral device may be reused, which is not specifically limited in the embodiment of the present application.
[0099] Step S302: sending a first broadcast packet to the control terminal via the first Bluetooth module.
[0100] Specifically, in the first broadcast state, the first Bluetooth module of the peripheral device broadcasts the first broadcast packet to the outside. The control terminal enters the scanning state and obtains the first broadcast packet through the second Bluetooth module. Among them, the first broadcast packet includes the service UUID, the identification information of the peripheral device and the device ID. The service UUID can be used to identify whether the corresponding peripheral device complies with the communication protocol agreed upon between the control terminals. Because there may be many BLE devices broadcasting their broadcast packets around the same control terminal at the same time, at this time, only BLE devices that meet the agreed communication protocol will be displayed in the device list of the control terminal APP, and BLE devices that do not meet the agreed communication protocol will not be displayed. The identification information of the peripheral device can enable the control terminal to preferentially display the device ID of the peripheral device so that the user can preferentially select the peripheral device to quickly configure the peripheral device to connect to the wireless network.
[0101] In one possible implementation, the identification information of the peripheral device enables the user to preferentially select the peripheral device in the display interface of the control terminal to configure the network, including: the control terminal receives the first broadcast packet, and based on the identification information of the peripheral device, displays the device ID of the peripheral device at the first position in the device list of the display interface.
[0102] Specifically, when the peripheral device enters the first broadcast state, the broadcast data is as follows:
[0103]
[0104] Among them, Identify is used to set the position to 1 after clicking the preset key, and it will last for 30 seconds. After the control terminal recognizes this position, it will give priority to displaying the peripheral device in the search list.
[0105] Step S303: Establishing a Bluetooth connection between the peripheral device and the control terminal.
[0106] In the embodiment of the present application, the identification information of the peripheral device in the first broadcast packet can display the device ID of the peripheral device in the first place of the device list on the display interface of the terminal device, so that the user can trigger the Bluetooth connection between the peripheral device and the control terminal by clicking the device ID of the peripheral device. Specifically, the Bluetooth connection is a connection between the first Bluetooth module of the peripheral device and the second Bluetooth module of the terminal device.
[0107] Step S304: Send the network configuration information of the router to the peripheral device through the second Bluetooth module.
[0108] Specifically, after a Bluetooth connection is established between the peripheral device and the control terminal, the next step of network configuration operation can be performed.
[0109] In a possible implementation, the network configuration operation includes the user selecting the SSID of the router to be connected on the control terminal and entering the password, and then sending the network configuration information to the peripheral device via Bluetooth after confirmation, so that the WiFi module of the peripheral device can connect to the wireless network.
[0110] Before the peripheral device enters the formal network configuration process, it needs to start a Service, which must include the following two features:
[0111] The first feature: ssid_info
[0112] content illustrate Feature Name ssid_info UUID Must contain "1C01" Permissions write(withresponse) illustrate Used to receive wifi information
[0113] The corresponding data structure is shown in the following code:
[0114]
[0115]
[0116] Note that if this structure is larger than 20 bytes, it will be sent in packets, with each packet having a maximum size of 20 bytes. To ensure that the packets are sent correctly, the feature needs to have write (with response) permission.
[0117] Second feature: device_state
[0118] content illustrate Feature Name device_state UUID Must contain "1C02" Permissions notify illustrate Notify the management end of the networking progress
[0119] The corresponding data structure is as follows:
[0120]
[0121] Step S305: Connect the WiFi module to the WiFi network according to the network configuration information of the router.
[0122] Specifically, when the network configuration is successful, the peripheral device immediately notifies ILink_LinkSuccess, indicating that the network configuration is successful. In order to improve the user experience, if the peripheral device can determine that the WiFi cannot be connected, it should notify ILink_LinkWiFiErr. At this time, the control terminal will prompt the user to modify the router information.
[0123] For ease of understanding, the WiFi network access method provided in the embodiment of the present application is described in detail below in conjunction with a specific application scenario.
[0124] See also Figure 4 , is a flowchart of a WiFi access method provided in an embodiment of the present application. In this embodiment, the peripheral device is an image forming device, which includes a control module (the control module is also provided with a first Bluetooth module) and a WiFi module; an application APP is installed on the control terminal, and the control terminal can communicate with the image forming device through the APP. Figure 4 As shown, it mainly includes the following steps.
[0125] Step S401: The user triggers the network configuration process through the control terminal.
[0126] Specifically, the user can trigger the network configuration process through the APP of the control terminal and discover the image forming device to be configured through Bluetooth.
[0127] Step S402: The user triggers the network configuration process through the image forming device.
[0128] It should be noted that there is no particular order between step S401 and step S402.
[0129] Step S403: the image forming apparatus sends a first broadcast packet via the first Bluetooth module.
[0130] Specifically, the first broadcast packet includes the service UUID, the printer's identification information and the device ID.
[0131] Step S404: the control terminal parses the first broadcast packet, identifies the image forming device, and preferentially displays the device ID of the image forming device at the front of the Bluetooth search list according to the identification information.
[0132] Step S405: establishing a Bluetooth connection between the image forming apparatus and the control terminal.
[0133] It can be understood that, since the device ID of the image forming apparatus is displayed at the front of the Bluetooth search list, the user can give priority to the image forming apparatus and control the terminal to establish a Bluetooth connection with the image forming apparatus.
[0134] Step S406: The image forming device sends two characteristic values ssid_info and device_state to the control terminal.
[0135] After the image forming device establishes a Bluetooth connection with the control terminal, the image forming device returns two characteristic values ssid_info and device_state to the control terminal. Specifically, the two characteristic values ssid_info and device_state are returned to the APP of the control terminal.
[0136] Step S407: The control terminal writes the information (SSID and password) of the router selected by the user to connect to into ssid_info and sends it to the image forming apparatus.
[0137] Specifically, the control terminal may send ssid_info to the first Bluetooth module of the image forming device through the second Bluetooth module.
[0138] Step S408: The image forming apparatus sends ssid_info to the WiFi module.
[0139] Specifically, the first Bluetooth module of the image forming device sends ssid_info to the WiFi module, so that the WiFi module obtains the SSID and password according to ssid_info to connect to the router.
[0140] Step S409: the WiFi module writes the WiFi connection status into device_state and transmits it to the first Bluetooth module of the image forming apparatus.
[0141] Step S410: the image forming apparatus sends device_state to the control terminal via the first Bluetooth module.
[0142] Among them, device_state is used to notify the control terminal of the status and result of network configuration, for example, network configuration success or network configuration failure.
[0143] In a possible implementation, when the SSID and password of the router selected by the user to connect exceed the predetermined bytes, the information of the router needs to be sent in packets in step S407. The APP processes the SSID and password of the router in packets, and splices the total number of packets and the cyclic redundancy check (CRC) check value of each packet into a first data packet; after receiving the first data packet, the image forming device saves the data of the first data packet, and distinguishes the sequence number of the subsequent second data packet according to the CRC check value in the first data packet, and splices the data carried by the second data packet to restore the information of the router. Specifically, if it is divided into 10 data packets for sending, the first data packet will include the total number of data packets 10 and 10 CRC check values; when receiving the second data packet, the image forming device verifies the CRC check value carried by the second data packet with the CRC of the stored first data packet, and saves it if it is a correct packet, and parses the second data packet with the correct check, and splices out the SSID and password of the router.
[0144] See also Figure 5 , is a schematic diagram of data packet splitting provided in an embodiment of the present application. Figure 5 As shown, in the first data packet, the total number of packets is 1 byte; in the second data packet, the CRC check value is 2 bytes and the data is 18 bytes. Of course, those skilled in the art can adopt other data packet splitting methods according to actual needs, for example, setting the total number of packets, CRC check value and / or data to other byte numbers, and the embodiments of the present application do not specifically limit this.
[0145] Through the above-mentioned packet segmentation method, the information of the extremely long router can be packetized and sent, and the transmission security of the data packet can be guaranteed.
[0146] The technical solution provided by the embodiments of the present application has the following technical effects:
[0147] 1. Users can press a button to change the Bluetooth broadcast status of peripheral devices;
[0148] 2. The first broadcast status of the peripheral device can be displayed preferentially by the control terminal to allow the user to quickly configure the wireless network of the peripheral device.
[0149] Embodiment 2:
[0150] It is understandable that the above embodiments all describe the WiFi network access method. Based on the above implementation, the present application also provides a method for adding a peripheral device to a control terminal after the peripheral device is connected to a WiFi network.
[0151] See also Figure 6, is a flow chart of a method for adding a peripheral device provided in an embodiment of the present application. Figure 6 As shown, it mainly includes the following steps.
[0152] Step S601: The user clicks Add Device on the control terminal.
[0153] Specifically, the user can click to add a device on the APP of the control terminal, and adding a device refers to adding a peripheral device.
[0154] Step S602: Control the terminal to perform a search to display a list of searched devices.
[0155] In a possible implementation, the device list may include: a list of devices supporting Bluetooth and / or a list of networked devices.
[0156] Step S603: When the user selects a peripheral device that supports Bluetooth, a Bluetooth connection is established with the peripheral device that supports Bluetooth, and router information is sent to the peripheral device; when the peripheral device that supports Bluetooth is connected to the network, the control terminal identifies the peripheral device on the network and establishes a binding relationship.
[0157] Specifically, when a user needs to establish a Bluetooth connection with a peripheral device, when the user presses a predetermined button on the peripheral device, the device name of the peripheral device on which the predetermined button is pressed is displayed at the front of the list in the device list, so that the user can quickly select the peripheral device that needs Bluetooth network configuration, quickly configure the network for the peripheral device, and establish a wireless network connection with the peripheral device after the network is configured, so as to realize the addition of peripheral devices.
[0158] When the user presses a predetermined button on a peripheral device, the device name of the peripheral device on which the predetermined button is pressed is displayed at the front of the list in the device list. The specific implementation is the same as the description of Example 1. When a peripheral device that supports Bluetooth initiates a Bluetooth broadcast, the control terminal receives the first broadcast packet or the second broadcast packet, and the control terminal displays the peripheral device that sends the first broadcast packet at the front of the device list in priority, so that the user can quickly identify the peripheral devices that need to be configured with the network, so as to quickly bind the peripheral devices that have been configured with the network.
[0159] Step S604: When the user selects a peripheral device that has been connected to the network, a binding request is initiated with the peripheral device and a binding relationship is established.
[0160] Specifically, the list of networked devices includes peripheral devices that have been configured with wireless networks, or peripheral devices that have been connected to the network by wired means, or peripheral devices that have established communication with the cloud server; when the control terminal searches for networked devices, it searches for all peripheral devices that have been connected to the same local area network in the local area network to which the control terminal is connected. Furthermore, the control terminal can also search the cloud server for online peripheral devices that have established communication with the cloud server through a cellular network or a wide area network, and display the searched peripheral devices in the list of networked devices. When the user selects a networked peripheral device, the control terminal can perform a quick binding with the peripheral device.
[0161] Through the embodiments of the present application, a user can use the Wi-Fi network of the mobile phone in a control terminal (such as a mobile phone) to quickly search for peripheral devices (such as an image forming device) connected to the same Wi-Fi network. When the mobile phone uses a mobile cellular network, it can also search for peripheral devices communicating in the cloud, allowing the user to add different peripheral devices to achieve a wide range of mobile printing communications.
[0162] In a possible implementation, the displayed device list may also include: peripheral devices that emit SSID; when the user selects a peripheral device that emits SSID, establish direct communication with the peripheral device, control the terminal to transmit router information to the peripheral device that emits SSID, so that the peripheral device that emits SSID connects to the wireless network, and then control the terminal to establish communication with the peripheral device in the wireless network and perform a binding operation.
[0163] In a possible implementation, controlling the terminal to establish direct communication with the peripheral device specifically includes: controlling the terminal to establish direct communication with a soft AP of the peripheral device or establishing a point-to-point connection with the peripheral device in a Wi-Fi Direct manner.
[0164] By adopting the technical solution provided in the embodiment of the present application, when the user initiates binding a device or adding a device in the control terminal, the control terminal displays the searched peripheral devices and displays a list of peripheral devices that support Bluetooth and / or a list of peripheral devices that support Wi-Fi or networking in groups, so as to facilitate the user to quickly identify the desired target device, rather than displaying all the searched peripheral devices in one device list, which makes it difficult for the user to choose.
[0165] Embodiment three:
[0166] In the prior art, the first Bluetooth module of the peripheral device sends a broadcast by sending a broadcast packet of the same protocol, and the control terminal parses the broadcast packet according to the Bluetooth protocol to obtain corresponding data. However, if the Bluetooth protocols supported by the peripheral device and the control terminal are different, the peripheral device and the control terminal will not be able to communicate via Bluetooth.
[0167] To address this problem, an embodiment of the present application provides a communication method.
[0168] See also Figure 7 , is a communication method provided in an embodiment of the present application. The method can be applied to Figure 1 and Figure 2 The application scenarios shown are as follows: Figure 7 As shown, it mainly includes the following steps.
[0169] Step S701: the peripheral device sends a first broadcast packet encapsulated according to a first Bluetooth protocol to the control terminal.
[0170] In the embodiment of the present application, the peripheral device may support multiple Bluetooth protocols. For example, a first Bluetooth protocol and a second Bluetooth protocol. It should be noted that the first Bluetooth protocol and the second Bluetooth protocol are used as examples for illustration in the embodiment of the present application, and the embodiment of the present application does not specifically limit this. For example, in some possible implementations, the peripheral device may also support more than three Bluetooth protocols.
[0171] First, the peripheral device encapsulates a first broadcast packet according to a first Bluetooth protocol; then, the first Bluetooth module starts Bluetooth broadcasting, and sends the first broadcast packet to the control terminal through the first Bluetooth module.
[0172] Step S702: If the first Bluetooth protocol is a protocol supported by a first application of the control terminal, the first broadcast packet is parsed using the first application.
[0173] It is understandable that the control terminal may support the first Bluetooth protocol or may not support the first Bluetooth protocol.
[0174] Among them, if the first Bluetooth protocol is a protocol supported by the first application of the control terminal, the first application is used to parse the first broadcast packet; if the first Bluetooth protocol is a protocol not supported by the control terminal, the first application is not used to parse the first broadcast packet and the first broadcast packet is discarded.
[0175] Step S703: the peripheral device sends a second broadcast packet encapsulated according to the second Bluetooth protocol to the control terminal.
[0176] First, the peripheral device may encapsulate a second broadcast packet according to a second Bluetooth protocol; then, start Bluetooth broadcasting, and send the second broadcast packet to the control terminal through the first Bluetooth module.
[0177] In a possible implementation, after the peripheral device sends the first broadcast packet, it may delay for a preset time before sending the second broadcast packet, for example, delaying for 500ms, 800ms, etc., which is not specifically limited in the embodiment of the present application.
[0178] Step S704: If the second Bluetooth protocol is a protocol supported by the second application of the control terminal, the second broadcast packet is parsed using the second application.
[0179] It is understandable that the control terminal may support the second Bluetooth protocol or may not support the second Bluetooth protocol.
[0180] Among them, if the second Bluetooth protocol is a protocol supported by the second application of the control terminal, the second application is used to parse the second broadcast packet; if the second Bluetooth protocol is a protocol not supported by the control terminal, the second application is not used to parse the second broadcast packet and the second broadcast packet is discarded.
[0181] In summary, in the embodiments of the present application, the peripheral device supports multiple Bluetooth protocols, which can improve the compatibility of the peripheral device.
[0182] In a possible implementation, the first broadcast packet and / or the second broadcast packet include a first broadcast packet and a second broadcast packet. The first broadcast packet is only sent when the network is configured, and the second broadcast packet is sent when the network is not configured to perform normal Bluetooth communication. The specific contents of the first broadcast packet and the second broadcast packet can be found in the description of the above embodiment, and will not be repeated here for the sake of brevity.
[0183] Specifically, the user starts the network configuration operation in the peripheral device, and the first Bluetooth module switches from the second broadcast state to the first broadcast state. In the first broadcast state, the first Bluetooth module broadcasts the first broadcast packet encapsulated according to the first Bluetooth protocol to the control terminal; in the second broadcast state, the first Bluetooth module sends a second broadcast packet encapsulated according to the first Bluetooth protocol to the control terminal, wherein the first broadcast packet and the second broadcast packet are different. If the first Bluetooth protocol is a protocol supported by the first application of the control terminal, the control terminal can use the first application to parse the first broadcast packet and the second broadcast packet.
[0184] In one possible implementation, the first broadcast packet and / or the second broadcast packet includes a service UUID, identification information of the peripheral device, and a device ID. The service UUID can be used to identify whether the corresponding peripheral device complies with the communication protocol agreed upon between the control terminals. Because there may be many BLE devices broadcasting their broadcast packets around the same control terminal at the same time, at this time, only BLE devices that meet the agreed communication protocol will be displayed in the device list of the control terminal APP, and BLE devices that do not meet the agreed communication protocol will not be displayed. The identification information of the peripheral device can enable the control terminal to preferentially display the device ID of the peripheral device so that the user can preferentially select the peripheral device to quickly configure the peripheral device to connect to the wireless network.
[0185] In one possible implementation, after the control terminal uses the first application to parse the first broadcast packet, and / or after using the second application to parse the second broadcast packet, a Bluetooth connection between the control terminal and the peripheral device can be established based on the data obtained from the analysis.
[0186] It is understandable that after the Bluetooth connection is established between the peripheral device and the control terminal, the next step of network configuration operation can be performed. Specifically, the control terminal sends the network configuration information of the router to the first Bluetooth module of the peripheral device through the second Bluetooth module, and the peripheral device connects the WiFi module to the WiFi network according to the network configuration information of the router.
[0187] In a possible implementation, when the network configuration information of the router (the SSID and password of the router) exceeds the predetermined bytes, the network configuration information of the router needs to be sent in packets. Specifically, the control terminal processes the SSID and password of the router in packets, and splices the total number of packets and the cyclic redundancy check (CRC) check value of each packet into a first data packet; after receiving the first data packet, the image forming device saves the data of the first data packet, and distinguishes the sequence number of the subsequent second data packet according to the CRC check value in the first data packet, and splices the data carried by the second data packet to restore the information of the router. Specifically, if it is divided into 10 data packets for transmission, the first data packet will include the total number of data packets 10 and 10 CRC check values; when receiving the second data packet, the image forming device verifies the CRC check value carried by the second data packet with the CRC of the stored first data packet, and if it is found to be a correct packet, it is saved, and the second data packet with the correct check is parsed to splice the SSID and password of the router. For the specific content of the network configuration operation, please refer to the description of the above embodiment, and for the sake of simplicity, it will not be repeated here.
[0188] Through the above-mentioned packet segmentation method, the information of the extremely long router can be packetized and sent, and the transmission security of the data packet can be guaranteed.
[0189] Corresponding to the above embodiment, the present application also provides a peripheral device. Figure 8 A schematic diagram of the structure of a peripheral device provided in an embodiment of the present invention, the peripheral device 800 may include: a processor 801, a memory 802 and a communication unit 803. These components communicate through one or more buses. Those skilled in the art can understand that the structure of the peripheral device shown in the figure does not constitute a limitation on the embodiment of the present invention, it can be a bus structure or a star structure, and can also include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0190] The communication unit 803 is used to establish a communication channel so that the memory 802 can communicate with other devices, receive user data sent by other devices or send user data to other devices.
[0191] The processor 801 is the control center of the storage device. It uses various interfaces and lines to connect various parts of the entire electronic device. It runs or executes software programs and / or modules stored in the memory 802, and calls data stored in the memory to perform various functions of the electronic device and / or process data. The processor can be composed of an integrated circuit (IC), for example, it can be composed of a single packaged IC, or it can be composed of multiple packaged ICs with the same or different functions. For example, the processor 801 can include only a central processing unit (CPU). In an embodiment of the present invention, the CPU can be a single computing core or multiple computing cores.
[0192] The memory 802 is used to store the execution instructions of the processor 801. The memory 802 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0193] When the execution instructions in the memory 802 are executed by the processor 801 , the peripheral device 800 is enabled to execute part or all of the steps in the above method embodiment.
[0194] In a specific implementation, the present invention further provides a computer storage medium, wherein the computer storage medium may store a program, and when the program is executed, the program may include some or all of the steps in each embodiment of the calling method provided by the present invention. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0195] In the embodiments of the present application, "at least one" refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0196] Those skilled in the art will appreciate that the various units and algorithm steps described in the embodiments disclosed herein can be implemented in a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
[0197] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0198] In several embodiments provided by the present invention, if any function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0199] The above is only a specific embodiment of the present invention. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. The protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A WiFi access method, applied to a peripheral device, characterized in that: The peripheral device includes a first Bluetooth module and a WiFi module, and the method includes: when the peripheral device enters a network configuration state, the first Bluetooth module enters a first broadcast state; Sending a first broadcast packet to the control terminal through the first Bluetooth module, wherein the first broadcast packet includes a service UUID, identification information of the peripheral device and a device ID, and the identification information of the peripheral device enables a user to preferentially select the peripheral device in a display interface of the control terminal to configure a network; Establishing a Bluetooth connection between the peripheral device and the control terminal; Receiving network configuration information of a router from the control terminal through the first Bluetooth module; Connecting the WiFi module to the WiFi network according to the network configuration information of the router; Wherein, when the peripheral device enters the network configuration state, the first Bluetooth module enters the first broadcast state including: The user starts the network configuration operation in the peripheral device, and the first Bluetooth module switches from the second broadcast state to the first broadcast state. In the second broadcast state, the second broadcast packet sent by the first Bluetooth module is different from the first broadcast packet.
2. The WiFi access method according to claim 1, characterized in that: The identification information of the peripheral device enables the user to preferentially select the peripheral device in the display interface of the control terminal to configure the network, including: The control terminal receives the first broadcast packet, and displays the device ID of the peripheral device at the first position of the device list on the display interface according to the identification information of the peripheral device.
3. The WiFi access method according to claim 1, characterized in that: The receiving of the network configuration information of the router from the control terminal through the first Bluetooth module includes: receiving a first data packet, the first data packet including the total number of packets and the check value of the sub-packets; receiving a second data packet, detecting whether the second data packet is correct based on the check value of the first data packet, and if correct, parsing the second data packet to obtain the network configuration information of the router.
4. A WiFi network access method, applied to a control terminal, the control terminal includes a second Bluetooth module, characterized in that: The method comprises: Acquire identification information of a peripheral device through the second Bluetooth module; Wherein, obtaining identification information of a peripheral device through the second Bluetooth module includes: Controlling the control terminal to enter a scanning state, obtaining a first broadcast packet sent by the peripheral device, wherein the first broadcast packet includes a service UUID, identification information of the peripheral device, and a device ID, and the identification information of the peripheral device enables a user to preferentially select the peripheral device in a display interface of the control terminal to configure a network; Parsing the first broadcast packet to obtain the identification information; According to the identification information, the device ID of the peripheral device is displayed first in the device list of the display interface; Establishing a Bluetooth connection with the peripheral device according to the user's selection, and sending the network configuration information of the router to the peripheral device; The first broadcast packet is: when the user starts the network configuration operation in the peripheral device and the first Bluetooth module in the peripheral device switches from the second broadcast state to the first broadcast state, the peripheral device sends a broadcast packet to the control terminal through the first Bluetooth module, and the second broadcast packet sent by the first Bluetooth module in the second broadcast state is different from the first broadcast packet.
5. The method according to claim 4, characterized in that Also includes: Receive a network access success message returned by the peripheral device, and send a disconnection instruction to the peripheral device to disconnect the Bluetooth connection with the peripheral device.
6. The method according to claim 4, characterized in that The sending of the network configuration information of the router to the peripheral device includes: sending a first data packet, the first data packet including the total number of packets and the check value of the sub-packets; sending a second data packet so that the peripheral device detects whether the second data packet is correct based on the check value of the first data packet, and if correct, parses the second data packet to obtain the network configuration information of the router.
7. The method according to claim 4, wherein the device list on the display interface comprises a list of peripheral devices supporting Bluetooth and / or a list of networked devices; in, The controlling the control terminal to enter the scanning state includes: controlling the second Bluetooth module of the control terminal to search for peripheral devices supporting Bluetooth, and / or controlling the control terminal to search for peripheral devices that have been connected to the network, and / or controlling the control terminal to search for peripheral devices that have communicated with the cloud server; When the user selects a peripheral device that has been connected to the network or a peripheral device that has been communicating with the cloud server, the control terminal establishes a binding relationship with the peripheral device that has been connected to the network or the peripheral device that has been communicating with the cloud server.
8. The method according to claim 4, wherein the device list on the display interface further comprises: The peripheral device that sends out the SSID, when the user selects the peripheral device that sends out the SSID, establishes direct communication with the peripheral device, and sends the network configuration information of the router to the peripheral device.
9. A peripheral device, characterized in that: including memory, processor and computer program; The computer program is stored in the memory and is configured to be executed by the processor to implement the method according to any one of claims 1 to 3.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed, the steps of the method according to any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Bluetooth processing method and device
CN107087247A
WiFi network access method, intelligent hardware equipment and electronic terminal
CN107231606A
Method and device for establishing communication connection, electronic device and storage medium
CN110166974A
Intelligent equipment WiFi network distribution method and system, electronic equipment and medium
CN113518407A