WiFi connection method, router and storage medium
Through the coordinated work of connecting devices and routers, the WiFi network status is monitored in real time and the network is automatically reconnected, which solves the problem that the device cannot automatically reconnect after the WiFi password is modified, improving the user experience and enhancing network security.
Patent Information
- Application Number
- CN202510315535.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-17
- Publication Date
- 2025-06-10
AI Technical Summary
In the prior art, after the WiFi password is modified, the device cannot automatically detect and reconnect to the network, and the user needs to operate manually, resulting in a reduced user experience and a significant impact on network interruption.
Through the coordinated work of connecting devices and routers, monitor the status of WiFi network in real time. When a password update is detected, the connecting device generates a request and sends it to the router. The router confirms the device authorization based on the device connection information table and sends an encrypted password, and the connecting device reconnects to the WiFi network.
After the WiFi password is modified, the device can automatically detect and reconnect to the network, reducing user operation steps, improving user experience, and enhancing network security.
Smart Images

Figure CN120129087A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of wireless communication technologies, and particularly to a WiFi connection method, a router, and a storage medium. Background Art
[0002] WiFi (Wireless Fidelity) is based on wireless communication technology to connect electronic devices such as computers to a network through a wireless access point. When the password of the shared WiFi network is changed by the device user, all devices that have already connected to the WiFi network need to use the updated password to reconnect to the WiFi network.
[0003] In the prior art, when a single device encounters a wrong WiFi password, the device only automatically disconnects, and does not provide a clear password error prompt until the user himself / herself notices the network interruption and enters the device for settings. The user's setting process is generally as follows: find the list of connected networks, manually select and delete the WiFi network with the wrong password, and then the user needs to re-search for the WiFi network and enter the new password to re-establish the connection.
[0004] The current technical solutions require the user to perform multiple confirmations and operations, and cannot completely automatically retrieve the new password and reconnect. The user has more operation steps, reducing the user experience. Summary of the Invention
[0005] The present invention provides a WiFi connection method, a router, and a storage medium, which can monitor the WiFi network status in real time and respond quickly after the WiFi password is modified, simplify the network connection recovery steps, and improve the user experience.
[0006] According to one aspect of the present invention, there is provided a WiFi connection method, which is cooperatively executed by a connecting device and a router, including:
[0007] Through the connecting device, when it is determined that the connection to the target WiFi network is disconnected, a first request is generated and sent to the router providing the target WiFi network;
[0008] Through the router, according to the first request and a pre-established device connection information table, a password update notification is sent to the connecting device;
[0009] Through the connecting device, after receiving the password update notification, in response to the user's password acquisition operation, a second request is generated and sent to the router;
[0010] Through the router, when it is determined that the connecting device is an authorized device according to the second request and the device connection information table, an encrypted password is sent to the connecting device;
[0011] Reconnect to the WiFi network via the connection device according to the encrypted password.
[0012] According to another aspect of the present invention, there is provided a router, which includes:
[0013] At least one processor; and
[0014] A memory communicatively connected to the at least one processor; wherein,
[0015] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the WiFi connection method described in any embodiment of the present invention.
[0016] According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement the WiFi connection method described in any embodiment of the present invention when executed.
[0017] In the technical solution of the embodiment of the present invention, by using a connection device, when it is determined that the connection to the target WiFi network is disconnected, a first request is generated and sent to the router providing the target WiFi network. Using the router, according to the first request and the device connection information table, a password update notification is sent to the connection device. Using the connection device, after receiving the password update notification, in response to the user's password acquisition operation, a second request is generated and sent to the router. Using the router, when it is determined that the connection device is an authorized device, an encrypted password is sent to the connection device. Using the connection device, according to the encrypted password, the way to reconnect to the WiFi network enables the connection device to automatically start the processing flow after the WiFi password is modified, without the need for the user to perform a manual reconnection operation. The connection device system can monitor the WiFi network status in real time. Once it detects that the password is modified, it can quickly start the processing flow and timely reconnect the device to the network, reducing the impact of network interruption on the user and improving the user experience. Moreover, it can prevent unauthorized devices from obtaining the new password, effectively enhancing the security of the network.
[0018] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0020] Figure 1 is a flowchart of a WiFi connection method provided in Embodiment 1 of the present invention;
[0021] Figure 2 is a flowchart of another WiFi connection method provided in Embodiment 2 of the present invention;
[0022] Figure 3 is a schematic structural diagram of a router for implementing the WiFi connection method of the embodiments of the present invention. Detailed implementation manners
[0023] To enable those skilled in the art to better understand the solutions of the present invention, the following clearly and completely describes the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those clearly listed steps or units, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.
[0025] Embodiment 1
[0026] Figure 1 is a flowchart of a WiFi connection method provided in Embodiment 1 of the present invention. This embodiment is applicable to the situation where after the password of the target WiFi network is updated, the connecting device automatically obtains the new password and reconnects. This method can be executed in cooperation by the connecting device and the router, and the connecting device and the router have data processing functions. As Figure 1 shown, this method includes:
[0027] S110. When it is determined that the connection to the target WiFi network is disconnected through the connection device, a first request is generated and sent to the router providing the target WiFi network.
[0028] Optionally, the present invention is designed based on the OpenHarmony system. The connection device can be various electronic devices installed with the OpenHarmony system and having a wireless connection function, capable of communicating with the WiFi network, including but not limited to mobile phones, smart communication devices, computers, in-vehicle devices, smart home devices, etc.
[0029] Optionally, in the prior art, a router can be used to create and manage a WiFi network, provide network access services for connection devices. The router connects multiple connection devices together through wireless signals and connects these devices to the Internet or other networks to achieve data forwarding and sharing. In this application, the router refers to the router providing the target WiFi network. However, only for explaining the WiFi reconnection process through this router, the WiFi connection method of the present invention is applicable to other routers and is not limited thereto.
[0030] Optionally, the connection device and the router are within the coverage range of the same frequency band of the WiFi signal and both support the standard protocols of WiFi communication, such as IEEE 802.11b / g / n / ac and other protocols.
[0031] Optionally, the connection device can subscribe to the network status change event notification in advance. When it is detected that the connection status of the connection device to the target WiFi network changes from connected to disconnected, the connection device will receive the network disconnection event notification. The connection device will obtain the network handle and the callback function. According to the network handle, the identifier of the currently disconnected target WiFi network can be determined, and then the router receiving the first request can be determined. The callback function can be used to generate the first request according to the preset logic.
[0032] The advantage of such a setting is that the connection device system can monitor the WiFi network status in real time. Once it detects that the password is modified, it can quickly start the processing flow and timely reconnect the device to the network, reducing the impact of network interruption on users.
[0033] Optionally, the first request includes the device identifier of the connection device, the router identifier, and the password acquisition request identifier. The device identifier may include the MAC (Media Access Control) address and IMEI (International Mobile Equipment Identity) code of the device, or may only include the MAC address; the router identifier may refer to the SSID (Service Set Identifier) of the router, that is, the name of the target WiFi network; the password acquisition request identifier is a preset request type identifier, and the identifier content can be customized. For example, "0x01" is used to represent the request for obtaining the password. The password acquisition request is used to request the password from the router. When sending the first request, the connection device does not know that the target WiFi has updated the password. The first request is only a password acquisition request sent for reconnecting to the target WiFi, and does not specify to obtain the updated password.
[0034] S120. Through the router, according to the first request and the pre-established device connection information table, send a password update notification to the connection device.
[0035] Wherein, the device connection information table may include the device identifiers, connection statuses, and authorization identifiers of the connection devices connected to the target WiFi network.
[0036] Wherein, the method may further include any one of the following:
[0037] Through the router, whenever it is determined that a new device is connected to the target WiFi network, determine the device identifier of the new device according to the network protocol, and store the device identifier of the new device in the device connection information table maintained by the router;
[0038] Through the router, real-time monitor the connection statuses of the connection devices in the device connection information table, and in the device connection information table, store the connection statuses of the connection devices corresponding to the device identifiers of the connection devices respectively; and
[0039] Through the router, when receiving a permission change request sent by the router management program, determine the device identifier of the target connection device for which the permission is being changed according to the permission change request, and in the device connection information table, modify the authorization identifier corresponding to the device identifier of the target connection device.
[0040] Optionally, whenever a new device successfully connects to the target WiFi network provided by the router, the router obtains the device's MAC address and IMEI code (if the device supports providing the IMEI code) through the network protocol, marks the status as "connected", changes the status to "not connected" after disconnection, and stores the device's MAC address, IMEI code, and connection status in the device connection information table maintained in the router's storage database. The storage format can be to record the information of one device per line, separating the MAC address, IMEI code, and connection status with a specific delimiter (such as a comma). When the connection status of the device is updated, read the device connection information table, find the corresponding device information line, modify the connection status field, and then write it back to the device connection information table.
[0041] Optionally, the user can find the connected device and perform authorization settings through the user management interface of the application. The application is an application for network management. The application can send a permission change request to the router using the HTTP protocol. The permission change request can be a POST request, encapsulating the device information of the connected device for which the permission is changed in JSON format in the request body. The permission change request also includes authorization or cancellation of authorization information. The router parses the permission change request and records the authorization information in the is_authorized field of the device corresponding to the MAC address in the device information table.
[0042] Optionally, the device identifier of the connected device in the device connection information table can include only the MAC address, or can also include the MAC address and IMEI code; the connection status includes connected and not connected; the authorization identifier can be represented by different identifier values, respectively indicating authorized and unauthorized. For example, it can be represented by 0 for unauthorized and 1 for authorized.
[0043] Optionally, the router can determine whether there is a data row with this device identifier recorded in the device connection information table based on the device identifier and the device connection information table. If it exists, it is determined that the connected device is a device that has historically connected to the target WiFi network. If the request type identifier in the first request is recognized as obtaining the password 0x01, that is, the first request includes a password acquisition request, the router can send a password modification notification message to the connected device through the TCP protocol.
[0044] Optionally, on the connected device side, a TCP server is pre-started to listen on a specified port to receive notification messages from the router.
[0045] S130: Through the connected device, after receiving the password update notification, in response to the user's password acquisition operation, generate a second request and send it to the router.
[0046] Optionally, after receiving the password update notification through the connection device, in response to a user's password acquisition operation, and generating a second request to be sent to the router, it may include:
[0047] After receiving the password update notification through the connection device, generating a password update prompt box and presenting it to the user; wherein, the password update prompt box includes password update inquiry information and operation options;
[0048] When the connection device responds to a user's password acquisition operation, generating a second request to be sent to the router; wherein, the second request includes a request for obtaining a new password and the device identifier of the connection device.
[0049] Optionally, the password update notification is a message sent by the router through the TCP protocol, which may be in the form of a data packet, and the password update notification is used to notify the connection device that the password of the router has been changed.
[0050] Optionally, the password update prompt box may contain password update inquiry information, which is in text form, and the password update inquiry information may be used to ask the user whether they wish to obtain a new password; the operation options may include an OK option and a Cancel option.
[0051] Optionally, when the user clicks the OK option through the connection device, it is determined that the user's password acquisition operation is responded to; when the user clicks the Cancel option through the connection device, reconnecting to the target WiFi network is cancelled.
[0052] Optionally, the request for obtaining a new password in the second request is used to obtain the updated password.
[0053] S140. When the router determines that the connection device is an authorized device according to the second request and the device connection information table, sending an encrypted password to the connection device.
[0054] Optionally, after receiving the second request sent by the connection device, the router parses the MAC address of the device from the second request, queries the authorization identifier corresponding to the MAC address in the device connection information table through an SQL query statement, and determines whether the device is authorized to obtain the password.
[0055] Optionally, when it is determined that the connection device is an authorized device, the new password is encrypted by the AES (Advanced Encryption Standard) algorithm and sent to the connection device.
[0056] The advantage of such a setting is that by using the unique identification information of the device for device identification, it is ensured that only authorized connected devices can interact with the router, thereby preventing unauthorized devices from obtaining the new password and effectively improving the network security.
[0057] S150. Reconnect to the WiFi network according to the encrypted password by connecting the device.
[0058] Optionally, after receiving the encrypted password by connecting the device, use the same key and AES algorithm for decryption. The decryption result is the updated new password. Use the new password to reconnect to the target WiFi network and store the new password.
[0059] The technical solution of the embodiment of the present invention, by using the connected device, when it is determined that the connection to the target WiFi network is disconnected, generates a first request and sends it to the router providing the target WiFi network. Using the router, according to the first request and the device connection information table, sends a password update notification to the connected device. Using the connected device, after receiving the password update notification, in response to the user's password acquisition operation, generates a second request and sends it to the router. Using the router, when it is determined that the connected device is an authorized device, sends the encrypted password to the connected device. Using the connected device, according to the encrypted password, reconnects to the WiFi network. In this way, after the WiFi password is modified, the connected device can automatically start the processing flow without the user performing a manual reconnection operation. The connected device system can monitor the WiFi network status in real time. Once it detects that the password is modified, it can quickly start the processing flow and timely reconnect the device to the network, reducing the impact of network interruption on the user and improving the user experience. Moreover, it can prevent unauthorized devices from obtaining the new password and effectively improve the network security.
[0060] Embodiment 2
[0061] Figure 2 The flowchart of a WiFi connection method provided for the second embodiment of the present invention. Based on the above embodiment, this embodiment specifically describes the WiFi connection method. As Figure 2 shown, the method includes:
[0062] S210. When the connected device receives a network disconnection event notification, determine the currently disconnected target WiFi network according to the network handle and call the callback function to generate a first request.
[0063] Wherein, the first request includes the device identifier of the connected device, the router identifier, and the password acquisition request identifier.
[0064] Wherein, the connected device subscribes to the network status change event notification in advance by calling the target method in the OpenHarmony system.
[0065] Optionally, in the OpenHarmony system, the subscribeNetworkStateChanged method in the ohos.net.NetManager class can be called to subscribe to network state change event notifications. This method requires two parameters to be passed in. The first parameter is of the NetHandle type and can be obtained through ohos.net.NetManager.getNetHandle(), which represents the network handle. The second parameter is a callback function of the NetStateCallback type, which is used to handle network state change events.
[0066] Optionally, the ohos.net.NetManager.getNetHandle() method can return a valid network handle based on the current network connection status of the system. The network handle can be used to identify an object of a specific network connection. In the OpenHarmony system, a device may be connected to multiple different types of networks simultaneously, and each network connection has a unique NetHandle corresponding to it. Through the network handle, the system can accurately identify and manage different network connections.
[0067] Optionally, a callback function of the NetStateCallback type can be used to handle network state change events. When the network state changes, the system will call the callback function and pass the relevant network state information to the callback function. The connected device can implement the preset processing logic in the callback function. That is, after determining that the network state has changed from the connected state to the disconnected state, a first request is generated.
[0068] S220: Through the router, determine the device identifier of the connected device according to the first request, and when it is determined that the device identifier of the connected device is already stored in the device connection information table, send a password update notification to the connected device.
[0069] Optionally, through the router, determine the device identifier of the connected device according to the first request, and when it is determined that the device identifier of the connected device is not stored in the device connection information table, the first request is ignored.
[0070] S230: Through the connected device, after receiving the password update notification, generate a password update prompt box and display it to the user.
[0071] Among them, the password update prompt box includes password update inquiry information and operation options.
[0072] S240: Through the connected device, when responding to the user's password acquisition operation, generate a second request and send it to the router.
[0073] Among them, the second request includes a request for obtaining a new password and the device identifier of the connected device.
[0074] Optionally, a method for displaying a dialog box is pre-created in the AbilitySlice component of OpenHarmony on the device, and a Dialog object is created in this method. The basic properties of the Dialog object are pre-set, and the basic properties may include the custom layout, text information, OK button, and cancel button of the password update prompt box. The text information is used to ask the user whether they wish to obtain a new password. In addition, the processing logic of the OK button and the cancel button in the Dialog object is included in this method. After receiving the password update notification, the Dialog object is called to display the password update prompt box to the user. After the user clicks the OK or cancel button, the corresponding operation is executed according to the logic corresponding to the button. The logic corresponding to the OK button is to generate a second request and send it to the router in response to the user's password acquisition operation. The logic corresponding to the cancel button is to cancel the password update and close the password update prompt box.
[0075] S250: Through the router, determine the device identifier of the connected device according to the second request, and obtain the authorization identifier of the connected device according to the device connection information table and the device identifier of the connected device.
[0076] In an optional example, the router can query the authorization identifier corresponding to the MAC address through an SQL statement. For example, the SQL statement for finding the device with the MAC address '00:11:22:33:44:55' and checking the authorization status can be: SELECT * FROM device_info WHERE mac_address = '00:11:22:33:44:55' AND is_authorized = '1'.
[0077] S260: Through the router, when it is determined that the connected device is an authorized device according to the authorization identifier, encrypt the updated new password and send it to the connected device.
[0078] Optionally, through the router, when it is determined that the connected device is an unauthorized device according to the authorization identifier, send an unauthorized notification to the connected device.
[0079] S270: Through the connected device, decrypt the encrypted password and determine the new password of the target WiFi network according to the decryption result.
[0080] S280: Through the connected device, reconnect to the target WiFi network using the new password and store the new password.
[0081] Optionally, after the connected device obtains the decrypted new password, it can call the API (Application Programming Interface) related to WiFi connection in the OpenHarmony system, such as the method in the ohos.net.wifi.WifiManager class, to automatically connect to the WiFi network.
[0082] In the technical solution of the embodiment of the present invention, by using the connected device, when it is determined that the connection to the target WiFi network is disconnected, a first request is generated and sent to the router providing the target WiFi network. The router, according to the first request and the device connection information table, sends a password update notification to the connected device. The connected device, after receiving the password update notification, in response to the user's password acquisition operation, generates a second request and sends it to the router. When the router determines that the connected device is an authorized device, it sends the encrypted password to the connected device. The connected device reconnects to the WiFi network according to the encrypted password. In this way, after the WiFi password is modified, the connected device can automatically start the processing flow without the user having to perform a manual reconnection operation. The connected device system can monitor the WiFi network status in real time. Once it detects that the password has been modified, it can quickly start the processing flow and promptly reconnect the device to the network, reducing the impact of network interruption on the user and improving the user experience. Moreover, it can prevent unauthorized devices from obtaining the new password, effectively enhancing the security of the network.
[0083] Embodiment 3
[0084] Figure 3 FIG. shows a schematic structural diagram of a router 10 that can be used to implement the embodiments of the present invention. The router is intended to represent various forms of digital computers, such as, for example, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The router can also represent various forms of mobile devices, such as, for example, personal digital processors, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0085] As Figure 3As shown, the router 10 includes at least one processor 11 and a memory communicatively connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc. The memory stores a computer program executable by the at least one processor. The processor 11 can execute various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the router 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0086] Multiple components in the router 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disc, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the router 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0087] The processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the WiFi connection method as described in the embodiments of the present invention. That is:
[0088] Through the connection device, when it is determined that the connection to the target WiFi network is disconnected, a first request is generated and sent to the router providing the target WiFi network;
[0089] Through the router, according to the first request and a pre-established device connection information table, a password update notification is sent to the connection device;
[0090] Through the connection device, after receiving the password update notification, in response to the user's password acquisition operation, a second request is generated and sent to the router;
[0091] Through the router, when it is determined that the connection device is an authorized device according to the second request and the device connection information table, an encrypted password is sent to the connection device;
[0092] Reconnect to the WiFi network through the connection device according to the encrypted password.
[0093] In some embodiments, the WiFi connection method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed onto router 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the WiFi connection method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the WiFi connection method by any other suitable means (e.g., by means of firmware).
[0094] The various embodiments of the systems and techniques described above in this document may be implemented in digital electronic circuitry, integrated circuit systems, field-programmable gate arrays (FPGA), application-specific integrated circuits (ASIC), application-specific standard products (ASSP), systems-on-chip (SOC), complex programmable logic devices (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that may be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a special-purpose or general-purpose programmable processor that receives data and instructions from a storage system, at least one input device, and at least one output device, and transmits the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0095] The computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs may be executed entirely on the machine, partially on the machine, as a stand-alone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0096] In the context of the present invention, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0097] To provide for interaction with a user, the systems and techniques described herein can be implemented on a router that includes: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the router. Other kinds of devices can also be used to provide for interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, speech input, or tactile input).
[0098] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0099] A computing system may include a client and a server. The client and the server are generally far from each other and usually interact via a communication network. The client-server relationship is created by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, solving the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.
[0100] It should be understood that various forms of processes shown above can be used, steps can be reordered, added or deleted. For example, the steps recited in the present invention can be executed in parallel, sequentially or in a different order, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is made herein.
[0101] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A WiFi connection method, characterized in that: Executed by the connection device and the router, including: When it is determined that the connection is disconnected from the target WiFi network, the connection device generates a first request and sends the first request to a router providing the target WiFi network; sending, through the router, a password update notification to the connected device according to the first request and a pre-established device connection information table; After receiving the password update notification, the connection device generates a second request in response to the password acquisition operation of the user and sends it to the router; When it is determined by the router that the connecting device is an authorized device according to the second request and the device connection information table, sending an encrypted password to the connecting device; Reconnect to the WiFi network through the connection device according to the encryption password.
2. The method according to claim 1, characterized in that The device connection information table includes the device identification, connection status and authorization identification of each connection device connected to the target WiFi network.
3. The method according to claim 2, characterized in that Also includes any of the following: By means of the router, whenever it is determined that a new device is connected to the target WiFi network, a device identification of the new device is determined according to the network protocol, and the device identification of the new device is stored in a device connection information table maintained by the router; The router monitors the connection status of each connected device in the device connection information table in real time, and stores the connection status of each connected device in the device connection information table in correspondence with the device identification of each connected device; as well as When the router receives a permission change request sent by the router management program, the device identification of the target connection device currently undergoing permission change is determined according to the permission change request, and the authorization identification corresponding to the device identification of the target connection device is modified in the device connection information table.
4. The method according to claim 2, characterized in that: When it is determined that the connection device is disconnected from the target WiFi network, a first request is generated, including: When receiving a network disconnection event notification, the connection device determines the currently disconnected target WiFi network according to the network handle, and calls the callback function to generate a first request; wherein the first request includes the device identifier, router identifier, and password acquisition request identifier of the connection device; Among them, the connected device pre-subscribes to network status change event notifications by calling the target method in the open source Hongmeng system.
5. The method according to claim 2, characterized in that: The method of sending a password update notification to the connected device through the router according to the first request and a pre-established device connection information table includes: The router determines the device identification of the connection device according to the first request, and when it is determined that the device identification of the connection device has been stored in the device connection information table, sends a password update notification to the connection device.
6. The method according to claim 2, characterized in that After receiving the password update notification, the connection device generates a second request in response to a password acquisition operation of the user and sends it to the router, including: After receiving the password update notification, the connection device generates a password update prompt box and displays it to the user; wherein the password update prompt box includes password update inquiry information and operation options; Through the connection device, in response to the user's password acquisition operation, a second request is generated and sent to the router; wherein the second request includes a request for obtaining a new password and a device identification of the connection device.
7. The method according to claim 2, characterized in that: When, by the router, it is determined that the connected device is an authorized device according to the second request and the device connection information table, sending an encrypted password to the connected device includes: Determine, by the router, a device identification of the connecting device according to the second request, and obtain an authorization identification of the connecting device according to the device connection information table and the device identification of the connecting device; Through the router, when the connection device is determined to be an authorized device according to the authorization identifier, the updated new password is encrypted and sent to the connection device.
8. The method according to claim 1, characterized in that: Reconnecting to the WiFi network through the connection device according to the encryption password includes: Decrypting the encrypted password through the connecting device, and determining a new password for the target WiFi network according to the decryption result; Through the connection device, the target WiFi network is reconnected using the new password, and the new password is stored.
9. A router, characterized in that: The router comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the WiFi connection method according to any one of claims 1 to 8 of the present invention.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the WiFi connection method according to any one of claims 1 to 8 when executed.