[go: up one dir, main page]

CN112165477B - Gateway searching method and device, electronic equipment and storage medium - Google Patents

Gateway searching method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112165477B
CN112165477B CN202011004524.XA CN202011004524A CN112165477B CN 112165477 B CN112165477 B CN 112165477B CN 202011004524 A CN202011004524 A CN 202011004524A CN 112165477 B CN112165477 B CN 112165477B
Authority
CN
China
Prior art keywords
gateway
binding
search request
information
user equipment
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
CN202011004524.XA
Other languages
Chinese (zh)
Other versions
CN112165477A (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.)
Guangzhou Hedong Technology Co ltd
Jinmao Green Building Technology Co Ltd
Original Assignee
Guangzhou Hedong Technology Co ltd
Jinmao Green Building Technology 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 Guangzhou Hedong Technology Co ltd, Jinmao Green Building Technology Co Ltd filed Critical Guangzhou Hedong Technology Co ltd
Priority to CN202011004524.XA priority Critical patent/CN112165477B/en
Publication of CN112165477A publication Critical patent/CN112165477A/en
Application granted granted Critical
Publication of CN112165477B publication Critical patent/CN112165477B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/164Adaptation or special uses of UDP protocol
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0442Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply asymmetric encryption, i.e. different keys for encryption and decryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0876Network architectures or network communication protocols for network security for authentication of entities based on the identity of the terminal or configuration, e.g. MAC address, hardware or software configuration or device fingerprint
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Power Engineering (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the application discloses a gateway searching method, a gateway searching device, electronic equipment and a storage medium. According to the technical scheme provided by the embodiment of the application, the UDP packet is broadcast, the first ID information returned by the user equipment based on the UDP packet is received, the received first ID information is stored as the binding ID of the current gateway, the searching state of the current gateway is set to be a hidden state, and the gateway stops broadcasting the UDP packet in the hidden state. And then, judging whether the search request contains sequence information corresponding to the binding ID or not by receiving the search request broadcasted by the user equipment in real time, and if so, replying to the search request. By adopting the technical means, the gateway can be searched by the user equipment corresponding to the binding ID in a hidden state, the potential safety hazard of gateway searching is reduced, and the use safety of the local area network is ensured.

Description

Gateway searching method and device, electronic equipment and storage medium
Technical Field
The embodiment of the application relates to the technical field of communication networks, in particular to a gateway searching method, a gateway searching device, electronic equipment and a storage medium.
Background
At present, when a user device connects with a gateway and uses a local area network, the gateway is generally required to be searched, and network access authentication is performed based on the searched gateway so that the user device connects with the gateway. When the user equipment searches the gateway, the gateway broadcasting UDP packet is adopted to enable the user equipment to search the gateway, so that the user equipment can search the gateway conveniently.
However, the manner of broadcasting the UDP packet through the gateway facilitates the user equipment to search for the gateway, but also leaves the gateway in a public state, resulting in other devices to search for and operate the gateway. For application scenes with high privacy requirements such as home local area networks, corresponding potential safety hazards exist, and safety is lacking.
Disclosure of Invention
The embodiment of the application provides a gateway searching method, a gateway searching device, electronic equipment and a storage medium, which can improve the security of gateway searching and avoid potential safety hazards caused by easily searching a gateway.
In a first aspect, an embodiment of the present application provides a gateway searching method, including:
broadcasting a UDP packet, and receiving first ID information returned by user equipment based on the UDP packet;
storing the received first ID information as a binding ID of a current gateway, setting a searching state of the current gateway as a hidden state, and stopping broadcasting the UDP packet by the gateway in the hidden state;
and receiving a search request broadcasted by user equipment in real time, judging whether the search request contains sequence information corresponding to the binding ID, and if so, replying to the search request.
Further, after storing the received first ID information as a binding ID of the current gateway and setting a search state of the current gateway as a hidden state, the method further includes:
and deleting the binding ID in response to a reset operation of the current gateway search state, exiting the hidden state, and recovering the broadcast UDP packet.
Further, determining whether the search request includes sequence information corresponding to the binding ID includes:
analyzing the search request, and extracting an ID sequence string contained in the search request;
and judging whether the ID sequence string corresponds to the binding ID.
Further, the ID sequence string is generated by encrypting the first ID information through a predefined encryption algorithm;
correspondingly, determining whether the ID sequence string corresponds to the binding ID includes:
extracting the binding ID, and encrypting the binding ID based on the encryption algorithm;
and judging whether the encrypted binding ID is consistent with the ID sequence string.
Further, the encryption algorithm is used for inverting the sequence of the first ID information back and forth and encrypting through an asymmetric algorithm.
Further, after replying to the search request, the method further comprises:
and receiving second ID information sent by the user equipment, and adding or replacing the binding ID based on the second ID information.
In a second aspect, an embodiment of the present application provides a gateway searching method, including:
the method comprises the steps of performing equipment ID registration in advance and receiving first ID information distributed by a cloud;
the UDP packet broadcast by the gateway is connected with the gateway, and returns the first ID information to the gateway, wherein the first ID information is used for saving the binding ID of the gateway;
broadcasting a search request when searching the gateway, and adding an ID sequence string in the search request, wherein the ID sequence string is generated by encrypting the first ID information through a predefined encryption algorithm;
and receiving a reply returned by the gateway through the binding ID comparison to the search request, and connecting the gateway based on the reply.
In a third aspect, an embodiment of the present application provides a gateway searching apparatus, including:
the broadcasting module is used for broadcasting the UDP packet and receiving first ID information returned by the user equipment based on the UDP packet;
the setting module is used for storing the received first ID information as the binding ID of the current gateway, setting the searching state of the current gateway as a hidden state, and stopping broadcasting the UDP packet by the gateway in the hidden state;
and the judging module is used for receiving a search request broadcasted by the user equipment in real time, judging whether the search request contains sequence information corresponding to the binding ID, and if so, replying to the search request.
In a fourth aspect, embodiments of the present application provide an electronic device, including:
a memory and one or more processors;
the memory is used for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the gateway searching method as described in the first aspect.
In a fifth aspect, embodiments of the present application provide a storage medium containing computer executable instructions, which when executed by a computer processor, are for performing the gateway search method as described in the first aspect.
According to the embodiment of the application, the user equipment receives the first ID information returned by the user equipment based on the UDP packet by broadcasting the UDP packet, stores the received first ID information as the binding ID of the current gateway, sets the searching state of the current gateway as a hidden state, and stops broadcasting the UDP packet in the hidden state. And then, judging whether the search request contains sequence information corresponding to the binding ID or not by receiving the search request broadcasted by the user equipment in real time, and if so, replying to the search request. By adopting the technical means, the gateway can be searched by the user equipment corresponding to the binding ID in a hidden state, the potential safety hazard of gateway searching is reduced, and the use safety of the local area network is ensured.
Drawings
Fig. 1 is a flowchart of a gateway searching method according to an embodiment of the present application;
FIG. 2 is a flowchart of search request judgment in the first embodiment of the present application;
FIG. 3 is a binding ID comparison flow chart in accordance with one embodiment of the present application;
fig. 4 is a flowchart of another gateway searching method according to the first embodiment of the present application;
fig. 5 is a flowchart of a user equipment searching gateway in the first embodiment of the present application;
fig. 6 is a schematic structural diagram of a gateway searching device according to a second embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to a third embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the following detailed description of specific embodiments thereof is given with reference to the accompanying drawings. It is to be understood that the specific embodiments described herein are merely illustrative of the application and not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the matters related to the present application are shown in the accompanying drawings. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart depicts operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently, or at the same time. Furthermore, the order of the operations may be rearranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figures. The processes may correspond to methods, functions, procedures, subroutines, and the like.
The gateway searching method aims at pre-storing ID information of corresponding user equipment at one end of a gateway as a binding ID so as to conveniently judge whether a received searching request is from the user equipment corresponding to the binding ID or not based on the binding ID in a hidden state, and then replying the searching request. Thereby realizing the security of gateway search connection. In contrast to conventional gateway devices, they are typically exposed during operation. In order to facilitate the access of the user equipment, a mode of broadcasting UDP packets in real time is adopted so as to facilitate the search of the user equipment. However, the broadcast of the UDP packet enables all user devices to search for the gateway and operate. This clearly increases the security risk of local area network usage, affecting the security and specificity of gateway usage. Based on the above, the gateway searching method of the embodiment of the application is provided to solve the security problem of the existing gateway equipment searching management.
Embodiment one:
fig. 1 shows a flowchart of a gateway searching method according to an embodiment of the present application, where the gateway searching method provided in the embodiment may be performed by a gateway device, and the gateway device may be implemented by using software and/or hardware.
The following description will be made taking a gateway device as an example of a main body for executing the gateway searching method. Referring to fig. 1, the gateway searching method specifically includes:
s110, broadcasting a UDP packet, and receiving first ID information returned by the user equipment based on the UDP packet.
Illustratively, in a home lan application, the user device accesses the home lan by searching for and connecting to a gateway. In order to ensure the security and the specificity of the home lan, it is necessary to avoid that the gateway is searched by other irrelevant devices, only by the designated user device. The gateway is required to operate in a hidden state, i.e. not to be searched by the respective device by broadcasting UDP packets (UDP, userDatagramProtocolUDP, user datagram protocol) providing the application with a way to send encapsulated IP packets without establishing a connection. Before this, the gateway needs to explicitly search for ID information of its own user equipment in a hidden state. This ID information is defined as first ID information, which is obtained by the user equipment when registering the device ID, and sent to the gateway side in advance.
Specifically, when registering the device ID, the user registers the device ID through the relevant APP on the user device, and sends a registration request to the cloud. The cloud end allocates a unique ID to the user equipment, that is, the first ID information, based on the registration request of the user equipment. Further, since one end of the gateway cannot reply to the search request according to the binding ID when the corresponding binding ID is not stored, the device cannot search for the gateway in the hidden state. Therefore, when the gateway does not store the binding ID, the embodiment of the present application sets the gateway to the public state. In the public state, the gateway will broadcast the UDP packet in real time, so that each device searches the gateway. And for the user end, after receiving the first ID information distributed by the cloud, in order to bind the user end with the gateway, the user equipment needs to search the gateway according to the UDP packet broadcast by the gateway so as to conveniently search the gateway in a hidden state. And further accessing the gateway and sending the first ID information to the gateway.
And S120, storing the received first ID information as a binding ID of the current gateway, setting the searching state of the current gateway as a hidden state, and stopping broadcasting the UDP packet by the gateway in the hidden state.
The user equipment may connect to the gateway through an APP on the device and send the first ID information. And, when sending the first ID information to the gateway, a corresponding setting instruction needs to be attached to inform the gateway to save the first ID information. Further, after receiving the first ID information, the gateway end stores the first ID information as a binding ID according to a setting instruction of the user equipment, which indicates that the current gateway is bound with the user equipment corresponding to the binding ID. Only the device corresponding to the binding ID can search for the gateway. Further, since the gateway is still in the open state at this time, after the binding ID is set, the gateway may be set to the hidden state. It can be understood that in the hidden state, the gateway does not broadcast UDP packets any more, and the gateway is prevented from being searched by other devices, so that the potential safety hazard of gateway access is reduced, and the use safety of the local area network is improved.
S130, receiving a search request broadcasted by user equipment in real time, judging whether the search request contains sequence information corresponding to the binding ID, and if yes, replying to the search request.
After that, when the user equipment needs to search for an access gateway, the gateway is searched for by broadcasting a search request. In order to facilitate the gateway to compare ID information, the search authority of the user equipment is determined. The user equipment needs to add ID information corresponding to the binding ID in the search request so that the gateway can confirm whether the user equipment has the search authority. And for one end of the gateway, the search request broadcasted by the user equipment is monitored in real time. After receiving the search request, the search request is analyzed and judged to determine whether the search request contains sequence information related to the pre-stored binding ID. It can be understood that if the search request includes the sequence information corresponding to the binding ID, the device sending the search request is considered to be the user equipment corresponding to the binding ID, and has a preset binding relationship with the gateway, and the gateway replies to the search request. Otherwise, the current user equipment and the gateway are considered to have no preset binding relation, and the gateway ignores the search request.
Specifically, referring to fig. 2, the determining process of the search request includes:
s1301, analyzing the search request, and extracting an ID sequence string contained in the search request;
s1302, judging whether the ID sequence string corresponds to the binding ID.
The gateway analyzes the search request based on the received search request and extracts the ID sequence string contained therein. The binding ID stored in advance is further extracted to be compared with the ID sequence string. If the two correspond, the user equipment sending the search request is indicated to be the user equipment corresponding to the binding ID. It should be noted that, the ID sequence string may be directly generated according to the first ID information of the user equipment, and when comparing the ID sequence string, it is only required to directly compare whether the binding ID is consistent with the ID sequence string. In order to enhance the security of the ID information, in some embodiments, the ID sequence string may be generated by encrypting the first ID information by a predefined encryption algorithm. Through the encryption ID sequence string, the occurrence of the conditions of ID information leakage and the like caused by network attack of the ID information can be avoided, and the security of gateway search access is ensured.
And because the ID sequence string is encrypted by using an encryption algorithm, when the ID sequence string is compared, whether the ID sequence string is consistent with the binding ID cannot be directly judged. Therefore, after the ID sequence string is extracted, the embodiment of the present application extracts the binding ID and encrypts the binding ID simultaneously, so that the encrypted binding ID compares the ID sequence string. Referring to fig. 3, the binding ID comparison procedure includes:
s13021, extracting the binding ID, and encrypting the binding ID based on the encryption algorithm;
s13022, judging whether the encrypted binding ID is consistent with the ID sequence string.
Specifically, after parsing the search request and extracting the ID sequence string, the gateway encrypts the binding ID using the same encryption algorithm according to the encryption algorithm used for the previous ID sequence string. And further judging whether the encrypted binding ID is consistent with the ID sequence string, and if so, replying a search request. It should be noted that, the encryption algorithm needs to be preconfigured in the gateway, and specifically, the encryption algorithm may be synchronously sent to the gateway to be configured when the user equipment sends the first ID information. Or the gateway can be directly configured when leaving the factory, and the follow-up corresponding user equipment APP configures the same encryption algorithm. Thereby ensuring that the encrypted first ID information of the two is consistent.
Further, the encryption algorithm is used for inverting the sequence of the first ID information back and forth and encrypting through an asymmetric algorithm. When a search request is sent by one end of user equipment, the first ID information is extracted for encryption to generate an ID sequence string. Through the encryption algorithm, the first ID information is firstly inverted front and back, and the ID sequence string is obtained by encrypting the first ID information through an asymmetric algorithm based on the inverted front and back information. The asymmetric encryption algorithm has two keys: public keys (public keys) and private keys (private keys). The public key and the private key are a pair, and if the data is encrypted by the public key, the data can be decrypted only by the corresponding private key. Because two different keys are used for encryption and decryption, this algorithm is called an asymmetric encryption algorithm. It should be noted that, in the embodiment of the present application, the ID sequence string obtained by encrypting based on the asymmetric encryption algorithm does not directly adopt the manner of extracting the first ID information by decrypting the ID sequence string when the ID sequence string is subsequently compared with the binding ID. Instead, the binding ID is encrypted by the same encryption algorithm by extracting the pre-stored binding ID, and then is compared with the ID sequence string. That is, when encryption is performed using an asymmetric encryption algorithm at this time, encryption is performed using only one key of the public key or the private key. It will be appreciated that the ID sequence string and binding ID, when unencrypted, are the actual content of the first ID information. Therefore, after the same encryption algorithm is used for encryption, the information sequences of the two should be consistent, so that the search request judgment can be performed.
In some embodiments, after the user equipment encrypts the obtained ID sequence string by using an asymmetric encryption algorithm, for one end of the gateway, the user equipment may also decrypt the ID sequence string by using the asymmetric encryption algorithm to obtain the initial first ID information. And comparing the first ID information with the binding ID to judge the search request. The above encryption transmission and comparison method for the first ID information is only one implementation mode of the present application, and in practical application, the information may be encrypted by using a plurality of different encryption algorithms, which is not limited in this embodiment.
Finally, based on the search request judgment, if the search request is determined to be from the corresponding user equipment of the binding ID, the search request is replied. Based on this reply, the user equipment can perform authentication of the gateway connection and even directly access the gateway. When the search request is determined not to be from the corresponding user equipment of the binding ID, the search request does not need to be replied, and the gateway end discards the search request and does not process the search request.
In one embodiment, after the user equipment is connected to the gateway, the original encryption algorithm of the gateway can be replaced by sending a new encryption algorithm, and the subsequent user equipment encrypts the first ID information based on the new encryption algorithm to generate the ID sequence string. And one end of the gateway encrypts the binding ID according to the replaced encryption algorithm, then compares the binding ID with the ID sequence string, and judges the gateway search request. The security of local area network access can be further improved by replacing the encryption algorithm, and the situation that the encryption algorithm is broken to cause data theft and loss is avoided.
In one embodiment, the gateway further receives second ID information sent by the user equipment, and adds or replaces the binding ID based on the second ID information. Specifically, after the user equipment accesses the gateway, local area network management can be performed based on the APP on the user equipment. When the user needs to add or replace the current binding ID, the second ID information is attached to the instruction by sending an add or replace instruction. After receiving the instruction, the gateway end responds to the instruction and adds or replaces the binding ID based on the second ID information. For example, in the home lan, when the new device accesses the gateway, the user device creates second ID information, and sends the second ID information to the new device and the gateway, and the gateway regenerates a binding ID based on the second ID information for storage. And the gateway compares the ID sequence strings based on the newly generated binding ID, and can identify the search authority of the newly added equipment and reply to the search request. By adding or replacing the binding ID, the user can manage the equipment accessed to the local area network conveniently, so that the local area network has higher security.
In one embodiment, when the user needs to delete the binding ID, replace the lan user device or restore the gateway to the public state, the reset key on the gateway is pressed, and after the user presses the reset key for a set time, the reset operation of the gateway searching state is triggered. At the moment, the gateway responds to the reset operation of the current gateway search state, deletes the binding ID, exits the hidden state and restores the broadcast UDP packet. After the gateway deletes the binding ID and replies the broadcast UDP packet, the gateway does not reply the search request broadcasted by the subsequent user equipment because no binding ID is available for comparing the search request. And, broadcast UDP package through gateway at this moment, every equipment can search for the gateway on the basis of UDP package to can be convenient for carry out the rebinding of user equipment.
In one embodiment, the user device and gateway may also communicate via a specified communication protocol. It will be appreciated that in a home lan, in order to avoid the gateway being easily searched, the gateway does not broadcast UDP packets using a general communication protocol but instead broadcasts UDP packets using a specific communication protocol when broadcasting UDP packets. The corresponding user equipment end requires to use the corresponding communication protocol to receive the UDP packet so as to search the gateway. Therefore, the device for searching the gateway can be reduced, and the gateway is prevented from being easily searched and operated. In order to ensure the specificity and safety of the local area network, the gateway searching is performed by the gateway searching method in steps S110-S130, so as to ensure the safety and specificity of the local area network.
On the basis of the foregoing embodiment, the embodiment of the present application further provides another gateway searching method, referring to fig. 4, where the gateway searching method includes:
s210, performing equipment ID registration in advance, and receiving first ID information distributed by a cloud;
s220, connecting the gateway based on a UDP packet broadcasted by the gateway, and returning the first ID information to the gateway, wherein the first ID information is used for storing a binding ID of the gateway;
s230, broadcasting a search request when searching the gateway, and adding an ID sequence string in the search request, wherein the ID sequence string is generated by encrypting the first ID information through a predefined encryption algorithm;
s240, receiving a reply returned by the gateway through the binding ID comparison to the search request, and connecting the gateway based on the reply.
The gateway searching method is executed by the ue, so that the technical effects of steps S110 to S130 can be achieved, which are not repeated herein.
Specifically, referring to fig. 5, a flowchart of a user equipment searching gateway is provided, as shown in fig. 5, in an initial state, the gateway is in a public state, a UDP packet is broadcast to facilitate the user equipment searching, and further binding of the first ID information is performed. For one end of the user equipment, the first ID information needs to be acquired through the registration device ID, so that the binding ID of the gateway is set later and the search request is sent. After the user equipment acquires the first ID information, the user equipment returns the first ID information to the gateway according to the UDP packet broadcast by the gateway, the gateway sets a binding ID based on the first ID information, and the self search state is set to be a hidden state. And then comparing the binding ID of the user equipment according to the search request broadcasted by the user equipment, and further replying the search request. The user equipment searches the gateway based on the reply of the gateway and connects the gateway, thereby completing the access of the local area network.
And receiving the first ID information returned by the user equipment based on the UDP packet by broadcasting the UDP packet, storing the received first ID information as the binding ID of the current gateway, setting the searching state of the current gateway as a hidden state, and stopping broadcasting the UDP packet by the gateway in the hidden state. And then, judging whether the search request contains sequence information corresponding to the binding ID or not by receiving the search request broadcasted by the user equipment in real time, and if so, replying to the search request. By adopting the technical means, the gateway can be searched by the user equipment corresponding to the binding ID in a hidden state, the potential safety hazard of gateway searching is reduced, and the use safety of the local area network is ensured.
Embodiment two:
on the basis of the above embodiments, fig. 6 is a schematic structural diagram of a gateway searching apparatus according to a second embodiment of the present application. Referring to fig. 6, the gateway searching apparatus provided in this embodiment specifically includes: a broadcasting module 21, a setting module 22 and a judging module 23.
The broadcasting module 21 is configured to broadcast a UDP packet, and receive first ID information returned by the user equipment based on the UDP packet;
the setting module 22 is configured to store the received first ID information as a binding ID of the current gateway, and set a search state of the current gateway as a hidden state, where the gateway stops broadcasting the UDP packet;
the judging module 23 is configured to receive a search request broadcasted by a user equipment in real time, judge whether the search request includes sequence information corresponding to the binding ID, and if yes, reply to the search request.
And receiving the first ID information returned by the user equipment based on the UDP packet by broadcasting the UDP packet, storing the received first ID information as the binding ID of the current gateway, setting the searching state of the current gateway as a hidden state, and stopping broadcasting the UDP packet by the gateway in the hidden state. And then, judging whether the search request contains sequence information corresponding to the binding ID or not by receiving the search request broadcasted by the user equipment in real time, and if so, replying to the search request. By adopting the technical means, the gateway can be searched by the user equipment corresponding to the binding ID in a hidden state, the potential safety hazard of gateway searching is reduced, and the use safety of the local area network is ensured.
The gateway searching device provided in the second embodiment of the present application may be used to execute the gateway searching method provided in the first embodiment, and has corresponding functions and beneficial effects.
Embodiment III:
an electronic device according to a third embodiment of the present application, referring to fig. 7, includes: processor 31, memory 32, communication module 33, input device 34 and output device 35. The number of processors in the electronic device may be one or more and the number of memories in the electronic device may be one or more. The processor, memory, communication module, input device, and output device of the electronic device may be connected by a bus or other means.
The memory 32 is a computer readable storage medium, and may be used to store a software program, a computer executable program, and a module, such as program instructions/modules corresponding to the gateway searching method according to any embodiment of the present application (e.g., a broadcasting module, a setting module, and a judging module in the gateway searching apparatus). The memory may mainly include a memory program area and a memory data area, wherein the memory program area may store an operating system, at least one application program required for a function; the storage data area may store data created according to the use of the device, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some examples, the memory may further include memory remotely located with respect to the processor, the remote memory being connectable to the device through 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 communication module 33 is used for data transmission.
The processor 31 executes various functional applications of the device and data processing by running software programs, instructions and modules stored in the memory, i.e., implements the gateway search method described above.
The input means 34 may be used to receive entered numeric or character information and to generate key signal inputs related to user settings and function control of the device. The output means 35 may comprise a display device such as a display screen.
The electronic device provided by the above embodiment can be used for executing the gateway searching method provided by the above embodiment, and has corresponding functions and beneficial effects.
Embodiment four:
the present embodiments also provide a storage medium containing computer executable instructions, which when executed by a computer processor, are for performing a gateway search method comprising: broadcasting a UDP packet, and receiving first ID information returned by user equipment based on the UDP packet; storing the received first ID information as a binding ID of a current gateway, setting a searching state of the current gateway as a hidden state, and stopping broadcasting the UDP packet by the gateway in the hidden state; and receiving a search request broadcasted by user equipment in real time, judging whether the search request contains sequence information corresponding to the binding ID, and if so, replying to the search request.
Storage media-any of various types of memory devices or storage devices. The term "storage medium" is intended to include: mounting media such as CD-ROM, floppy disk or tape devices; computer system memory or random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, lanbas (Rambus) RAM, etc.; nonvolatile memory such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements, etc. The storage medium may also include other types of memory or combinations thereof. In addition, the storage medium may be located in a first computer system in which the program is executed, or may be located in a second, different computer system connected to the first computer system through a network such as the internet. The second computer system may provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media residing in different locations (e.g., in different computer systems connected by a network). The storage medium may store program instructions (e.g., embodied as a computer program) executable by one or more processors.
Of course, the storage medium containing the computer executable instructions provided in the embodiments of the present application is not limited to the gateway searching method described above, and may also perform the relevant operations in the gateway searching method provided in any embodiment of the present application.
The gateway searching apparatus, the storage medium and the electronic device provided in the foregoing embodiments may perform the gateway searching method provided in any embodiment of the present application, and technical details not described in detail in the foregoing embodiments may be referred to the gateway searching method provided in any embodiment of the present application.
The foregoing description is only of the preferred embodiments of the present application and the technical principles employed. The present application is not limited to the specific embodiments described herein, but is capable of numerous obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the present application. Therefore, while the present application has been described in connection with the above embodiments, the present application is not limited to the above embodiments, but may include many other equivalent embodiments without departing from the spirit of the present application, and the scope of the present application is determined by the scope of the claims.

Claims (9)

1. A gateway searching method, comprising:
broadcasting a UDP packet, and receiving first ID information returned by user equipment based on the UDP packet;
storing the received first ID information as a binding ID of a current gateway, setting a searching state of the current gateway as a hidden state, and stopping broadcasting the UDP packet by the gateway in the hidden state;
receiving a search request broadcasted by user equipment in real time, judging whether the search request contains sequence information corresponding to the binding ID, if so, replying to the search request, wherein the steps include analyzing the search request, and extracting an ID sequence string contained in the search request;
and judging whether the ID sequence string corresponds to the binding ID.
2. The gateway search method according to claim 1, further comprising, after saving the received first ID information as a binding ID of a current gateway and setting a search state of the current gateway to a hidden state:
and deleting the binding ID in response to a reset operation of the current gateway search state, exiting the hidden state, and recovering the broadcast UDP packet.
3. The gateway search method according to claim 2, wherein the ID sequence string is generated by encrypting the first ID information by a predefined encryption algorithm;
correspondingly, determining whether the ID sequence string corresponds to the binding ID includes:
extracting the binding ID, and encrypting the binding ID based on the encryption algorithm;
and judging whether the encrypted binding ID is consistent with the ID sequence string.
4. A gateway search method according to claim 3, wherein the encryption algorithm is used to invert the sequence of the first ID information back and forth and encrypt by an asymmetric algorithm.
5. The gateway search method of claim 1, further comprising, after replying to the search request:
and receiving second ID information sent by the user equipment, and adding or replacing the binding ID based on the second ID information.
6. A gateway searching method, comprising:
the method comprises the steps of performing equipment ID registration in advance and receiving first ID information distributed by a cloud;
the UDP packet broadcast by the gateway is connected with the gateway, and returns the first ID information to the gateway, wherein the first ID information is used for saving the binding ID of the gateway;
broadcasting a search request when searching the gateway, adding an ID sequence string in the search request, wherein the ID sequence string is generated by encrypting the first ID information through a predefined encryption algorithm, and the method comprises the steps of analyzing the search request and extracting the ID sequence string contained in the search request;
judging whether the ID sequence string corresponds to the binding ID;
and receiving a reply returned by the gateway through the binding ID comparison to the search request, and connecting the gateway based on the reply.
7. A gateway searching apparatus, comprising:
the broadcasting module is used for broadcasting the UDP packet and receiving first ID information returned by the user equipment based on the UDP packet;
the setting module is used for storing the received first ID information as the binding ID of the current gateway, setting the searching state of the current gateway as a hidden state, and stopping broadcasting the UDP packet by the gateway in the hidden state;
the judging module is used for receiving a search request broadcasted by the user equipment in real time, judging whether the search request contains sequence information corresponding to the binding ID, if so, replying to the search request, and particularly, analyzing the search request, extracting an ID sequence string contained in the search request, and judging whether the ID sequence string corresponds to the binding ID.
8. An electronic device, comprising:
a memory and one or more processors;
the memory is used for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the gateway searching method of any of claims 1-6.
9. A storage medium containing computer executable instructions which, when executed by a computer processor, are for performing the gateway search method of any of claims 1-6.
CN202011004524.XA 2020-09-22 2020-09-22 Gateway searching method and device, electronic equipment and storage medium Active CN112165477B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011004524.XA CN112165477B (en) 2020-09-22 2020-09-22 Gateway searching method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011004524.XA CN112165477B (en) 2020-09-22 2020-09-22 Gateway searching method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112165477A CN112165477A (en) 2021-01-01
CN112165477B true CN112165477B (en) 2023-05-02

Family

ID=73863293

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011004524.XA Active CN112165477B (en) 2020-09-22 2020-09-22 Gateway searching method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112165477B (en)

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2622625A1 (en) * 2005-09-14 2007-03-22 O-Ya!, Inc. Networked information indexing and search apparatus and method
CN104581718A (en) * 2013-10-09 2015-04-29 中兴通讯股份有限公司 Method and system for realizing security access and wireless gateway equipment
US9426118B2 (en) * 2014-10-28 2016-08-23 Belkin International Inc. Remote grant of network access
CN104796484B (en) * 2015-04-29 2018-10-26 西安诺瓦电子科技有限公司 A kind of fast search connection method based on display screen control system
CN106550360B (en) * 2015-09-23 2020-06-23 中国电信股份有限公司 WiFi connection method and system
CN110034984B (en) * 2016-03-29 2021-09-07 华为技术有限公司 Access method, device and system
CN106878923B (en) * 2017-01-09 2021-04-23 云丁网络技术(北京)有限公司 Quick networking method for ultra-low power consumption intelligent equipment and intelligent home system
CN109218994B (en) * 2018-09-05 2021-09-17 北京字节跳动网络技术有限公司 Equivalent equipment Bluetooth communication method and device based on gateway
CN109348458B (en) * 2018-10-23 2022-09-09 深圳绿米联创科技有限公司 Network access configuration method and device, electronic equipment and network system
CN110855535A (en) * 2019-11-14 2020-02-28 深圳市同进共赢科技有限公司 Gateway equipment, home equipment and connection method between gateway equipment and home equipment

Also Published As

Publication number Publication date
CN112165477A (en) 2021-01-01

Similar Documents

Publication Publication Date Title
CN113055867A (en) Method and device for auxiliary network distribution of terminal and electronic equipment
WO2019062666A1 (en) System, method, and apparatus for securely accessing internal network
CN112333213B (en) Privacy protection method and device for business data of power Internet of things
CN113301572B (en) Connection method and device of Bluetooth equipment, storage medium and Bluetooth equipment
CN113347072B (en) VPN resource access method, device, electronic equipment and medium
CN112333212B (en) Encryption management method and device for business data of power Internet of things
CN114221822B (en) Distribution network method, gateway device and computer readable storage medium
CN112492004B (en) Method, device, system and storage medium for establishing local communication link
CN116647425B (en) An IPSec-VPN implementation method, device, electronic device and storage medium of OVN architecture
CN112769761A (en) Signal transmission mode selection method and device based on service classification
WO2024032289A1 (en) Video playback method and system, video security platform, and communication device
US11606193B2 (en) Distributed session resumption
CN113992427B (en) Data encryption sending method and device based on adjacent nodes
US8670565B2 (en) Encrypted packet communication system
CN112165477B (en) Gateway searching method and device, electronic equipment and storage medium
CN110161985B (en) A method and device for safety control of smart home appliances based on CoAP protocol
CN113839958B (en) Communication encryption method, device, control system and storage medium for smart home
CN114884771B (en) Identity network construction method, device and system based on zero trust concept
WO2016209830A1 (en) Automatic discovery and onboarding of electronic devices
CN112350875B (en) Centralized management configuration method and device for configuration data
CN111211958B (en) Method and device for providing VPN (virtual private network) service, block chain network and node equipment
CN108769989B (en) Wireless network connection method, wireless access device and equipment
KR101365889B1 (en) Control method of connecting to mobile-network for smart phone, the system and the computer readable medium able running the program thereof
CN118250090B (en) Internet of Things Platform Information Processing Method and Device
CN119312372B (en) Device resource decryption method, device, electronic device and storage medium

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