Connection relationship recovery method and device, electronic equipment and storage medium

By using non-volatile memory powered by an alternative power source to store critical connection parameters in the gateway device, and by utilizing a coprocessor and backup communication channels to restore routing connections, the problem of low reconnection efficiency of smart devices after gateway restart is solved, achieving fast and seamless network recovery.

CN121367720APending Publication Date: 2026-01-20GREE ELECTRIC APPLIANCE INC OF ZHUHAI +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511390977.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-26
Publication Date
2026-01-20

Smart Images

  • Figure CN121367720A_ABST
    Figure CN121367720A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a connection relation recovery method and device, electronic equipment and a storage medium, and the method comprises the steps: storing key connection parameters of intelligent equipment through calling a nonvolatile memory which is powered by other power supplies in gateway equipment; the other power supplies are power supplies except the main power supply; when the gateway equipment is restarted, the intelligent equipment is controlled to recover the routing connection relation with the gateway equipment based on the key connection parameters, so that the key connection parameters of the intelligent equipment are stored for a long time, and the gateway equipment can bypass a time-consuming traditional reconnection process based on the parameters after being restarted; and the routing reconnection efficiency of the intelligent equipment is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of connection relationship recovery, in particular to a connection relationship recovery method, a connection relationship recovery device, an electronic device and a computer readable storage medium. BACKGROUND

[0002] With the development of Internet of Things (IoT) technology, the number of smart devices in home networks has increased dramatically, from smart speakers, cameras to various sensors. These devices usually establish connections with gateway devices through WiFi to achieve interconnection. However, this architecture relying on a single WiFi network brings a significant technical challenge: when the gateway device is unexpectedly powered off, firmware upgraded or restarted, all connected smart devices will simultaneously disconnect and attempt to reconnect, so how to improve the reconnection efficiency of smart devices directly determines the use efficiency of the devices. SUMMARY

[0003] The embodiments of the present application provide a connection relationship recovery method, device, electronic device and computer readable storage medium to overcome the above problems or at least partially solve the above problems.

[0004] The embodiments of the present application disclose a connection relationship recovery method, which is applied to a gateway device, the gateway device is configured with corresponding smart devices, and the connection relationship recovery method comprises:

[0005] calling a non-volatile memory with other power supply in the gateway device to save key connection parameters of the smart devices; the other power supply is a power supply other than the main power supply;

[0006] controlling the smart devices to recover the routing connection relationship with the gateway device based on the key connection parameters when the gateway device is restarted.

[0007] Optionally, the gateway device is configured with a main processor for implementing a routing function, and the step of calling a non-volatile memory with other power supply in the gateway device to save key connection parameters of the smart devices comprises:

[0008] generating key connection parameters for the smart devices when the main processor is connected with the smart devices through the routing connection relationship; the key connection parameters include a basic service set identifier and an IP address allocated by the gateway device for the smart devices;

[0009] storing the basic service set identifier and the IP address to the non-volatile memory with other power supply in the gateway device based on an internal communication interface of the gateway device;

[0010] The IoT chip of the smart device is provided with a non-volatile storage area, and the smart device is configured to:

[0011] store the basic service set identifier and the IP address to the non-volatile storage area.

[0012] Optionally, the gateway device is configured with a coprocessor and a dual-mode communication module, and the other power supply is used to supply power to the coprocessor and the dual-mode communication module when the main power supply is powered off, and before the step of controlling the smart device to recover the connection relationship with the gateway device based on the key connection parameter, further comprising:

[0013] calling the dual-mode communication module to build a backup communication channel of the gateway device and the smart device;

[0014] generating a loading firmware, and calling the coprocessor to activate the backup communication channel in the power-on stage by using the loading firmware;

[0015] sending a beacon frame to the smart device based on the backup communication channel to maintain the backup communication channel.

[0016] Optionally, the step of controlling the smart device to recover the routing connection relationship with the gateway device based on the key connection parameter when the gateway device is restarted comprises:

[0017] calling the coprocessor to listen to the working state of the main processor and the main power supply;

[0018] in response to listening to the main processor restart or the main power supply power off, calling the coprocessor to broadcast a pre-warning frame containing the basic service set identifier based on the backup communication channel;

[0019] The smart device is configured to:

[0020] receive the pre-warning frame;

[0021] when the basic service set identifier in the pre-warning frame matches the basic service set identifier in the non-volatile storage area, send a fast association application to the gateway device based on the basic service set identifier;

[0022] receive the fast association application and recover the routing connection relationship between the smart device and the gateway device based on the fast association application.

[0023] Optionally, the fast association application includes the IP address, and the step of recovering the routing connection relationship between the smart device and the gateway device based on the fast association application comprises:

[0024] receiving an IP address sent by the smart device;

[0025] renewing a routing connection relationship between the smart device and the gateway device based on the IP address sent by the smart device when it is determined that the IP address sent by the smart device is consistent with the IP address stored in the non-volatile memory.

[0026] Optionally, the key connection parameter comprises a verification token for the smart device, the verification token is stored in the non-volatile memory and the non-volatile storage area respectively, the fast association application contains the verification token, and before the step of renewing the routing connection relationship between the smart device and the gateway device based on the IP address, the method further comprises:

[0027] receiving a verification token sent by the smart device;

[0028] when it is determined that the smart device is legal through the verification token, performing the step of renewing the routing connection relationship between the smart device and the gateway device based on the IP address.

[0029] Optionally, the gateway device is configured with a corresponding edge node device and a central cloud server, and after the step of generating the key connection parameter for the smart device, the method further comprises:

[0030] generating a data snapshot of the key connection parameter;

[0031] storing the key connection parameter to the edge node device according to a first update frequency;

[0032] storing the data snapshot to the central cloud server according to a second update frequency;

[0033] after broadcasting a pre-advertising frame containing the basic service set identifier based on the backup communication channel, in response to not receiving the fast association application within a preset time threshold, generating a first acquisition request for the key connection parameter using the MAC address of the gateway device;

[0034] the edge node device is configured to, in response to receiving the first acquisition request, send the key connection parameter to the gateway device;

[0035] when receiving the key connection parameter sent by the edge node device, renewing the routing connection relationship between the smart device and the gateway device based on the key connection parameter;

[0036] when not receiving the key connection parameter sent by the edge node device within a preset time threshold, sending a second acquisition request for the data snapshot to the central cloud server;

[0037] The center cloud server is configured to, in response to receiving the second acquisition request, find the key connection parameter from a full snapshot based on the data snapshot, and send the key connection parameter to the gateway device;

[0038] When receiving the key connection parameter sent by the center cloud server, the routing connection relationship between the smart device and the gateway device is resumed based on the key connection parameter.

[0039] The embodiment of the application also discloses a connection relationship recovery device, and the method is applied to a gateway device which is configured with a corresponding smart device, and the connection relationship recovery device comprises:

[0040] A key connection parameter maintaining module is configured to call a nonvolatile memory with other power supply in the gateway device, and save the key connection parameter of the smart device, wherein the other power supply is a power supply other than a main power supply.

[0041] A routing connection relationship recovery module is configured to control the smart device to resume the routing connection relationship with the gateway device based on the key connection parameter when the gateway device is restarted.

[0042] The embodiment of the application also discloses an electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus.

[0043] The memory is used for storing a computer program.

[0044] The processor is used for executing the program stored on the memory, and realizes the method as described in the embodiment of the application.

[0045] The embodiment of the application also discloses a computer readable storage medium, which stores instructions, and when executed by one or more processors, causes the processor to execute the method as described in the embodiment of the application.

[0046] The embodiment of the application has the following advantages:

[0047] The embodiment of the application saves the key connection parameter of the smart device by calling the nonvolatile memory with other power supply in the gateway device, the other power supply is a power supply other than a main power supply, and the routing connection relationship with the gateway device is resumed based on the key connection parameter when the gateway device is restarted, thereby realizing long-term storage of the key connection parameter of the smart device, enabling the gateway device to bypass a time-consuming traditional reconnection process based on the parameters after being restarted, and improving the routing reconnection efficiency of the smart device. BRIEF DESCRIPTION OF DRAWINGS

