CN112738829B - Response message processing method and device, storage medium and electronic device - Google Patents

Response message processing method and device, storage medium and electronic device Download PDF

Info

Publication number
CN112738829B
CN112738829B CN202011602955.6A CN202011602955A CN112738829B CN 112738829 B CN112738829 B CN 112738829B CN 202011602955 A CN202011602955 A CN 202011602955A CN 112738829 B CN112738829 B CN 112738829B
Authority
CN
China
Prior art keywords
internet
things
message
address
request message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011602955.6A
Other languages
Chinese (zh)
Other versions
CN112738829A (en
Inventor
刘超逸
樊明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qingdao Haier Technology Co Ltd, Haier Smart Home Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202011602955.6A priority Critical patent/CN112738829B/en
Publication of CN112738829A publication Critical patent/CN112738829A/en
Application granted granted Critical
Publication of CN112738829B publication Critical patent/CN112738829B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/02Arrangements for optimising operational condition
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a processing method and a device of a response message, a storage medium and an electronic device, wherein the processing method comprises the following steps: setting a network IP address of the internet of things hotspot device as a private website under the condition that the internet of things hotspot device receives an AUTH frame; determining the message type of a request message received by an internet of things hot spot device, and determining a response message sent to a mobile terminal by the internet of things hot spot device according to the message type; and modifying the source IP address in the response message into the private website. By adopting the technical scheme, the problem that the success rate of network allocation is low due to the fact that the mobile terminal automatically switches networks when the mobile terminal detects that the Internet of things hot spot equipment is in an networking-free state in the process of network allocation of the Internet of things hot spot equipment is solved.

Description

Response message processing method and device, storage medium and electronic device
Technical Field
The present invention relates to the field of communications, and in particular, to a method and apparatus for processing a response message, a storage medium, and an electronic device.
Background
With the rise of the internet of things technology, more and more wireless fidelity (Wireless Fidelity, abbreviated as WiFi) internet of things intelligent devices are available, and the WiFi internet of things intelligent devices need to acquire a WiFi name and a password of a user to access a network of the user so as to allow the user to control through the network, and the above process is abbreviated as distribution network. One way for the WiFi internet of things to intelligently obtain the WiFi name and password is to use the WiFi internet of things intelligent device as a wireless access point, the device installed with the intelligent home application software actively connects with the wireless access point to transmit the WiFi information of the user to the access point, and the WiFi internet of things intelligent device is used as a wireless terminal to connect with the WiFi network of the user, and the above network configuration mode is referred to as softap mode.
In the softap mode, the mobile terminal is connected with the WiFi Internet of things intelligent equipment, whether the network is available or not can be detected, the mobile terminal detects that the network is unavailable and automatically switches networks because the WiFi Internet of things intelligent equipment is in a state of being incapable of networking, and the application software cannot know the network switching operation of the mobile terminal system, so that binding failure is caused.
Aiming at the problems of low network distribution success rate and the like caused by the fact that the mobile terminal automatically switches networks when the mobile terminal detects that the internet-of-things hot spot equipment is in an internet-of-things state in the process of distributing networks with the internet-of-things hot spot equipment (namely the WiFi internet-of-things intelligent equipment), the mobile terminal has not been provided with an effective solution at present.
Disclosure of Invention
The embodiment of the invention provides a processing method and device of a response message, a storage medium and an electronic device, which at least solve the problems of lower network allocation success rate and the like caused by the fact that a mobile terminal automatically switches networks when detecting that an Internet of things hot spot device is in an networking-free state in the process of allocating the network with the Internet of things hot spot device.
According to an aspect of an embodiment of the present invention, there is provided a method for processing a reply message, including: under the condition that an AUTH frame is received by an Internet of things hot spot device, setting a network Internet protocol (Internet Protocol, IP for short) address of the Internet of things hot spot device as a private website; determining the message type of a request message received by an internet of things hot spot device, and determining a response message sent to a mobile terminal by the internet of things hot spot device according to the message type; and modifying the source IP address in the response message into the private website.
In an exemplary embodiment, setting the network IP address of the internet of things hotspot device to be a private network address includes: determining that the mobile terminal and the internet of things hotspot device are connected, and the internet of things hotspot device receives an AUTH frame; and setting the network IP address of the Internet of things hot spot device to 192.168.0.1.
In an exemplary embodiment, after determining the message type of the request message received by the internet of things hotspot device, the method further includes: in the case that the message type of the request message is a domain name system (Domain Name System, abbreviated as DNS) request message, or a hypertext transfer protocol (Hypertext Transfer Protocol, abbreviated as HTTP) request message or a network control message protocol (Internet Control Message Protocol, abbreviated as ICMP) request message, acquiring a source IP address, a source port and a destination IP address carried in the DNS request message; and modifying the destination IP address of the DNS request message or the HTTP request message or the ICMP request message into the private address.
In an exemplary embodiment, modifying the source IP address in the reply message to the private network address includes: screening a DNS response message from a response message corresponding to the DNS request message under the condition that the message type of the request message is the DNS request message; and modifying the source IP address of the DNS response message into the private website.
In an exemplary embodiment, after modifying the source IP address in the reply message to the private network address, the method further includes: when the message type of the request message is HTTP request message, after the source IP address in the response message corresponding to the HTTP request message is modified to the private website, the modified response message is sent to the mobile terminal; and disconnecting the HTTP connection between the mobile terminal and the internet of things hotspot device.
In an exemplary embodiment, after modifying the source IP address in the reply message to the private network address, the method further includes: sending a modified response message to the mobile terminal; and under the condition that the softtap configuration information is received, modifying the network IP address of the Internet of things hot spot equipment from the private website to a target website, wherein the softtap configuration information is used for indicating that a softtap network distribution mode between the Internet of things hot spot equipment and the mobile terminal is ended.
According to another aspect of the embodiment of the present invention, there is also provided a processing device for a response message, including: the setting module is used for setting the network IP address of the internet of things hotspot device as a private website under the condition that the internet of things hotspot device receives the AUTH frame; the processing module is used for determining the message type of the request message received by the internet of things hot spot equipment and determining a response message sent to the mobile terminal by the internet of things hot spot equipment according to the message type; and the modification module is used for modifying the source IP address in the response message into the private website.
In an exemplary embodiment, the setting module is further configured to determine that the mobile terminal has established a connection with the internet of things hotspot device, and the internet of things hotspot device has received an AUTH frame; and setting the network IP address of the Internet of things hot spot device to 192.168.0.1.
According to still another aspect of the embodiments of the present invention, there is further provided a computer-readable storage medium having a computer program stored therein, where the computer program is configured to execute the above-mentioned processing method of a response message when running.
According to still another aspect of the embodiments of the present invention, there is further provided an electronic device including a memory, a processor, and a computer program stored on the memory and capable of running on the processor, where the processor executes the method for processing a response message according to the above-mentioned method.
According to the method and the system for configuring the internet of things, in the process of configuring the network between the mobile terminal and the internet of things hotspot device, the network IP address of the internet of things hotspot device is set to be a private website, a response message sent to the mobile terminal by the internet of things hotspot device is determined according to the message type of a request message received by the internet of things hotspot device from the mobile terminal, and then the source IP address is modified to be the private website in the response message sent to the mobile terminal by the internet of things hotspot device. By adopting the technical scheme, the problems that the network distribution success rate is low and the like caused by the fact that the mobile terminal automatically switches the network when the mobile terminal detects that the Internet of things hot spot equipment is in an networking-free state in the network distribution process of the Internet of things hot spot equipment are solved, and the network distribution success rate of the mobile terminal and the Internet of things hot spot equipment is greatly improved due to the fact that the response message is introduced by the processing method.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiments of the invention and together with the description serve to explain the invention and do not constitute a limitation on the invention. In the drawings:
FIG. 1 is a block diagram of a hardware configuration of a computer terminal of a method for processing a response message according to an embodiment of the present invention;
FIG. 2 is a flowchart (I) of a method for processing a reply message according to an embodiment of the invention;
FIG. 3 is a flowchart (II) of a method for processing a reply message according to an embodiment of the invention;
fig. 4 is a block diagram of a processing apparatus for a reply message according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The method embodiments provided in the embodiments of the present application may be executed in a computer terminal or similar computing device. Taking the operation on a computer terminal as an example, fig. 1 is a block diagram of a hardware structure of a computer terminal according to a processing method of a response message in an embodiment of the present invention. As shown in fig. 1, the computer terminal may include one or more (only one is shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a microprocessor MCU or a processing device such as a programmable logic device FPGA) and a memory 104 for storing data, and in one exemplary embodiment, may also include a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those skilled in the art that the configuration shown in fig. 1 is merely illustrative and is not intended to limit the configuration of the computer terminal described above. For example, a computer terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration than the equivalent functions shown in FIG. 1 or more than the functions shown in FIG. 1.
The memory 104 may be used to store a computer program, for example, a software program of application software and a module, such as a computer program corresponding to a method for processing a response message in an embodiment of the present invention, and the processor 102 executes the computer program stored in the memory 104, thereby performing various functional applications and data processing, that is, implementing the method described above. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory remotely located relative to the processor 102, which may be connected to the computer terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission means 106 is arranged to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, simply referred to as NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used to communicate with the internet wirelessly.
In the related art, after a mobile terminal is connected with a softtap hotspot of an internet of things hotspot device, two situations can occur: 1) Prompt immediately, or prompt network to be unavailable after a certain time (perhaps after a few seconds or perhaps 10 s); 2) Without a prompt that the network is unavailable, the mobile terminal automatically switches (immediately) to a network available to the network.
In the softtap mode, the network configuration of the Internet of things hot spot equipment needs to keep connection between the Internet of things hot spot equipment and the mobile terminal, and the hot spot of the Internet of things hot spot equipment is not connected with an external network, so that the mobile terminal can detect that the network is unavailable, the mobile terminal can be automatically switched to other available networks, and the application software cannot know the network switching operation of the mobile terminal system, so that the binding fails.
In order to solve the above technical solution, in this embodiment, a processing method of a reply message is provided, and fig. 2 is a flowchart (one) of a processing method of a reply message according to an embodiment of the present invention, where the flowchart includes the following steps:
step S202, setting a network Internet Protocol (IP) address of an Internet of things hotspot device as a private website under the condition that the Internet of things hotspot device receives an AUTH frame;
step S204, determining the message type of a request message received by the Internet of things hot spot equipment, and determining a response message sent to the mobile terminal by the Internet of things hot spot equipment according to the message type;
step S206, the source IP address in the response message is modified into the private website.
Through the steps, in the process of carrying out network allocation between the mobile terminal and the internet of things hotspot device, the network IP address of the internet of things hotspot device is set to be a private website, a response message sent to the mobile terminal by the internet of things hotspot device is determined according to the message type of a request message received by the internet of things hotspot device from the mobile terminal, and then the source IP address is modified to be the private website in the response message sent to the mobile terminal by the internet of things hotspot device. By adopting the technical scheme, the problems that the network distribution success rate is low and the like caused by the fact that the mobile terminal automatically switches the network when the mobile terminal detects that the Internet of things hot spot equipment is in an networking-free state in the network distribution process of the Internet of things hot spot equipment are solved, and the network distribution success rate of the mobile terminal and the Internet of things hot spot equipment is greatly improved due to the fact that the response message is introduced by the processing method.
In this embodiment, a camouflage scheme is adopted to improve the network allocation success rate of the mobile terminal and the internet of things hotspot device, which can be specifically understood to camouflage the internet of things hotspot device hotspots in the internet of things hotspot device softtap mode network allocation process. The disguising of the hot spot of the internet of things hot spot device is started after detecting a softtap hot spot (receiving an AUTH frame of the mobile terminal) of the internet of things hot spot device connected with the mobile terminal after entering configuration, and is closed when receiving softtap information and exiting from the configuration mode. The source IP in the response message fed back to the mobile terminal by the Internet of things hotspot device is modified into a private website (namely the IP address of the Internet of things hotspot device hotspot) through replying to the specific network detection frame, so that the mobile device connected with the hotspot judges the hotspot of the Internet of things hotspot device as an available network, the mobile device is prevented from automatically disconnecting the link, and the success rate of network allocation is improved.
Step S202 described above, when setting the network IP address of the internet of things hotspot device as the private network address, includes, in an alternative embodiment: determining that the mobile terminal and the internet of things hotspot device are connected, and the internet of things hotspot device receives an AUTH frame; and setting the network IP address of the Internet of things hot spot device to 192.168.0.1. In this embodiment, the basis for determining whether the mobile terminal is in a network configuration with the internet of things hotspot device, that is, whether the mobile terminal is connected with the internet of things hotspot device hotspot is: whether the internet of things hotspot device receives the AUTH frame. If the internet of things hotspot device receives the AUTH frame, the mobile terminal and the internet of things hotspot device are indicated to be connected, at the moment, the internet of things hotspot device starts disguising, registers a series of functions, and sets the IP address of the network module of the internet of things hotspot device to 192.168.0.1.
In the process of the mobile terminal and the internet of things hotspot device performing network configuration, a request message is sent to the internet of things hotspot device, and after determining the message type of the request message received by the internet of things hotspot device, step S204 optionally includes: when the message type of the request message is a Domain Name System (DNS) request message, or a hypertext transfer protocol (HTTP) request message or an internet group management protocol (ICMP) request message, acquiring a source IP address, a source port and a destination IP address carried in the DNS request message or the HTTP request message or the ICMP request message; and modifying the destination IP address of the DNS request message or the HTTP request message or the ICMP request message into the private address.
In this embodiment, it may be understood that, for a request message sent by a mobile terminal to an internet of things hotspot device, a message type may be specifically distinguished by a message protocol number in the request message, for example, when the message protocol number is 17, a user datagram protocol (User Datagram Protocol, abbreviated as UDP) message, when the message protocol number is 6, a transmission control protocol (Transmission Control Protocol, abbreviated as TCP) message, and when the message protocol number is 1, an internet control message protocol (Internet Control Message Protocol, abbreviated as ICMP) message. If the specific message type is determined, the internet of things hotspot device may acquire the source IP address, the source port and the destination IP address carried in the corresponding request message, and modify the destination IP address in the DNS request message or the HTTP request message or the ICMP request message to the private address 192.168.0.1.
After modifying the destination IP address in the request message of different types to the private address 192.168.0.1, the internet of things hotspot device may generate a response message by adopting different methods according to the message of different types, where step S206 modifies the source IP address in the response message to the private address, and in an alternative embodiment, the method includes: screening a DNS response message from a response message corresponding to the DNS request message under the condition that the message type of the request message is the DNS request message; and modifying the source IP address of the DNS response message into the private website. For example: and screening a DNS message with a port number of 17 for the returned UDP response message, searching a matched source IP and port in the record by using the destination IP (namely a private website) and the port, and if the matched source IP and port are found, replacing the source IP in the message with the destination IP in the record.
In the case that the message type of the request message is an HTTP request message, step S206 above, in an optional embodiment, further includes: after modifying the source IP address in the response message corresponding to the HTTP request message into the private website, sending the modified response message to the mobile terminal; and disconnecting the HTTP connection between the mobile terminal and the internet of things hotspot device. In this embodiment, all HTTP connections are handled as short connections, and the connection is closed up to 1 second after sending the response. And starting the service when the disguised life cycle of the Internet of things hot spot equipment starts, closing the service when the disguised life cycle of the Internet of things hot spot equipment ends, and closing all connections.
For the method in the above embodiment, after modifying the source IP address in the reply message to the private website, in an optional embodiment, the internet of things hotspot device sends the modified reply message to the mobile terminal; and under the condition that the softtap configuration information is received, modifying the network IP address of the Internet of things hot spot equipment from the private website to a target website, wherein the softtap configuration information is used for indicating that a softtap network distribution mode between the Internet of things hot spot equipment and the mobile terminal is ended.
In order to better understand the processing method of the response message, the following description is provided with reference to an optional embodiment, but is not limited to the technical solution of the embodiment of the present invention, specifically:
in an alternative embodiment, the mobile terminal may determine whether a network is available by generally: sending a DNS request to a fixed IP address; a internet packet explorer (Packet Internet Groper, short for Ping) domain name address; ping IP address; HTTP domain name address. Therefore, when the internet of things hotspot device is available to the mobile terminal for disguising the hotspots of the internet of things hotspot device, the disguising scheme comprises a simple DNS service, a simple HTTP service, a simple network-emulated address translation (Network Address Translation, abbreviated as NAT) scheme (DNS), a simple NAT-emulated scheme (HTTP) and a simple NAT-emulated scheme (ICMP), and is effective only during softtap configuration, and other network-related processes do not change at all. The following schemes are specifically introduced:
simple DNS service: the DNS server receives all DNS requests, and responds with the IP address of the interface (192.168.0.1), regardless of the domain name requested. Starting a service at the beginning of a Light Weight IP (LWIP) camouflage life cycle; and closing the service at the end of the LWIP disguise life cycle.
Simple HTTP service: the HTTP server receives all HTTP requests, and responds 204 (no content) whatever the request content. All HTTP connections are handled as short connections, and the connection is closed up to 1 second after sending the response. Starting service when the LWIP disguises the life cycle; the LWIP masquerades the service at the end of the lifecycle and closes all connections. The LWIP cloud core module is specifically realized by the following steps: after configuration is entered, detecting a softtap hot spot (receiving an AUTH frame of the mobile phone) of a mobile phone connection upper module, and starting an LWIP camouflage function; closing the camouflage function when the softap information is received and the configuration mode is exited; the Http response message fixedly comprises an X-ReqID field containing a Hua as a mark (Hua is needed by a mobile phone); the HTTP connection is processed according to the short connection, and the connection is closed after the response is sent;
simple NAT-like scheme (DNS): in ip4_input of LWIP, for each DNS request message (UDP destination port 53), a 3-tuple (source IP, source port, destination IP) is recorded, the destination IP of the message is modified to the IP of the interface, and the checksum is recalculated. In ip4_output of LWIP, for each DNS response message (UDP source port 53), a matching (source IP, source port) is found in the 3-tuple record using (destination IP of the message, destination port of the message), and if found, (source IP) in the message is replaced with (destination IP) in the 3-tuple, and the checksum is recalculated. The 3-tuple holds a maximum of 20 groups, and the 3-tuple records have no timeout processing. Starting processing at the beginning of the LWIP camouflage lifecycle; the LWIP masquerading lifecycle ends, stops processing, and clears the 3-tuple record. The LWIP cloud core module is specifically realized by the following steps: the destination IP of the DNS request message is not the interface IP and is stored in the triplet; otherwise, the storage is not needed; the checksum is not required to be recalculated in LWIP implementation; the dns response message contains 3 answers fields (interface IP, OPPO handset needs); the triple size is 50 in implementation and can be adjusted according to the memory size.
Simple NAT-like scheme (HTTP): in ip4_input of LWIP, for each HTTP message (TCP destination port 80), a 3-tuple (source IP, source port, destination IP) is recorded, the destination IP of the message is modified to the IP of the interface, and the checksum is recalculated. In ip4_output of LWIP, for each HTTP message (TCP source port 80), the matching (source IP, source port) is found in the 3-tuple record using (destination IP of the message, destination port of the message), and if found, (source IP) in the message is replaced with (destination IP) in the 3-tuple and the checksum is recalculated. The 3-tuple holds a maximum of 20 groups, and the 3-tuple records have no timeout processing. Starting processing at the beginning of the LWIP camouflage lifecycle; the LWIP masquerading lifecycle ends, stops processing, and clears the 3-tuple record. The LWIP cloud core module is specifically realized by the following steps: the destination IP of the http request message is not the interface IP and is stored in the triplet; otherwise, the storage is not needed; the checksum is not required to be recalculated in LWIP implementation; the triple size is 50 in implementation and can be adjusted according to the memory size.
Simple NAT-like scheme (ICMP): in ip4_input of LWIP, for each ICMP echo request message, a 4-tuple (source IP, destination IP, identifier, seq) is recorded, the destination IP of the message is modified to the IP of the interface, and the checksum is recalculated. In ip4_output of LWIP, for each ICMP echo response packet, a matching (source IP, identifier, seq) is found in the 4-tuple record using (destination IP of packet), and if found, (source IP) in the packet is replaced with (destination IP) in the 4-tuple, and the checksum is recalculated. The 4-tuple holds a maximum of 20 groups, and 4-tuple records have no timeout processing. Starting processing at the beginning of the LWIP camouflage lifecycle; the LWIP masquerading lifecycle ends, stopping the process, and emptying the 4-tuple record. The LWIP cloud core module is specifically realized by the following steps: the Lwip implementation does not need to save 4-tuple, and is implemented as follows: in ip4_input, ICMP messages are not checked for src ip (check_ip_src) after being judged.
Meanwhile, in an optional embodiment, by adopting the scheme, after the android mobile phone is connected with the hot spot of the internet of things hot spot device, network abnormality (network unavailability) is not prompted, and the phenomenon of automatic switching of the mobile phone is avoided. The cloud core (or BN) module is specifically used for verification, and the verification result is as follows: in general, the Hua Cheng, rong and VIVO mobile phones are effective; millet (including red rice) is valid on most cell phones, but is not valid on millet 6, mi play); the upper part of the oppo mobile phone is effective; samsung, google cell phones are all ineffective; other domestic small brands are effective; in addition, the simple verification of the apple mobile phone is effective, and the problem that the hot spot wifi lamp of the internet of things hot spot equipment is lighted slowly when the apple mobile phone is connected is also solved.
Fig. 3 is a flowchart (second) of a method for processing a reply message according to an embodiment of the present invention, as shown in fig. 3, first, an internet of things hotspot device enters a softtap network configuration mode, detects whether a softtap hotspot is connected to a mobile phone, and if an AUTH frame is received, starts LWIP masquerading, registers DNS service function, registers HTTP service function, and sets the IP of a network module itself to 192.168.0.1. Then, the message type is determined according to the message protocol number of the request message, so as to perform different operations, which can be specifically divided into:
(1) The received message protocol number is 17, and is judged to be a UDP message, if the received message port number is 53, the received message protocol number is judged to be a DNS message, and the number of the cache records is less than 50 (the number can be adjusted according to the memory size). And recording a source IP and a source port for the received DNS request message. The destination IP (destination address is 192.168.0.1 and the source address is not recorded in the cache queue), the destination IP of the message is modified into the IP (192.168.0.1) of the interface, and the three data are pressed into the cache queue as a structure body; and screening a DNS message with a port number of 17 for the returned UDP response message, searching a matched source IP and port in the record by using the destination IP (namely a private website) and the port, and if the matched source IP and port are found, replacing the source IP in the message with the destination IP in the record.
(2) The received message protocol number is 6, and is judged to be a TCP message, if the received message port number is 80, the received message protocol number is judged to be an HTTP message, and the number of the cache records is less than 50 (the number can be adjusted according to the memory size). For a received HTTP message, when the destination IP is not 192.168.0.1 and the source address is not in a cache queue, recording the source IP, the source port and the destination IP, modifying the destination IP of the message by 192.168.0.1, and pressing three data into the cache; for the returned response message, the content of the message is 204 (no content), the matched source IP and port are searched in the record by using the destination IP and port, if the source IP in the message is found, the source IP in the message is replaced by the destination IP in the record, and the HTTP connection is disconnected within 1s after the transmission is completed.
(3) And judging the received message protocol number as 1 to be an ICMP message, and judging the received message protocol number as an Echo Request if the ICMP message type number is 8. For input, a 4-tuple (source IP, destination IP, identifier seq) is recorded, and the destination IP of the message is modified into an interface IP; for output, the matching source IP, identifier seq is queried in the 4-tuple record, and if found, the source IP in the message is replaced with the destination IP in the 4-tuple.
And if the softap configuration is finished, all the buffer memories and the cancellation message processing interfaces are cleared.
According to the technical scheme of the optional embodiment of the invention, in the process of softtap network distribution of the Internet of things hotspot device, hotspots of the device are disguised as available networks, so that when a majority of mobile terminals of main stream brands are connected with the hotspots of the device and send configuration information, the hotspots are not automatically switched to other networks because the hotspots are judged as unavailable networks, and the success rate of network distribution flow is improved.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising several instructions for causing a terminal device (which may be a mobile terminal, a computer, a server, or a network device, etc.) to perform the method of the various embodiments of the present invention.
The embodiment also provides a device for processing the response message, and the device is applied to a computer terminal, and is used for implementing the foregoing embodiments and preferred embodiments, and is not described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, implementation of hardware, or a combination of software and hardware is also possible and contemplated, and fig. 4 is a block diagram of a processing apparatus for a reply message according to an embodiment of the present invention, where the apparatus includes:
the setting module 42 is configured to set a network IP address of the internet of things hotspot device as a private network address when the internet of things hotspot device receives the AUTH frame;
the processing module 44 is configured to determine a message type of a request message received by the internet of things hotspot device, and determine a response message sent by the internet of things hotspot device to the mobile terminal according to the message type;
and a modifying module 46, configured to modify the source IP address in the reply packet into the private network address.
According to the method and the system for configuring the internet of things, in the process of configuring the network between the mobile terminal and the internet of things hotspot device, the network IP address of the internet of things hotspot device is set to be a private website, a response message sent to the mobile terminal by the internet of things hotspot device is determined according to the message type of a request message received by the internet of things hotspot device from the mobile terminal, and then the source IP address is modified to be the private website in the response message sent to the mobile terminal by the internet of things hotspot device. By adopting the technical scheme, the problems that the network distribution success rate is low and the like caused by the fact that the mobile terminal automatically switches the network when the mobile terminal detects that the Internet of things hot spot equipment is in an networking-free state in the network distribution process of the Internet of things hot spot equipment are solved, and the network distribution success rate of the mobile terminal and the Internet of things hot spot equipment is greatly improved due to the fact that the response message is introduced by the processing method.
In this embodiment, a camouflage scheme is adopted to improve the network allocation success rate of the mobile terminal and the internet of things hotspot device, which can be specifically understood to camouflage the internet of things hotspot device hotspots in the internet of things hotspot device softtap mode network allocation process. The disguising of the hot spot of the internet of things hot spot device is started after detecting a softtap hot spot (receiving an AUTH frame of the mobile terminal) of the internet of things hot spot device connected with the mobile terminal after entering configuration, and is closed when receiving softtap information and exiting from the configuration mode. The source IP in the response message fed back to the mobile terminal by the Internet of things hotspot device is modified into a private website (namely the IP address of the Internet of things hotspot device hotspot) through replying to the specific network detection frame, so that the mobile device connected with the hotspot judges the hotspot of the Internet of things hotspot device as an available network, the mobile device is prevented from automatically disconnecting the link, and the success rate of network allocation is improved.
In an alternative embodiment, the setup module 42 is further configured to include: determining that the mobile terminal and the internet of things hotspot device are connected, and the internet of things hotspot device receives an AUTH frame; and setting the network IP address of the Internet of things hot spot device to 192.168.0.1. In this embodiment, the basis for determining whether the mobile terminal is in a network configuration with the internet of things hotspot device, that is, whether the mobile terminal is connected with the internet of things hotspot device hotspot is: whether the internet of things hotspot device receives the AUTH frame. If the internet of things hotspot device receives the AUTH frame, the mobile terminal and the internet of things hotspot device are indicated to be connected, at the moment, the internet of things hotspot device starts disguising, registers a series of functions, and sets the IP address of the network module of the internet of things hotspot device to 192.168.0.1.
In the process of carrying out network allocation between the mobile terminal and the internet of things hotspot device, a request message is sent to the internet of things hotspot device, and a processing module 44 is used for acquiring a source IP address, a source port and a destination IP address carried in the DNS request message or the HTTP request message or the ICMP request message when the message type of the request message is a Domain Name System (DNS) request message or a hypertext transfer protocol (HTTP) request message or an internet group management protocol (ICMP) request message; and modifying the destination IP address of the DNS request message or the HTTP request message or the ICMP request message into the private address.
In this embodiment, it may be understood that, for a request message sent by a mobile terminal to an internet of things hotspot device, a message type may be specifically distinguished by a message protocol number in the request message, for example, when the message protocol number is 17, a user datagram protocol (User Datagram Protocol, abbreviated as UDP) message, when the message protocol number is 6, a transmission control protocol (Transmission Control Protocol, abbreviated as TCP) message, and when the message protocol number is 1, an internet control message protocol (Internet Control Message Protocol, abbreviated as ICMP) message. If the specific message type is determined, the internet of things hotspot device may acquire the source IP address, the source port and the destination IP address carried in the corresponding request message, and modify the destination IP address in the DNS request message or the HTTP request message or the ICMP request message to the private address 192.168.0.1.
After modifying the destination IP address in the different types of request messages to the private address 192.168.0.1, the internet of things hotspot device may generate a response message by adopting different methods according to the different types of messages, where the modifying module 46 is configured to modify the source IP address in the response message to the private address, and in an alternative embodiment, includes: screening a DNS response message from a response message corresponding to the DNS request message under the condition that the message type of the request message is the DNS request message; and modifying the source IP address of the DNS response message into the private website. For example: and screening a DNS message with a port number of 17 for the returned UDP response message, searching a matched source IP and port in the record by using the destination IP (namely a private website) and the port, and if the matched source IP and port are found, replacing the source IP in the message with the destination IP in the record.
In the case that the message type of the request message is an HTTP request message, in an alternative embodiment, the modification module 46 is further configured to include: after modifying the source IP address in the response message corresponding to the HTTP request message into the private website, sending the modified response message to the mobile terminal; and disconnecting the HTTP connection between the mobile terminal and the internet of things hotspot device. In this embodiment, all HTTP connections are handled as short connections, and the connection is closed up to 1 second after sending the response. And starting the service when the disguised life cycle of the Internet of things hot spot equipment starts, closing the service when the disguised life cycle of the Internet of things hot spot equipment ends, and closing all connections.
For better understanding, for the method in the above embodiment, after modifying the source IP address in the reply message to the private website, in an optional embodiment, the internet of things hotspot device sends the modified reply message to the mobile terminal; and under the condition that the softtap configuration information is received, modifying the network IP address of the Internet of things hot spot equipment from the private website to a target website, wherein the softtap configuration information is used for indicating that a softtap network distribution mode between the Internet of things hot spot equipment and the mobile terminal is ended.
Embodiments of the present invention also provide a computer readable storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
Alternatively, in the present embodiment, the above-described storage medium may be configured to store a computer program for performing the steps of:
s1, setting a network Internet Protocol (IP) address of an internet of things hotspot device as a private website under the condition that the internet of things hotspot device receives an AUTH frame;
s2, determining the message type of a request message received by the Internet of things hot spot equipment, and determining a response message sent to the mobile terminal by the Internet of things hot spot equipment according to the message type;
s3, modifying the source IP address in the response message into the private website.
In one exemplary embodiment, the computer readable storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing a computer program.
Specific examples in this embodiment may refer to the examples described in the foregoing embodiments and the exemplary implementation, and this embodiment is not described herein.
An embodiment of the invention also provides an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s1, setting a network Internet Protocol (IP) address of an internet of things hotspot device as a private website under the condition that the internet of things hotspot device receives an AUTH frame;
s2, determining the message type of a request message received by the Internet of things hot spot equipment, and determining a response message sent to the mobile terminal by the Internet of things hot spot equipment according to the message type;
s3, modifying the source IP address in the response message into the private website.
In an exemplary embodiment, the electronic apparatus may further include a transmission device connected to the processor, and an input/output device connected to the processor.
Specific examples in this embodiment may refer to the examples described in the foregoing embodiments and the exemplary implementation, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the invention described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may be implemented in program code executable by computing devices, so that they may be stored in a storage device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (9)

