CN107995115B - Automatic networking method without master-slave relation - Google Patents

Automatic networking method without master-slave relation Download PDF

Info

Publication number
CN107995115B
CN107995115B CN201610955066.5A CN201610955066A CN107995115B CN 107995115 B CN107995115 B CN 107995115B CN 201610955066 A CN201610955066 A CN 201610955066A CN 107995115 B CN107995115 B CN 107995115B
Authority
CN
China
Prior art keywords
address
sender
receiver
temporary
equipment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610955066.5A
Other languages
Chinese (zh)
Other versions
CN107995115A (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.)
Shenzhen Chunmiao Jingying Technology Co ltd
Original Assignee
Shenzhen Chunmiao Jingying 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 Shenzhen Chunmiao Jingying Technology Co ltd filed Critical Shenzhen Chunmiao Jingying Technology Co ltd
Priority to CN201610955066.5A priority Critical patent/CN107995115B/en
Publication of CN107995115A publication Critical patent/CN107995115A/en
Application granted granted Critical
Publication of CN107995115B publication Critical patent/CN107995115B/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
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L5/00Arrangements affording multiple use of the transmission path
    • H04L5/003Arrangements for allocating sub-channels of the transmission path
    • H04L5/0053Allocation of signaling, i.e. of overhead other than pilot signals
    • H04L5/0055Physical resource allocation for ACK/NACK

Abstract

The invention discloses an automatic networking method without master-slave relation, which comprises seven steps, wherein each device automatically generates a temporary device address after being started, each device sends out a handshake signal, the sender device sends out the handshake signal, the receiver device in a communication range judges the address of the sender device, and if the address of the sender device is the same as that of the receiver device, the receiver device updates the address of the sender device into a device address table of the receiver device, so that the successful handshake between the sender device and the receiver device can be realized, and the sender device can be added into a network of the receiver device; and the sender equipment sends an ACK signal, and after any equipment in the communication range receives the ACK signal, the address of the sender equipment is extracted from the address information of the sender equipment until the handshake between the sender equipment and the receiver equipment is completed, and the in-network communication between the sender equipment and the receiver equipment can be realized after the handshake is completed.

Description