[0048] Figure 1 is a step flow chart of a connection relationship recovery method provided in an embodiment of the present application;

[0049] Figure 2 is a flow chart of a connection relationship recovery method provided in an embodiment of the present application;

[0050] Figure 3 is a structural block diagram of a connection relationship recovery device provided in an embodiment of the present application;

[0051] Figure 4 is a hardware structural block diagram of an electronic device provided in an embodiment of the present application;

[0052] Figure 5 is a schematic diagram of a computer readable medium provided in an embodiment of the present application. DETAILED DESCRIPTION

[0053] In order to make the above objectives, features and advantages of the present application more apparent, further detailed description will be made to the present application with reference to the accompanying drawings and specific embodiments.

[0054] Referring to Figure 1 , a step flow chart of a connection relationship recovery method provided in an embodiment of the present application is shown, which can specifically include the following steps:

[0055] Step 101, calling a non-volatile memory with other power supply in the gateway device to save key connection parameters of the smart device; the other power supply is a power supply other than the main power supply;

[0056] Step 102, when the gateway device is restarted, controlling the smart device to recover the routing connection relationship with the gateway device based on the key connection parameters.

[0057] In specific implementation, the embodiment of the present application can be applied to a gateway device, which is configured with corresponding smart devices.

[0058] Unlike the traditional single-processor router, the gateway device of the embodiment of the present application adopts a unique dual-processor and dual-power supply architecture.

[0059] The gateway device includes:

[0060] Main Processor: the core of the gateway device, responsible for performing main routing functions such as data packet forwarding, DHCP service, NAT (Network Address Translation) and managing WiFi connection. It is powered by the main power supply of the gateway and stops working when the main power supply is interrupted.

[0061] Coprocessor: A separate, low-power chip that acts as an auxiliary to the main processor. It integrates its own firmware and communication interface.

[0062] Main Power: The primary power source for the gateway device, usually an AC adapter. It powers all the main functions of the gateway, such as powering the main processor.

[0063] Auxiliary Power: A backup power system independent of the main power, usually composed of supercapacitors or small batteries. It is specifically designed to provide continuous power to the coprocessor and its associated communication modules (such as Bluetooth) in the event of a main power outage. Optionally, the independent power management module of the auxiliary power is composed of a supercapacitor group and a high-efficiency power management IC, which can provide 72 hours of continuous power to the coprocessor after the main power is interrupted. The supercapacitor realizes 30-second fast charging through a bidirectional DC-DC converter, supports 500,000 cycle life, cooperates with dynamic power consumption adjustment and hardware-level power-off detection, and ensures that the gateway can still maintain connection state backup and BLE control channel operation during 3 days of complete power outage.

[0064] The purpose of this structure is:

[0065] Separate design, route high-power, main function tasks to the main processor, and "state backup" and "emergency communication" low-power, high-reliability tasks to the coprocessor. This division of labor ensures that even in the case of complete shutdown of the main system, critical state data can be continuously maintained.

[0066] Ensure data persistence, as the coprocessor and non-volatile memory are independently powered by the auxiliary power, it can continue to run when the main power is disconnected. This allows it to synchronize the latest critical connection parameters from the main processor and store them in FRAM, a non-volatile memory, ensuring the permanence of data and solving the fatal flaw of memory data loss in traditional solutions.

[0067] The coprocessor can also maintain a backup communication channel (such as BLE). This channel allows the gateway to immediately send a signal to surrounding smart devices during the reboot process that the gateway device is rebooting, thereby enabling smart pre-reconnection of smart devices and greatly shortening the reconnection time.

[0068] Through a separate, always-on "brain (coprocessor)" and "memory bank (non-volatile memory)", it ensures that in any power outage situation, the gateway can quickly recover its "memory" and provide a fast, seamless recovery channel for all smart devices.

[0069] The embodiment of the present application can permanently store the key network information of the connected smart device in a special memory that is not affected by the main power supply when the gateway device is normally running, thereby solving the problem of memory data loss after the gateway is powered off, leading to device reconnection failure or too long time consumption.

[0070] The gateway device generally refers to a router, but has a wider function, including protocol conversion, security, device management, etc.

[0071] Other power supply refers to a power supply mode independent of the main power supply of the gateway, such as a built-in super capacitor or a backup battery, to ensure that a specific component can still work when the main power supply of the gateway is interrupted.

[0072] The non-volatile memory can be a storage medium that can maintain data content even after power failure, such as a ferroelectric random access memory (FRAM).

[0073] The key connection parameters can be a set of core information necessary for the smart device to establish a connection with the gateway, and can include but are not limited to:

[0074] Basic Service Set Identifier (BSSID): MAC address of the gateway, used to uniquely identify the gateway.

[0075] IP address: IP address assigned by the gateway to the smart device.

[0076] Verification token: key for identity verification and IP spoofing prevention.

[0077] The embodiment of the present application can use the above-mentioned saved key connection parameters to skip the traditional cumbersome reconnection process and achieve fast and non-sensory network connection recovery of the device after the gateway restarts. Through the cooperation between the gateway and the smart device, it avoids the two most time-consuming links of full channel scanning and DHCP request.

[0078] Gateway device restart refers to the system restart of the gateway due to power failure, manual restart, or firmware upgrade, etc.

[0079] Smart device refers to any terminal device connected to the home gateway through a wireless network (such as WiFi) and having certain computing power, which can include but is not limited to: smart camera, smart speaker, smart TV, smart light bulb, smart socket, smart door lock, smart sensor, etc.

[0080] In specific implementation, the gateway device of the embodiment of the present application can send a pre-warning frame or instruction to the smart device through a backup communication channel (such as Bluetooth) to inform it that the gateway is restarting and is ready for fast reconnection. Specifically, the smart device uses the BSSID, IP address, etc. stored in its chip to perform directional reconnection to the gateway instead of blind network scanning.

[0081] The routing connection relationship can be a network connection established between the smart device and the gateway, allowing data packets to be forwarded and communicated between the two.

[0082] In the embodiment, the key connection parameters of the smart device are saved by calling the non-volatile memory with other power supply in the gateway device; the other power supply is a power supply other than the main power supply; when the gateway device is restarted, the smart device is controlled to recover the routing connection relationship with the gateway device based on the key connection parameters, thereby achieving long-term storage of the key connection parameters of the smart device, enabling the gateway device to bypass the time-consuming traditional reconnection process based on the parameters after the gateway device is restarted, and improving the routing reconnection efficiency of the smart device.

[0083] Further, the following beneficial effects are achieved:

[0084] The problem of long device reconnection time after gateway restart in the prior art is solved, and the recovery time is shortened from several seconds to sub-second level, achieving "WiFi non-sensing recovery".

[0085] In the smart home and other scenarios, the devices such as cameras and sensors can quickly recover to the online state, avoiding service interruption, and greatly improving user satisfaction.

[0086] On the basis of the above-mentioned embodiments, variant embodiments of the above-mentioned embodiments are proposed, and it should be noted that, in order to make the description brief, only the differences from the above-mentioned embodiments are described in the variant embodiments.

[0087] Optionally, the gateway device is configured with a main processor for implementing a routing function, and the step of calling the non-volatile memory with other power supply in the gateway device to save the key connection parameters of the smart device comprises:

[0088] When the main processor is connected with the smart device through the routing connection relationship, the key connection parameters for the smart device are generated; the key connection parameters include a basic service set identifier and an IP address allocated by the gateway device for the smart device;

[0089] Based on the internal communication interface of the gateway device, the basic service set identifier and the IP address are stored in the non-volatile memory with other power supply in the gateway device;

[0090] The non-volatile storage area is arranged in the IoT chip of the smart device, and the smart device is configured to:

[0091] The basic service set identifier and the IP address are stored in the non-volatile storage area.

[0092] In a specific implementation, the gateway device of the embodiment of the present application can generate key connection parameters when the main processor is connected with the smart device through the routing connection relationship, so as to create a unique identity information for each newly accessed smart device for quickly restoring the connection.

