Information processing method and device based on intelligent gateway, medium and program product
By directly accessing the smart gateway in a local area network (LAN) environment, and using lightweight probe packets and LAN authorization tokens to determine and verify the network environment, the latency problem of smart gateway router information query and configuration is solved, enabling fast and convenient information access and configuration.
Patent Information
- Application Number
- CN202511521207.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-23
- Publication Date
- 2026-01-06
AI Technical Summary
In existing smart gateways, router information querying and configuration rely on remote methods, resulting in response delays and the inability to query and configure when the network is disconnected.
By directly accessing the smart gateway in a local area network environment, and using lightweight probe packets and local area network authorization tokens to determine and verify the network environment, direct access and configuration of the router can be achieved.
It improved response speed, solved the problem of information query and configuration when the network is offline, and enhanced the convenience and experience of users.
Smart Images

Figure CN121283802A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of smart gateway technology, and more specifically, to an information processing method, device, medium, and program product based on a smart gateway. Background Technology
[0002] In a smart gateway, once a user binds to the smart gateway via a client, they can view and modify the router information within the smart gateway through the client. However, current methods for querying and configuring router information rely on remote methods, requiring information to be forwarded between the client and the smart gateway via the cloud. This approach results in response delays due to the need for information relay and makes it impossible to query and configure router information when the network is offline. Summary of the Invention
[0003] This disclosure provides an information processing method, device, medium, and program product based on a smart gateway, which enables direct access to the smart gateway in a local area network environment, improves response speed, and solves the problem of network outage failure.
[0004] According to a first aspect of the present disclosure, an information processing method based on a smart gateway is provided, wherein the smart gateway is an Internet of Things control device that integrates router functions. The method includes: In response to an operation targeting the first smart gateway, determine the current network environment; If the current network environment is determined to be a local area network environment, the IP address of the connected router is used as the local area network request address, and a first request message is sent to the first smart gateway. Receive the first response message returned by the first smart gateway in response to the first request message.
[0005] In one feasible embodiment, determining the current network environment includes: Without a WiFi connection, determine that the current network environment is a remote network environment; If WiFi is already connected, obtain the IP address of the connected router, send data packets based on the router's IP address, and determine the current network environment based on the responses to the data packets.
[0006] In one feasible embodiment, determining the current network environment based on the responses to the data packets includes: If no response to the data packet is received within the first time period, the current network environment is determined to be a remote network environment. If a response to the data packet is received from the second smart gateway within the second time period, and the device identifier of the second smart gateway is different from the device identifier of the first smart gateway, then the current network environment is determined to be a remote network environment. If a response to the data packet is received from a third smart gateway within the second time period, and the device identifier of the third smart gateway is the same as the device identifier of the first smart gateway, then the current network environment is determined to be a local area network environment.
[0007] In one feasible embodiment, before determining that the current network environment is a local area network environment, the method further includes: A local area network authorization token is generated based on the identification information of the first smart gateway; The local area network authorization token is sent to the third smart gateway, which then verifies the token based on the local area network authorization token and the locally stored binding information. Receive a message from the third smart gateway indicating successful verification.
[0008] In one feasible embodiment, the method further includes: Receive the message indicating verification failure returned by the third intelligent gateway, and determine that the current network environment is a remote network environment; And / or, the LAN authorization token is configured with a validity period, and the third smart gateway also verifies the validity period.
[0009] In one feasible embodiment, the method further includes: If the current network environment is determined to be a remote network environment, the server address is used as the network request address to send a third request message to the server, so that the server can forward the third request message to the first smart gateway; the third request message is used to request to query router information and / or request to configure router information.
[0010] In one feasible embodiment, it further includes: A change in the current network environment has been detected; the current network environment will be re-detected. If the network environment is determined to be a local area network, update the IP address of the connected router; or if the network environment is determined to be a remote network, switch to the server address and use that address as the network request address to configure the currently accessed smart gateway.
[0011] In one feasible embodiment, the first request message includes a router information query request message and / or a router configuration modification request message; And / or, prior to responding to an operation against the first smart gateway, it also includes: In response to the addition of a device, the identification information of the first smart gateway is obtained; Based on the account information and the identification information, a device binding request message is sent to the server; Receive the device binding success message returned by the server and store the identification information.
[0012] According to a second aspect of the present disclosure, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the methods described in the first aspect and any embodiment thereof.
[0013] According to a third aspect of the present disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the methods described in the first aspect and any of the embodiments thereof.
[0014] According to a fourth aspect of the present disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the methods described in the first aspect and any embodiment thereof.
[0015] According to a fifth aspect of the present disclosure, an information processing apparatus based on a smart gateway is provided, wherein the smart gateway is an Internet of Things (IoT) control device integrating router functionality; the apparatus includes: The determination module is used to determine the current network environment in response to an operation on the first smart gateway; The sending module is used to send a first request message to the first smart gateway by using the IP address of the connected router as the local area network request address when the current network environment is determined to be a local area network environment. The receiving module is used to receive the first response message returned by the first smart gateway in response to the first request message.
[0016] The beneficial effects of the technical solutions provided in this disclosure are: This disclosure provides an information processing method based on a smart gateway. The smart gateway is an IoT control device integrating router functions. Specifically, when responding to an operation targeting a first smart gateway, the current network environment can be determined. If the current network environment is determined to be a local area network (LAN), the IP address of the connected router is used as the LAN request address, and a first request message is sent to the first smart gateway. Upon receiving a first response message from the first smart gateway in response to the first request message, direct access to the first smart gateway can be achieved without information relay through the cloud. This improves response speed and solves the problem in existing technologies where information querying or configuration of the router is impossible during network outages. The implementation of this disclosure can automatically switch the access method to the smart gateway according to the network environment, without user operation, thus improving user convenience and experience. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this disclosure, the accompanying drawings used in the description of the embodiments of this disclosure will be briefly introduced below.
[0018] Figure 1 A flowchart illustrating an information processing method based on a smart gateway, provided in this embodiment of the disclosure; Figure 2 A timing diagram provided for an embodiment of this disclosure; Figure 3 A flowchart provided for an embodiment of this disclosure; Figure 4 This disclosure provides a block diagram of an information processing device based on a smart gateway; Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0019] The embodiments of this disclosure are described below with reference to the accompanying drawings. It should be understood that the embodiments described below with reference to the accompanying drawings are exemplary descriptions for explaining the technical solutions of the embodiments of this disclosure, and do not constitute a limitation on the technical solutions of the embodiments of this disclosure.
[0020] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the terms “comprising” and “including” as used in embodiments of this disclosure mean that the corresponding feature can be implemented as the presented feature, information, data, step, operation, element, and / or component, but do not exclude implementation as other features, information, data, step, operation, element, component, and / or combinations thereof supported by the art. It should be understood that when we say that an element is “connected” or “coupled” to another element, the one element can be directly connected or coupled to the other element, or it can mean that the one element and the other element are connected through an intermediate element. Furthermore, “connected” or “coupled” as used herein can include wireless connection or wireless coupling. The term “and / or” as used herein indicates at least one of the items defined by the term, for example, “A and / or B” or “A, B” indicates implementation as “A,” or implementation as “B,” or implementation as “A and B.”
[0021] The term "based on" as used in the various embodiments of this disclosure can be interpreted as meaning that the premises, conditions, or information upon which it is based are not unique, but at least one or a part of them. That is, it indicates that at least one explicit basis exists, and does not exclude other possible basis.
[0022] The following description of several exemplary embodiments illustrates the technical solutions of this disclosure and the technical effects produced by these solutions. It should be noted that the following embodiments can be referenced, learned from, or combined with each other. Identical terms, similar features, and similar implementation steps in different embodiments will not be repeated.
[0023] The terms and devices involved in the embodiments of this disclosure will be described below.
[0024] A smart gateway can be an IoT control device that integrates router functionality. For example, a smart gateway can be a 5G CPE (Customer Premises Equipment), a smart device that converts 5G mobile network signals into Wi-Fi or wired network signals. In a home setting, configuring a 5G CPE gateway can simultaneously meet the network needs of multiple smart home devices, such as smart TVs, smart speakers, smart door locks, smart clothes dryers, and security cameras.
[0025] Client: This can be an application used to manage smart home devices. Users can add multiple home devices through a single client for unified management. In one example, users can also add a smart gateway through the client. For instance, by scanning the QR code on the smart gateway via the "Add Device" entry provided in the client, the client sends a binding request (carrying the user account and device identifier) to the cloud via the SDK. After the cloud verifies the device's legitimacy and user permissions, it returns a binding success command and synchronizes the relevant information to the client. At this point, the user can view the successfully bound smart gateway in the device list within the client.
[0026] Local Area Network (LAN) environment: A network environment for devices connected within a limited physical area (such as home, office, or campus).
[0027] Remote network environment: A distributed network environment connected via a wide area network (WAN) or the Internet. In this environment, devices in different regions, cities, and countries can be connected, such as interconnecting cross-regional corporate headquarters and branch offices. In a remote network environment, electronic devices can, but are not limited to, use 4G or 5G mobile networks.
[0028] The information processing method based on a smart gateway provided in the embodiments of this disclosure will be described in detail below.
[0029] The method provided in this disclosure can be executed by an electronic device, which may include a device running a client, such as a smartphone, tablet, or computer.
[0030] Specifically, such as Figure 1 As shown, the information processing method based on a smart gateway provided in this embodiment includes steps S101 to S103: S101. In response to an operation targeting the first smart gateway, determine the current network environment.
[0031] S102. If the current network environment is determined to be a local area network environment, the IP address of the connected router is used as the local area network request address, and a first request message is sent to the first smart gateway.
[0032] S103. Receive the first response message returned by the first smart gateway in response to the first request message.
[0033] Optionally, the first smart gateway can refer to the smart gateway that the user currently intends to access, such as the first smart gateway selected by the client, where the client and the first smart gateway have a binding relationship. For example, when the user clicks on the first smart gateway through the client and enters the device's homepage, an operation targeting the first smart gateway is triggered.
[0034] Optionally, the network environment varies depending on the network connection status of the electronic device. In this embodiment, the network environment is divided into a local area network (LAN) environment and a remote network environment. In a LAN environment, the electronic device is connected to the internet and can access resources on the local LAN. Therefore, when it is determined that the electronic device is in a LAN environment, the SDK integrated in the client can use the currently detected router IP address as the LAN request address to send a request message to the smart gateway. The smart gateway can then directly return the corresponding result.
[0035] Optionally, the first request message includes a router information query request message and / or a router configuration modification request message. In one example, the client can view router-related information such as the signal strength of the currently accessed smart gateway, the number of connected devices, and upload and download speeds. This information can be transmitted in real time by the smart gateway. In another example, the client can configure router information in the smart gateway, such as modifying parameters like the Wi-Fi name and password. The client's SDK can send commands via a local area network address, and the smart gateway updates the configuration information in real time and returns the results.
[0036] In this disclosed embodiment, compared to the prior art, when the electronic device is in a local area network environment, there is no need for information forwarding through the cloud; data can be directly transmitted between the client and the smart gateway (e.g., Figure 2 and Figure 3 As shown in the figure, it helps to improve the response speed and solves the problem of not being able to configure or query information about the router in the smart gateway when the network is disconnected (such as when the client is disconnected from the cloud). In addition, the electronic device can adaptively switch the access mode to the smart gateway according to different network environments without the need for manual operation by the user, which helps to improve the convenience and user experience of the user.
[0037] Optionally, S001 to S003 are also included before responding to an operation targeting the first smart gateway: S001. In response to the operation of adding a device, obtain the identification information of the first smart gateway.
[0038] S002. Based on the account information and the identification information, send a device binding request message to the server.
[0039] S003. Receive the device binding success message returned by the server and store the identification information.
[0040] Optionally, before accessing the smart gateway through the client, the user can first bind the corresponding smart gateway through the client. For example, the user can add a device through the client's entry point, obtain the identification information of the smart gateway to be bound (such as scanning a QR code on the smart gateway), and send a binding request to the cloud via the SDK (this request carries the user account and device identifier). After verifying the device's legitimacy and the user's permissions, the cloud can return a binding success instruction to the client and synchronize the corresponding information to the client for storage. Based on this, the user can view the successfully bound smart gateway through the client's device list.
[0041] Optionally, in S101, the operation performed by the user on the first smart gateway through the client is implemented after the client and the first smart gateway are bound together. The user can find the corresponding first smart gateway in the device list of the client and access the first smart gateway by clicking the entry corresponding to the first smart gateway in the device list.
[0042] In this embodiment of the disclosure, device binding can be completed through the cooperation of the client, the cloud and the smart gateway. After the device is successfully bound, the user can conveniently access the smart gateway through the client, thereby improving the user experience.
[0043] Optionally, in S101, the current network environment is determined, including steps A1 and A2: Step A1: Without connecting to WiFi, determine that the current network environment is a remote network environment.
[0044] Optionally, when an electronic device is not connected to Wi-Fi, it can refer to the electronic device currently using a mobile network (such as a 4G or 5G mobile network). In this case, the network environment in which the electronic device is located can be regarded as a remote network environment.
[0045] Step A2: If WiFi is already connected, obtain the IP address of the connected router, send data packets based on the router's IP address, and determine the current network environment based on the responses to the data packets.
[0046] Optionally, considering that the smart gateway the user intends to access and the smart gateway corresponding to the router currently connected to the electronic device may be different, if it is determined that the electronic device is connected to Wi-Fi, a data packet can also be sent through the IP address of the router currently connected to the electronic device. Based on the response obtained to the data packet, the current network environment can be determined, so as to avoid the situation where it is determined to be in a local area network state but no response can be obtained from the accessed smart gateway, thereby improving the user experience.
[0047] Optionally, the data packet is sent by the client to the smart gateway of the router to which the electronic device is currently connected. This smart gateway may be different from or the same as the smart gateway accessed by the user through the client.
[0048] Optionally, the data packet can be a lightweight probe packet, which is a small data packet used to quickly probe the status of a target device or network connectivity.
[0049] Optionally, step A2 determines the current network environment based on the response to the data packet, including steps A21 to A23: Step A21: If no response to the data packet is received within the first time period, the current network environment is determined to be a remote network environment.
[0050] Step A22: If a response to the data packet from the second smart gateway is received within the second time period, and the device identifier of the second smart gateway is different from the device identifier of the first smart gateway, then the current network environment is determined to be a remote network environment.
[0051] Step A23: If a response to the data packet is received from the third smart gateway within the second time period, and the device identifier of the third smart gateway is the same as the device identifier of the first smart gateway, then the current network environment is determined to be a local area network environment.
[0052] Optionally, the electronic device can send a probe packet to the IP address of the currently connected router to verify local network reachability. If no response is received (e.g., a timeout), it indicates a possible interruption in the link between the electronic device and the router, or that the router is not responding, suggesting a remote network environment (i.e., not a direct local connection). If a response is received, the device identifier ID of the smart gateway in the response needs further examination.
[0053] If a reply is received, but the device identifier in the reply is different from the device identifier of the first smart gateway, it indicates that the reply comes from a non-first smart gateway, such as a neighbor's smart gateway or a malicious node. There may be network hijacking or misconnection. In this case, it can be determined to be a remote network environment.
[0054] When a response is received, and the device identifier in the response is the same as the device identifier of the first smart gateway, it indicates that the probe packet has reached the smart gateway currently accessed by the user, which belongs to the local network and can be determined as a local area network environment.
[0055] For example, in a network structure consisting of a smartphone, a smart gateway (with integrated router functionality), and the internet, the router's IP address (e.g., 192.168.XX.X) is also the smart gateway's address. In the aforementioned detection process, the smartphone can send a probe packet to 192.168.XX.X, and the smart gateway will respond, including a device identifier (e.g., GATEWAY_HOME). If this device identifier matches the device identifier of the smart gateway the user intends to access, it can be determined to be a local area network (LAN) environment.
[0056] Optionally, the aforementioned first, second, and third smart gateways are intended to distinguish between different scenarios. The terms "first," "second," and "third" are not used to define different smart gateways; whether they belong to the same smart gateway needs to be determined by the device identifier. That is, in step A23, if the device identifier in the response is the same as the device identifier of the first smart gateway, then the third smart gateway and the first smart gateway can be considered to be the same smart gateway. In step A22, if the device identifier in the response is different from the device identifier of the first smart gateway, then the second smart gateway and the first smart gateway can be considered to be different smart gateways.
[0057] In this embodiment, by using lightweight probe packets for verification, the SDK can efficiently distinguish whether an electronic device is currently directly connected to the smart gateway that the user intends to access, thereby ensuring the security and reliability of the service. Verification via data packets enables round-trip detection within a short time (e.g., 100ms), adapting to scenarios with high real-time requirements (such as smart home control scenarios), without consuming significant bandwidth or resources, and having minimal impact on the performance of the electronic device and smart gateway. Furthermore, device identification verification prevents attacks involving forged responses, further improving service stability and reliability, and enhancing the user experience.
[0058] In this embodiment of the disclosure, the network environment determination method provided by the above embodiments can provide a basis for the client to intelligently select the access path to the smart gateway, avoid the waste of cloud resources in the local area network environment, reduce the impact of network fluctuations in the remote network environment, and improve the convenience and experience of users.
[0059] Optionally, considering that device verification based solely on device identifiers has low security, this embodiment of the disclosure, upon determining that the device identifier in the response matches the device identifier of the first smart gateway, also provides an authorization verification scheme to achieve dual protection, effectively addressing issues such as forgery, hijacking, and misoperation, ensuring a consistent connection to a legitimate and authorized target smart gateway. For example, device identifiers have limitations; for instance, they may be maliciously altered or forged, or some devices may be reassigned new identifiers after repair or reset, leading to association of old identifiers with new devices and causing permission confusion.
[0060] Optionally, the authorization verification scheme is implemented before determining that the current network environment is a local area network environment in step A23, including steps A231 to A233: Step A231: Generate a local area network authorization token based on the identification information of the first smart gateway.
[0061] Step A232: Send the LAN authorization token to the third smart gateway, and have the third smart gateway verify it based on the LAN authorization token and the binding information stored locally.
[0062] Step A233: Receive a message from the third smart gateway indicating successful verification.
[0063] Optionally, the SDK can encrypt and generate a token based on the identification information of the smart gateway (first smart gateway) that the user intends to access, and send it to the third smart gateway that sends the reply. The third smart gateway (at this time, based on the aforementioned judgment in step A23, the first smart gateway and the third smart gateway belong to the same smart gateway) decrypts the token (such as extracting the device identifier and user account from the token) and compares it with the locally stored binding information, such as whether the user account is associated with the device identifier. If the comparison is successful, it can be confirmed that the third smart gateway itself is the first smart gateway that the user intends to access, and return a verification success message to the SDK, allowing subsequent LAN requests. At the same time, the SDK can determine that the current network environment is a LAN network environment.
[0064] Optionally, the LAN authorization token can be encapsulated in the second request message and sent to the third smart gateway. After receiving the second request message, the third smart gateway verifies the LAN authorization token and returns the verification result to the client. If the client sends a second response message indicating successful verification, the third smart gateway returns the response result.
[0065] Optionally, the binding information may include user account, device identifier, and other information.
[0066] Optionally, it also includes step A234: receiving a message indicating verification failure returned by the third smart gateway, and determining that the current network environment is a remote network environment.
[0067] In this embodiment of the disclosure, considering the possibility of device identifier mismatch (such as an attacker forging the same device identifier as the smart gateway they intend to access, impersonating a legitimate device), expired or incorrect binding information, unstable network environment, errors in token generation or verification logic, user misoperation, etc., which may lead to verification failure, in order to ensure the security and stability of the service, the current network environment is determined to be a remote network environment when verification is determined to fail.
[0068] Optionally, the LAN authorization token can be encapsulated in the second request message and sent to the third smart gateway. After receiving the second request message, the third smart gateway verifies the LAN authorization token. If the verification fails, the smart gateway will send a rejection request message to the client, indicating that the verification failed, and return the verification result.
[0069] Optionally, the LAN authorization token is configured with a validity period, and the third smart gateway also verifies the validity period.
[0070] For example, the token may also include a timestamp or expiration field (which can be carried in the second request message). The third smart gateway can also synchronously verify the token's validity to prevent expired or unauthorized access. If the token expires, even if the binding information matches, the verification will fail.
[0071] For example, assuming a user selects a smart gateway they wish to access via a client (e.g., selecting "living room router" from a device list), the SDK can obtain the smart gateway's unique identifier (e.g., ID) and generate an encrypted token. This token may include a timestamp, user account, device triplet information (e.g., device public key, device identifier, and key), a random number, etc. The SDK sends the token to the selected smart gateway, which decrypts the token and performs the following verification operation: Verify 1. Whether the device identifier matches the device identifier stored locally, and whether the authorized user account is consistent; Verify 2. Whether the context information (such as the timestamp) in the token is valid.
[0072] If both verifications 1 and 2 pass, the smart gateway returns a verification success message to the SDK, and the SDK can determine that the current network environment is a local area network environment; otherwise, the verification fails and the request is rejected, and the SDK can directly determine that the current network environment is a remote network environment.
[0073] For example, a client (which can obtain a user's registered account, such as user123@xxx.com) establishes a connection with a smart gateway and obtains the gateway's device identifier, such as gateway_001. Then, combining this with a pre-agreed encryption key and the current timestamp, the client generates a local area network (LAN) authorization token using an encryption algorithm. Let's assume the token is a1b2c3... The client then encapsulates the generated LAN authorization token in an authorization request and sends it to the smart gateway. Upon receiving the authorization request, the smart gateway decrypts the token (extracting information such as the user account and device identifier) and searches its local storage for binding information related to the user account user123@xxx.com and the device identifier gateway_001. The extracted user account and device identifier are compared with the locally stored binding information. The smart gateway can also extract the timestamp from the authorization request (e.g., by parsing the data used to generate the token) and compare it with the current time. If the difference between the token generation time and the current time is within a preset validity period (e.g., within 5 minutes), the token is considered not expired. The smart gateway can also use the same encryption key and encryption algorithm as the client to generate a verification token based on the device identifier and timestamp in the request, and compare it with the authorization token in the request. If the tokens match, the token is considered valid. If any of the above operations of binding information comparison, token validity verification, or token validity verification fail, the smart gateway will reject the request and determine that the current network environment is a remote network environment. If all verification steps are successful, the smart gateway returns an authorization success effect, allowing subsequent LAN requests and determining that the current network environment is a LAN environment.
[0074] Optionally, the method provided in this disclosure can be adapted to different network environments, enabling adaptive switching of access methods to the smart gateway, such as... Figure 2 and Figure 3 As shown, in different network environments, different access methods can be used to query and / or configure router information.
[0075] Optionally, the method provided in this embodiment further includes step B1: when it is determined that the current network environment is a remote network environment, a third request message is sent to the server using the server address as the network request address, so as to forward the third request message to the first smart gateway through the server; the third request message is used to request to query router information and / or request to configure router information.
[0076] For example, in a remote network environment, the SDK can automatically switch to using a remote address (such as a server address) as the network request address. Interaction, query, or configuration requests are completed via cloud relay. Related request messages can be sent from the client to the cloud, forwarded by the cloud to the smart gateway, processed by the smart gateway, and returned to the cloud, which then synchronizes the results back to the client. Authorization for remote operations can be directly verified through the cloud based on the user account, without the need for additional tokens, effectively ensuring service security.
[0077] The method provided in this disclosure can also adaptively achieve a seamless transition when the network environment dynamically switches. Optionally, it further includes steps C1 to C2: Step C1: A change in the current network environment is detected, and the current network environment is re-detected.
[0078] Step C2: If the network environment is determined to be a local area network, update the IP address of the connected router; or if the network environment is determined to be a remote network, switch to the server address and use that address as the network request address to configure the currently accessed smart gateway.
[0079] For example, when a user moves their electronic device, causing a change in the network environment (such as moving from home to outdoors, or switching from 4G to the smart gateway's Wi-Fi), the SDK can detect the network change and automatically re-detect the network environment in real time (e.g., ... Figure 3 The code snippet "SDK detects changes in mobile network and begins detection" indicates that if the system switches from a remote network environment to a local area network (LAN) environment, the above implementation steps can be repeated, and the IP address of the connected router (e.g., the LAN address, as there may be a scenario where a user switches from connecting to smart gateway A to using the 5G mobile network and then back to connecting to smart gateway B) can be updated. If the system switches from a LAN environment to a remote network environment, it can directly switch to the remote interface to access the smart gateway.
[0080] The solution proposed in this disclosure can still access the smart gateway when switching network environments. The entire process can be implemented without manual intervention from the user, achieving seamless adaptive switching, which can effectively improve the convenience and experience of the user.
[0081] In this embodiment, the entire chain from device binding to daily management (information query and configuration of the router) can be automated, solving the problem of failure when the network is disconnected. Furthermore, the security of local area network operations can be ensured through an authorization verification scheme, and the operational efficiency in different network environments can be improved through intelligent address switching, which is beneficial to optimizing the user experience.
[0082] This disclosure provides an information processing device based on a smart gateway, such as... Figure 4 As shown, the information processing device 100 based on a smart gateway can be applied to the clothing care system provided in the above embodiments. The device 100 includes: The determination module 101 is used to determine the current network environment in response to an operation on the first smart gateway.
[0083] The sending module 102 is used to send a first request message to the first smart gateway by using the IP address of the connected router as the local area network request address when the current network environment is determined to be a local area network environment.
[0084] The receiving module 103 is used to receive the first response message returned by the first smart gateway in response to the first request message.
[0085] The apparatus of this disclosure embodiment can execute the method provided in this disclosure embodiment, and its implementation principle is similar, and it has corresponding technical effects. The actions performed by each module in the apparatus of each embodiment of this disclosure correspond to the steps in the method of each embodiment of this disclosure. For a detailed functional description of each module of the apparatus, please refer to the description in the corresponding method shown above, and it will not be repeated here.
[0086] This disclosure provides an electronic device including a memory, a processor, and a computer program stored in the memory. The processor executes the computer program to implement the steps of the method provided in any optional embodiment of this disclosure. Compared with the prior art, this disclosure provides an information processing method based on a smart gateway. The smart gateway is an IoT control device integrating router functions. Specifically, when responding to an operation targeting a first smart gateway, the current network environment can be determined. If the current network environment is determined to be a local area network (LAN), the IP address of the connected router is used as the LAN request address, and a first request message is sent to the first smart gateway. Upon receiving a first response message from the first smart gateway in response to the first request message, direct access to the first smart gateway can be achieved without information relay through the cloud, which improves response speed and solves the problem in the prior art where information querying or configuration of the router is impossible when the network is interrupted. The implementation of this disclosure can automatically switch the access method to the smart gateway according to the network environment without user operation, which improves user convenience and experience.
[0087] In one alternative embodiment, an electronic device is provided, such as Figure 5 As shown, Figure 5The illustrated electronic device 4000 includes a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, for example, via a bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, which can be used for data interaction between the electronic device and other electronic devices, such as sending and / or receiving data. It should be noted that in practical applications, the transceiver 4004 is not limited to one type, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of this disclosure.
[0088] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with this disclosure. Processor 4001 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0089] Bus 4002 may include a pathway for transmitting information between the aforementioned components. Bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 4002 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0090] The memory 4003 may be ROM (Read Only Memory) or other types of static storage devices capable of storing static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices capable of storing information and instructions, or EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium capable of carrying or storing computer programs and capable of being read by a computer, without limitation herein.
[0091] The memory 4003 is used to store computer programs that execute embodiments of the present disclosure, and is controlled by the processor 4001 to execute them. The processor 4001 is used to execute the computer programs stored in the memory 4003 to implement the steps shown in the foregoing method embodiments.
[0092] Electronic devices include, but are not limited to: smartphones, tablets, and computers.
[0093] This disclosure provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the steps and corresponding content of the aforementioned method embodiments.
[0094] This disclosure also provides a computer program product, including a computer program that, when executed by a processor, can implement the steps and corresponding content of the aforementioned method embodiments.
[0095] It should be understood that although arrows indicate various operation steps in the flowcharts of the embodiments of this disclosure, the order in which these steps are implemented is not limited to the order indicated by the arrows. Unless explicitly stated herein, in some implementation scenarios of the embodiments of this disclosure, the implementation steps in each flowchart can be executed in other orders as required. Furthermore, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on the actual implementation scenario. Some or all of these sub-steps or stages can be executed at the same time, and each sub-step or stage can also be executed at different times. In scenarios where execution times differ, the execution order of these sub-steps or stages can be flexibly configured as required, and the embodiments of this disclosure do not limit this.
[0096] The above description is only an optional implementation method for some implementation scenarios of this disclosure. It should be noted that for those skilled in the art, other similar implementation methods based on the technical concept of this disclosure without departing from the technical concept of this disclosure also fall within the protection scope of the embodiments of this disclosure.
Claims
1. A smart gateway-based information processing method, characterized by, The intelligent gateway is an Internet of Things control device integrating a router function; The method comprises: In response to an operation on a first intelligent gateway, determining a current network environment; In a case where the current network environment is determined to be a local area network environment, sending a first request message to the first intelligent gateway, taking a connected router IP address as a local area network request address; Receiving a first response message returned by the first intelligent gateway in response to the first request message.
2. The method of claim 1, wherein, The determination of the current network environment comprises: In a case where no WiFi is connected, determining that the current network environment is a remote network environment; In a case where WiFi is connected, obtaining a connected router IP address, sending a data packet based on the router IP address, and determining the current network environment based on a reply to the data packet.
3. The method of claim 2, wherein, The determination of the current network environment based on the reply to the data packet comprises: If no reply to the data packet is received within a first time length, it is determined that the current network environment is a remote network environment; If a reply to the data packet from a second intelligent gateway is received within a second time length, and a device identifier of the second intelligent gateway is different from a device identifier of the first intelligent gateway, it is determined that the current network environment is a remote network environment; If a reply to the data packet from a third intelligent gateway is received within the second time length, and a device identifier of the third intelligent gateway is the same as the device identifier of the first intelligent gateway, it is determined that the current network environment is a local area network environment.
4. The method of claim 3, wherein, Before the determination that the current network environment is a local area network environment, the method further comprises: Generating a local area network authorization token based on identifier information of the first intelligent gateway; Sending the local area network authorization token to the third intelligent gateway, and performing verification by the third intelligent gateway based on the local area network authorization token and locally stored binding information; Receiving a message returned by the third intelligent gateway, indicating that the verification is successful.
5. The method of claim 4, wherein, The method further comprises: Receiving a message returned by the third intelligent gateway, indicating that the verification fails, and determining that the current network environment is a remote network environment; And / or, the local area network authorization token is configured with a valid time length, and the third intelligent gateway further verifies the valid time length.
6. The method according to any one of claims 2 to 5, characterized in that, The method further comprises: In a case where the current network environment is determined to be a remote network environment, sending a third request message to a server, taking a server address as a network request address, so as to forward the third request message to the first intelligent gateway through the server; the third request message is used to request to query router information and / or request to configure router information.
7. The method of claim 1, wherein, Further comprising: Detecting that the current network environment changes, and re-detecting the current network environment; In a case where it is determined to be in a local area network environment, updating a connected router IP address, or in a case where it is determined to be in a remote network environment, switching to a server address and taking the address as a network request address, so as to configure a currently accessed intelligent gateway.
8. An electronic device comprising a memory, a processor, and a computer program stored on the memory, wherein the computer program, when executed by the processor, causes the electronic device to perform the method of any one of claims 1 to 7. The processor executes the computer program to implement the method of any one of claims 1 to 7.
9. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the method of any one of claims 1 to 7.
10. A computer program product comprising a computer program, characterized in that, The computer program, which is executed by a processor, implements the method of any one of claims 1 to 7.