1. The processing method of the response message is characterized by comprising the following steps:
setting a network Internet Protocol (IP) address of the internet of things hotspot device as a private website under the condition that the internet of things hotspot device receives an AUTH frame;
determining the message type of a request message received by an internet of things hot spot device, and determining a response message sent to a mobile terminal by the internet of things hot spot device according to the message type;
modifying the source IP address in the response message into the private website;
after determining the message type of the request message received by the internet of things hotspot device, the method further comprises the following steps:
acquiring a source IP address, a source port and a destination IP address carried in the DNS request message or the HTTP request message or the ICMP request message under the condition that the message type of the request message is a Domain Name System (DNS) request message or a hypertext transfer protocol (HTTP) request message or a network control message (ICMP) request message;
and modifying the destination IP address of the DNS request message or the HTTP request message or the ICMP request message into the private address.
2. The method of claim 1, wherein setting the network IP address of the internet of things hotspot device to be a private network address comprises:
determining that the mobile terminal and the internet of things hotspot device are connected, and the internet of things hotspot device receives an AUTH frame;
and setting the network IP address of the Internet of things hot spot device to 192.168.0.1.
3. The method of claim 1, wherein modifying the source IP address in the reply message to the private web address comprises:
screening a DNS response message from a response message corresponding to the DNS request message under the condition that the message type of the request message is the DNS request message;
and modifying the source IP address of the DNS response message into the private website.
4. The method of claim 1, wherein after modifying the source IP address in the reply message to the private web address, the method further comprises:
when the message type of the request message is HTTP request message, after the source IP address in the response message corresponding to the HTTP request message is modified to the private website, the modified response message is sent to the mobile terminal;
and disconnecting the HTTP connection between the mobile terminal and the internet of things hotspot device.
5. The method according to any one of claims 1 to 4, wherein after modifying the source IP address in the reply message to the private network address, the method further comprises:
sending a modified response message to the mobile terminal;
and under the condition that the softtap configuration information is received, modifying the network IP address of the Internet of things hot spot equipment from the private website to a target website, wherein the softtap configuration information is used for indicating that a softtap network distribution mode between the Internet of things hot spot equipment and the mobile terminal is ended.
6. A device for processing a reply message, comprising:
the setting module is used for setting the network IP address of the internet of things hotspot device as a private website under the condition that the internet of things hotspot device receives the AUTH frame;
the processing module is used for determining the message type of the request message received by the internet of things hot spot equipment and determining a response message sent to the mobile terminal by the internet of things hot spot equipment according to the message type;
the modification module is used for modifying the source IP address in the response message into the private website;
the processing module is further configured to obtain a source IP address, a source port, and a destination IP address carried in the DNS request message or the HTTP request message or the ICMP request message when the message type of the request message is a domain name system DNS request message or a hypertext transfer protocol HTTP request message or a network control message protocol ICMP request message; and is combined with
And modifying the destination IP address of the DNS request message or the HTTP request message or the ICMP request message into the private address.
7. The apparatus of claim 6, wherein the means for setting is further for determining that the mobile terminal has established a connection with the internet of things hotspot device and that the internet of things hotspot device has received an AUTH frame; and setting the network IP address of the Internet of things hot spot device to 192.168.0.1.
8. A computer readable storage medium, characterized in that the computer readable storage medium comprises a stored program, wherein the program when run performs the method of any of the preceding claims 1 to 5.
9. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method according to any of the claims 1 to 5 by means of the computer program.
CN202011602955.6A 2020-12-29 2020-12-29 Response message processing method and device, storage medium and electronic device Active CN112738829B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011602955.6A CN112738829B (en) 2020-12-29 2020-12-29 Response message processing method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011602955.6A CN112738829B (en) 2020-12-29 2020-12-29 Response message processing method and device, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN112738829A CN112738829A (en) 2021-04-30
CN112738829B true CN112738829B (en) 2023-07-21