[0093] The main processor is a chip responsible for the core routing function in the gateway device.

[0094] The routing connection relationship is a network connection service provided by the main processor for the smart device, allowing the device to receive and transmit data.

[0095] The key connection parameters are core data that must be saved in order to achieve fast reconnection, including:

[0096] Basic service set identifier (BSSID): the unique address of the gateway wireless module, used for accurate positioning of the device.

[0097] IP address: the network address assigned to the device by the gateway, used for data routing.

[0098] The embodiment of the present application provides the necessary data premise for subsequent fast recovery by centrally managing the key parameters.

[0099] The embodiment of the present application can also transmit the key connection parameters generated above from the main processor and persistently store them in the gateway device, so as to prevent data loss caused by power interruption.

[0100] The internal communication interface can be a physical connection between the main processor and the non-volatile memory (such as FRAM), usually an SPI, I2C, etc. high-speed communication bus.

[0101] Other power supply non-volatile memory: a storage medium powered by a backup power supply (such as a super capacitor) and data will not be lost after power failure.

[0102] The embodiment of the present application stores the basic service set identifier and the IP address in the gateway device with other power supply non-volatile memory, ensuring that the connection memory of the gateway will not disappear due to power failure, and fundamentally solving the problem that all devices need to be re-assigned IP after reboot.

[0103] The embodiment of the present application can also enable the smart device to have "memory" capability, which can save its own connection information, so as to actively and quickly initiate reconnection after the gateway is restarted.

[0104] IoT chip: the computing core inside the smart device.

[0105] Non-volatile storage area: a special storage area inside the IoT chip, used for permanently saving data.

[0106] The embodiment of the application makes the intelligent device store the basic service set identifier and the IP address to the non-volatile storage area, so that the intelligent device is recovered from passive waiting for the gateway to active directional connection. This not only accelerates the reconnection of the device itself, but also relieves the burden of the gateway and avoids the overload of the DHCP server.

[0107] 1. The intelligent device comprises:

[0108] IoT chip: the core chip of the intelligent device (such as a camera, a sensor). It is responsible for running the application logic of the device, and usually integrates a WiFi / Bluetooth communication module

[0109] Non-volatile storage area (NVS partition): a special storage space divided in the IoT chip of the intelligent device, used to store data that will not be lost after restart, such as the last connected WiFi information, IP address, etc.

[0110] Connection parameters stored in the non-volatile storage area (NVS partition):

[0111] Gateway BSSID: the MAC address of the gateway, used to uniquely identify the gateway. The device can directly connect to the gateway according to this BSSID without scanning all channels.

[0112] Last valid IP address: the last IP address successfully obtained by the device. In fast recovery, the device will directly request the gateway to recover this IP address to avoid the DHCP allocation process.

[0113] Optimal channel: the best channel where the gateway is located when the device is connected last. This can further accelerate the directional connection.

[0114] Pre-shared token: a key or token used for HMAC-SHA256 verification with the gateway. This is the key to ensuring the security of the connection.

[0115] Other parameters: including encryption keys, session IDs, etc. to support lossless recovery of TCP / UDP sessions.

[0116] 2. The gateway device comprises:

[0117] Co-processor: an auxiliary chip of the gateway device. It coexists with the main WiFi chip of the gateway, and its main responsibility is to maintain the operation of a small number of key functions when the main chip is powered off.

[0118] Non-volatile memory (FRAM): an independent hardware component on the co-processor of the gateway device, used to save the connection state data on the gateway side in real time.

[0119] Connection parameters stored in FRAM:

[0120] Connected device list: records the MAC addresses of all currently connected devices. This lets the gateway know which devices have successfully connected to it before.

[0121] IP allocation record: records the last IP address assigned to each device. This allows the gateway to assign the original IP address directly to the device when it reconnects.

[0122] BSSID and channel configuration: the gateway's own BSSID and current operating channel. This ensures that the gateway can immediately recover to the correct network configuration after a reboot.

[0123] Token information: stores a token database for HMAC-SHA256 verification to verify the legitimacy of device reconnection requests.

[0124] The NVS partition stores the device's own connection memory, which is the device's credentials for "finding" the gateway and IP address. The FRAM stores the gateway's memory of all connected devices, which is the gateway's database for "recognizing" devices and quickly restoring their connection state. The two work together, one responsible for "active seeking" and one responsible for "quick response", to achieve the entire quick recovery mechanism.

[0125] Optionally, the gateway device is configured with a coprocessor and a dual-mode communication module, and the other power supply is used to power the coprocessor and the dual-mode communication module when the main power supply is powered off, and before the step of controlling the smart device and restoring the connection relationship with the gateway device based on the key connection parameters, it further includes:

[0126] Calling the dual-mode communication module to build a backup communication channel between the gateway device and the smart device;

[0127] Generating a loading firmware, and calling the coprocessor to activate the backup communication channel during the power-on stage using the loading firmware;

[0128] Based on the backup communication channel, a beacon frame is sent to the smart device to maintain the backup communication channel.

[0129] The embodiment of the application can establish a usable and low-power communication channel as an emergency contact line between the gateway and the smart device.

[0130] The coprocessor is a separate, low-power auxiliary chip that can work when the main processor is powered off.

[0131] The dual-mode communication module is a chip integrated in the gateway device that supports two wireless technologies (such as Bluetooth 5.2 and Zigbee 3.0) simultaneously.

[0132] The standby communication channel is a low-power wireless network constructed by using a dual-mode communication module, and is used for transmitting control signals instead of a large amount of data.

[0133] The dual-mode switching logic of the embodiment of the application is as follows: when the device does not detect a beacon frame of a target BSSID for 3 times (with an interval of 100 ms) continuously in the main mode (WiFi scanning), the device is automatically switched to the low-power mode (BLE listening), and if no BLE broadcast frame of the gateway is received within 15 seconds, a hierarchical recovery strategy is triggered, that is, 3 active BLE scans are performed at an interval of 200 ms (the power consumption is increased to 1.2 mA), and if there is still no response, the device is switched back to the WiFi scanning mode and an exponential backoff algorithm is enabled (the initial interval is 1 second, and the upper limit is 32 seconds).

[0134] The embodiment of the application provides a standby channel when the main network fails, ensures that the gateway can still communicate with the device before restarting, and avoids a communication blind area.

[0135] In actual application, in order to ensure that the standby channel can be started and put into use at the fastest speed when the gateway restarts and prepare for the next broadcast, the embodiment of the application can generate a loading firmware, and use the loading firmware to call the coprocessor to activate the standby communication channel in the power-on stage.

[0136] The loading firmware can be a microprogram specially written for the coprocessor and used for controlling the startup and running of the coprocessor.

[0137] The power-on stage can be an initial stage when the coprocessor starts to start up.

[0138] The embodiment of the application greatly shortens the time for the gateway to recover communication after restarting by setting the loading of the standby channel as the highest priority, and creates a prerequisite for fast reconnection of the device.

[0139] The embodiment of the application periodically sends a “heartbeat” signal to the nearby smart device through the standby communication channel, so as to maintain the continuous running of the standby communication channel and make the device perceive the existence of the gateway.

[0140] The beacon frame is a data packet periodically broadcasted by a base station (here, the gateway) in wireless communication, and usually contains network identification, configuration information, etc. Here, it also carries the pre-warning information that the gateway is restarting. The beacon frame of the standby channel (such as Bluetooth) is very small and has very low power consumption, and is very suitable for battery-powered IoT devices, and will not significantly affect the endurance of the IoT devices.

[0141] Beneficial effects:

[0142] The device does not need to perform power-consuming full channel scanning, but only needs to listen to the beacon frame on the standby channel, and once the signal is detected, the reconnection state can be immediately entered, and the standby communication channel is constructed and maintained, thereby providing a prior condition for subsequent recovery of the association relationship.

[0143] Optionally, the step of controlling the smart device to recover the routing connection relationship with the gateway device based on the key connection parameter when the gateway device is restarted comprises:

[0144] The co-processor is called to listen to the working state of the main processor and the main power supply;

