CN112165477A - 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
CN112165477A
CN112165477A CN202011004524.XA CN202011004524A CN112165477A CN 112165477 A CN112165477 A CN 112165477A CN 202011004524 A CN202011004524 A CN 202011004524A CN 112165477 A CN112165477 A CN 112165477A
Authority
CN
China
Prior art keywords
gateway
binding
information
search request
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.)
Granted
Application number
CN202011004524.XA
Other languages
Chinese (zh)
Other versions
CN112165477B (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

Abstract

The embodiment of the application discloses a gateway searching method and device, electronic equipment and a storage medium. According to the technical scheme provided by the embodiment of the application, the first ID information returned by the user equipment based on the UDP packet is received through broadcasting the UDP packet, 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 the 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 the search request. By adopting the technical means, the gateway can be searched by the user equipment correspondingly bound with the 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 equipment is connected 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 equipment is connected with the gateway. When the user equipment searches the gateway, the user equipment can search the gateway by adopting a mode of broadcasting the UDP packet by the gateway, so that the user equipment can conveniently search the gateway.
However, although the way of broadcasting the UDP packet through the gateway facilitates the user equipment to search for the gateway, the gateway is also made public, so that other equipment can search for and operate the gateway. For application scenarios with high privacy requirements such as home local area networks, corresponding potential safety hazards exist, and safety is lacked.
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 safety 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 search 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 the current gateway, setting the searching state of the current gateway to be 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 the search request.
Further, after saving the received first ID information as the binding ID of the current gateway and setting the search state of the current gateway to be the hidden state, the method further includes:
and in response to the reset operation of the current gateway searching state, deleting the binding ID, 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, judging 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 search method, including:
device ID registration is carried out in advance, and first ID information distributed by a cloud is received;
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 being stored as a binding ID of the gateway;
when searching the gateway, broadcasting a search request, 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 comparison of the binding ID with the search request, and connecting the gateway based on the reply.
In a third aspect, an embodiment of the present application provides a gateway search apparatus, including:
the broadcast 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 user equipment in real time, judging whether the search request contains sequence information corresponding to the binding ID, and if so, replying the search request.
In a fourth aspect, an embodiment of the present application provides an electronic device, including:
a memory and one or more processors;
the memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the gateway search method of the first aspect.
In a fifth aspect, embodiments of the present application provide a storage medium containing computer-executable instructions for performing the gateway search method according to the first aspect when executed by a computer processor.
According to the embodiment of the application, the UDP packet is broadcasted, 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 the 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 the search request. By adopting the technical means, the gateway can be searched by the user equipment correspondingly bound with the 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 illustrating a search request determination process according to a first embodiment of the present application;
FIG. 3 is a flow chart of binding ID comparison according to one embodiment of the present application;
fig. 4 is a flowchart of another gateway searching method provided in an embodiment of the present application;
FIG. 5 is a flowchart illustrating a user equipment searching for a gateway according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a gateway search apparatus 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
In order to make the objects, technical solutions and advantages of the present application more apparent, specific embodiments of the present application will be described in detail with reference to the accompanying drawings. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be further noted that, for the convenience of description, only some but not all of the relevant portions of the present application are shown in the drawings. Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
The gateway searching method aims to pre-store ID information of corresponding user equipment at one end of a gateway as a binding ID so as to judge whether a received searching request comes from the user equipment corresponding to the binding ID or not based on the binding ID in a hidden state, and then reply to the searching request. Thereby realizing the security of the gateway searching connection. In contrast to conventional gateway devices, they are usually in the public state during operation. In order to facilitate the access of the user equipment, a real-time broadcast UDP packet mode is adopted to facilitate the search of the user equipment. However, the manner of broadcasting the UDP packet enables all the ues to search for the gateway and operate the gateway. This undoubtedly increases the security risk of the use of the local area network, and affects the security and the specificity of the use of the gateway. Therefore, the gateway searching method provided by the embodiment of the application is provided to solve the security problem of the existing gateway device searching management.
The first embodiment is as follows:
fig. 1 is a flowchart of a gateway searching method provided in an embodiment of the present application, where the gateway searching method provided in this embodiment may be executed by a gateway device, and the gateway device may be implemented in a software and/or hardware manner.
The following description will be given taking a gateway device as an example of a main body for executing the gateway search method. Referring to fig. 1, the gateway search method specifically includes:
s110, broadcasting the 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 local area network, the gateway needs to be prevented from being searched by other unrelated devices and only searched by the specified user device. The gateway is required to operate in a hidden state, i.e. to be searched by each device without broadcasting UDP packets (user datagram protocol, a method for sending encapsulated IP packets without establishing a connection is provided for applications). Before that, the gateway needs to explicitly search the ID information of its own user equipment in the hidden state. Defining the ID information as first ID information, wherein the first ID information is obtained by the user equipment when registering the equipment ID and is sent to one end of the gateway in advance.
Specifically, when registering the device ID, the user registers the device ID through a relevant APP on the user device, and sends a registration request to the cloud. The cloud assigns a unique ID to the user device based on the registration request of the user device, namely the first ID information. Further, since the gateway cannot reply the search request according to the binding ID when the corresponding binding ID is not stored at one end of the gateway, the device cannot search for the gateway in a hidden state. Therefore, in the embodiment of the present application, when the gateway does not store the binding ID, the gateway is set to the public state. In the open state, the gateway broadcasts UDP packets in real time so that each device can search for the gateway. For the user side, after receiving the first ID information allocated by the cloud, in order to bind itself with the gateway, the user equipment needs to search the gateway according to the UDP packet broadcast by the gateway at this time in order to search the gateway in a hidden state. And further accessing the gateway and sending the first ID information to the gateway.
S120, storing the received first ID information as the binding ID of the current gateway, setting the searching state of the current gateway to be a hidden state, and stopping broadcasting the UDP packet by the gateway under the hidden state.
The user equipment can connect with the gateway through the APP on the equipment and send the first ID information. And when the first ID information is sent to the gateway, a corresponding setting instruction needs to be attached to inform the gateway to store the first ID information. Further, after receiving the first ID information, the gateway stores the first ID information as a binding ID according to a setting instruction of the user equipment, indicating 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 public 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 a hidden state, the gateway does not broadcast the UDP packet any more, and avoids being searched by other devices, thereby reducing the potential safety hazard of gateway access and improving the security of local area network usage.
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 so, replying the search request.
Thereafter, when the user equipment needs to search for an access gateway, the gateway is searched by broadcasting a search request. In order to facilitate the ID information comparison of the gateway, 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 right. For the gateway side, the search request broadcast 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 binding ID stored in advance. It can be understood that, if the search request includes the sequence information of the corresponding binding ID, the device sending the search request is considered as the user device corresponding to the binding ID, and a preset binding relationship exists between the device and the gateway, and at this time, the gateway replies to the search request. Otherwise, the current user equipment and the gateway are not considered to have a preset binding relationship, and the gateway ignores the search request.
Specifically, referring to fig. 2, the search request determination process 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.
And the gateway analyzes the search request based on the received search request and extracts the ID sequence string contained in the search request. Further by extracting a pre-stored binding ID to be aligned with this ID sequence string. If the two are corresponding, it indicates that the user equipment sending the search request is 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 strings, it is sufficient to directly compare whether the binding ID is consistent with the ID sequence string. 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. By encrypting the ID sequence string, the situations that the ID information is leaked due to network attack and the like can be avoided, and the security of gateway search access is guaranteed.
However, since the ID sequence string is encrypted by using an encryption algorithm, it cannot be directly determined whether the ID sequence string is identical to the binding ID when the ID sequence string is compared. Therefore, after the ID sequence string is extracted, the binding ID is synchronously extracted and encrypted, and the encrypted binding ID is compared with the ID sequence string. Referring to fig. 3, the binding ID comparison process 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 the search request is parsed and the ID sequence string is extracted, 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 the search request. It should be noted that the encryption algorithm needs to be configured in the gateway in advance, and specifically, the encryption algorithm may be configured by synchronously sending the encryption algorithm to the gateway when the user equipment sends the first ID information. Or the encryption algorithm can be directly configured when the gateway leaves a factory, and the same encryption algorithm can be configured for the subsequent corresponding user equipment APP. Thus, the first ID information after the encryption of the two is ensured to be 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 the user equipment sends a search request, the first ID information is extracted and encrypted to generate an ID sequence string. Through the encryption algorithm, the first ID information is firstly inverted front and back, and an asymmetric algorithm is used for encryption on the basis of the information after front and back inversion to obtain an ID sequence string. The asymmetric encryption algorithm has two keys: public keys (public keys for short) and private keys (private keys for short). The public key and the private key are a pair, and if data is encrypted by the public key, the data can be decrypted only by the corresponding private key. This algorithm is called asymmetric encryption algorithm because two different keys are used for encryption and decryption. It should be noted that, in the embodiment of the present application, the ID sequence string obtained by encryption based on the asymmetric encryption algorithm does not directly adopt a manner of decrypting the ID sequence string to extract the first ID information when performing subsequent comparison with the binding ID. Instead, the binding ID is encrypted by the same encryption algorithm by extracting the binding ID stored in advance, and then the binding ID is compared with the ID sequence string. That is, when the asymmetric encryption algorithm is used for encryption, only one of the public key and the private key is used for encryption. It is understood that when the ID sequence string and the binding ID are not encrypted, the substantial content thereof is the first ID information. Therefore, after the encryption is performed by using the same encryption algorithm, the information sequences of the two should be consistent, so that the search request can be judged.
In some embodiments, after the user equipment encrypts the obtained ID sequence string by using the asymmetric encryption algorithm, for 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 so as to judge the search request. The above encryption transmission and comparison method for the first ID information is only one implementation method implemented in the present application, and in practical applications, a plurality of different encryption algorithms may also be used to encrypt the information.
And finally, if the search request is determined to be from the corresponding user equipment of the binding ID based on the search request judgment, replying the search request. Based on this reply, the user equipment can authenticate the gateway connection or even directly access the gateway. When the search request is determined not to come from the corresponding user equipment of the binding ID, the search request does not need to be replied, and one end of the gateway discards the search request without processing.
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, compares the binding ID with the ID sequence string, and judges the gateway search request. By replacing the encryption algorithm, the security of local area network access can be further improved, and the situations that data is stolen and lost due to the fact that the encryption algorithm is cracked are 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 may 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. And after receiving the instruction, the gateway responds to the instruction and adds or replaces the binding ID based on the second ID information. For example, in a home local area network, when a new device accesses a gateway, second ID information is created by a user device, the second ID information is sent to the new device and the gateway, and the gateway regenerates a binding ID based on the second ID information for storage. And the subsequent newly added equipment broadcasts a search request, attaches an ID sequence string corresponding to the second ID information to the search request, and the gateway compares the ID sequence string based on the newly generated binding ID, so that the search authority of the newly added equipment can be identified and the search request is replied. By adding or replacing the binding ID, the user can conveniently manage the equipment accessed to the local area network, so that the local area network has higher security.
In one embodiment, when the user needs to delete the binding ID, replace the lan ue, or restore the gateway to the public state, the reset operation of the gateway search state is triggered by pressing a reset key on the gateway after the user presses the reset key for a set time. And at the moment, the gateway responds to the reset operation of the current gateway searching state, deletes the binding ID, exits the hidden state and recovers 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 can be used for comparing the search request. And, at this moment, the gateway broadcasts the UDP packet, and each device can search the gateway based on the UDP packet, so that the rebinding of the user equipment can be facilitated.
In one embodiment, the user equipment and the gateway may also communicate via a specified communication protocol. It is understood that, in the home lan, in order to avoid the gateway being easily searched, the gateway does not broadcast the UDP packet using the general communication protocol but broadcasts the UDP packet using the specified communication protocol when performing the UDP packet broadcasting. The corresponding user equipment requires to use a corresponding communication protocol to be able to receive the UDP packet and search for the gateway. Therefore, the equipment for searching the gateway can be reduced, and the gateway is prevented from being easily searched and operated. However, the number of devices using the specified communication protocol is relatively large, and in the home lan, in order to ensure the specificity and security of the lan and avoid other devices using the same communication protocol from operating the gateway, the gateway search is performed by the gateway search method in steps S110 to S130, so as to ensure the security and specificity of the lan.
On the basis of the foregoing embodiment, an embodiment of the present application further provides another gateway search method, and with reference to fig. 4, the gateway search method includes:
s210, device ID registration is performed in advance, and first ID information distributed by a cloud is received;
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 being stored as 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 comparison of the binding ID and the search request, and connecting the gateway based on the reply.
The gateway searching method is executed by the user equipment, and the technical effects of the steps S110 to S130 can be achieved, which are not described herein again.
Specifically, referring to fig. 5, a flowchart of searching for a gateway by a ue is provided, as shown in fig. 5, in an initial state, the gateway is in an open state, and broadcasts a UDP packet to facilitate ue searching, and further performs binding of the first ID information. For the user equipment, first ID information needs to be acquired by registering the equipment ID, so as to subsequently set the binding ID of the gateway and send a search request. And after the user equipment acquires the first ID information, returning the first ID information to the gateway according to the UDP packet broadcast by the gateway, setting a binding ID by the gateway based on the first ID information, and setting the self searching state as a hidden state. And then, comparing the self binding ID according to the search request broadcast by the user equipment, and further replying the search request. And the user equipment searches the gateway based on the reply of the gateway and is connected with the gateway, so that the access of the local area network is completed.
In the above, by broadcasting the UDP packet, receiving first ID information returned by the user equipment based on the UDP packet, storing the received first ID information as the binding ID of the current gateway, setting the search state of the current gateway to a hidden state, and in the hidden state, the gateway stops broadcasting the UDP packet. 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 the search request. By adopting the technical means, the gateway can be searched by the user equipment correspondingly bound with the 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.
Example two:
on the basis of the foregoing embodiment, fig. 6 is a schematic structural diagram of a gateway search apparatus according to a second embodiment of the present application. Referring to fig. 6, the gateway search apparatus provided in this embodiment specifically includes: a broadcasting module 21, a setting module 22 and a judging module 23.
The broadcast 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 a current gateway, set a search state of the current gateway to a hidden state, and stop broadcasting a UDP packet by the gateway in the hidden state;
the determining module 23 is configured to receive a search request broadcasted by a user equipment in real time, determine whether the search request includes sequence information corresponding to the binding ID, and if so, reply to the search request.
In the above, by broadcasting the UDP packet, receiving first ID information returned by the user equipment based on the UDP packet, storing the received first ID information as the binding ID of the current gateway, setting the search state of the current gateway to a hidden state, and in the hidden state, the gateway stops broadcasting the UDP packet. 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 the search request. By adopting the technical means, the gateway can be searched by the user equipment correspondingly bound with the 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 apparatus provided in the second embodiment of the present application may be configured to execute the gateway searching method provided in the first embodiment, and has corresponding functions and beneficial effects.
Example three:
an embodiment of the present application provides an electronic device, and with reference to fig. 7, the electronic device includes: a processor 31, a memory 32, a communication module 33, an input device 34, and an 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 can be used for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the gateway searching method (for example, a broadcasting module, a setting module, and a judging module in the gateway searching apparatus) according to any embodiment of the present application. The memory can mainly comprise a program storage area and a data storage area, wherein the program storage area can store an operating system and an application program required by at least one function; the storage data area may store data created according to use of the device, and the like. Further, 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 located remotely from the processor, and these remote memories may be connected to the device over 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 executing software programs, instructions and modules stored in the memory, that is, implements the gateway search method described above.
The input device 34 may be used to receive entered numeric or character information and to generate key signal inputs relating to user settings and function controls of the apparatus. The output device 35 may include a display device such as a display screen.
The electronic device provided by the foregoing can be used to execute the gateway searching method provided by the foregoing first embodiment, and has corresponding functions and advantages.
Example four:
embodiments of the present application also provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform a gateway search method, the gateway search 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 the current gateway, setting the searching state of the current gateway to be 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 the search request.
Storage medium-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.; non-volatile 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 different second 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) that are executable by one or more processors.
Of course, the storage medium provided in the embodiments of the present application contains computer-executable instructions, and the computer-executable instructions are not limited to the gateway search method described above, and may also perform related operations in the gateway search method provided in any embodiments of the present application.
The gateway search apparatus, the storage medium, and the electronic device provided in the foregoing embodiments may execute the gateway search method provided in any embodiment of the present application, and reference may be made to the gateway search method provided in any embodiment of the present application without detailed technical details described in the foregoing embodiments.
The foregoing is considered as illustrative of the preferred embodiments of the invention and the technical principles employed. The present application is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present application has been described in more detail with reference to the above embodiments, the present application is not limited to the above embodiments, and may include 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 (10)

1. 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 the current gateway, setting the searching state of the current gateway to be 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 the search request.
2. The gateway searching method according to claim 1, wherein after saving the received first ID information as a binding ID of a current gateway and setting a searching state of the current gateway to a hidden state, further comprising:
and in response to the reset operation of the current gateway searching state, deleting the binding ID, exiting the hidden state and recovering the broadcast UDP packet.
3. The gateway searching method of claim 1, wherein determining whether the search request includes sequence information corresponding to the binding ID comprises:
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.
4. The gateway searching method according to claim 3, wherein the ID sequence string is generated by encrypting the first ID information by a predefined encryption algorithm;
correspondingly, judging 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.
5. The gateway searching method according to claim 4, wherein the encryption algorithm is used to invert the sequence of the first ID information back and forth and encrypt it by an asymmetric algorithm.
6. The gateway searching method according to 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.
7. A gateway search method, comprising:
device ID registration is carried out in advance, and first ID information distributed by a cloud is received;
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 being stored as a binding ID of the gateway;
when searching the gateway, broadcasting a search request, 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 comparison of the binding ID with the search request, and connecting the gateway based on the reply.
8. A gateway search apparatus, comprising:
the broadcast 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 user equipment in real time, judging whether the search request contains sequence information corresponding to the binding ID, and if so, replying the search request.
9. An electronic device, comprising:
a memory and one or more processors;
the memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the gateway search method of any of claims 1-6.
10. A storage medium containing computer-executable instructions for performing the gateway search method of any of claims 1-6 when executed by a computer processor.
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 true CN112165477A (en) 2021-01-01
CN112165477B 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)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070073894A1 (en) * 2005-09-14 2007-03-29 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
CN104796484A (en) * 2015-04-29 2015-07-22 西安诺瓦电子科技有限公司 Quick search connection method based on display screen control system
US20160119284A1 (en) * 2014-10-28 2016-04-28 Belkin International Inc. Remote grant of network access
CN106550360A (en) * 2015-09-23 2017-03-29 中国电信股份有限公司 WiFi methods of attachment and system
CN109218994A (en) * 2018-09-05 2019-01-15 北京字节跳动网络技术有限公司 Equivalent device Bluetooth communication method and device based on gateway
US20190037378A1 (en) * 2016-03-29 2019-01-31 Huawei Technologies Co., Ltd. Access method, device, and system
CN109348458A (en) * 2018-10-23 2019-02-15 深圳绿米联创科技有限公司 Network connection configuration method, apparatus, electronic equipment and network system
US20200015153A1 (en) * 2017-01-09 2020-01-09 Yun Ding Network Technology (Beijing) Co., Ltd. Method for smart device to access network, mobile terminal, cloud server, device, and system
CN110855535A (en) * 2019-11-14 2020-02-28 深圳市同进共赢科技有限公司 Gateway equipment, home equipment and connection method between gateway equipment and home equipment

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070073894A1 (en) * 2005-09-14 2007-03-29 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
US20160119284A1 (en) * 2014-10-28 2016-04-28 Belkin International Inc. Remote grant of network access
CN104796484A (en) * 2015-04-29 2015-07-22 西安诺瓦电子科技有限公司 Quick search connection method based on display screen control system
CN106550360A (en) * 2015-09-23 2017-03-29 中国电信股份有限公司 WiFi methods of attachment and system
US20190037378A1 (en) * 2016-03-29 2019-01-31 Huawei Technologies Co., Ltd. Access method, device, and system
US20200015153A1 (en) * 2017-01-09 2020-01-09 Yun Ding Network Technology (Beijing) Co., Ltd. Method for smart device to access network, mobile terminal, cloud server, device, and system
CN109218994A (en) * 2018-09-05 2019-01-15 北京字节跳动网络技术有限公司 Equivalent device Bluetooth communication method and device based on gateway
CN109348458A (en) * 2018-10-23 2019-02-15 深圳绿米联创科技有限公司 Network connection configuration method, apparatus, 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
CN112165477B (en) 2023-05-02