Automatic networking method without master-slave relation
Technical Field
The invention relates to the technical field of communication, in particular to an automatic networking method without a master-slave relationship.
Background
The existing communication networking mode needs one device to manage other sub-devices, and all the sub-devices can only communicate through the device. For example, WIFI requires a WIFI router to assign addresses to each device and perform data exchange, which results in that when there is no such main device, connection communication cannot be performed between the devices, and the sub-devices can only perform networking around the main device. Therefore, the networking mode of the master device and the slave device is too dependent on the master device, and is not flexible and convenient enough.
Disclosure of Invention
Aiming at the defects in the technology, the invention provides an automatic networking method without master-slave relationship, which has the advantages of master-slave-free distribution, flexible networking and convenience.
In order to achieve the above object, the present invention provides an automatic networking method without master-slave relationship, comprising the following steps:
step 1, after each device is started, a temporary device address is automatically generated, each device sends out a handshake signal with self device number information and the temporary device address, and the device sending the handshake signal is used as a sender device;
step 2, after any device in the communication range receives the handshake signal, extracting the temporary device address of the sender device, and taking the device receiving the handshake signal as the receiver device;
step 3, the receiver device judges whether the received temporary device address is the same as the self inherent device address, if not; executing the step 4; if the address of the temporary equipment is the same as the address of the temporary equipment, the receiver equipment does not perform any operation on the address of the sender equipment;
step 4, the receiver device updates the temporary device address of the sender device into the inherent device address table of the receiver device, the sender device and the receiver device successfully handshake, and the sender device is added into the network of the receiver device;
step 5, after the step 4 is finished, the sending party equipment sends an ACK signal;
step 6, after any device in the communication range receives the ACK signal, extracting the temporary device address of the sender device until the handshake is completed;
and 7, after the handshake is finished, performing in-network communication between the sender equipment and the receiver equipment.
Wherein, the step 6 specifically comprises:
step 61, each receiving side device receiving the ACK signal extracts the temporary device address of the sending side from the sending side device and updates the temporary device address to the device address table of the receiving side device;
step 62, the sender device determines whether the device address of the receiver device is the same as the temporary device address of the sender device, and if so, the sender device regenerates a new temporary address and repeats the handshake action until a unique device address is obtained; if not, go to step 63;
step 63, the sender device keeps the previous temporary device address unchanged and repeats the handshake action;
step 64, repeating the handshake action for a plurality of times, and if the device address of the receiver device is not the same as the temporary device address of the sender device, executing step 65; if the device address of the receiver device is the same as the temporary device address of the sender device, go to step 62;
and step 65, converting the temporary device address of the sender device into a formal device address, updating the formal device address into a device address table of the receiver, and finishing handshaking.
Wherein, the step 7 specifically comprises:
step 71, the sender device sends information to the receiver device;
step 72, the sender device finds the address of the receiver device from the sender device address table of the sender device, and if the address of the receiver device does not exist in the sender device address table, the sending operation is terminated; if the address of the receiver device exists in the address table of the sender device, go to step 73;
step 73, the sender device packages the content to be sent and the address of the receiver device into a data packet and sends the data packet out;
step 74, after the device in the network receives the data packet, the device in the network extracts the address information of the sender device in the data packet, if the address in the received data packet is the same as the address of the receiver device, it indicates that the object of sending data by the sender device is the receiver device, and the receiver device informs the sender device that the data has been received; if the address in the received data packet is different from the address of the receiver device, the receiver device does not respond.
In step 74, when the object of the data sent by the sender device is the receiver device, the receiver device processes the data packet sent by the sender device and responds to inform that the sender device that the data is received.
After step 73, if no device in the network receives the data packet, the sender device may continue to send the data packet ten times, and if the device in the network does not receive the data packet after ten times, it indicates that the sender device has been detached from the network of the receiver device, and the receiver device deletes the sender device address of the sender device from the receiver device address table; and if the equipment in the network within ten times successfully receives the information of the sender equipment, responding by the receiver equipment in the network.
In step 1 and step 5, both the form of sending handshake signals and the form of sending ACK signals by the sender device are broadcast.
In step 64, the number of times of repeating the handshake action is twenty.
The invention has the beneficial effects that:
compared with the prior art, the automatic networking method without master-slave relationship of the invention has the advantages that each device automatically generates a temporary device address after being started, each device sends out a handshake signal, the sender device sends out the handshake signal, the receiver device in the communication range judges the address of the sender device, if the address of the sender device is the same as that of the receiver device, the receiver device updates the address of the sender device into the device address table of the receiver device, so that successful handshake between the sender device and the receiver device can be realized, and the sender device can be added into the network of the receiver device; and the sender equipment sends an ACK signal, and after any equipment in the communication range receives the ACK signal, the address of the sender equipment is extracted from the address information of the sender equipment until the handshake between the sender equipment and the receiver equipment is completed, and the in-network communication between the sender equipment and the receiver equipment can be realized after the handshake is completed. The automatic networking method without the master-slave relationship does not need a WIFI router to distribute addresses to all devices, does not have the sub-devices of the master device, and is flexible and convenient to network.
Drawings
FIG. 1 is a block flow diagram of a method for automatic networking without master-slave relationship according to the present invention;
FIG. 2 is a block flow diagram of a specific step 6 in the method for automatic networking without master-slave relationship according to the present invention;
FIG. 3 is a block flow diagram of a specific step 7 of the method for automatic networking without master-slave relationship according to the present invention;
fig. 4 is a schematic view of a communicable network of the master-slave relationship-free automatic networking method of the present invention.
Detailed Description
In order to more clearly describe the present invention, the present invention will be further described with reference to the accompanying drawings.
Referring to fig. 1, the present invention provides an automatic networking method without master-slave relationship, including the following steps:
step S1, after each device is started, a temporary device address is automatically generated, each device sends out a handshake signal with its own device number information and the temporary device address, and the device sending the handshake signal is used as a sender device;
step S2, after any device in the communication range receives the handshake signal, extracting the temporary device address of the sender device, and the device receiving the handshake signal is used as the receiver device;
step S3, the receiver device judges whether the received temporary device address is the same as the own inherent device address, if not; step S4 is executed; if the address of the temporary equipment is the same as the address of the temporary equipment, the receiver equipment does not perform any operation on the address of the sender equipment;
step S4, the receiver device updates the temporary device address of the sender device into the inherent device address table of the receiver device, the sender device and the receiver device successfully handshake, and the sender device has joined the network of the receiver device;
step S5, after completing step S4, the sender device sends an ACK signal;
step S6, after any device in the communication range receives the ACK signal, extracting the temporary device address of the sender device until the handshake is completed;
step S7, after the handshake is completed, the sender device and the receiver device perform intra-network communication.
Compared with the prior art, the automatic networking method without master-slave relationship of the invention has the advantages that each device automatically generates a temporary device address after being started, each device sends out a handshake signal, the sender device sends out the handshake signal, the receiver device in the communication range judges the address of the sender device, if the address of the sender device is the same as that of the receiver device, the receiver device updates the address of the sender device into the device address table of the receiver device, so that successful handshake between the sender device and the receiver device can be realized, and the sender device can be added into the network of the receiver device; and the sender equipment sends an ACK signal, and after any equipment in the communication range receives the ACK signal, the address of the sender equipment is extracted from the address information of the sender equipment until the handshake between the sender equipment and the receiver equipment is completed, and the in-network communication between the sender equipment and the receiver equipment can be realized after the handshake is completed. The automatic networking method without the master-slave relationship does not need a WIFI router to distribute addresses to all devices, does not have the sub-devices of the master device, and is flexible and convenient to network.
Referring to fig. 2, step S6 specifically includes:
step S61, each receiver device receiving the ACK signal extracts the temporary device address of the sender from the sender device and updates the temporary device address to the device address table of the receiver device;
step S62, the sender device judges whether the device address of the receiver device is the same as the temporary device address of the sender device, if so, the sender device regenerates a new temporary address and repeats the handshake action until a unique device address is obtained; if not, go to step S63;
step S63, the sender device keeps the previous temporary device address unchanged and repeats the handshake action;
step S64, repeating the handshake action for a plurality of times, if the device address of the receiver device is not the same as the temporary device address of the sender device, executing step S65; if the device address of the receiver device is the same as the temporary device address of the sender device, step S62 is executed;
step S65, the temporary device address of the sender device is converted into the formal device address, and the device address is updated into the device address table of the receiver, and the handshake is completed.
Referring to fig. 3, step S7 specifically includes:
step S71, the sender device sends information to the receiver device;
step S72, the sender equipment finds the receiver equipment address from the sender equipment address table of the sender equipment, if the receiver equipment address does not exist in the sender equipment address table, the sending operation is terminated; if the address of the receiver device exists in the address table of the sender device, go to step S73;
step S73, the sender device packages the content to be sent and the receiver device address into data packets and sends the data packets out;
step S74, after the device in the network receives the data packet, the device in the network extracts the address information of the sender device in the data packet, if the address in the received data packet is the same as the address of the receiver device, it indicates that the object of the sender device for sending data is the receiver device, and the receiver device informs the sender device that the data has been received; if the address in the received data packet is different from the address of the receiver device, the receiver device does not respond.
In this embodiment, in step S74, when the data transmission object of the sending device is the receiving device, the receiving device processes the data packet sent by the sending device and responds to inform the sending device that the data has been received.
In this embodiment, after step S73, if no device in the network receives the data packet, the sender device may continue to send the data packet ten times, and if the device in the network still does not receive the data packet after ten times, it indicates that the sender device has been detached from the network of the receiver device, and the receiver device deletes the sender device address of the sender device from the receiver device address table; and if the equipment in the network within ten times successfully receives the information of the sender equipment, responding by the receiver equipment in the network.
In this embodiment, in step S1 and step S5, the form in which the sender apparatus sends the handshake signal and the form in which the ACK signal is sent are both broadcast.
In this embodiment, in step S64, the number of times of repeating the handshake operation is twenty. Of course, the number of times of repeating the handshake operation is not limited to twenty times, which is set for a case where there are many devices.
Referring to fig. 4, the devices in this embodiment are A, B, C, D, E, after being powered on, the devices A, B, C, D, E generate a temporary device address respectively, and send out a handshake signal with the device number information and the temporary device address, and the devices A, B, C, D, E all serve as sender devices, and of course, the devices A, B, C, D, E all serve as receiver devices, and have no master-slave division, and are flexible and convenient to network. Of course, the equipment in the present case is not limited to A, B, C, D, E, and may be more equipment.
The above disclosure is only for a few specific embodiments of the present invention, but the present invention is not limited thereto, and any variations that can be made by those skilled in the art are intended to fall within the scope of the present invention.