[0145] In response to listening to the main processor restart or the main power supply power off, the co-processor is called to broadcast a pre-warning frame containing the basic service set identifier based on the standby communication channel;

[0146] The smart device is configured to:

[0147] Receive the pre-warning frame;

[0148] When the basic service set identifier in the pre-warning frame matches the basic service set identifier in the non-volatile storage area, a fast association application is sent to the gateway device based on the basic service set identifier;

[0149] Receive the fast association application, and recover the routing connection relationship between the smart device and the gateway device based on the fast association application.

[0150] The embodiment of the application can ensure that the co-processor can timely perceive and immediately act before the gateway main system fails or restarts, and send a restart pre-warning to the smart device through the standby channel, thereby preparing for fast reconnection.

[0151] Specifically, the co-processor can detect the accidental interruption of the main power supply or the restart signal of the main processor in real time, and once the above event is detected, the co-processor will immediately start the standby communication channel and broadcast a pre-warning frame to all smart devices.

[0152] The embodiment of the application can also actively send a notification (pre-warning frame) that the gateway is restarting to all smart devices through the low-power standby channel when the gateway main power supply is interrupted or the main processor is restarted.

[0153] The pre-warning frame can be a broadcast data packet containing key information, used to notify the device that the gateway is about to or is restarting.

[0154] The basic service set identifier BSSID is the unique MAC address of the gateway wireless interface.

[0155] The problem that a device cannot predict the state of a gateway in the prior art is solved by calling the co-processor to broadcast a pre-warning frame containing the basic service set identifier based on the backup communication channel in response to listening to the main processor restarting or the main power being powered off. The device no longer needs to blindly wait for a timeout, but can immediately react according to the pre-warning, and the reconnection process is changed from passive to active.

[0156] The embodiment of the application can enable an intelligent device to identify and respond to a pre-warning of a gateway, and accurately locate the gateway based on a pre-stored BSSID, instead of performing a time-consuming full-channel scan.

[0157] The basic service set identifier in the pre-warning frame can be data containing the MAC address of the gateway broadcasted by the gateway through the backup channel. In a specific implementation, the embodiment of the application can achieve energy consumption balance through three optimizations with a 100 ms scan interval: first, the scan is only for a single target BSSID (not full-channel scan), so that the power consumption of each scan is low; second, the device switches to a low-power BLE mode immediately after failing to scan for three times, further reducing power consumption; and third, for devices such as door locks with extremely low power consumption, a dynamic scan interval (100 ms to 2 s programmable) is supported, which is combined with a duty cycle optimization algorithm to greatly reduce power consumption.

[0158] The basic service set identifier in the non-volatile storage area can be the MAC address of the gateway device saved in the NVS of the intelligent device when the intelligent device is normally connected.

[0159] By checking the BSSID, the "discovery" stage of the device to recover the connection is greatly shortened. By matching the BSSID in the broadcast information with the BSSID of the local data, the intelligent device can accurately know which gateway device is calling, thereby avoiding unnecessary scanning and power consumption.

[0160] After the intelligent device and the gateway device are ready, a simplified and efficient process is used to quickly rebuild the routing connection.

[0161] The fast association request can be a simplified 802.11 protocol request, which aims to skip the complex negotiation step and realize fast handshaking.

[0162] The traditional full set of WiFi connection processes are simplified into fast association based on the pre-stored BSSID, which works in cooperation with subsequent IP address and token verification to ensure that the connection rebuilding is both fast and secure.

[0163] Optionally, the fast association request includes the IP address, and the step of resuming the routing connection relationship between the intelligent device and the gateway device based on the fast association request includes:

[0164] receiving the IP address sent by the smart device;

[0165] when it is determined that the IP address sent by the smart device is consistent with the IP address stored in the non-volatile memory, resuming the routing connection relationship between the smart device and the gateway device based on the IP address sent by the smart device.

[0166] In the related art, when the smart device is disconnected from the gateway, if it needs to be reconnected, it usually needs to reacquire the IP address through the dynamic host configuration protocol (DHCP).

[0167] The DHCP process usually includes the following steps:

[0168] DHCP Discover (discovery): the device broadcasts a data packet to the network, requesting a DHCP server.

[0169] DHCP Offer (offer): After the DHCP server receives the request, it selects an available IP address from its IP address pool and sends an "offer" data packet containing the address.

[0170] DHCP Request (request): After the device receives the "offer" data packet, it sends a "request" data packet to formally request the use of the IP address.

[0171] DHCP ACK (acknowledgment): The DHCP server sends an "acknowledgment" data packet to finally allocate the IP address to the device.

[0172] This complete DHCP negotiation process requires multiple communication handshakes and takes a long time. When the gateway is restarted, if hundreds or thousands of smart devices simultaneously perform this series of operations, it may cause the DHCP server to overload, further prolonging the reconnection time.

[0173] The embodiments of the present application simplify this process and directly skip the DHCP negotiation to achieve fast recovery of the IP address.

[0174] In specific implementation, the embodiments of the present application use the pre-stored IP address to skip the time-consuming and easy-to-overload DHCP negotiation process and directly restore the routing connection between the smart device and the gateway. This is like reserving a special parking space for the smart device, which directly enters the warehouse when reconnecting without the need to find and queue again.

[0175] The beneficial effects include:

[0176] Greatly shorten the reconnection time: bypassing the complex DHCP negotiation process, the acquisition time of the IP address is shortened from several seconds to an instant, which is the key to realizing "sensitive recovery".

[0177] Prevent DHCP overload: Avoids all devices making DHCP requests concurrently when the gateway restarts, fundamentally solves the problem of DHCP server overload, and improves the stability and reliability of the system.

[0178] Enhance connection consistency: Ensure that the device can obtain the same IP address as before after reconnection, which is crucial for some services that rely on IP addresses, such as internal network penetration.

[0179] Optionally, the key connection parameter includes a verification token for the smart device, the verification token is stored in the non-volatile memory and non-volatile storage area respectively, and the fast association application contains the verification token, before the step of restoring the routing connection relationship between the smart device and the gateway device based on the IP address, further comprising:

[0180] Receiving the verification token sent by the smart device;

[0181] When it is determined that the smart device is legal through the verification token, the step of restoring the routing connection relationship between the smart device and the gateway device based on the IP address is executed.

[0182] In the related art wireless network, device identity verification usually depends on the 802.11 protocol standard. The most common verification method is:

[0183] Pre-shared key (PSK): The device and the gateway use the same pre-shared password (i.e. WiFi password). The device uses the password to generate an encryption key when connecting, and performs a four-way handshake (4-way handshake) with the gateway to verify identity.

[0184] 802.1X authentication: In enterprise-level networks, devices need to go through a more complex identity verification through an independent authentication server (RADIUS), using a username and password, or a digital certificate.

[0185] Both methods have limitations: the PSK method requires devices to re-perform handshakes after the gateway restarts, which increases the reconnection time. While 802.1X is more secure, the process is more complex and not suitable for home IoT scenarios that require fast and seamless recovery.

[0186] The embodiment of the application introduces a verification token, simplifies the identity verification process to one step while maintaining high security, and seamlessly integrates it into the fast reconnection process.

[0187] In a specific implementation, before IP address recovery, the identity of the smart device is quickly and reliably verified to prevent illegal device impersonation or IP spoofing attacks. This ensures that the quick recovery is carried out in a secure and trusted environment, avoiding the incorrect allocation of pre-stored IP addresses to malicious devices.

[0188] Verification Token: A dynamically generated, unique key bound to the device and session. It is not a static password, but more like a "one-time" ticket to prove the legitimacy of the device. The way to generate the token can include: using a dynamic token system based on P-256 elliptic curve, whose complete life cycle management is as follows: the token is generated by the gateway in real time through the hardware encryption engine every time the device successfully connects, containing HMAC-SHA256 signature of device MAC + timestamp + random salt, and the valid period is strictly limited to 5 minutes; the gateway and the device synchronize token updates through a bidirectional TLS1.3 channel, and immediately discard the old token and issue a new token after each verification; when token leakage (such as reuse) or expiration is detected, a three-level emergency protocol is triggered immediately - first try to renegotiate through the BLE secure channel (time-consuming <200ms), if failed, fall back to complete 802.1X authentication, and generate a security event log to report to the cloud.