Family

ID=75610611

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011602955.6A Active CN112738829B (en) 2020-12-29 2020-12-29 Response message processing method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN112738829B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104243103A (en) * 2014-10-13 2014-12-24 福州瑞芯微电子有限公司 Method, system, transmitting terminal and receiving terminal for disconnected WIFI (wireless fidelity) data transmission
CN106209537A (en) * 2016-07-25 2016-12-07 深圳市双驰科技有限公司 A kind of home appliance and WIFI module, distribution method
CN110650070A (en) * 2018-06-26 2020-01-03 九阳股份有限公司 Household appliance network configuration method and WiFi module
CN111918283A (en) * 2020-07-27 2020-11-10 宁波奥克斯电气股份有限公司 Network distribution method, device and system of Internet of things equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4418970B2 (en) * 2006-09-01 2010-02-24 サイレックス・テクノロジー株式会社 Network device and computer program
WO2013052097A1 (en) * 2011-10-03 2013-04-11 Dantech Systems, LLC Network application based intranet
CN107113615B (en) * 2016-02-29 2020-02-14 华为技术有限公司 Authentication method and system for Access Point (AP) and related equipment
US20200351156A1 (en) * 2019-04-30 2020-11-05 TP-Link Research America Corp. Method and system for fast onboarding new device into existing iot network

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104243103A (en) * 2014-10-13 2014-12-24 福州瑞芯微电子有限公司 Method, system, transmitting terminal and receiving terminal for disconnected WIFI (wireless fidelity) data transmission
CN106209537A (en) * 2016-07-25 2016-12-07 深圳市双驰科技有限公司 A kind of home appliance and WIFI module, distribution method
CN110650070A (en) * 2018-06-26 2020-01-03 九阳股份有限公司 Household appliance network configuration method and WiFi module
CN111918283A (en) * 2020-07-27 2020-11-10 宁波奥克斯电气股份有限公司 Network distribution method, device and system of Internet of things equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
区块链物联网设备与无线访问点双向认证方案;唐呈俊等;《网络空间安全》;20191225(第12期);全文 *