Similar Documents

Publication Publication Date Title
WO2019062666A1 (en) System, method, and apparatus for securely accessing internal network
JP2020080530A (en) Data processing method, device, terminal, and access point computer
US20080282081A1 (en) Mutually authenticated secure channel
CN112333213B (en) Privacy protection method and device for business data of power Internet of things
CN107979615B (en) Message encryption sending and authentication method, device, client and firewall
CN112333212B (en) Encryption management method and device for business data of power Internet of things
CN110933484A (en) Management method and device of wireless screen projection equipment
CN113347072B (en) VPN resource access method, device, electronic equipment and medium
CN113225352B (en) Data transmission method and device, electronic equipment and storage medium
CN108664395A (en) Applied program testing method, device, equipment and storage medium
CN112769868A (en) Communication method, communication device, electronic device and storage medium
CN109391686A (en) The processing method and CDN node server of access request
CN113316149A (en) Identity security authentication method, device, system, wireless access point and medium
CN106537962B (en) Wireless network configuration, access and access method, device and equipment
WO2014205703A1 (en) Method and device for detecting shared access, and terminal device
CN112165477B (en) Gateway searching method and device, electronic equipment and storage medium
KR101060688B1 (en) Wireless instant messenger system and service security methods
CN114221822B (en) Distribution network method, gateway device and computer readable storage medium
WO2014201783A1 (en) Encryption and authentication method, system and terminal for ad hoc network
CN113839958B (en) Communication encryption method, device, control system and storage medium for smart home
WO2016161772A1 (en) Frequency range locking method, device and system
CN108769989B (en) Wireless network connection method, wireless access device and equipment
CN201663659U (en) Front end of conditional access system and scriber management system
JP6718466B2 (en) Dynamic data encryption method and related method for controlling decryption right
CN117061115B (en) Key negotiation method, key negotiation apparatus, computer device, and computer-readable 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