[0189] The specific verification process can be achieved through a four-way man-in-the-middle attack defense mechanism:

[0190] 1. Beacon frame digital signature;

[0191] Meaning: Ensure that the "gateway restart warning" received by the device is sent by the real gateway, not by the attacker.

[0192] Specific implementation:

[0193] Gateway device generates signature: The gateway uses a private key to encrypt and sign the key information (such as gateway BSSID, timestamp and sequence number) of the enhanced beacon frame in its secure chip (TEE, trusted execution environment), generating a unique digital signature.

[0194] Smart device verifies signature: The smart device will pre-burn the gateway's public key in its chip when it is manufactured. When the device receives the beacon frame, it will use the public key to decrypt and verify the signature. If the signature is valid, the device confirms that the beacon frame comes from a legitimate gateway and can safely proceed to the next step.

[0195] 2. Token dynamic binding;

[0196] Meaning: Ensure that the token used for quick identity verification cannot be reused after being stolen or forged on other devices.

[0197] Specific implementation:

[0198] Strong correlation generation: The HMAC token generated by the gateway not only contains a random number, but also is tightly bound with the MAC address of the device, the BSSID of the gateway, and a session nonce (one-time random number).

[0199] Single validity: The token adopts a mechanism similar to HOTP (HMAC-based One-Time Password), which is invalidated immediately after each use, preventing "replay attacks" by attackers intercepting the token.

[0200] 3. Secondary authentication through an out-of-band channel;

[0201] Meaning: In the most critical identity verification link, an additional, independent physical verification of the main communication channel (WiFi) is added.

[0202] Specific implementation:

[0203] Main channel transmission: The device sends a fast association application containing the token to the gateway through WiFi.

[0204] Out-of-band verification: During this process, the gateway and the device will simultaneously perform a simple secondary verification through a backup channel (BLE / Zigbee). For example, the gateway may send a short verification code through Bluetooth, and the device must respond correctly through Bluetooth within a very short time. Since it is difficult for an attacker to control two independent physical channels at the same time, this greatly increases the difficulty of attack.

[0205] 4. Real-time threat awareness;

[0206] Meaning: Continuously monitor abnormal behavior in the network environment and take immediate action when suspicious situations are found.

[0207] Specific implementation:

[0208] RSSI fluctuation monitoring: The gateway continuously monitors the RSSI (Signal Strength Indicator) of beacon frames. Normal signal strength is usually within a stable range, and if the RSSI suddenly fluctuates abnormally (such as more than ±3dB), it may mean that there is a fake AP or interference source nearby.

[0209] Linkage to the cloud: Once an anomaly is detected, the gateway will immediately trigger an alarm and report the MAC address or IP address of the suspicious device to the cloud. The cloud system can use this information to update its blacklist and link other gateway devices for blocking, forming a network-wide defense system.

[0210] Beneficial effects:

[0211] Realize second-level security authentication: Through simple token matching, shorten the authentication time from traditional four-way handshake (which may take hundreds of milliseconds) to instant completion, which is the key to realizing no-sense recovery.

[0212] Enhanced anti-counterfeiting capability: Token and IP address are strongly bound. Even if an attacker steals the IP address of a device, it cannot pass the verification without the correct token. This provides an additional security barrier for device reconnection.

[0213] Simplify user experience: Users do not need to intervene in complex authentication processes, and all security verification is automatically completed between the device and the gateway, achieving a perfect combination of security and convenience.

[0214] Exemplarily, the no-sense recovery process of the smart camera:

[0215] Suppose the user's WiFi gateway suddenly loses power and then resumes power supply. At the same time, a smart camera connected to the gateway needs to quickly recover the connection and continue monitoring.

[0216] 1. Permanent storage of connection information;

[0217] When working normally, the user's gateway main processor allocates an IP address (such as 192.168.1.10) to the smart camera and obtains the camera's BSSID (such as AA:BB:CC:DD:EE:FF).

[0218] Gateway device: The gateway's main processor immediately synchronizes the camera's IP address, BSSID, and token to the coprocessor through the internal communication interface, and the coprocessor permanently saves them in the FRAM.

[0219] Smart device: The camera's IoT chip also stores these same parameters (IP address, BSSID, token) in its NVS partition.

[0220] 2. Emergency communication channel establishment;

[0221] The coprocessor of the gateway is powered by a super capacitor, which remains operational when the gateway's main power supply is interrupted.

[0222] The coprocessor calls the dual-mode communication module (such as Bluetooth) to establish a backup communication channel, and through a special loading firmware, it activates this channel during the power-on phase.

[0223] The coprocessor uses this backup channel to periodically send low-power beacon frames to surrounding devices to maintain the activity of the channel.

[0224] 3. Gateway restart warning;

[0225] After the gateway is powered off and powered on again, the coprocessor immediately listens to the restart state of the main processor.

[0226] The coprocessor broadcasts a pre-ad frame through the standby channel, which contains the BSSID (AA: BB: CC: DD: EE: FF) of the gateway, informing the camera that it is recovering.

[0227] The camera continuously listens to the standby channel, and as soon as it receives this pre-ad frame, it will be immediately awakened from the low-power mode.

[0228] 4. The camera re-connects in direction;

[0229] After receiving the pre-ad frame, the camera enters the fast reconnection mode.

[0230] The camera matches the BSSID in its NVS partition with the BSSID in the pre-ad frame. Since they are the same, the camera confirms that the pre-ad is from the gateway it is familiar with.

[0231] The camera no longer performs full channel scanning, but sends a fast association application to the gateway based on the pre-stored BSSID (AA: BB: CC: DD: EE: FF).

[0232] 5. IP address lossless recovery;

[0233] In the fast association application, the camera attaches its pre-stored IP address (192.168.1.10) and verification token. After receiving the application, the gateway performs the following steps:

[0234] First, it receives and verifies the verification token sent by the camera, ensuring that the request is legitimate.

[0235] After verification, the gateway checks whether the IP address (192.168.1.10) requested by the camera is consistent with the record stored in its FRAM.

[0236] After determining consistency, the gateway directly restores the IP address of the camera and rebuilds the routing connection relationship. The entire process does not require DHCP negotiation and is completed instantly.

[0237] Finally, the camera restores the connection with the gateway in less than a second, and continues to send video streams, and the user feels no network interruption.

[0238] Optionally, the gateway device is configured with a corresponding edge node device and a central cloud server, and after the step of generating the key connection parameters for the smart device, it further includes:

[0239] Generating a data snapshot of the key connection parameters;

[0240] storing the key connection parameters to the edge node device according to a first update frequency;

[0241] storing the data snapshot to the central cloud server according to a second update frequency;

[0242] after broadcasting a pre-announcement frame containing the basic service set identifier based on the backup communication channel, in response to not receiving the fast association application within a preset time threshold, generating a first acquisition request for the key connection parameters using the MAC address of the gateway device;

[0243] The edge node device is configured to, in response to receiving the first acquisition request, send the key connection parameters to the gateway device;

[0244] When receiving the key connection parameters sent by the edge node device, restoring the routing connection relationship between the smart device and the gateway device based on the key connection parameters;

[0245] When not receiving the key connection parameters sent by the edge node device within a preset time threshold, sending a second acquisition request for the data snapshot to the central cloud server;

[0246] The central cloud server is configured to, in response to receiving the second acquisition request, find the key connection parameters from the full snapshot based on the data snapshot, and send the key connection parameters to the gateway device;

[0247] When receiving the key connection parameters sent by the central cloud server, restoring the routing connection relationship between the smart device and the gateway device based on the key connection parameters.

[0248] The embodiment of the application can create a multi-level remote backup system to prevent local recovery failure. By regularly synchronizing the key connection parameters to the edge node and the central cloud, it is ensured that there is a reliable data source when the gateway local data is lost or damaged.