Also Published As

Publication number Publication date
CN112738829A (en) 2021-04-30

Similar Documents

Publication Publication Date Title
US11134543B2 (en) Interworking LPWAN end nodes in mobile operator network
US10993166B2 (en) Data transmission method, electronic device, and computer readable storage medium
JP6726426B2 (en) Login-free method and device between terminals
CN109889499B (en) Message sending method and related device
CN106534289B (en) Automatic testing method, device and system
CN108243192B (en) Method and system for identifying application access network
CN107181804B (en) The method for down loading and device of resource
JP2017517227A (en) eUICC management method, eUICC, SM platform, and system
US20180091581A1 (en) Method of switching download mode, control method thereof and control system thereof
EP3433978B1 (en) Standalone network probing using available network connections
RU2010136044A (en) WIRELESS RADIO CONTROL UNITS USING IDENTIFIERS
CN105612805A (en) Communication method, communication system and relevant device of wearable device
US20190342738A1 (en) Method and Device for Sharing File Between Different Terminals
CN104378451A (en) Network communication route selecting method, device and system
US20200259783A1 (en) Method and apparatus for determining ethernet mac address
CN104301444A (en) Network IP acquiring method, device, application platform, client and system
CN113692753A (en) Network device and method for searching edge service implemented in network device
CN108306907A (en) A kind of management method of terminal, network function and terminal
CN112738829B (en) Response message processing method and device, storage medium and electronic device
EP3065445B1 (en) Method, cse, and system for transmitting m2m application request
CN114125023B (en) Method and device for determining data connection, storage medium and electronic device
CN103327482B (en) Terminal and network method for handover control
CN109495918B (en) Data transmission method and device
US20160309411A1 (en) Dynamic ungrouping of ip packets before cellular transmission
CN101127720B (en) Method for guaranteeing network address translation and reachability of internal local address

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant