Control equipment, intelligent equipment network distribution method and computer readable storage medium
By selecting the Bluetooth distribution network first during the smart device distribution process, switching to the AP distribution network when no Bluetooth broadcast packet is detected, and switching back to the Bluetooth distribution network when Bluetooth broadcast packet is detected during the AP distribution process, the solution The problem of low success rate of smart device distribution network in the prior art has achieved higher success rate of distribution network and better user experience.
Patent Information
- Application Number
- CN202410009157.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-03
- Publication Date
- 2025-02-11
AI Technical Summary
The existing smart device distribution methods have strong reliance on a single technical path, resulting in low networking success rate and poor operating experience.
The Bluetooth distribution network is preferred by controlling the device, but when the Bluetooth distribution packet of the smart device is not detected within the preset time period, switch to the AP distribution mode, and if the Bluetooth distribution packet is detected during the AP distribution process, switch back immediately Bluetooth distribution network mode to improve the success rate of distribution network.
It improves the success rate and efficiency of smart device distribution network, simplifies distribution network steps, and improves user experience.
Smart Images

Figure CN119421111A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to terminal technology, and more specifically, to a control device, a smart device network configuration method, and a computer-readable storage medium. Background Art
[0002] With the rapid development of smart homes, smart home appliances have become more and more popular. The networking of devices requires a network configuration process - obtaining the network information (wireless LAN (wifi) name and password) required to be connected from the mobile application (APPlication, APP), connecting to the router and then connecting to the manufacturer's cloud platform, thereby realizing the function of APP controlling the home.
[0003] In order to improve the success rate of device networking and improve the operating experience, most smart IoT modules currently provide multiple network configuration methods to solve the strong dependence of a single network configuration method on a certain technology or operation path. Currently, as the mainstream of the industry, most modules support both Bluetooth and Wireless Access Point (AP) network configuration modes, and enter different technical interaction processes according to the user's mobile phone operation status. Summary of the invention
[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the embodiments of the present application provide a control device, a smart device network configuration method and a computer-readable storage medium, which can improve the success rate of smart device network configuration.
[0005] In a first aspect, an embodiment of the present application provides a control device, including: a controller, configured to: determine whether a Bluetooth broadcast packet of a smart device to be networked is not scanned within a preset time period; while keeping the Bluetooth scanning turned on, detect whether there is an AP network generated by the smart device to enter the AP network configuration process, and execute the network configuration of the smart device based on the AP network configuration process; before sending network configuration information to the smart device through the AP connection between the control device and the smart device, if a Bluetooth broadcast packet sent by the smart device is scanned, stop the AP network configuration process; based on the Bluetooth broadcast packet sent by the smart device, establish a Bluetooth connection with the smart device to enter the Bluetooth network configuration process, and execute the network configuration of the smart device based on the Bluetooth network configuration process.
[0006] In a second aspect, an embodiment of the present application provides a smart device network configuration method, which is applied to a control device, including:
[0007] Determine that no Bluetooth broadcast packet of the smart device to be networked is scanned within a preset time period;
[0008] While keeping Bluetooth scanning turned on, detect whether there is an AP network generated by the smart device to enter the AP network configuration process, and perform network configuration of the smart device based on the AP network configuration process;
[0009] Before sending the network configuration information to the smart device through the AP connection between the control device and the smart device, if a Bluetooth broadcast packet sent by the smart device is scanned, stop the AP network configuration process;
[0010] Based on the Bluetooth broadcast packet sent by the smart device, a Bluetooth connection is established with the smart device to enter the Bluetooth network configuration process, and the network configuration of the smart device is performed based on the Bluetooth network configuration process.
[0011] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, including: a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the smart device networking method shown in the second aspect is implemented.
[0012] In a fourth aspect, an embodiment of the present application provides a computer program product, including: when the computer program product runs on a computer, the computer implements the smart device network configuration method shown in the second aspect.
[0013] The technical solution provided by the embodiment of the present application has the following advantages over the prior art: In the embodiment of the present application, in the process of network configuration for the smart device, Bluetooth network configuration is preferentially selected, but when the Bluetooth broadcast packet sent by the smart device is not detected within the preset time, while continuing to detect the Bluetooth broadcast packet sent by the smart device, it is detected whether there is an AP network generated by the smart device to enter the AP network configuration process (when the Bluetooth broadcast packet is not detected after the timeout, it is automatically switched from the Bluetooth network configuration mode to the AP network configuration mode, but the scanning of the Bluetooth broadcast packet is maintained at the same time), and before the AP network configuration process is executed to send the network configuration information to the smart device through the AP connection, when the Bluetooth broadcast packet sent by the smart device is scanned, the AP network configuration process is stopped, a Bluetooth connection is established based on the Bluetooth broadcast packet sent by the smart device, and then the Bluetooth network configuration process is entered (that is, it is switched from the AP network configuration mode to the Bluetooth network configuration mode), so that the smart device is configured for network configuration based on the Bluetooth network configuration process. Since the Bluetooth network configuration mode has simple steps and a high success rate, if the Bluetooth broadcast packet is detected during the AP network configuration process and switched to the Bluetooth network configuration mode, the success rate of network configuration for the smart device can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the implementation methods in the embodiments of the present application or the related technologies, the following is a brief introduction to the drawings required for use in the embodiments or the related technology descriptions. Obviously, the drawings described below are some embodiments of the present application, and a person skilled in the art can also obtain other drawings based on these drawings.
[0015] Figure 1 A schematic diagram of a scenario in which a control device configures a network for a smart device according to some embodiments is shown;
[0016] Figure 2 shows a hardware configuration block diagram of a smart device 100 according to some embodiments;
[0017] Figure 3 shows a hardware configuration block diagram of a control device 200 according to some embodiments;
[0018] Figure 4 shows a software configuration diagram in a control device 200 according to some embodiments;
[0019] Figure 5 One of the flowcharts of the method for configuring a network for a smart device according to some embodiments is shown;
[0020] Figure 6 A second flow chart of a method for configuring a network for a smart device according to some embodiments is shown;
[0021] Figure 7 A third flowchart of a method for configuring a network for smart devices according to some embodiments is shown;
[0022] Figure 8 A fourth flowchart of a method for configuring a network for smart devices according to some embodiments is shown;
[0023] Fig. 9 A fifth flow chart of a method for configuring a network for smart devices according to some embodiments is shown;
[0024] Fig.10 A sixth flow chart of a method for configuring a network for smart devices according to some embodiments is shown;
[0025] FIG11( a ) shows a seventh flow chart of a method for configuring a network for smart devices according to some embodiments;
[0026] FIG11( b ) shows an eighth flow chart of a method for configuring a network for smart devices according to some embodiments. DETAILED DESCRIPTION
[0027] In order to make the purpose and implementation method of the present application clearer, the exemplary implementation method of the present application will be clearly and completely described below in conjunction with the drawings in the exemplary embodiments of the present application. Obviously, the described exemplary embodiments are only part of the embodiments of the present application, rather than all the embodiments.
[0028] It should be noted that the brief description of terms in this application is only for the convenience of understanding the embodiments described below, and is not intended to limit the embodiments of this application. Unless otherwise specified, these terms should be understood according to their common and usual meanings.
[0029] The terms "first", "second", "third", etc. in the specification and claims of this application and the above drawings are used to distinguish similar or similar objects or entities, and do not necessarily mean to limit a specific order or sequence, unless otherwise noted. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances.
[0030] The terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device comprising a list of components is not necessarily limited to all the components expressly listed but may include other components not expressly listed or inherent to such product or device.
[0031] Figure 1 This is a schematic diagram of a scenario in which the control device in the embodiment of the present application is a smart device network configuration, wherein the control device can have a variety of implementation forms, for example, it can be a television, a smart TV, a laser projection device, a monitor, an electronic whiteboard (electronic bulletin board), an electronic desktop (electronic table), a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, etc.; the smart device can have a variety of implementation forms, for example, it can be an air conditioner, a refrigerator, a range hood, a water heater, an electric fan, a speaker and other smart home devices, the specific implementation form can be determined according to the actual situation and is not limited here. Figure 1 As shown, the user can configure the network for the smart device 100 by operating the control device 200 .
[0032] In some embodiments, the communication between the smart device 100 and the control device 200 includes AP communication or Bluetooth protocol communication, and other short-range communication methods. The control device 200 can configure the network for the smart device 100 through the APP installed on the control device, and manage and control the smart device 100 through the APP after the smart device 100 is successfully configured.
[0033] In some embodiments, the control device 200 can be controlled wirelessly or wired. The user can control the control device 200 by inputting user commands through buttons on a remote controller, voice input, control panel input, etc.
[0034] In some embodiments, a mobile terminal, a tablet computer, a computer, a laptop computer, etc. may also be used to control the control device 200. For example, the control device 200 may be controlled using an application running on a mobile phone.
[0035] In some embodiments, the control device 200 receives user control through operations such as touch or gestures.
[0036] In some embodiments, the control device 200 also communicates data with the server 300. The control device 200 may be allowed to communicate via a local area network (LAN), a wireless local area network (WLAN), and other networks. The server 300 may provide various content and interactions to the control device 200. The server 300 may be one cluster or multiple clusters, and may include one or more types of servers.
[0037] Figure 2 FIG. 1 exemplarily shows a configuration block diagram of the smart device 100 according to an exemplary embodiment. Figure 2 As shown, the smart device 100 includes a controller 110, a communication interface 130, a user input / output interface 140, an external memory, and a power supply. The smart device 100 can receive user input operation instructions and perform corresponding control in response to the user input operation instructions.
[0038] like Figure 3 The control device 200 includes at least one of a tuner and demodulator 210, a communicator 220, a detector 230, an external device interface 240, a controller 250, a display 260, an audio output interface 270, a user interface 280, an external memory, and a power supply.
[0039] In some embodiments, the controller includes a processor, a video processor, an audio processor, a graphics processor, a RAM, a ROM, and a first interface to an nth interface for input / output.
[0040] The display 260 includes a display screen component for presenting images, and a driving component for driving image display, which is used to receive image signals output from the controller, and display video content, image content, and menu control interface components and user control UI interface.
[0041] The display 260 may be a liquid crystal display, an OLED display, or a projection display, and may also be a projection device and a projection screen.
[0042] The communicator 220 is a component for communicating with an external device or server according to various communication protocol types. For example, the communicator may include at least one of a Wifi module, a Bluetooth module, a wired Ethernet module, and other network communication protocol chips or near field communication protocol chips, and an infrared receiver. The control device 200 may establish transmission and reception of control signals and data signals with the smart device 100 or the server 300 through the communicator 220.
[0043] The user interface 280 can be used to receive control signals from a control device (such as an infrared remote controller, etc.) or directly receive user input operation instructions and convert the operation instructions into instructions that the control device 200 can recognize and respond to. In this case, it can be called a user input interface.
[0044] The detector 230 is used to collect signals from the external environment or the external interaction. For example, the detector 230 includes a light receiver, a sensor for collecting the intensity of ambient light; or, the detector 230 includes an image collector, such as a camera, which can be used to collect external environment scenes, user attributes or user interaction gestures; or, the detector 230 includes a sound collector, such as a microphone, etc., for receiving external sounds.
[0045] The external device interface 240 may include, but is not limited to, any one or more of the following interfaces: a high-definition multimedia interface (HDMI), an analog or digital high-definition component input interface (component), a composite video input interface (CVBS), a USB input interface (USB), an RGB port, etc. It may also be a composite input / output interface formed by the above multiple interfaces.
[0046] The tuner-demodulator 210 receives broadcast television signals via wired or wireless reception, and demodulates audio and video signals, such as EPG data signals, from a plurality of wireless or wired broadcast television signals.
[0047] In some embodiments, the controller 250 and the tuner-demodulator 210 may be located in different separate devices, that is, the tuner-demodulator 210 may also be located in an external device of the main device where the controller 250 is located, such as an external set-top box.
[0048] The controller 250 controls the operation of the control device and responds to user operations through various software control programs stored in the memory (internal memory or external memory). The controller 250 controls the overall operation of the control device 200. For example, in response to receiving a user command for selecting a UI object to be displayed on the display 260, the controller 250 can perform operations related to the object selected by the user command.
[0049] In some embodiments, the controller includes a central processing unit (CPU), a video processor, an audio processor, a graphics processing unit (GPU), and at least one of a random access memory (RAM), a read-only memory (ROM), a first interface to an nth interface for input / output, a communication bus, etc.
[0050] Among them, RAM, also called main memory, is an internal memory that directly exchanges data with the controller. It can be read and written at any time (except when refreshed), and it is very fast. It is usually used as a temporary data storage medium for operating systems or other running programs. The biggest difference between it and ROM is the volatility of data, that is, once the power is cut off, the stored data will be lost. RAM is used in computers and digital systems to temporarily store programs, data and intermediate results. ROM works in a non-destructive read-out mode and can only read but not write information. Once the information is written, it is fixed, and even if the power is cut off, the information will not be lost, so it is also called fixed memory.
[0051] The user may input a user command through a graphical user interface (GUI) displayed on the display 260, and the user input interface receives the user input command through the graphical user interface (GUI). Alternatively, the user may input a user command through a specific sound or gesture, and the user input interface recognizes the sound or gesture through a sensor to receive the user input command.
[0052] "User interface" is the medium interface for interaction and information exchange between applications or operating systems and users. It realizes the conversion between the internal form of information and the form acceptable to users. The commonly used form of user interface is the graphical user interface (GUI), which refers to the user interface related to computer operation displayed in a graphical way. It can be an icon, window, control or other interface element displayed on the display screen of the control device, where the control can include icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets and other visual interface elements.
[0053] The present application provides a control device, a smart device network configuration method, and a computer-readable storage medium, wherein the control device can implement the smart device network configuration method provided in the present application embodiment, or the functional module or functional entity in the control device can implement the smart device network configuration method provided in the present application embodiment. The control device includes: a controller corresponding to the above Figure 3 Controller 250 in.
[0054] In some embodiments of the present application, the controller is configured to: determine whether a Bluetooth broadcast packet of the smart device to be networked is scanned within a preset time period; while keeping the Bluetooth scanning turned on, detect whether there is an AP network generated by the smart device to enter the AP network configuration process, and execute the network configuration of the smart device based on the AP network configuration process; before sending network configuration information to the smart device through the AP connection between the control device and the smart device, if a Bluetooth broadcast packet sent by the smart device is scanned, stop the AP network configuration process; based on the Bluetooth broadcast packet sent by the smart device, establish a Bluetooth connection with the smart device to enter the Bluetooth network configuration process, and execute the network configuration of the smart device based on the Bluetooth network configuration process.
[0055] The preset duration can be determined according to actual needs and is not limited here.
[0056] In some embodiments of the present application, the AP network generated by the smart device may be an AP network generated by a WiFi module of the smart device. The WiFi module of the smart device includes a wireless module called a soft AP (Soft-AP). The specific hardware part of the soft AP is a standard wireless network card, but the soft AP uses a driver program to enable the soft AP to provide the same signal switching, routing and other functions as the AP.
[0057] It should be noted that, for control devices with different operating systems, the above process of detecting whether there is an AP network generated by the smart device and establishing an AP connection may be the same or different. The specific process can be determined based on actual conditions and is not limited here.
[0058] Exemplarily, for a control device whose operating system is an Android system, the above process of detecting whether there is an AP network generated by the smart device and establishing an AP connection may specifically include: detecting whether an AP network is currently connected, if an AP network is currently connected, detecting whether the WiFi name of the currently connected AP network starts with a preset mark, and ending if the WiFi name of the currently connected AP network starts with a preset mark; if the WiFi name of the currently connected AP network does not start with a preset mark, or if an AP network is not currently connected, scanning nearby AP networks to detect whether there is an AP network whose WiFi name starts with a preset mark in at least one of the currently scanned AP networks. It can be determined by filtering according to the local area network identification code that there are several AP networks whose WiFi names start with a preset mark in at least one of the previously scanned AP networks. If there is an AP network whose WiFi name starts with a preset mark in at least one AP network (the AP network is the AP network generated by the smart device), the AP network is automatically connected, that is, the control device establishes an AP connection with the smart device; if there are multiple AP networks whose WiFi names start with a preset mark in at least one AP network (the multiple AP networks include the AP network generated by the smart device), the identifiers of the multiple AP networks are displayed on the control device (that is, an AP list is displayed, and the AP list includes the identifiers of the multiple AP networks) for user selection, and then the AP network selected by the user is connected, that is, the control device establishes an AP connection with the smart device; if there is no AP network whose WiFi name starts with a preset mark in at least one AP network, a reminder message is output to prompt the user to select the required AP network on the setting page of the control device for connection, and then return to the APP to determine whether the WiFi name of the currently connected AP network starts with the preset mark. If the WiFi name of the currently connected AP network starts with the preset mark, it is determined that the currently connected AP network is the AP network of the smart device.
[0059] Exemplarily, for a control device whose operating system is an iOS system, the above-mentioned process of detecting whether there is an AP network generated by the smart device and establishing an AP connection may specifically include: detecting whether the AP network is currently connected; if the AP network is currently connected, detecting whether the WiFi name of the currently connected AP network starts with a preset mark; if the WiFi name of the currently connected AP network starts with a preset mark, then ending; if the WiFi name of the currently connected AP network does not start with a preset mark, or if the AP network is not currently connected, outputting a reminder message to prompt the user to go to the phone settings page to select an AP network whose WiFi name starts with a preset mark for connection, and then returning to the APP to end.
[0060] Among them, the AP network whose WiFi name begins with a preset mark, that is, the AP network generated by the electronic device that needs to be networked. The smart device is an electronic device that needs to be networked. Therefore, the WiFi name of the AP network generated by the smart device begins with a preset mark.
[0061] The preset mark can be determined according to actual conditions and is not limited here. For example, the preset mark can be "HIS", where "HIS" represents a pre-agreed device type.
[0062] In an embodiment of the present application, in the process of configuring a network for a smart device, Bluetooth configuration is preferentially selected, but if a Bluetooth broadcast packet sent by the smart device is not detected within a preset time period, while continuing to detect the Bluetooth broadcast packet sent by the smart device, it is detected whether there is an AP network generated by the smart device to enter the AP configuration process (if the Bluetooth broadcast packet sent by the smart device is not detected after a timeout, the Bluetooth configuration mode is automatically switched to the AP configuration mode, but the scanning of the Bluetooth broadcast packet is maintained at the same time), and before the AP configuration process is executed to send the configuration information to the smart device through the AP connection, if a Bluetooth broadcast packet sent by the smart device is scanned, the AP configuration process is stopped, a Bluetooth connection is established based on the Bluetooth broadcast packet sent by the smart device, and then the Bluetooth configuration process is entered (i.e., switching from the AP configuration mode to the Bluetooth configuration mode), so as to configure the smart device for a network based on the Bluetooth configuration process. Since the Bluetooth configuration mode has simple steps and a high success rate, if a Bluetooth broadcast packet is detected during the AP configuration process and switched to the Bluetooth configuration mode, the success rate of configuring the smart device for a network can be improved.
[0063] The following is an introduction to the more commonly used AP network configuration process:
[0064] S401: Establish an AP connection between the control device and the smart device.
[0065] Illustratively, the above S401 may include the following S401a and S401b.
[0066] S401a, the control device connects to the AP network generated by the smart device.
[0067] S401b: The control device establishes a communication channel with the smart device by opening a protocol stack.
[0068] In the embodiment of the present application, the protocol stack is a private connection protocol, specifically referring to establishing a communication channel between the control device and the smart device through a private protocol.
[0069] Start the protocol stack and determine whether it is successfully started. If the protocol stack fails to start after a timeout, retry the preset number of times (usually 3 times). If each retry still fails to start the protocol stack after a timeout, it is determined that the network configuration has failed. The reason for the network configuration failure is the failure to start the protocol stack. If the protocol stack is successfully started, enter the device to determine whether the control device supports the preset protocol.
[0070] S402: Determine whether the smart device is a device that supports a preset protocol.
[0071] The preset protocol may be a private directory 8 protocol or other protocols, which are not limited here.
[0072] It can be understood that the control device of the present application obtains the WiFi list and determines whether the smart device is online in different ways for smart devices that support the preset protocol and smart devices that do not support the preset protocol. Among them, for smart devices that support the preset protocol, the control device can obtain the first WiFi list searched by the smart device through the following S403 to S408, and determine whether the smart device is successfully online through the following S412; for smart devices that do not support the preset protocol, the control device can obtain the second WiFi list searched by itself through the following S414, and determine whether the smart device is successfully online through the following S418.
[0073] If it is determined that the smart device is a device that supports the preset protocol, the following S403 is executed; if it is determined that the smart device is not a device that supports the preset protocol, the following S414 is executed.
[0074] S403: Send a message to the smart device to obtain device information.
[0075] S404: Determine whether a message for obtaining device information is successfully sent to the smart device.
[0076] Retry a preset number of times (usually 3 times). If each retry fails, it is determined that the network configuration has failed. The reason for the network configuration failure is that the device information cannot be sent down. If the device information is successfully sent down, the following S405 is executed.
[0077] S405: Determine whether the device information returned by the smart device is successfully received.
[0078] A timeout timer of a certain length (usually 20 seconds) is set, and a retry time interval (such as retrying once every 10 seconds) is set. After success, the timer is removed and the following S406 is executed; if the timeout fails, it is determined that the network configuration has failed, and the reason for the network configuration failure is that the device information has not been obtained.
[0079] S406: Send a message to the smart device to obtain a WiFi list.
[0080] S407: Determine whether a message for obtaining a WiFi list is successfully sent to the smart device.
[0081] Retry a preset number of times (usually 3 times). If each retry fails, it is determined that the network configuration has failed. The reason for the network configuration failure is that the WiFi list cannot be sent down. If the WiFi list is successfully sent down, the following S408 is executed.
[0082] S408: Determine whether the first WiFi list returned by the smart device is successfully received.
[0083] Set a timeout timer of a certain length (usually 20s), set a retry interval (such as retrying once every 10s), remove the timer after success, and execute the following S409; if the timeout fails, it is determined that the network configuration has failed, and the reason for the network configuration failure is that the WiFi list has not been obtained.
[0084] S409: Based on the first WiFi list, send network configuration information to the smart device.
[0085] The network configuration information is the WiFi name and WiFi password of the target WiFi used by the smart device for network configuration. The target WiFi is a WiFi selected by the control device for the smart device from the first WiFi list. The first WiFi list includes at least one WiFi.
[0086] S410: Determine whether the network configuration information is written successfully.
[0087] Retry a preset number of times (usually 3 times). If each retry fails, it is determined that the network configuration has failed. The reason for the network configuration failure is the failure to send the network configuration information. If the network configuration information is successfully written, the following S411 is executed.
[0088] S411, determining whether a callback indicating successful distribution network information delivery is received successfully.
[0089] Set a timeout timer of a certain length (usually 20s), set a retry time interval (such as retrying once every 10s), remove the timer after success, and execute the following S412; if the timeout fails, it is determined that the network configuration has failed, and the reason for the network configuration failure is the failure to send the network configuration information.
[0090] S412: The interface polls the device status.
[0091] The interface polls the device status and can send a query message to the smart device to check whether it is online. If a reply message indicating successful online status is received from the smart device, it means that the smart device is online, that is, the smart device has been successfully configured with the network; if a reply message indicating unsuccessful online status is received from the smart device, the smart device is not online.
[0092] Set a timeout timer of a certain length (such as 60s), set a retry time interval (such as retry once every 3s), remove the timer after success, and execute the following S413; if the timeout fails, the network configuration fails, and the reason for the network configuration failure is that no device supporting the preset protocol is found to be online.
[0093] S413, reminding the user to connect back to the original router and bind the control device and smart device to the cloud.
[0094] If the control device and smart device are successfully bound in the cloud, the network configuration is successful.
[0095] In the embodiment of the present application, due to the AP network configuration process, the control device needs to connect to the AP network generated by the smart device. Therefore, in the above S412, if the control device communicates with the smart device and determines that the smart device is successfully online, the control device needs to disconnect the AP network generated by the connected smart device, connect back to the previously connected router, and then complete the network configuration by binding the control device and the smart device through the cloud.
[0096] If the smart device is a device that supports the preset protocol, the control device executes the AP network configuration process described in S403 to S413 above; if the smart device is not a device that supports the preset protocol, the control device executes the AP network configuration process described in S414 to S417 below.
[0097] S414: The control device obtains the second WiFi list searched by itself.
[0098] S415. Send network distribution information to the smart device.
[0099] The network configuration information is the WiFi name and WiFi password of the target WiFi used by the smart device for network configuration. The target WiFi is a WiFi selected by the control device for the smart device from the second WiFi list. The second WiFi list includes at least one WiFi.
[0100] S416: Determine whether the network configuration information is written successfully.
[0101] Retry a preset number of times (usually 3 times). If each retry fails, it is determined that the network configuration has failed. The reason for the network configuration failure is the failure to send the network configuration information. If the network configuration information is successfully written, the following S415 is executed.
[0102] S417: Determine whether the callback indicating the successful distribution network information delivery is received successfully.
[0103] Set a timeout timer of a certain length (usually 20s), set a retry time interval (such as retrying once every 10s), remove the timer after success, and execute the following S416; if the timeout fails, it is determined that the network configuration has failed, and the reason for the network configuration failure is the failure to send the network configuration information.
[0104] S418. Remind the user to connect back to the original router and monitor the device online.
[0105] After the control device is connected back to the original router, the control device monitors whether the smart device is online from the cloud. If the smart device is online, it is determined that the smart device is online. If the smart device is not online, it is determined that the smart device is not online.
[0106] Set a timeout timer of a certain length (usually 20s), set a retry time interval (such as retry once every 10s or retry once every 1s), remove the timer after success, and execute the following S418; if the timeout is unsuccessful, it is determined that the network configuration has failed, and the reason for the network configuration failure is that the device that does not support the preset protocol is not found online.
[0107] S419, go to the cloud to bind control devices and smart devices.
[0108] If the control device and smart device are successfully bound in the cloud, the network configuration is successful.
[0109] According to the above-mentioned AP network configuration process, it can be known that the AP network configuration process steps are relatively complex and time-consuming. Therefore, before the above-mentioned S409 or S415, if a Bluetooth broadcast packet sent by a smart device is detected, the AP network configuration process can be switched to the Bluetooth network configuration process, thereby simplifying the steps of smart device network configuration, reducing network configuration time, improving smart device network configuration efficiency, and improving the success rate of smart device network configuration.
[0110] In some embodiments of the present application, the controller is further configured to: after entering the AP network configuration process and executing until the network configuration information is sent to the smart device through the AP connection, if the Bluetooth broadcast packet sent by the smart device is still not scanned, continue to execute the AP network configuration process to complete the network configuration of the smart device.
[0111] In some embodiments of the present application, when a Bluetooth broadcast packet sent by a smart device is scanned within a preset time, the control device configures the smart device through a Bluetooth network configuration process. The Bluetooth broadcast packet sent by the smart device that is not scanned within the preset time may be a Bluetooth broadcast packet sent by any device that is not scanned within the preset time (then the Bluetooth broadcast packet sent by the smart device must not be scanned); the Bluetooth broadcast packet sent by the smart device that is not scanned within the preset time may also be a Bluetooth broadcast packet sent by at least one device that is scanned within the preset time, but at least one device is not a smart device (at least one device identifier (a device identifier is used to indicate a device in at least one device) can be displayed to the user, and then it is determined whether the at least one device includes a smart device based on the user's selection. For example, if the user selects a device identifier from at least one device identifier, the device indicated by the device identifier selected by the user is a smart device. If the user does not select any of the at least one device identifier, but chooses to continue scanning, it means that at least one device does not include a smart device).
[0112] In some embodiments of the present application, after detecting whether there is an AP network generated by the smart device and before successfully establishing the AP connection, if at least one Bluetooth broadcast packet that has not been scanned before is scanned (hereinafter referred to as at least one first Bluetooth broadcast packet, which is not sent by the same device as the Bluetooth broadcast packet scanned within a preset time period), at least one first device identifier can be displayed to the user, and each first device identifier is used to indicate a device that sends a first Bluetooth broadcast packet. If the user selects a first device identifier from at least one first device identifier, the device indicated by the first device identifier is a smart device, and the AP network configuration process is switched to the Bluetooth network configuration process. If the user does not select any first device identifier from at least one first device identifier, but chooses to continue scanning, it means that the Bluetooth broadcast packet sent by the smart device has not been scanned yet.
[0113] In some embodiments of the present application, the above-mentioned display of at least one first device identifier may be a pop-up window displaying at least one first device identifier when displaying the AP network configuration process interface, or the AP network configuration page may be switched to a Bluetooth network configuration page, and the Bluetooth network configuration page displays at least one first device identifier.
[0114] It is understandable that after detecting whether there is an AP network generated by the smart device and before successfully establishing the AP connection, whether the Bluetooth broadcast packet sent by the smart device is scanned needs to be determined through interaction with the user. And after interacting with the user to determine that the Bluetooth broadcast packet sent by the smart device is scanned, the Bluetooth scanning can be stopped, the AP network configuration process is stopped, and the Bluetooth network configuration process is entered.
[0115] In some embodiments of the present application, the controller is specifically configured to: after successfully establishing the AP connection and before sending the network configuration information to the smart device through the AP connection, if a Bluetooth broadcast packet sent by the smart device is scanned, stop the AP network configuration process.
[0116] In some embodiments of the present application, after the AP connection is successfully established and before the network configuration information is sent to the smart device through the AP connection, it is possible to determine whether the scanned Bluetooth broadcast packet is a Bluetooth broadcast packet sent by the smart device by interacting with the user, or it is possible to determine whether the scanned Bluetooth broadcast packet is a Bluetooth broadcast packet sent by the smart device based on the AP connection.
[0117] Among them, to determine whether the scanned Bluetooth broadcast packet is a Bluetooth broadcast packet sent by a smart device by interacting with the user, you can refer to the above-mentioned description of determining whether the scanned Bluetooth broadcast packet is a Bluetooth broadcast packet sent by a smart device by interacting with the user after detecting whether there is an AP network generated by the smart device and before successfully establishing the AP connection. It will not be repeated here.
[0118] Among them, determining whether the scanned Bluetooth broadcast packet is a Bluetooth broadcast packet sent by the smart device based on the AP connection can be that the control device communicates with the smart device based on the AP connection, obtains the device identification of the smart device, and then compares whether the device identification carried by the scanned Bluetooth broadcast packet matches the device identification of the smart device. If they match, it is determined that the Bluetooth broadcast packet sent by the smart device is scanned, otherwise it is determined that the Bluetooth broadcast packet sent by the smart device is not scanned. For a specific description, please refer to the following related description, which will not be repeated here.
[0119] In some embodiments of the present application, after the AP connection is successfully established and before the network configuration information is sent to the smart device through the AP connection, if it is determined that a Bluetooth broadcast packet sent by the smart device is scanned, the Bluetooth scanning can be stopped, the AP network configuration process can be stopped, and the Bluetooth network configuration process can be entered.
[0120] Accordingly, before sending the network configuration information to the smart device through the AP connection, if the Bluetooth broadcast packet sent by the smart device is still not detected, the Bluetooth scanning can be stopped.
[0121] In the embodiment of the present application, after entering the AP network configuration process, the AP network configuration page will be displayed on the control device. Therefore, after the AP connection is successful, the control device already knows which smart device needs to be configured, and can then determine whether there is a Bluetooth broadcast packet sent by the smart device in the scanned Bluetooth broadcast packet based on the AP connection. Then, after switching to the Bluetooth network configuration, there is no need to display the Bluetooth network configuration page (for the user to select the smart device to be configured). In this way, without user perception and without affecting the user experience (the user experience of switching network configuration pages back and forth is poor, such as first switching from the Bluetooth network configuration page to the AP network configuration page, and then switching from the AP network configuration page to the Bluetooth network configuration page, the user will think that the device is faulty), switching between AP network configuration and Bluetooth network configuration is performed, thereby improving the success rate and efficiency of smart device network configuration.
[0122] In some embodiments of the present application, the controller is specifically configured to: after successfully establishing the AP connection and before determining whether the smart device is a device that supports a preset protocol, stop the AP network configuration process when a Bluetooth broadcast packet sent by the smart device is scanned.
[0123] In an embodiment of the present application, after the AP connection is successfully established and before determining whether the smart device is a device that supports the preset protocol, if a Bluetooth broadcast packet sent by the smart device is scanned, the Bluetooth network configuration process is switched to. This can improve the network configuration efficiency and the network configuration success rate while minimizing the execution of the AP network configuration process, and the implementation process is relatively simple.
[0124] In some embodiments of the present application, after the AP connection is successfully established and before determining whether the smart device is a device that supports the preset protocol, if a Bluetooth broadcast packet sent by the smart device is scanned, the Bluetooth scanning can be stopped, the AP network configuration process can be stopped, and the Bluetooth network configuration process can be entered.
[0125] Accordingly, in some embodiments of the present application, after determining whether the smart device is a device that supports the preset protocol, if the Bluetooth broadcast packet sent by the smart device is still not detected, the Bluetooth scanning can be stopped.
[0126] In some embodiments of the present application, the controller is further configured to: upon detecting that the device identifier carried by the target Bluetooth broadcast packet matches the device identifier of the smart device obtained through the AP connection, determine that the target Bluetooth broadcast packet is a Bluetooth broadcast packet sent by the smart device.
[0127] It can be understood that detecting whether the device identification carried by the Bluetooth broadcast packet matches the device identification of the smart device obtained through the AP connection is a method for determining whether the scanned Bluetooth broadcast packet is a Bluetooth broadcast packet sent by the smart device based on the AP connection.
[0128] The device identifier may be a media access control (MAC) address of the smart device, or a unique identifier (device ID) of the smart device, or other device identifiers that uniquely identify the smart device, which are not limited here.
[0129] Among them, the Bluetooth broadcast packet carries the device identification. After the control device establishes an AP connection with the smart device (the control device connects to the AP network generated by the smart device, and turns on the protocol stack to establish a communication channel with the smart device), the control device can communicate with the smart device through the AP connection to obtain the device identification of the smart device, and then the control device compares the device identification in the scanned Bluetooth broadcast packet to see if it matches the device identification of the smart device. If it matches, it means that the scanned Bluetooth broadcast packet is a Bluetooth broadcast packet sent by the smart device.
[0130] It can be understood that if the device identifier carried by the target Bluetooth broadcast packet matches the device identifier of the smart device obtained through the AP connection, it means that the target Bluetooth broadcast packet is a Bluetooth broadcast packet sent by the smart device, which means that the smart device is a device that the user has determined needs to be networked. Therefore, based on the target Bluetooth broadcast packet, the AP network configuration process for the smart device can be switched to the Bluetooth network configuration process for the smart device, and then the mode switching for network configuration for the smart device can be realized without the need for user participation.
[0131] Exemplarily, the device identifier carried by the target Bluetooth broadcast packet may be exactly the same as the device identifier of the smart device obtained through the AP connection, which means that the device identifier carried by the target Bluetooth broadcast packet matches the device identifier of the smart device obtained through the AP connection; or the number of last preset digits (for example, the last four digits) of the device identifier carried by the target Bluetooth broadcast packet may be the same as the number of last preset digits (for example, the last four digits) of the device identifier of the smart device obtained through the AP connection, which means that the device identifier carried by the target Bluetooth broadcast packet matches the device identifier of the smart device obtained through the AP connection. The specific number can be determined based on actual conditions and is not limited here.
[0132] In an embodiment of the present application, whether the target Bluetooth broadcast packet is a Bluetooth broadcast packet sent by the smart device is determined based on whether the device identifier carried by the target Bluetooth broadcast packet matches the device identifier of the smart device obtained through the AP connection. Whether the Bluetooth broadcast packet sent by the smart device is detected can be automatically confirmed without user participation, and the switching between the AP network configuration process and the Bluetooth network configuration process can be achieved without the user's perception, thereby improving the user experience.
[0133] In some embodiments of the present application, the controller is further configured to: after establishing a Bluetooth connection with the smart device based on a Bluetooth broadcast packet sent by the smart device, and before sending network configuration information to the smart device through the Bluetooth connection, if it is detected that the Bluetooth network configuration process fails, continue to execute the AP network configuration process.
[0134] Among them, after sending the network configuration information to the smart device through the Bluetooth connection, if it is detected that the Bluetooth network configuration process fails, the network configuration usually cannot be successful through the AP network configuration process. It is necessary to detect whether the network configuration failure is caused by other reasons.
[0135] In an embodiment of the present application, before sending the network configuration information to the smart device via the Bluetooth connection, if it is detected that the Bluetooth network configuration process fails, the AP network configuration process is continued and the smart device network configuration may succeed, thereby improving the success rate of the smart device network configuration.
[0136] In some embodiments of the present application, the controller is further configured to: after sending network configuration information to the smart device through the AP connection, send a query message to the smart device via the Bluetooth connection whether the network configuration is successful; and determine that the network configuration is completed when a response message of successful network configuration is received from the smart device via the Bluetooth connection.
[0137] In the embodiment of the present application, since in the AP network configuration process, after sending the network configuration information, the process of determining whether the smart device has been successfully configured is relatively complicated, it may be necessary to switch the WiFi network to which the control device is connected, and switching failure or delay may occur during the network switching process. Therefore, the present application combines the Bluetooth connection to determine whether the smart device has been successfully configured, which can improve the network configuration efficiency and the network configuration success rate.
[0138] See also Figure 4 In some embodiments, the system is divided into four layers, from top to bottom, namely, the application layer (APPlications) layer (referred to as "application layer"), the application framework layer (APPlication Framework) layer (referred to as "framework layer"), the Android runtime (Android runtime) and system library layer (referred to as "system runtime library layer"), and the kernel layer.
[0139] In some embodiments, at least one application is running in the application layer, and these applications can be window programs, system settings programs, clock programs, etc. provided by the operating system, or applications developed by third-party developers. In specific implementations, the application packages in the application layer are not limited to the above examples.
[0140] The framework layer provides application programming interfaces (APIs) and programming frameworks for applications. The application framework layer includes some predefined functions. The application framework layer is equivalent to a processing center that determines the actions that applications in the application layer take. Through the API interface, applications can access system resources and obtain system services during execution.
[0141] like Figure 4 As shown, in the embodiment of the present application, the application framework layer includes managers, content providers, etc., wherein the manager includes at least one of the following modules: an activity manager (ActivityManager) is used to interact with all activities running in the system; a location manager (Location Manager) is used to provide system services or applications with access to system location services; a package manager (Package Manager) is used to retrieve various information related to the application package currently installed on the device; a notification manager (NotificationManager) is used to control the display and clearing of notification messages; a window manager (Window Manager) is used to manage icons, windows, toolbars, wallpapers, and desktop components on the user interface.
[0142] In some embodiments, the activity manager is used to manage the life cycle of each application and the common navigation back function, such as controlling the exit, opening, and back of the application. The window manager is used to manage all window programs, such as obtaining the display screen size, determining whether there is a status bar, locking the screen, capturing the screen, and controlling the display window changes (for example, reducing the display window, shaking the display, distorting the display, etc.).
[0143] In some embodiments, the system runtime layer provides support for the upper layer, namely the framework layer. When the framework layer is used, the Android operating system will run the C / C++ library contained in the system runtime layer to implement the functions to be implemented by the framework layer.
[0144] In some embodiments, the kernel layer is a layer between hardware and software. Figure 4 As shown, the kernel layer includes at least one of the following drivers: audio driver, display driver, Bluetooth driver, camera driver, WIFI driver, USB driver, HDMI driver, sensor driver (such as fingerprint sensor, temperature sensor, pressure sensor, etc.), and power driver, etc.
[0145] In order to explain this scheme in more detail, the following will be combined in an exemplary manner Figures 5 to 10 To explain, it is understandable that Figures 5 to 10 The steps involved may include more steps or fewer steps in actual implementation, and the order of these steps may also be different, subject to the ability to implement the smart device network configuration method provided in the embodiment of the present application. The smart device network configuration method is applied to a control device that is controlled by a control device. The execution subject of the smart device network configuration method may be a control device, or a functional module or functional entity in the control device that can implement the smart device network configuration method, which is not limited here. Moreover, the specific description of the smart device network configuration method provided in the embodiment of the present application can refer to the relevant description of the above-mentioned control device, and the same or similar technical effects can be achieved, which will not be repeated here.
[0146] Figure 5 The flowchart of the steps of implementing a method for configuring a smart device network according to one or more embodiments of the present application may include the following S501 to S504.
[0147] S501: Determine that no Bluetooth broadcast packet of the smart device to be networked is scanned within a preset time period.
[0148] S502: While keeping Bluetooth scanning turned on, detect whether there is an AP network generated by the smart device to enter the AP network configuration process, and execute the network configuration of the smart device based on the AP network configuration process.
[0149] S503, before sending the network configuration information to the smart device through the AP connection between the control device and the smart device, in the case of scanning a Bluetooth broadcast packet sent by the smart device, stopping the AP network configuration process;
[0150] S504: Establish a Bluetooth connection with the smart device based on the Bluetooth broadcast packet sent by the smart device to enter a Bluetooth network configuration process, and perform network configuration of the smart device based on the Bluetooth network configuration process.
[0151] In an embodiment of the present application, in the process of configuring a network for a smart device, Bluetooth configuration is preferentially selected, but if a Bluetooth broadcast packet sent by the smart device is not detected within a preset time period, while continuing to detect the Bluetooth broadcast packet sent by the smart device, it is detected whether there is an AP network generated by the smart device to enter the AP configuration process (if no Bluetooth broadcast packet is detected after a timeout, the Bluetooth configuration mode is automatically switched to the AP configuration mode, but the scanning of the Bluetooth broadcast packet is maintained at the same time), and before the AP configuration process is executed to send the network configuration information to the smart device through the AP connection, if a Bluetooth broadcast packet sent by the smart device is scanned, the AP configuration process is stopped, a Bluetooth connection is established based on the Bluetooth broadcast packet sent by the smart device, and then the Bluetooth configuration process is entered (i.e., switching from the AP configuration mode to the Bluetooth configuration mode), so as to configure the smart device for a network based on the Bluetooth configuration process. Since the Bluetooth configuration mode has simple steps and a high success rate, if a Bluetooth broadcast packet is detected during the AP configuration process and switched to the Bluetooth configuration mode, the success rate of configuring the smart device for a network can be improved.
[0152] In some embodiments of the present application, Figure 5 ,like Figure 6 As shown, the above S502 can be specifically implemented through the following S502a and S502b.
[0153] S502a: After the AP connection is successfully established and before the network configuration information is sent to the smart device through the AP connection, a Bluetooth broadcast packet sent by the smart device is scanned.
[0154] S502b, stop the AP network configuration process.
[0155] In some embodiments of the present application, Figure 6 ,like Figure 7 As shown, the above S502a can be specifically implemented through the following S502a1.
[0156] S502a1: After the AP connection is successfully established and before determining whether the smart device is a device that supports a preset protocol, a Bluetooth broadcast packet sent by the smart device is scanned.
[0157] In some embodiments of the present application, Figure 7 ,like Figure 8 As shown, the above S502a1 can be specifically implemented through the following S502a1A.
[0158] S502a1A, after successfully establishing the AP connection and before sending the network configuration information to the smart device through the AP connection, when it is detected that the device identifier carried by the target Bluetooth broadcast packet matches the device identifier of the smart device obtained through the AP connection, it is determined that the target Bluetooth broadcast packet is the Bluetooth broadcast packet sent by the smart device.
[0159] In some embodiments of the present application, Figure 8 ,like Fig. 9 As shown, after the above S504, the smart device network configuration method provided in the embodiment of the present application may further include the following S505.
[0160] S505: After establishing a Bluetooth connection with the smart device based on the Bluetooth broadcast packet sent by the smart device and before sending network configuration information to the smart device through the Bluetooth connection, if it is detected that the Bluetooth network configuration process fails, continue to execute the AP network configuration process.
[0161] In some embodiments of the present application, Fig. 9 ,like Fig.10 As shown, after the above S505, the smart device network configuration method provided in the embodiment of the present application may further include the following S506 and S507.
[0162] S506: After sending the network configuration information to the smart device through the AP connection, sending a query message to the smart device through the Bluetooth connection to determine whether the network configuration is successful.
[0163] S507: When a response message indicating successful network configuration of the smart device is received through the Bluetooth connection, determine that the network configuration is completed.
[0164] Exemplarily, as shown in FIG. 11(a) and FIG. 11(b), a schematic flow chart of a method for configuring a network for a smart device provided in an embodiment of the present application includes the following S1101a to S1115. Among them, the first controller, the first Bluetooth module and the first WiFi module are functional modules or functional entities in the smart device to be configured, and the second controller, the second Bluetooth module, the second WiFi module and the display are functional modules or functional entities in the control device.
[0165] S1101a: The first controller detects that it has entered the network configuration state, and generates a Bluetooth signal instruction and an AP network generation instruction.
[0166] S1101b. The first controller sends a Bluetooth activation instruction to the first Bluetooth module.
[0167] S1101c. The first Bluetooth module responds to the Bluetooth signal instruction and broadcasts a Bluetooth broadcast packet.
[0168] S1101d. The first controller sends an AP network generation instruction to the first WiFi module.
[0169] S1101e. The first WiFi module responds to the AP network generation instruction and generates an AP network.
[0170] S1102a: The second controller receives a network configuration instruction for configuring a network for a smart device, generates a Bluetooth scanning instruction, and sends the Bluetooth scanning instruction to a second Bluetooth module.
[0171] S1102b. The second Bluetooth module responds to the Bluetooth scanning instruction and starts Bluetooth scanning.
[0172] S1102c. The second controller controls the display to display a Bluetooth scanning interface, and the Bluetooth scanning interface displays a Bluetooth scanning animation.
[0173] S1102d: After the second Bluetooth module scans for a certain period of time, if the second Bluetooth module scans at least one first Bluetooth broadcast packet, the second Bluetooth module sends at least one first device identifier corresponding to the scanned at least one first Bluetooth broadcast packet to the second controller.
[0174] A first device identifier is used to indicate a device that sends a Bluetooth broadcast packet, and at least one first Bluetooth broadcast packet corresponds to at least one first device identifier.
[0175] The first device identification includes at least one of the following information: device name, device model, and device category.
[0176] S1102e. The second controller controls the display to display at least one first device identifier on the Bluetooth scanning interface.
[0177] Exemplarily, the second Bluetooth module scans 2 Bluetooth broadcast packets, which correspond to device identification 1 of device 1 and device identification 2 of device 2 respectively.
[0178] If at least one of the first device identifiers includes a target device identifier (the target device identifier is used to indicate a smart device), the user selects the target device identifier and executes the following S1102f to S1102h to establish a Bluetooth connection between the control device and the smart device and enter the Bluetooth network configuration process; if at least one of the first device identifiers does not include a target device identifier, the user chooses to continue the Bluetooth scan and returns to re-execute the above S1102c to S1102e. If a Bluetooth broadcast packet sent by a smart device is scanned within the preset time, the following S1102f to S1102h are executed; if a Bluetooth broadcast packet sent by a smart device is still not scanned within the preset time, the following S1102i is executed.
[0179] S1102f: In response to the user selecting a target device identifier from at least one first device identifier, the second controller generates and sends a first Bluetooth connection instruction to the second Bluetooth module.
[0180] The first Bluetooth connection instruction is used to instruct the second Bluetooth module to establish a Bluetooth connection with the smart device based on the first Bluetooth broadcast packet corresponding to the target device identifier.
[0181] S1102g: The second Bluetooth module responds to the first Bluetooth connection instruction and establishes a Bluetooth connection with the smart device based on the first Bluetooth broadcast packet corresponding to the target device identifier.
[0182] S1102h. The second controller executes the Bluetooth network configuration process based on the Bluetooth connection to configure the smart device.
[0183] It should be noted that, in the process of executing the Bluetooth network configuration process in the above S1102h, the process of sending the network configuration information based on the Bluetooth connection shown in the following S1201 to S1205 is included.
[0184] S1201. The second controller obtains a WiFi list and controls the display to display the WiFi list.
[0185] Among them, the WiFi list can be a WiFi list corresponding to at least one WiFi signal scanned by the second controller through the second WiFi module, or it can be a WiFi list received by the second controller from the first controller through a Bluetooth connection. The WiFi list is a WiFi list corresponding to at least one WiFi information scanned by the first controller through the first WiFi module.
[0186] S1202: In response to the user selecting a target WiFi from the WiFi list, the second controller controls the display to display a password input interface of the target WiFi.
[0187] S1203: In response to the user inputting the WiFi password, the second controller sends network configuration information to the first controller via the Bluetooth connection, where the network configuration information includes the target WiFi and the WiFi password.
[0188] S1204: The first controller sends a WiFi connection instruction to the first WiFi module based on the received network configuration information.
[0189] S1205: The first WiFi module responds to the WiFi connection instruction and establishes a connection with the target WiFi to continue network configuration.
[0190] For the specific Bluetooth network configuration process, please refer to the relevant technology and will not be described here.
[0191] S1102i. The second controller determines that no Bluetooth broadcast packet is scanned within a preset time period.
[0192] S1103a: When the second Bluetooth module keeps performing Bluetooth scanning, the second controller sends a query instruction to the second WiFi module to query whether the second WiFi module is currently connected to the home router.
[0193] S1103b. The second WiFi module responds to the query instruction, generates a response message according to whether it is connected to the home router, and sends the response message to the second controller.
[0194] When the response message indicates that the second WiFi module is currently connected to the home router, execute the following S1103c to S1103d; when the response message indicates that the second WiFi module is not currently connected to the home router (data networking state), execute the following S1103e to S1103f.
[0195] S1103c. When the response message indicates that the second WiFi module is currently connected to the home router, the second controller generates a disconnection instruction for the home router and an AP network search instruction, and sends the disconnection instruction for the home router and the AP network search instruction to the second WiFi module.
[0196] S1103d. The second WiFi module responds to the disconnect home router instruction to disconnect the currently connected home router; and responds to the search AP network instruction to search for the AP network in the current environment.
[0197] S1103e: When the response message indicates that the second WiFi module is not currently connected to the home router, the second controller generates an AP network search instruction and sends the AP network search instruction to the second WiFi module.
[0198] S1103f. The second WiFi module responds to the AP network search instruction and searches for the AP network in the current environment.
[0199] S1104a. The second controller controls the display to display an AP network search interface, and the AP network search interface displays a search animation.
[0200] S1104b: After the second WiFi module searches for a certain period of time, if the second WiFi module searches for at least one AP network, at least one WiFi name corresponding to the at least one AP network is sent to the second controller.
[0201] Among them, a WiFi name is used to indicate a device that generates an AP network, and at least one AP network corresponds to at least one WiFi name.
[0202] S1104c: The second controller determines whether there is a target WiFi name including a preset tag in the at least one WiFi name.
[0203] If the second controller determines that there is a target WiFi name in at least one WiFi name, the WiFi name is the WiFi name of the AP network generated by the smart device, and the following S1105a to S1105b are executed to establish an AP connection between the control device and the smart device; if the second controller determines that there are multiple target WiFi names in at least one WiFi name, the following S1106a to S1106c are executed; if the second controller determines that there is no target WiFi name in at least one WiFi name, the following S1107a to S1107c are executed.
[0204] S1105a: When the second controller determines that there is a target WiFi name in the at least one WiFi name, the second controller generates and sends to the second WiFi module a first connection instruction to connect to an AP network corresponding to the target WiFi name.
[0205] S1105b. The second WiFi module responds to the first connection instruction and connects to the AP network corresponding to the target WiFi name.
[0206] After executing S1105b, execute the following S1108.
[0207] S1106a: When the second controller determines that there are multiple target WiFi names in the at least one WiFi name, the second controller controls the display to display the multiple target WiFi names.
[0208] S1106b: In response to the received trigger operation of selecting a first target WiFi name from multiple target WiFi names, the second controller generates and sends to the second WiFi module a second connection instruction for connecting to an AP network corresponding to the first target WiFi name.
[0209] Among them, the AP network corresponding to the first target WiFi name is the AP network generated by the smart device.
[0210] S1106c. The second WiFi module responds to the second connection instruction and connects to the AP network corresponding to the first target WiFi name.
[0211] After executing S1106c, execute the following S1108.
[0212] S1107a: When determining that the target WiFi name does not exist in the at least one WiFi name, the second controller controls the display to display a prompt message to prompt the user to go to the setting page to select an AP network to be connected.
[0213] S1107b: In response to the received operation of the user selecting the target AP network on the setting page, the second controller generates and sends a third connection instruction for connecting to the target AP network to the second WiFi module.
[0214] The target AP network is the AP network generated by the smart device.
[0215] S1107c. The second WiFi module responds to the third connection instruction and connects to the target AP network.
[0216] After executing S1107c, execute the following S1108.
[0217] S1108. The second WiFi module establishes a communication channel with the first WiFi module by opening the protocol stack to successfully establish an AP connection with the smart device.
[0218] S1109: The second WiFi module obtains a device identification of the smart device through the AP connection, and sends the device identification of the smart device to the second controller.
[0219] S1110. The second Bluetooth module sends at least one scanned second Bluetooth broadcast packet to the second controller.
[0220] The at least one second Bluetooth broadcast packet is a Bluetooth broadcast packet sent by different devices scanned after S1103a, and each second Bluetooth broadcast packet carries a second device identifier.
[0221] The second device identifier is used to uniquely indicate a device, and the second device identifier may be a MAC address of the device.
[0222] The second device identification is different from the first device identification.
[0223] S1111. The second controller determines whether there is a Bluetooth broadcast packet in at least one second Bluetooth broadcast packet whose carried device identifier matches the device identifier of the smart device.
[0224] Before the AP network configuration process is executed to determine whether the smart device is a device that supports the preset protocol, at least one second Bluetooth broadcast packet is scanned. If the device identifier carried by the target Bluetooth broadcast packet in the at least one second Bluetooth broadcast packet matches the device identifier of the smart device, it is determined that the target Bluetooth broadcast packet is a Bluetooth broadcast packet sent by the smart device, and the following S1112a to S1112c are executed. If the device identifier carried by any Bluetooth broadcast packet in the at least one second Bluetooth broadcast packet does not match the device identifier of the smart device, it is determined that no Bluetooth broadcast packet sent by the smart device is scanned, and the following S1113 is executed.
[0225] S1112a: When determining that the device identification carried in the target Bluetooth broadcast packet matches the device identification of the smart device, the second controller generates and sends a stop Bluetooth scanning instruction to the second Bluetooth module, and generates and sends a second Bluetooth connection instruction.
[0226] The second Bluetooth connection instruction is used to instruct the second Bluetooth module to establish a Bluetooth connection with the smart device based on the target Bluetooth broadcast packet.
[0227] S1112b. The second Bluetooth module responds to the stop Bluetooth scanning instruction, stops Bluetooth scanning, responds to the second Bluetooth connection instruction, and establishes a Bluetooth connection with the smart device based on the target Bluetooth broadcast packet.
[0228] S1112c. The second controller executes the Bluetooth network configuration process based on the Bluetooth connection to continue configuring the smart device.
[0229] It should be noted that, in the process of executing the Bluetooth network configuration process in the above S1112c, including the process of sending network configuration information based on the Bluetooth connection shown in the above S1201 to S1205, please refer to the above related description for details, which will not be repeated here.
[0230] S1113. When the second controller determines that there is no Bluetooth broadcast packet in the scanned Bluetooth broadcast packet whose device identifier matches the device identifier of the smart device or no Bluetooth broadcast packet is scanned, it determines whether the smart device is a device that supports the preset protocol to continue to execute the AP network configuration process to configure the smart device.
[0231] It should be noted that the process of executing the AP network configuration process in the above S1113 includes the process of sending network configuration information based on AP connection shown in the following S1301 to S1305.
[0232] S1301. The second controller obtains a WiFi list and controls the display to display the WiFi list.
[0233] Among them, the WiFi list can be a WiFi list corresponding to at least one WiFi signal scanned by the second controller through the second WiFi module, or it can be a WiFi list received by the second controller from the first controller through an AP connection. The WiFi list is a WiFi list corresponding to at least one WiFi information scanned by the first controller through the first WiFi module.
[0234] S1302: In response to the user selecting a target WiFi from the WiFi list, the second controller controls the display to display a password input interface of the target WiFi.
[0235] S1303: In response to the user inputting the WiFi password, the second controller sends network configuration information to the first controller through the AP connection, where the network configuration information includes the target WiFi and the WiFi password.
[0236] S1304: The first controller sends a WiFi connection instruction to the first WiFi module based on the received network configuration information.
[0237] S1305: The first WiFi module responds to the WiFi connection instruction and establishes a connection with the target WiFi to continue network configuration.
[0238] It should be noted that in the embodiment of the present application, whether it is an AP network configuration process or a Bluetooth network configuration process, the WiFi list interface and the WiFi password input page displayed to the user by the second controller through the display are the same page. This can simplify the development process and save development costs. There is no need to develop different WiFi list interfaces and WiFi password input pages for different network configuration processes. Moreover, after the AP network configuration process successfully establishes the AP connection, it switches to the Bluetooth network configuration process before executing and sending the network configuration information. This can better realize the switching of the network configuration path without the user's perception.
[0239] S1114: After the second controller completes the AP network configuration process or starts the Bluetooth network configuration process, it generates and sends an instruction to disconnect the AP connection to the second WiFi module, and generates and sends a reconnection instruction to establish a connection with the home router to the second WiFi module.
[0240] S1115. The second WiFi module responds to the instruction to disconnect the AP connection, disconnects the AP click, responds to the reconnect instruction, and connects to the home router.
[0241] In the embodiment of the present application, regardless of whether the AP network configuration process is successfully completed for the smart device, the AP connection is disconnected and a connection is established with the home router.
[0242] In the embodiment of the present application, the Bluetooth network configuration mode is preferentially used to perform Bluetooth scanning of devices. If no device is scanned within the time limit, the AP network configuration mode is automatically entered. Under the premise of following the above basic process, after the Bluetooth scan times out and enters the AP network configuration process, the APP background continues to perform Bluetooth scanning. If a Bluetooth device is detected during the AP network configuration technical interaction path, the technical path is automatically switched for the user, and the user interaction remains unchanged, thereby improving the network configuration success rate. The strict technical interaction path distinction between AP network configuration and Bluetooth network configuration is broken, and the network configuration success rate is improved by relying on automatic switching of the network configuration interaction technical path without affecting the user experience. According to experimental statistics, after the current APP adopts this design scheme, the overall network configuration success rate is increased by about 0.5% (from 96% to about 97%).
[0243] An embodiment of the present invention also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the various processes of the above-mentioned smart device network configuration method and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0244] The computer readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0245] The present invention provides a computer program product, comprising: when the computer program product is run on a computer, the computer is enabled to implement the above-mentioned intelligent device network configuration method.
[0246] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
[0247] For the convenience of explanation, the above description has been made in conjunction with specific embodiments. However, the above exemplary discussion is not intended to be exhaustive or limit the embodiments to the specific forms disclosed above. Based on the above teachings, various modifications and variations can be obtained. The selection and description of the above embodiments are to better explain the principles and practical applications, so that those skilled in the art can better use the embodiments and various different variations of the embodiments suitable for specific use considerations.
Claims
1. A control device, characterized in that: include: The controller is configured to: determine that a Bluetooth broadcast packet of the smart device to be networked is not scanned within a preset time period; While keeping Bluetooth scanning turned on, detect whether there is an AP network generated by the smart device to enter the AP network configuration process, and perform network configuration of the smart device based on the AP network configuration process; Before sending network configuration information to the smart device through the AP connection between the control device and the smart device, in the case of scanning a Bluetooth broadcast packet sent by the smart device, stopping the AP network configuration process; Based on the Bluetooth broadcast packet sent by the smart device, a Bluetooth connection is established with the smart device to enter a Bluetooth network configuration process, and the network configuration of the smart device is performed based on the Bluetooth network configuration process.
2. The control device according to claim 1, characterized in that The controller is specifically configured as follows: After the AP connection is successfully established and before the network configuration information is sent to the smart device through the AP connection, if a Bluetooth broadcast packet sent by the smart device is scanned, the AP network configuration process is stopped.
3. The control device according to claim 2, characterized in that The controller is specifically configured as follows: After the AP connection is successfully established and before determining whether the smart device is a device that supports the preset protocol, if a Bluetooth broadcast packet sent by the smart device is scanned, the AP network configuration process is stopped.
4. The control device according to claim 2, characterized in that The controller is further configured to: When it is detected that the device identification carried by the target Bluetooth broadcast packet matches the device identification of the smart device obtained through the AP connection, it is determined that the target Bluetooth broadcast packet is a Bluetooth broadcast packet sent by the smart device.
5. The control device according to any one of claims 1 to 4, characterized in that: The controller is further configured to: After establishing a Bluetooth connection with the smart device based on the Bluetooth broadcast packet sent by the smart device, and before sending network configuration information to the smart device through the Bluetooth connection, if it is detected that the Bluetooth network configuration process fails, continue to execute the AP network configuration process.
6. The control device according to claim 5, characterized in that The controller is further configured to: After sending the network configuration information to the smart device through the AP connection, sending a query message to the smart device whether the network configuration is successful through the Bluetooth connection; When a response message indicating successful network configuration of the smart device is received through the Bluetooth connection, it is determined that the network configuration is completed.
7. A method for configuring a network for an intelligent device, characterized in that: Applied to control equipment, including: Determine that no Bluetooth broadcast packet of the smart device to be networked is scanned within a preset time period; While keeping Bluetooth scanning turned on, detect whether there is an AP network generated by the smart device to enter the AP network configuration process, and perform network configuration of the smart device based on the AP network configuration process; Before sending network configuration information to the smart device through the AP connection between the control device and the smart device, in the case of scanning a Bluetooth broadcast packet sent by the smart device, stopping the AP network configuration process; Based on the Bluetooth broadcast packet sent by the smart device, a Bluetooth connection is established with the smart device to enter a Bluetooth network configuration process, and the network configuration of the smart device is performed based on the Bluetooth network configuration process.
8. The method according to claim 7, characterized in that Before sending the network configuration information to the smart device through the AP connection between the control device and the smart device, in the case of scanning a Bluetooth broadcast packet sent by the smart device, stopping the AP network configuration process includes: After the AP connection is successfully established and before the network configuration information is sent to the smart device through the AP connection, if a Bluetooth broadcast packet sent by the smart device is scanned, the AP network configuration process is stopped.
9. The method according to claim 8, characterized in that After the AP connection is successfully established and before the network configuration information is sent to the smart device through the AP connection, in the case where a Bluetooth broadcast packet sent by the smart device is scanned, stopping the AP network configuration process includes: After the AP connection is successfully established and before determining whether the smart device is a device that supports the preset protocol, if a Bluetooth broadcast packet sent by the smart device is scanned, the AP network configuration process is stopped.
10. A computer-readable storage medium, characterized in that: include: A computer program is stored on a computer-readable storage medium, and when the computer program is executed by a processor, the smart device network configuration method as described in any one of claims 7 to 9 is implemented.
Citation Information
Cited By
Network distribution method and device of intelligent equipment, medium and packaging box of intelligent equipment
CN120979860A