[0249] Storing data to the edge node according to a first update frequency is to improve the recovery speed. The edge node is located near the user's geographical location, and the data synchronization frequency is high (the first update frequency), so that the gateway can obtain the latest data with extremely low delay (such as milliseconds) when needed. This provides the ability of "near recovery" as the first line of defense after local recovery failure.

[0250] Storing data to the central cloud server at the second update frequency is to ensure the final reliability. The central cloud is a global data backup, although the synchronization frequency is low (the second update frequency), but it stores the complete snapshot of all devices. This ensures that even if the edge node fails on a large scale, the data is still safe, providing the strongest "bottom" guarantee for the entire scheme.

[0251] Data snapshot: a complete copy of key connection parameters at a specific time point.

[0252] First update frequency: higher frequency, used to synchronize data to edge nodes, for example, every few minutes.

[0253] Second update frequency: lower frequency, used to backup data to the central cloud, for example, every hour.

[0254] Edge node device: a data center or server located near the user, used to provide low-latency localized cloud services.

[0255] Central cloud server: a remote, centralized cloud server that stores full backup data for all devices.

[0256] Beneficial effect: provides layered redundant backup, significantly improves the overall reliability of the system. Local data loss is no longer a fatal problem, because the edge node and the central cloud can provide effective data bottom.

[0257] The embodiment of the application can automatically start the cloud collaborative recovery process after the gateway fails to attempt local recovery, ensuring that the recovery process can continue.

[0258] The purpose of generating the first acquisition request in response to not receiving a fast association application within a preset time threshold after broadcasting a pre-advertising frame containing the basic service set identifier based on the backup communication channel is to ensure that the system can start the cloud recovery process in time and automatically when the local recovery fails.

[0259] Preset time threshold: the maximum time allowed for the local recovery process to complete, for example, 500 milliseconds. If this time is exceeded, the system will consider the local recovery to have failed.

[0260] First acquisition request: a data request sent by the gateway to the edge node, containing the MAC address of the gateway itself, used to locate and acquire key connection parameters.

[0261] The embodiment of the application can take advantage of the geographical advantage of the edge node to provide backup data to the gateway with extremely low delay, achieving fast recovery.

[0262] The edge node device can be responsible for receiving the request from the gateway and looking up the required key connection parameters in its local cache. Due to its proximity to the user, the edge node can provide much faster response speed than the central cloud, significantly shortening the recovery time. This enables a near "invisible" recovery experience even in the case of local recovery failure.

[0263] Further, as the ultimate recovery guarantee, it ensures that the connection can be recovered even in the most extreme case (such as edge node failure).

[0264] Second acquisition request: data request sent by the gateway to the central cloud when the edge node is unresponsive.

[0265] Full snapshot: complete data backup stored in the central cloud, containing all configuration information of all devices.

[0266] By causing the central cloud server to, in response to receiving the second acquisition request, look up the key connection parameters from the full snapshot based on the data snapshot, and send the key connection parameters to the gateway device; causing the gateway device, upon receiving the key connection parameters sent by the central cloud server, to recover the routing connection relationship between the smart device and the gateway device based on the key connection parameters, a highest level of reliability is provided. Although the recovery time is longer than local and edge node recovery, it ensures that even if the local and edge node are both problematic, the user can still ultimately recover the connection, avoiding service interruption.

[0267] Exemplarily,

[0268] 1.1. "When the main processor is connected to the smart device through the routing connection relationship, the gateway device generates key connection parameters for the smart device", after this step, the destination of the key connection parameters is divided into three levels of synchronization:

[0269] Local storage (L1): the main processor synchronizes these key connection parameters (BSSID, IP address, token, etc.) to the coprocessor in real time through the internal communication interface (such as SPI or I2C). The coprocessor permanently stores these parameters in FRAM as the basis for local fast recovery.

[0270] Edge node synchronization (L2): the gateway device will periodically (e.g. every 5 minutes) synchronize the latest key connection parameters in bulk to the nearest edge node through a secure protocol (such as QUIC). This synchronization is incremental, only transmitting changed data to ensure low latency and high efficiency.

[0271] Central cloud backup (L3): the edge node or gateway device will synchronize the data snapshot to the central cloud at a lower frequency (e.g. every hour) as the ultimate, global backup.

[0272] 1.2. After the step of "invoking the co-processor to broadcast a pre-announce frame containing the basic service set identifier based on the backup communication channel", when the local recovery fails, the recovery process enters the cloud collaborative phase:

[0273] Timeout trigger: When the device receives the pre-announce frame broadcast by the co-processor through the backup channel, it starts to attempt a fast association based on the local NVS partition data. If the preset recovery duration threshold (e.g. 500 milliseconds) is exceeded, the system determines that the local recovery has failed.

[0274] Request to edge node:

[0275] Device behavior: The device sends a request to the nearest edge node (L2) through its backup network channel (such as a cellular network or a basic network connection established after partial functional recovery of the gateway), with its own MAC address attached.

[0276] Edge node response: The edge node looks up the device's latest key connection parameters (BSSID, IP address, token) in the local cache according to the device's MAC address. After finding, it immediately issues these parameters to the device through an encrypted channel.

[0277] Re-execute local recovery:

[0278] Device side: When the device receives the key connection parameters from the edge node, it will overwrite and update the old data in its NVS partition with these data.

[0279] Recovery connection: The device will immediately re-execute the local recovery step: send a fast association application to the gateway based on the new BSSID, which contains the IP address and verification token obtained from the edge node.

[0280] Final central cloud backup:

[0281] Trigger condition: If the edge node service is unresponsive or unable to provide valid parameters (such as edge node itself failure or cache data expiration), the device will further timeout.

[0282] Device behavior: The device will initiate a final request to the central cloud (L3).

[0283] Central cloud response: The central cloud will find and issue key connection parameters from its full snapshot.

[0284] Final recovery: After the device receives the parameters, it also updates the NVS partition and attempts the local recovery process again.

[0285] Through this layered mechanism, cloud collaboration is no longer a step independent of local recovery. Instead, it acts as a parameter provider and a fallback in case of anomalies, ensuring that the device can obtain the correct key connection parameters under any circumstances and ultimately restore the routing connection with the gateway.

[0286] Once the gateway device receives critical connection parameters from the edge node or central cloud, it uses this data to restore the routing connection with the smart device. This process can be divided into the following key steps:

[0287] 2.1. Update local storage;

[0288] After receiving the critical connection parameters (BSSID, IP address, token) from the cloud, the gateway device first uses this data to update the corresponding device record in its non-volatile memory (FRAM). This is like the gateway repairing its lost "memory," ensuring that the local database is consistent with the cloud backup.

[0289] 2.2. Notify the smart device to re-initiate the connection;

[0290] After updating the local data, the gateway will send a "reconnection command" or a special beacon frame to the corresponding smart device via its backup communication channel (such as Bluetooth) or main WiFi channel. This command tells the smart device: "The gateway device's data has been restored, and the smart device can reconnect."

[0291] 2.3. Verify and restore the connection;

[0292] Upon receiving a reconnection command, the smart device retrieves previously stored or currently received key connection parameters from its own non-volatile storage (NVS partition). It then uses these parameters to initiate a quick association request to the gateway, which includes the pre-stored IP address and verification token.

[0293] After receiving the application, the gateway will perform dual authentication using its database, which it has just restored from the cloud.

[0294] Verify that the token in the request matches the stored token.

[0295] Verify that the IP address in the request matches the stored IP address.

[0296] If the verification is successful, the gateway will directly assign the pre-stored IP address to the device, thereby quickly restoring the routing connection and skipping the time-consuming DHCP process.

[0297] The cloud and edge nodes are not directly in control of the devices, but act as data providers to help the gateway and devices repair local data, and then let them re-execute the local fast recovery process discussed earlier to achieve the recovery of the connection relationship.

[0298] In order to enable those skilled in the art to better understand the embodiments of the present application, the following is described with an example.

[0299] Reference Figure 2 , Figure 2 is a flowchart of a connection relationship recovery method provided in an embodiment of the present application;