Claims (6)

1. An automatic networking method without master-slave relationship is characterized by comprising the following steps:
step 1, after each device is started, a temporary device address is automatically generated, each device sends out a handshake signal with self device number information and the temporary device address, and the device sending the handshake signal is used as a sender device;
step 2, after any device in the communication range receives the handshake signal, extracting the temporary device address of the sender device, and taking the device receiving the handshake signal as the receiver device;
step 3, the receiver device judges whether the received temporary device address is the same as the device address of the receiver device, if not; executing the step 4; if the address of the temporary equipment is the same as the address of the temporary equipment, the receiver equipment does not perform any operation on the address of the sender equipment;
step 4, the receiver device updates the temporary device address of the sender device into the device address table of the receiver device, the sender device and the receiver device successfully handshake, and the sender device is already added into the network of the receiver device;
step 5, after the step 4 is finished, the sending party equipment sends an ACK signal;
step 6, after any device in the communication range receives the ACK signal, extracting the temporary device address of the sender device until the handshake is completed;
step 7, after the handshake is completed, the sender equipment and the receiver equipment perform in-network communication;
the step 6 specifically comprises the following steps:
step 61, each receiving side device receiving the ACK signal extracts the temporary device address of the sending side from the sending side device and updates the temporary device address to the device address table of the receiving side device;
step 62, the sender device determines whether the device address of the receiver device is the same as the temporary device address of the sender device, and if so, the sender device regenerates a new temporary address and repeats the handshake action until a unique device address is obtained; if not, go to step 63;
step 63, the sender device keeps the previous temporary device address unchanged and repeats the handshake action;
step 64, repeating the handshake action for a plurality of times, and if the device address of the receiver device is not the same as the temporary device address of the sender device, executing step 65; if the device address of the receiver device is the same as the temporary device address of the sender device, go to step 62;
step 65, the temporary device address of the sender device is converted into the device address, and the device address is updated into the device address table of the receiver, and the handshake is completed.
2. The method for automatic networking without master-slave relationship according to claim 1, wherein the step 7 specifically comprises:
step 71, the sender device sends information to the receiver device;
step 72, the sender device finds the address of the receiver device from the sender device address table of the sender device, and if the address of the receiver device does not exist in the sender device address table, the sending operation is terminated; if the address of the receiver device exists in the address table of the sender device, go to step 73;
step 73, the sender device packages the content to be sent and the address of the receiver device into a data packet and sends the data packet out;
step 74, after the device in the network receives the data packet, the device in the network extracts the address information of the sender device in the data packet, if the address in the received data packet is the same as the address of the receiver device, it indicates that the object of sending data by the sender device is the receiver device, and the receiver device informs the sender device that the data has been received; if the address in the received data packet is different from the address of the receiver device, the receiver device does not respond.
3. The method according to claim 2, wherein in step 74, when the data transmitted by the sender device is the receiver device, the receiver device processes the data packet transmitted by the sender device and responds to inform the sender device that the data has been received.
4. The method according to claim 2, wherein after the step 73, if no device in the network receives the data packet, the sender device continuously sends the data packet ten times, and if after ten times, the device in the network still does not receive the data packet, it indicates that the sender device has been detached from the network of the receiver device, and the receiver device deletes the sender device address of the sender device from the receiver device address table; and if the equipment in the network within ten times successfully receives the information of the sender equipment, responding by the receiver equipment in the network.
5. The master-slave relationship-free automatic networking method according to claim 1, wherein in the steps 1 and 5, the form of sending the handshake signal and the form of sending the ACK signal by the sender device are both in a broadcast form.
6. The master-slave relationship-free automatic networking method according to claim 1, wherein in the step 64, the number of times of repeating the handshake action is twenty.
CN201610955066.5A 2016-10-27 2016-10-27 Automatic networking method without master-slave relation Active CN107995115B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610955066.5A CN107995115B (en) 2016-10-27 2016-10-27 Automatic networking method without master-slave relation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610955066.5A CN107995115B (en) 2016-10-27 2016-10-27 Automatic networking method without master-slave relation

