CN109361682B - Communication method, device, equipment and storage medium - Google Patents
Communication method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN109361682B CN109361682B CN201811341908.3A CN201811341908A CN109361682B CN 109361682 B CN109361682 B CN 109361682B CN 201811341908 A CN201811341908 A CN 201811341908A CN 109361682 B CN109361682 B CN 109361682B
- Authority
- CN
- China
- Prior art keywords
- equipment
- mac address
- connection
- connection password
- password
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04B—TRANSMISSION
- H04B3/00—Line transmission systems
- H04B3/54—Systems for transmission via power distribution lines
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5069—Address allocation for group communication, multicast communication or broadcast communication
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/08—Network architectures or network communication protocols for network security for authentication of entities
- H04L63/0876—Network 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/12—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L2101/00—Indexing scheme associated with group H04L61/00
- H04L2101/60—Types of network addresses
- H04L2101/618—Details of network addresses
- H04L2101/622—Layer-2 addresses, e.g. medium access control [MAC] addresses
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Power Engineering (AREA)
- Computing Systems (AREA)
- Medical Informatics (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- General Engineering & Computer Science (AREA)
- Mobile Radio Communication Systems (AREA)
- Small-Scale Networks (AREA)
Abstract
The embodiment of the invention provides a communication method, a communication device, communication equipment and a storage medium, wherein the method comprises the following steps: the method comprises the steps that a first device detects whether a signal which is sent by other devices and requests connection is received; if not, the first equipment broadcasts the MAC address of the first equipment and serves as the main equipment; the first equipment receives the MAC address of the second equipment sent by the second equipment, and generates a first connection password based on the MAC address of the first equipment and the MAC address of the second equipment; the second device is a first device which receives the MAC address broadcast by the first device; the first device receives a second connection password sent by the second device, establishes connection with the second device based on the first connection password and the second connection password, and stops broadcasting the MAC address of the first device to other devices, wherein the second connection password is generated by the second device based on the MAC address of the second device and the MAC address of the first device, so that interference can be reduced, the problem of reduction of network bandwidth is avoided, and the stable reliability of communication is ensured.
Description
Technical Field
Embodiments of the present invention relate to communications technologies, and in particular, to a communication method, apparatus, device, and storage medium.
Background
At present, under the power line communication protocol, two forms of networks can be constructed. One is an open network: all the power line devices meeting the common protocol can join the network, and devices already in communication frequently detect other surrounding power line devices and send or receive connection requests, and then share bandwidth, so that original communication becomes unstable.
In another encryption mode, a user sets two power line devices for communication to the same password, so that a private network can be formed, which reduces interference to a great extent, but the following problems still exist: 1) manual encryption is needed for users, operation is needed on power line equipment of both sides, and the process is complex; 2) the possibility that other surrounding devices set the same password cannot be avoided, so that other devices can join the private network, thereby causing interference and ultimately reducing the bandwidth.
Disclosure of Invention
Embodiments of the present invention provide a communication method, apparatus, device, and storage medium, which have a simple communication method, can reduce interference, avoid the problem of network bandwidth reduction, and ensure stable reliability of communication.
In a first aspect, an embodiment of the present invention provides a communication method, including:
the method comprises the steps that a first device detects whether a signal which is sent by other devices and requests connection is received;
if not, the first equipment broadcasts the MAC address of the first equipment and serves as the main equipment;
the first equipment receives the MAC address of the second equipment sent by the second equipment, and generates a first connection password based on the MAC address of the first equipment and the MAC address of the second equipment; the second device is a first device which receives the MAC address broadcast by the first device;
the first device receives a second connection password sent by the second device, establishes connection with the second device based on the first connection password and the second connection password, and stops broadcasting the MAC address of the first device to other devices, wherein the second connection password is generated by the second device based on the MAC address of the second device and the MAC address of the first device.
In a second aspect, an embodiment of the present invention further provides a communication method, including:
the second equipment receives the MAC address broadcasted by the first equipment and serves as slave equipment; the second device is a first device for receiving the MAC address broadcast by the first device;
the second device transmits the MAC address of the second device back to the first device based on the received MAC address;
the second device generates a second connection password based on the MAC address of the second device and the received MAC address, and sends the second connection password to the first device, so that the first device establishes connection with the second device based on the second connection password and the first connection password; the first connection password is generated by the first device based on the MAC address of the first device and the MAC address of the second device;
when the second device establishes connection with the first device, the second device stops receiving signals which are sent by other devices and request connection.
In a third aspect, an embodiment of the present invention provides a communication method, including:
the method comprises the steps that a first device detects whether a signal which is sent by other devices and requests connection is received;
if not, the first equipment broadcasts the MAC address of the first equipment and serves as the main equipment; the second equipment receives the MAC address broadcasted by the first equipment and serves as slave equipment; the second device is a first device for receiving the MAC address broadcast by the first device;
the second device transmits the MAC address of the second device back to the first device based on the received MAC address, and generates a second connection password based on the MAC address of the second device and the received MAC address;
the first device receives the MAC address of the second device sent by the second device, and generates a first connection password based on the MAC address of the first device and the MAC address of the second device;
the second device sends the second connection password to the first device;
the first equipment receives a second connection password sent by the second equipment, establishes connection with the second equipment based on the first connection password and the second connection password, and stops broadcasting own MAC address to other equipment;
when the second device establishes connection with the first device, the second device stops receiving signals which are sent by other devices and request connection.
In a fourth aspect, an embodiment of the present invention further provides a communication apparatus, including:
the detection module is used for detecting whether a signal which is sent by other equipment and requests connection is received;
the broadcasting module is used for broadcasting the MAC address of the broadcasting module if the MAC address is not the main device;
the password generation module is used for receiving the MAC address of the second equipment sent by the second equipment by the first equipment and generating a first connection password based on the MAC address of the first equipment and the MAC address of the second equipment; the second device is a first device which receives the MAC address broadcasted by the broadcasting module;
and the connection module is used for receiving a second connection password sent by the second equipment, establishing connection with the second equipment based on the first connection password and the second connection password, and stopping broadcasting the MAC address of the connection module to other equipment.
In a fifth aspect, an embodiment of the present invention provides a communication apparatus, including:
the receiving module is used for receiving the MAC address broadcasted by the first equipment and is used as slave equipment;
a return module, configured to return, by the second device, the MAC address of the second device to the first device based on the received MAC address;
the password generation module is used for generating a second connection password based on the MAC address of the password generation module and the received MAC address and sending the second connection password to the first equipment so as to enable the first equipment to establish connection with the second equipment based on the second connection password and the first connection password; the first connection password is generated by the first device based on the MAC address of the first device and the MAC address of the second device;
and the stopping module is used for stopping receiving the signals which are sent by other equipment and request for connection when the connection is established with the first equipment.
In a sixth aspect, an embodiment of the present invention provides an apparatus, including:
one or more processors;
a memory for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement a communication method provided by the embodiments of the present invention.
In a seventh aspect, the embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor, and the communication method provided by the embodiment of the present invention is provided.
According to the technical scheme provided by the embodiment of the invention, the first equipment generates the first connection password based on the MAC address of the first equipment and the MAC address of the second equipment, the second equipment generates the second connection password based on the MAC address of the first equipment and the MAC address of the main equipment, the first equipment establishes connection with the second equipment based on the first connection password and the second connection password, the password can be automatically generated, the using process is simple, the risk of password input errors is avoided, and the connection password is generated based on the MAC addresses of the two parts, so that the interference of other equipment is avoided; when the first device and the second device establish connection, the first device stops broadcasting the MAC address of the first device, and the second device rejects signals which are sent by other devices and request for connection, so that stable and reliable communication can be ensured.
Drawings
Fig. 1 is a flowchart of a communication method according to an embodiment of the present invention;
fig. 2 is a flowchart of a communication method according to an embodiment of the present invention;
fig. 3a is a flowchart of a communication method according to an embodiment of the present invention;
FIG. 3b is an interaction diagram of a first device and a second device provided by an embodiment of the invention;
fig. 3c is a schematic diagram illustrating that the first device and the second device establish a connection according to an embodiment of the present invention;
fig. 4 is a block diagram of a communication device according to an embodiment of the present invention;
fig. 5 is a block diagram of a communication device according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Fig. 1 is a flowchart of a communication method provided by an embodiment of the present invention, where the method is performed by a communication apparatus, the apparatus is implemented by software and/or hardware, the apparatus may be integrated in a power line device, and the method may be applied in a scenario where devices in a network communicate with each other.
As shown in fig. 1, the technical solution provided by the embodiment of the present invention includes:
s110: the first device detects whether a signal requesting connection sent by the other device is received.
In an embodiment of the present invention, the first device may be a power line device. After the first device is powered on, whether a signal requesting connection sent by other devices is received or not can be detected. Wherein the signal requesting connection carries the MAC address of the other device. Wherein the other device is a device other than the first device.
It should be noted that each device sends a connection request signal carrying the MAC address of the device.
S120: if not, the first device broadcasts the MAC address of the first device and serves as the main device.
In the embodiment of the present invention, if the first device does not receive the signal requesting connection sent by the other device, the MAC address of the first device is broadcasted to establish a communication connection with one of the other devices, and the first device may serve as a master device.
S130: the first equipment receives the MAC address of the second equipment sent by the second equipment, and generates a first connection password based on the MAC address of the first equipment and the MAC address of the second equipment; and the second equipment is the first equipment which receives the MAC address broadcasted by the first equipment.
In the embodiment of the present invention, a first device broadcasts its MAC address, and when a first device, that is, a second device, that receives the MAC address broadcasted by the first device, the first device sends its MAC address to the first device based on the received MAC address of the first device.
The first device receives the MAC address of the second device sent by the second device, and generates a first connection password based on the MAC address of the first device and the MAC address of the second device, wherein the first connection password is generated by the first device.
S140, the first device receives a second connection password sent by the second device, establishes connection with the second device based on the first connection password and the second connection password, and stops broadcasting the MAC address of the first device to other devices.
Wherein the second connection password is generated by the second device based on its own MAC address and the MAC address of the first device.
In an implementation manner in the embodiment of the present invention, optionally, the receiving, by the first device, a second connection password sent by the second device, and establishing a connection with the second device based on the first connection password and the second connection password may include: the first equipment sends an authentication message to the second equipment, wherein the authentication message carries the first connection password; the verification message is used for indicating the second equipment to send a feedback message to the first equipment when the first connection password is judged to be matched with the second connection password; the first equipment receives a feedback message sent by the second equipment; wherein the feedback message carries the second connection password; and if the first equipment judges that the first connection password generated by the first equipment is matched with the second connection password carried in the feedback message, the first equipment establishes connection with the second equipment.
Wherein the second device is a power line device. When the first device generates the first connection password, the first device sends an authentication message to the second device, wherein the authentication message carries the first connection password. And the second equipment receives the first connection password, matches the first connection password with a second connection password generated by the second equipment, and sends a feedback message to the first equipment when the second equipment judges that the first connection password is the same as the second connection password, wherein the feedback message carries the second connection password. And the first equipment receives the second connection password, and when the first equipment judges that the second connection password is the same as the first connection password, the first equipment establishes connection with the second equipment.
When the first device and the second device establish connection, the broadcast of the MAC address of the first device may be stopped, and the reception of a signal requesting connection sent by another device may be rejected.
The method for generating the first connection password by the first device is the same as the method for generating the second connection password by the second device. The method for generating the first connection password by the first device may have various forms, for example, the first device may combine its own MAC address with the MAC address of the second device to form the first connection password, or the first device may combine its own MAC address with the MAC address of the second device and add a set character to form the first connection password, or may have other forms. The second device generates the second connection password in the same manner as the first device forms the connection password, so the first connection password generated by the first device is finally the same as the second connection password generated by the second device.
At present, under the power line communication protocol, two forms of networks can be constructed. One is an open network: all the power line devices meeting the common protocol can join the network, and devices already in communication frequently detect other surrounding power line devices and send or receive connection requests, and then share bandwidth, so that original communication becomes unstable. In another encryption mode, a user sets two power line devices for communication to the same password, so that a private network can be formed, which reduces interference to a great extent, but the following problems still exist: 1) manual encryption is needed for users, operation is needed on power line equipment of both sides, and the process is complex; 2) the possibility that other surrounding devices set the same password cannot be avoided, so that other devices can also join the private network, thereby causing interference, and 3) the devices and the frequency detection device detect signals of other surrounding devices, and if the devices with the same password are considered to be sent out by the same network or respond to a connection request, the bandwidth is finally reduced.
In this embodiment, the first device generates a first connection password based on its own MAC address and the MAC address of the second device, and receives a second connection password generated based on the MAC address of the second device and the MAC address of the first device and sent by the second device, and the first device is connected to the second device based on the first connection password and the second connection password, so that the password can be automatically generated, manual setting is not required, the use is convenient, the operation is simple, the connection can be performed based on the unique connection password, and the occurrence of network interference of the same name is avoided; when the first device and the second device are connected, the MAC address of the first device and the MAC address of the second device are stopped being broadcasted to other devices, so that the connection with other devices can be avoided, the problems of communication interference and throughput attenuation are avoided, and the stability and reliability of communication are ensured.
On the basis of the above embodiment, when the first device is disconnected from the second device, the first device rejects to receive a signal requesting connection sent by another device, and when the first device is reconnected to the second device, the first device continues to communicate with the second device. The disconnection of the first device and the second device may be a case where both the first device and the second device are in a powered-on state but communication is interrupted. Therefore, when the first device is disconnected from the second device, the first device refuses to receive signals which are sent by other devices and request for connection, when the first device is reconnected with the second device, the first device continues to communicate with the second device, the first device can keep the original connection password and cannot be connected with other devices, and when the first device is reconnected with the second device, the first device continues to communicate, the connection process can be avoided being redetected, the connection time is saved, the interference can be greatly reduced, and the stability and the reliability of communication are guaranteed.
Fig. 2 is a flowchart of a communication method provided by an embodiment of the present invention, where the method is performed by a communication apparatus, the apparatus is implemented by software and/or hardware, the apparatus may be integrated in a power line device, and the method may be applied in a scenario where devices in a network communicate with each other.
As shown in fig. 2, the technical solution provided by the embodiment of the present invention includes:
s210: the second equipment receives the MAC address broadcasted by the first equipment and serves as slave equipment; and the second equipment is the first equipment for receiving the MAC address broadcasted by the first equipment.
In the embodiment of the present invention, if the first device does not receive the signal requesting connection sent by the other device, the MAC address of the first device is broadcasted to establish a communication connection with one of the other devices, and the first device may serve as a master device, and the second device may receive the MAC address broadcasted by the first device. Wherein the signal requesting the connection carries the MAC address of the device sending the signal.
S220: and the second equipment transmits the MAC address of the second equipment back to the first equipment based on the received MAC address.
In the embodiment of the invention, the second device sends the MAC address of the second device to the first device according to the MAC address of the first device. Specifically, the second device may send the MAC address of the second device to the MAC address of the first device, so as to send the MAC address of the second device to the first device.
S230: the second device generates a second connection password based on the MAC address of the second device and the received MAC address, and sends the second connection password to the first device, so that the first device establishes connection with the second device based on the second connection password and the first connection password; the first connection password is generated by the first device based on the MAC address of the first device and the MAC address of the second device.
And the method for generating the first connection password by the second device is the same as the method for generating the second connection password by the first device. The method for generating the second connection password by the second device may have various forms, for example, the MAC address of the first device of the second device may be combined with the MAC address of the second device to form the second connection password, or the second device may be configured to combine the MAC address of the first device with the MAC address of the second device and add the set characters to form the second connection password, or may also have other forms, where the manner for generating the second connection password by the second device is the same as the manner for forming the connection password by the first device, so that the second connection password finally generated by the second device is the same as the first connection password generated by the first device.
In the embodiment of the invention, when the first device generates the first connection password, the first device sends the verification message to the second device, wherein the verification message carries the first connection password. And the second equipment receives the first connection password, matches the first connection password with a second connection password generated by the second equipment, and sends a feedback message to the first equipment when the second equipment judges that the first connection password is the same as the second connection password, wherein the feedback message carries the second connection password. And the first equipment receives the second connection password, and when the first equipment judges that the second connection password is the same as the first connection password, the first equipment establishes connection with the second equipment.
S240: when the second device establishes connection with the first device, the second device stops receiving signals which are sent by other devices and request connection.
In the embodiment of the invention, when the second device establishes connection with the first device, the second device does not receive the connection request signal sent by other devices any more, so that connection with other devices can be avoided, interference of other devices is avoided, and stability and reliability of communication are ensured. When the second device establishes connection with the first device, the second device may stop broadcasting its MAC address, thereby avoiding establishing connection with other devices.
In the communication method provided by the embodiment of the present invention, the second device generates the second connection password based on the MAC of the second device and the MAC of the first device, which can generate a unique connection password to avoid interference of other devices.
Fig. 3a is a flowchart of a communication method according to an embodiment of the present invention, and as shown in fig. 3a, a technical solution according to an embodiment of the present invention includes:
s310: the first device detects whether a signal requesting connection sent by the other device is received.
S320: if not, the first device broadcasts the MAC address of the first device and serves as the main device.
S330: the second equipment receives the MAC address broadcasted by the first equipment and serves as slave equipment; and the second equipment is the first equipment for receiving the MAC address broadcasted by the first equipment.
S340: the second device transmits the MAC address of the second device back to the first device based on the received MAC address, and generates a second connection password based on the MAC address of the second device and the received MAC address;
s350: and the first equipment receives the MAC address of the second equipment sent by the second equipment, and generates a first connection password based on the MAC address of the first equipment and the MAC address of the second equipment.
S360: and the second equipment sends the second connection password to the first equipment.
S370: and the first equipment receives a second connection password sent by the second equipment, establishes connection with the second equipment based on the first connection password and the second connection password, and stops broadcasting the MAC address of the first equipment to other equipment.
S380: when the second device establishes connection with the first device, the second device stops receiving signals which are sent by other devices and request connection.
In the embodiment of the present invention, for example, as shown in fig. 3b, the first device broadcasts its MAC address a, the second device receives the MAC address of the first device, and may generate the second connection password according to the received MAC address and its MAC address. The second device transmits its own MAC address B back to the first device, and the first device may generate the first connection password according to the MAC address of the second device and its own MAC address. As shown in fig. 3c, the first device may send the first connection password AB to the second device, and the second device may also send the second connection password AB to the second device, so that the first device and the second device perform password matching, respectively, and thus the two devices establish a connection and join the private network.
According to the technical scheme provided by the embodiment of the invention, the first equipment generates the first connection password based on the MAC address of the first equipment and the MAC address of the slave equipment, the second equipment generates the second connection password based on the MAC address of the second equipment and the MAC address of the master equipment, the first equipment establishes connection with the second equipment based on the first connection password and the second connection password, the password can be automatically generated, the using process is simple, the risk of password input errors is avoided, and the connection password is generated based on the MAC addresses of the two parts, so that the interference of other equipment is avoided; when the first device and the second device establish connection, the first device stops broadcasting the MAC address of the first device, and the second device rejects signals which are sent by other devices and request for connection, so that stable and reliable communication can be ensured.
Fig. 4 is a communication apparatus according to an embodiment of the present invention, and as shown in fig. 4, the apparatus according to the embodiment of the present invention includes: a detection module 410, a broadcast module 420, a password generation module 430, and a connection module 440.
The detecting module 410 is configured to detect whether a signal requesting connection sent by another device is received;
the broadcasting module 420 is configured to broadcast the MAC address of the broadcasting module if the MAC address is not the main device;
a password generating module 430, configured to receive, by the first device, a MAC address of the second device sent by the second device, and generate a first connection password based on the MAC address of the first device and the MAC address of the second device; the second device is a first device which receives the MAC address broadcasted by the broadcasting module;
a connection module 440, configured to receive a second connection password sent by the second device, establish a connection with the second device based on the first connection password and the second connection password, and stop broadcasting its MAC address to other devices, where the second connection password is generated by the second device based on its MAC address and the MAC address of the first device.
Optionally, the apparatus further includes a rejecting module, configured to reject to receive a signal requesting connection sent by another device when the first device is disconnected from the second device.
Optionally, the connection module 440 is further configured to continue to communicate with the second device when the second device is reconnected.
Optionally, the connection module 440 is configured to send an authentication message to the second device, where the authentication message carries the first connection password; the verification message is used for indicating the second equipment to send a feedback message to the connection module when the first connection password is judged to be matched with the second connection password; wherein the second connection password is generated by the second device based on its own MAC address and the MAC address of the first device;
receiving a feedback message sent by the second equipment; wherein the feedback message carries the second connection password;
and if the first connection password generated by the user is judged to be matched with the second connection password carried in the feedback message, establishing connection with the second equipment.
The device can execute the method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Fig. 5 is a block diagram of a communication device according to an embodiment of the present invention, and as shown in fig. 5, the communication device includes a receiving module 510, a returning module 520, a password generating module 530, and a stopping module 540.
A receiving module 510, configured to receive a MAC address broadcast by a first device and serve as a slave device;
a returning module 520, configured to return, by the second device, the MAC address of the second device to the first device based on the received MAC address;
a password generating module 530, configured to generate a second connection password based on the MAC address of the first device and the received MAC address, and send the second connection password to the first device, so that the first device establishes a connection with the second device based on the second connection password and the first connection password; the first connection password is generated by the first device based on the MAC address of the first device and the MAC address of the second device;
a stopping module 540, configured to stop receiving a signal requesting connection sent by another device when connection is established with the first device.
The device can execute the method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Fig. 6 is a schematic structural diagram of an apparatus provided in an embodiment of the present invention, and as shown in fig. 6, the apparatus includes:
one or more processors 610, one processor 610 being exemplified in fig. 6;
a memory 620;
the apparatus may further include: an input device 630 and an output device 640.
The processor 610, the memory 620, the input device 630 and the output device 640 of the apparatus may be connected by a bus or other means, and fig. 6 illustrates the example of connection by a bus.
The memory 620, which is a non-transitory computer-readable storage medium, may be used to store software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to a communication method in the embodiments of the present invention (for example, the detection module 410, the broadcast module 420, the password generation module 430, and the connection module 440 shown in fig. 4, or the reception module 510, the feedback module 520, the password generation module 530, and the stop module 540 shown in fig. 5). The processor 610 executes various functional applications and data processing of the computer device by executing software programs, instructions and modules stored in the memory 620, namely, a communication method for implementing the above method embodiments, namely:
detecting whether a signal which is sent by other equipment and requests connection is received;
if not, broadcasting the MAC address of the user, and using the MAC address as main equipment;
receiving an MAC address of second equipment sent by the second equipment, and generating a first connection password based on the MAC address of the second equipment and the MAC address of the second equipment; the second device is a first device which receives the broadcasted MAC address;
and receiving a second connection password sent by the second device, establishing connection with the second device based on the first connection password and the second connection password, and stopping broadcasting the MAC address of the second device to other devices, wherein the second connection password is generated by the second device based on the MAC address of the second device and the MAC address of the first device.
Or;
receiving the MAC address broadcasted by the first equipment and using the MAC address as slave equipment; the second device is a first device for receiving the MAC address broadcast by the first device;
returning the MAC address of the first device to the first device based on the received MAC address;
generating a second connection password based on the MAC address of the first device and the received MAC address, and sending the second connection password to the first device so that the first device establishes connection with the second device based on the second connection password and the first connection password; the first connection password is generated by the first device based on the MAC address of the first device and the MAC address of the second device;
and when the connection is established with the first equipment, stopping receiving signals which are sent by other equipment and request for connection.
The memory 620 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the computer device, and the like. Further, the memory 620 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 620 optionally includes memory located remotely from processor 610, which may be connected to the terminal device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input means 630 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the computer apparatus. The output device 640 may include a display device such as a display screen.
An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a file processing method according to an embodiment of the present invention:
detecting whether a signal which is sent by other equipment and requests connection is received;
if not, broadcasting the MAC address of the user, and using the MAC address as main equipment;
receiving an MAC address of second equipment sent by the second equipment, and generating a first connection password based on the MAC address of the second equipment and the MAC address of the second equipment; the second device is a first device which receives the broadcasted MAC address;
and receiving a second connection password sent by the second device, establishing connection with the second device based on the first connection password and the second connection password, and stopping broadcasting the MAC address of the second device to other devices, wherein the second connection password is generated by the second device based on the MAC address of the second device and the MAC address of the first device.
Or;
receiving the MAC address broadcasted by the first equipment and using the MAC address as slave equipment; the second device is a first device for receiving the MAC address broadcast by the first device;
returning the MAC address of the first device to the first device based on the received MAC address;
generating a second connection password based on the MAC address of the first device and the received MAC address, and sending the second connection password to the first device so that the first device establishes connection with the second device based on the second connection password and the first connection password; the first connection password is generated by the first device based on the MAC address of the first device and the MAC address of the second device;
and when the connection is established with the first equipment, stopping receiving signals which are sent by other equipment and request for connection.
Any combination of one or more computer-readable media may be employed. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention 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 invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims (7)
1. A method of communication, comprising:
the method comprises the steps that a first device detects whether a signal which is sent by other devices and requests connection is received;
if not, the first equipment broadcasts the MAC address of the first equipment and serves as the main equipment;
the first equipment receives the MAC address of the second equipment sent by the second equipment, and generates a first connection password based on the MAC address of the first equipment and the MAC address of the second equipment; the second device is a first device which receives the MAC address broadcast by the first device;
the first device receives a second connection password sent by the second device, establishes connection with the second device based on the first connection password and the second connection password, and stops broadcasting own MAC address to other devices, wherein the second connection password is generated by the second device based on own MAC address and the MAC address of the first device;
wherein, the first device receives a second connection password sent by the second device, and establishes a connection with the second device based on the first connection password and the second connection password, including:
the first equipment sends an authentication message to the second equipment, wherein the authentication message carries the first connection password; the verification message is used for indicating the second equipment to send a feedback message to the first equipment when the first connection password is judged to be matched with the second connection password;
the first equipment receives a feedback message sent by the second equipment; wherein the feedback message carries the second connection password;
and if the first equipment judges that the first connection password generated by the first equipment is matched with the second connection password carried in the feedback message, the first equipment establishes connection with the second equipment.
2. The method of claim 1, further comprising:
when the first equipment is disconnected from the second equipment, the first equipment refuses to receive signals which are sent by other equipment and request connection.
3. The method of claim 2, further comprising:
when the first device reconnects with the second device, the first device continues to communicate with the second device.
4. A method of communication, comprising:
the method comprises the steps that a first device detects whether a signal which is sent by other devices and requests connection is received;
if not, the first equipment broadcasts the MAC address of the first equipment and serves as the main equipment;
the second equipment receives the MAC address broadcasted by the first equipment and serves as slave equipment; the second device is a first device for receiving the MAC address broadcast by the first device;
the second device transmits the MAC address of the second device back to the first device based on the received MAC address, and generates a second connection password based on the MAC address of the second device and the received MAC address;
the first device receives the MAC address of the second device sent by the second device, and generates a first connection password based on the MAC address of the first device and the MAC address of the second device;
the second device sends the second connection password to the first device;
the first equipment receives a second connection password sent by the second equipment, establishes connection with the second equipment based on the first connection password and the second connection password, and stops broadcasting own MAC address to other equipment;
when the second equipment establishes connection with the first equipment, the second equipment stops receiving signals which are sent by other equipment and request for connection;
wherein, the first device receives a second connection password sent by the second device, and establishes a connection with the second device based on the first connection password and the second connection password, including:
the first equipment sends an authentication message to the second equipment, wherein the authentication message carries the first connection password; the verification message is used for indicating the second equipment to send a feedback message to the first equipment when the first connection password is judged to be matched with the second connection password;
the first equipment receives a feedback message sent by the second equipment; wherein the feedback message carries the second connection password;
and if the first equipment judges that the first connection password generated by the first equipment is matched with the second connection password carried in the feedback message, the first equipment establishes connection with the second equipment.
5. A communications apparatus, comprising:
the detection module is used for detecting whether a signal which is sent by other equipment and requests connection is received;
the broadcasting module is used for broadcasting the MAC address of the broadcasting module if the MAC address is not the main device;
the password generation module is used for receiving the MAC address of the second equipment sent by the second equipment and generating a first connection password based on the MAC address of the password generation module and the MAC address of the second equipment; the second device is a first device which receives the MAC address broadcasted by the broadcasting module;
the connection module is used for receiving a second connection password sent by the second device, establishing connection with the second device based on the first connection password and the second connection password, and stopping broadcasting the MAC address of the second device to other devices, wherein the second connection password is generated by the second device based on the MAC address of the second device and the MAC address of the first device;
wherein, the first device receives a second connection password sent by the second device, and establishes a connection with the second device based on the first connection password and the second connection password, including:
the first equipment sends an authentication message to the second equipment, wherein the authentication message carries the first connection password; the verification message is used for indicating the second equipment to send a feedback message to the first equipment when the first connection password is judged to be matched with the second connection password;
the first equipment receives a feedback message sent by the second equipment; wherein the feedback message carries the second connection password;
and if the first equipment judges that the first connection password generated by the first equipment is matched with the second connection password carried in the feedback message, the first equipment establishes connection with the second equipment.
6. A communication device, comprising:
one or more processors;
a memory for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the communication method of any one of claims 1-3.
7. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the communication method according to any one of claims 1 to 3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811341908.3A CN109361682B (en) | 2018-11-12 | 2018-11-12 | Communication method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811341908.3A CN109361682B (en) | 2018-11-12 | 2018-11-12 | Communication method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109361682A CN109361682A (en) | 2019-02-19 |
CN109361682B true CN109361682B (en) | 2021-06-29 |
Family
ID=65345093
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811341908.3A Active CN109361682B (en) | 2018-11-12 | 2018-11-12 | Communication method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109361682B (en) |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2007213133A (en) * | 2006-02-07 | 2007-08-23 | Fujitsu Ltd | Hardware authentication device |
CN104468626A (en) * | 2014-12-25 | 2015-03-25 | 上海市共进通信技术有限公司 | System and method for achieving wireless authentication encryption of mobile terminal |
CN104684106B (en) * | 2015-02-02 | 2018-04-13 | 上海小蚁科技有限公司 | The method and device of network connection |
CN107466466B (en) * | 2016-11-09 | 2020-05-05 | 国民技术股份有限公司 | Secure communication method, controlled device and equipment, remote control device and equipment |
CN107682202B (en) * | 2017-10-26 | 2021-03-02 | 新华三技术有限公司 | Network equipment management method and device |
-
2018
- 2018-11-12 CN CN201811341908.3A patent/CN109361682B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN109361682A (en) | 2019-02-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111787517A (en) | Method and device for binding activation of intelligent equipment | |
CN107567017B (en) | Wireless connection system, device and method | |
CN110740460A (en) | device network access method, device, network device and storage medium | |
US10863559B2 (en) | Method and apparatus for communicating in a wireless communication network | |
US9319852B2 (en) | Interoperability and communications system dynamic media proxy based on capability negotiation | |
WO2019153722A1 (en) | Terminal communication method and device, terminal and storage medium | |
US11375575B2 (en) | Apparatus and method of performing a group communication | |
CN108966363B (en) | Connection establishing method and device | |
CN115004752A (en) | Perception agent SBP termination method and device, electronic equipment and storage medium | |
US8650313B2 (en) | Endpoint discriminator in network transport protocol startup packets | |
CN112087475B (en) | Message pushing method and device for cloud platform component application and message server | |
US10200849B1 (en) | Systems and methods for auto-pair via a plurality of protocols | |
WO2016029854A1 (en) | Wireless network connection method, device and system | |
CN113014610B (en) | Remote access method, device and system | |
CN109361682B (en) | Communication method, device, equipment and storage medium | |
WO2017032110A1 (en) | Application message processing system and method, and application device | |
CN116962114A (en) | Equipment interconnection method, device, equipment and medium based on distributed soft bus | |
CN116847319A (en) | Device authentication networking method, communication device and readable storage medium | |
CN115883572A (en) | Peripheral sharing method and device | |
CN103188662B (en) | A kind of method and device verifying WAP (wireless access point) | |
US20150229513A1 (en) | Systems and methods for efficient remote security panel configuration and management | |
CN115460562A (en) | Secure and trusted peer-to-peer offline communication system and method | |
WO2022108650A1 (en) | Method for seamlessly recovering a single sign-on password in wi-fi multi-access point device network | |
CN110809329A (en) | Network communication method, device, computer equipment and storage medium | |
CN112995095A (en) | Data processing method, 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 |