[0300] 1. Integrate the main WiFi chip and the coprocessor at the hardware level of the gateway side, the coprocessor maintains the continuous operation of the Bluetooth 5.2 / Zigbee 3.0 backup channel through an independent power management module, and is equipped with an FRAM non-volatile memory to save key parameters such as BSSID, channel configuration and connected device list in real time;

[0301] On the software level, set up a fast recovery management firmware, which sends a pre-warning frame containing the shutdown countdown and recovery strategy code through BLE broadcast within 500ms after detecting the restart signal, and uses a priority scheduling strategy to set the WiFi driver load to the highest kernel priority and delay the start of non-critical services.

[0302] 2. The device end stores the connection parameter structure (containing 28 bytes of data such as gateway BSSID, last valid IP, optimal channel and pre-shared token validity period) in the NVS partition of the IoT chip, and realizes real-time monitoring through the creation of a dual-mode daemon process - the main mode scans the target BSSID at an interval of 100ms, and the low-power mode continuously listens to BLE broadcast. The gateway sends an enhanced 802.11 beacon frame after restarting, and the device completes the recovery through a two-step verification mechanism: first, complete the standard 802.11 association (estimated time 200-300ms), then use hardware-accelerated HMAC-SHA256 to verify the pre-stored token (estimated time <50ms), and finally achieve lossless recovery of IP address and TCP / UDP session within 480ms end-to-end. At the same time, through three levels of cloud collaboration (local cache / edge node / central cloud), it can still maintain forced synchronous recovery within 1.5 seconds in abnormal situations.

[0303] The embodiments of the present application are applicable to scenarios that require devices to always maintain a connected state, for example, on a home IoT, after the gateway is unexpectedly powered off, the camera preferentially recovers from the local cache (<200ms) to avoid a monitoring blind area.

[0304] First, in the network discovery phase, the scheme realizes the transition from passive waiting to active prediction. In the traditional way, the device must wait for 15 to 30 seconds of timeout time to discover that the gateway network has been disconnected, and then start the time-consuming full channel scanning (usually 3 to 5 seconds) to find the gateway signal. While the scheme sends the BLE pre-warning frame through the coprocessor immediately when the main power is off, the device can instantly perceive the gateway state and directly reconnect based on the pre-stored BSSID, saving about 18 to 35 seconds of discovery and scanning time.

[0305] Second, in the IP address allocation phase, the scheme realizes lossless recovery. The existing technology relies on the DHCP protocol, which requires multiple handshakes between the device and the gateway, taking 1 to 3 seconds. When a large number of devices simultaneously request DHCP, it may also cause server overload. The scheme completely bypasses the DHCP negotiation, and the device directly sends the pre-stored IP address, and the gateway verifies and allocates it through the FRAM database instantly, almost reducing the IP address acquisition time to zero.

[0306] It should be noted that for the method embodiment, in order to simply describe, it is expressed as a series of action combinations, but those skilled in the art should know that the embodiments of the present application are not limited by the order of the described actions, because according to the embodiments of the present application, certain steps can be performed in other order or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.

[0307] Referring to Figure 3 , a structure block diagram of a connection relationship recovery device provided in an embodiment of the present application is shown, which can specifically include the following modules:

[0308] The key connection parameter maintaining module 301 is configured to call a non-volatile memory with other power supply in the gateway device to save the key connection parameters of the smart device; the other power supply is a power supply other than the main power supply;

[0309] The routing connection relationship recovery module 302 is configured to control the smart device to recover the routing connection relationship with the gateway device based on the key connection parameters when the gateway device is restarted.

[0310] For the device embodiment, it is basically similar to the method embodiment, so the description is relatively simple, and the related parts are referred to the part of the method embodiment.

[0311] In addition, the embodiment of the present application further provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program is executed by the processor to implement each process of the connection relationship recovery method and achieve the same technical effects. To avoid repetition, details are not described herein.

[0312] The embodiment of the present application further provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement each process of the connection relationship recovery method and achieve the same technical effects. To avoid repetition, details are not described herein. The computer readable storage medium includes a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, etc.

[0313] Figure 4 A hardware structure diagram of an electronic device for implementing various embodiments of the present application.

[0314] The electronic device 400 includes, but is not limited to, a radio frequency unit 401, a network module 402, an audio output unit 403, an input unit 404, a sensor 405, a display unit 406, a user input unit 407, an interface unit 408, a memory 409, a processor 410, and a power supply 411, etc. Those skilled in the art can understand that the electronic device 400 can include more or less components, or combine some components, or arrange different components. In the embodiments of the present application, the electronic device includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle terminal, a wearable device, and a pedometer, etc. Figure 4 The electronic device structure shown in the above table does not constitute a limitation on the electronic device, and the electronic device can include more or less components than the diagram, or combine some components, or arrange different components. In the embodiments of the present application, the electronic device includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle terminal, a wearable device, and a pedometer, etc.

[0315] It should be understood that, in the embodiments of the present application, the radio frequency unit 401 can be used for receiving and sending signals in the process of information transmission or conversation. Specifically, after receiving the downlink data from the base station, the radio frequency unit 401 processes the data for the processor 410. In addition, the radio frequency unit 401 sends the uplink data to the base station. Generally, the radio frequency unit 401 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, etc. In addition, the radio frequency unit 401 can also communicate with the network and other devices through a wireless communication system.

[0316] The electronic device provides wireless broadband Internet access for users through the network module 402, such as helping users to send and receive emails, browse web pages, and access streaming media, etc.

[0317] The audio output unit 403 can convert audio data, which is received by the radio frequency unit 401 or the network module 402 or stored in the memory 409, into an audio signal and output as sound. Also, the audio output unit 403 can provide an audio output related to a particular function performed by the electronic device 400 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 403 includes a speaker, a buzzer, and a receiver, etc.

[0318] The input unit 404 is used to receive audio or video signals. The input unit 404 can include a graphics processor (GPU) 4041 and a microphone 4042. The graphics processor 4041 processes image data of a still picture or a video obtained by an image capture device (e.g., a camera) in a video capture mode or an image capture mode. The processed image frame can be displayed on the display unit 406. The image frame processed by the graphics processor 4041 can be stored in the memory 409 (or other storage medium) or transmitted via the radio frequency unit 401 or the network module 402. The microphone 4042 can receive sound and can process such sound as audio data. The processed audio data can be converted into a format transmittable to a mobile communication base station via the radio frequency unit 401 in the case of a telephone call mode.

[0319] The electronic device 400 further includes at least one sensor 405, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 4061 according to the brightness of ambient light, and the proximity sensor can turn off the display panel 4061 and / or the backlight when the electronic device 400 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when at rest, and can be used to identify the electronic device posture (such as screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, knock), etc. The sensor 405 can also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be described here.

[0320] The display unit 406 is used to display information input by a user or information provided to a user. The display unit 406 can include a display panel 4061, which can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc.

[0321] The user input unit 407 can be used to receive inputted numerical or character information, and to generate key signal inputs related to user settings and function controls of the electronic device. Specifically, the user input unit 407 includes a touch panel 4071 and other input devices 4072. The touch panel 4071, also called a touch screen, can collect a user's touch operation (such as a user's operation on or near the touch panel 4071 using a finger, a stylus, or any suitable object or accessory) on or near the touch panel 4071. The touch panel 4071 can include two parts, a touch detecting device and a touch controller. The touch detecting device detects a user's touch position and detects a signal resulting from the touch operation, and transmits the signal to the touch controller. The touch controller receives the touch information from the touch detecting device, converts it into touch coordinates, and sends it to the processor 410, receives a command from the processor 410 and executes it. In addition, the touch panel 4071 can be implemented in various types such as a resistive type, a capacitive type, an infrared type, and a surface acoustic wave type. In addition to the touch panel 4071, the user input unit 407 can include other input devices 4072. Specifically, the other input devices 4072 can include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, etc., without being limited thereto.