Publications (2)

Publication Number Publication Date
CN107995115A CN107995115A (en) 2018-05-04
CN107995115B true CN107995115B (en) 2021-08-31

Family

ID=62028400

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610955066.5A Active CN107995115B (en) 2016-10-27 2016-10-27 Automatic networking method without master-slave relation

Country Status (1)

Country Link
CN (1) CN107995115B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1588905A (en) * 2004-10-18 2005-03-02 中国科学院计算技术研究所 Address automatic distributing method in mobile self organizing network

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100789773B1 (en) * 2006-12-08 2007-12-28 한국전자통신연구원 A mesh networking auto configuration method, virtual link setting method, packet transmission method and terminal for its in multi hop wireless lan

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1588905A (en) * 2004-10-18 2005-03-02 中国科学院计算技术研究所 Address automatic distributing method in mobile self organizing network

Also Published As

Publication number Publication date
CN107995115A (en) 2018-05-04

Similar Documents

Publication Publication Date Title
EP2519037B1 (en) Method and network for sharing sensor data among mobile terminals
CN107889185B (en) Networking method of wireless data acquisition system of electric meter
US9781579B2 (en) Method and device for realizing terminal WIFI talkback
CN110383767B (en) Topology switching method, device and system based on synchronous link and storage medium
CN104735744B (en) A kind of design method of the multi-hop relay routing based on terminal direct connection communication
CN113259864B (en) Narrow-band communication method, interphone, equipment, storage medium and ad hoc network system
CN106375453B (en) Bidirectional communication equipment, system and method based on HTTP connection
CN102404387A (en) Method, device and equipment for information synchronization with other nodes
CN112202877B (en) Gateway linkage method, gateway, cloud server and user terminal
CN105072149A (en) Method and device for building remote communication through proxy gateway
CN104247339A (en) Home network packet delivery
CN110519856A (en) The data transmission method and terminal of a kind of NB-IoT and base station
CN106027599B (en) Data transmission channel establishing method, system and server
CN105681225A (en) Network resource acquisition method and device
CN103765819B (en) A kind of data configuration method and network management server
CN105451367A (en) Wireless network connection method, device and system
CN107995115B (en) Automatic networking method without master-slave relation
CN108574615B (en) Content transmission method, device and system based on multipath MPTCP
JP2014068320A (en) Wireless lan communication device, system and method
EP3843495B1 (en) Communication method and apparatus, and device
JP2012199730A (en) Radio relay device, virtual machine generation server, radio relay method, and virtual machine generation method
JP2017103689A5 (en)
CN105471909A (en) Method for quickly establishing local area network connection and initiating device and routing device
CN112087745A (en) Network distribution method and device of household appliance, electronic device and storage medium
CN111343589A (en) Communication networking method, sub-node equipment and main node equipment

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