[0322] Further, the touch panel 4071 can be overlaid on the display panel 4061, and when the touch panel 4071 detects a touch operation on or near it, it transmits it to the processor 410 to determine the type of touch event, and then the processor 410 provides a corresponding visual output on the display panel 4061 according to the type of touch event. Although in the above description, the touch panel 4071 and the display panel 4061 are implemented as two independent components to realize the input and output functions of the electronic device, in some embodiments, the touch panel 4071 and the display panel 4061 can be integrated to realize the input and output functions of the electronic device, without being limited thereto. Figure 4

[0323] The interface unit 408 is an interface for connecting an external device to the electronic device 400. For example, the external device can include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input / output (I / O) port, a video I / O port, an earphone port, etc. The interface unit 408 can be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the electronic device 400, or can be used to transmit data between the electronic device 400 and the external device.

[0324] ​The memory 409 can be used to store software programs and various data. The memory 409 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; and the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), and the like. In addition, the memory 409 can include a high-speed random access memory, and can also include a nonvolatile memory, for example, at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory device.

[0325] The processor 410 is the control center of the electronic device, connects all parts of the electronic device through various interfaces and lines, executes various functions of the electronic device and processes data by running or executing software programs and / or modules stored in the memory 409 and calling data stored in the memory 409, and thus monitors the whole electronic device. The processor 410 can include one or more processing units; preferably, the processor 410 can integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 410.

[0326] The electronic device 400 can also include a power supply 411 (such as a battery) for supplying power to various components; preferably, the power supply 411 can be logically connected to the processor 410 through a power management system, so as to realize the functions of managing charging, discharging, and power consumption management, etc. through the power management system.

[0327] In addition, the electronic device 400 includes some functional modules which are not shown and will not be described here.

[0328] It should be noted that in this document, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or apparatus including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such a process, method, article or apparatus. Without more limitations, the element defined by the statement "including a" does not exclude the presence of additional identical elements in the process, method, article or apparatus including the element.

[0329] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0330] like Figure 5 As shown, in another embodiment of the present invention, a computer-readable storage medium 501 is also provided, which stores instructions that, when executed on a computer, cause the computer to perform the connection relationship restoration method described in the above embodiment.

[0331] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of the present invention.

[0332] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0333] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0334] In the embodiments of the present application, it should be understood that the disclosed apparatus and method can be implemented in other manners. For example, the described apparatus embodiments are merely schematic. The units as divided can or can not be physically reallocated, and can or can not be components independent of each other. In some embodiments, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electric, mechanical or other forms.

[0335] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., can be located in one place, or can be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purposes of the embodiments of the present application.

[0336] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can be physically present separately, or two or more units can be integrated into one unit.

[0337] If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the parts of the present application that essentially contribute to the prior art or the parts of the technical solutions can be embodied in the form of software products. The computer software product is stored in a storage medium, and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a ROM, a RAM, a magnetic disk or an optical disk, and various storage media that can store program codes.

[0338] The above is merely specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed by the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A connection relationship restoration method characterized by comprising: The method is applied to a gateway device configured with a corresponding smart device, and the connection relationship recovery method comprises: calling a non-volatile memory with other power supply in the gateway device to save key connection parameters of the smart device; the other power supply is a power supply other than the main power supply; when the gateway device is restarted, controlling the smart device to recover the routing connection relationship with the gateway device based on the key connection parameters.

2. The connection relationship restoration method according to claim 1, characterized by, The gateway device is configured with a main processor for implementing a routing function, and the step of calling a non-volatile memory with other power supply in the gateway device to save key connection parameters of the smart device comprises: when the main processor is connected with the smart device through the routing connection relationship, generating key connection parameters for the smart device; the key connection parameters include a basic service set identifier and an IP address allocated by the gateway device for the smart device; storing the basic service set identifier and the IP address to the non-volatile memory with other power supply in the gateway device based on an internal communication interface of the gateway device; The smart device is configured to: store the basic service set identifier and the IP address to the non-volatile storage area.

3. The connection relationship restoration method according to claim 2, characterized by, The gateway device is configured with a coprocessor and a dual-mode communication module, and the other power supply is used to supply power to the coprocessor and the dual-mode communication module when the main power supply is powered off, and before the step of controlling the smart device to recover the connection relationship with the gateway device based on the key connection parameters, further comprising: calling the dual-mode communication module to build a backup communication channel of the gateway device and the smart device; generating a loading firmware, and calling the coprocessor to activate the backup communication channel in the power-on stage by using the loading firmware; sending a beacon frame to the smart device based on the backup communication channel to maintain the backup communication channel.

4. The connection relationship restoration method according to claim 3, characterized by, The step of controlling the smart device to recover the routing connection relationship with the gateway device based on the key connection parameters when the gateway device is restarted comprises: calling the coprocessor to listen to the working state of the main processor and the main power supply; in response to listening to the main processor restart or the main power supply power off, calling the coprocessor to broadcast a pre-warning frame containing the basic service set identifier based on the backup communication channel; the smart device is configured to: receive the pre-warning frame; when the basic service set identifier in the pre-warning frame matches the basic service set identifier in the non-volatile storage area, send a fast association application to the gateway device based on the basic service set identifier; receiving the fast association application and recovering the routing connection relationship between the smart device and the gateway device based on the fast association application.

5. The connection relationship restoration method according to claim 4, characterized by, The fast association application includes the IP address, and the step of recovering the routing connection relationship between the smart device and the gateway device based on the fast association application comprises: receiving the IP address sent by the smart device; When it is determined that the IP address sent by the smart device is consistent with the IP address stored in the non-volatile memory, the routing connection relationship between the smart device and the gateway device is recovered based on the IP address sent by the smart device.

6. The connection relationship restoration method according to claim 5, characterized by, The key connection parameter includes a verification token for the smart device, the verification token is stored in the non-volatile memory and the non-volatile storage area respectively, the fast association application contains the verification token, and before the step of recovering the routing connection relationship between the smart device and the gateway device based on the IP address, the method further includes: receiving the verification token sent by the smart device; When it is determined that the smart device is legal through the verification token, the step of recovering the routing connection relationship between the smart device and the gateway device based on the IP address is executed.

7. The connection relationship restoration method according to claim 4, characterized by, The gateway device is configured with a corresponding edge node device and a central cloud server, and after the step of generating the key connection parameter for the smart device, the method further includes: generating a data snapshot of the key connection parameter; storing the key connection parameter to the edge node device according to a first update frequency; storing the data snapshot to the central cloud server according to a second update frequency; After broadcasting the pre-advertising frame containing the basic service set identifier based on the backup communication channel, in response to not receiving the fast association application within a preset time threshold, a first acquisition request for the key connection parameter is generated using the MAC address of the gateway device; The edge node device is configured to, in response to receiving the first acquisition request, send the key connection parameter to the gateway device; When the key connection parameter sent by the edge node device is received, the routing connection relationship between the smart device and the gateway device is recovered based on the key connection parameter; When the key connection parameter sent by the edge node device is not received within a preset time threshold, a second acquisition request for the data snapshot is sent to the central cloud server; The central cloud server is configured to, in response to receiving the second acquisition request, find the key connection parameter from the full snapshot based on the data snapshot, and send the key connection parameter to the gateway device; When the key connection parameter sent by the central cloud server is received, the routing connection relationship between the smart device and the gateway device is recovered based on the key connection parameter.

8. A connection relationship restoration apparatus characterized by comprising: The method is applied to a gateway device, the gateway device is configured with a corresponding smart device, and the connection relationship recovery device includes: A key connection parameter maintaining module is configured to call a non-volatile memory with other power supply in the gateway device to save the key connection parameter of the smart device; the other power supply is a power supply other than the main power supply; A routing connection relationship recovery module is configured to control the smart device to recover the routing connection relationship with the gateway device based on the key connection parameter when the gateway device is restarted.

9. An electronic device, comprising: comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory accomplish mutual communication through the communication bus; the memory, configured to store a computer program; the processor, configured to execute the program stored on the memory, so as to realize the method in any one of claims 1-7.

10. A computer readable storage medium having stored thereon instructions which, when executed by one or more processors, cause the processors to perform the method of any one of claims 1-7.