CN103873472A - Method for automatically having access to network - Google Patents
Method for automatically having access to network Download PDFInfo
- Publication number
- CN103873472A CN103873472A CN201410101541.3A CN201410101541A CN103873472A CN 103873472 A CN103873472 A CN 103873472A CN 201410101541 A CN201410101541 A CN 201410101541A CN 103873472 A CN103873472 A CN 103873472A
- Authority
- CN
- China
- Prior art keywords
- server
- client
- udp
- network
- address
- 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.)
- Pending
Links
Images
Abstract
The invention provides a method for automatically having access to the network. The method includes the steps that a server terminal starts a UDP to conduct broadcasting and sends a UDP information packet; a client terminal receives the UDP information packet and obtains the IP address of a server from the UDP information packet; according to the IP address of the server, TCP network connecting is built. By means of the method for automatically having access to the network, positive registering, reconnection after offline and intelligent heartbeats are achieved.
Description
Technical field
The present invention relates to internetwork connection mode, refer to especially a kind of method of automatic interconnection network.
Background technology
At present computer is connected when IP address is set generally employing automatic acquisition IP technology or two kinds of assigned ip addresses mode is set with the Internet.Generally client can select automatic acquisition IP address, after an equipment access local area network (LAN) is complete, no matter be that service end or client all must be by inquiries, determine IP each other, and connect IP by arranging, realize a service end and connect multiple clients, these generally will arrange one by one in client.So inefficiency, arranges trouble.
Ethernet communication mode mainly contains two kinds of TCP and UDP mode, and what nowadays the Internet was mainly applied is TCP technology, once its advantage is to establish to connect just very stablely, must manually arrange but connect IP.The Principle of Communication of UDP based on one-to-many, it sends an instruction to multiple intrasystem all devices, but not all equipment can receive instruction exactly, and equipment successful receiving rate can not reach very, cause some equipment to fail to be connected with the normal data of system made
Summary of the invention
The present invention proposes a kind of initiatively registration, disconnection reconnecting, the method for the automatic interconnection network of intelligent heartbeat.
Technical scheme of the present invention is achieved in that
A method for automatic interconnection network, comprising:
Server end starts UDP broadcasts, and sends UDP packets of information;
Client UDP packets of information, the IP address that therefrom obtains server;
According to the IP address of server, set up TCP network and connect.
The present invention initiatively sends broadcast frame address by server end, client is registered connection to rear active, because udp protocol can be one-to-many communication, therefore can realize the rapidity that information sends, after connecting, use the network of TCP more stable.Connected mode of the present invention is more initiatively with convenient.
Brief description of the drawings
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, to the accompanying drawing of required use in embodiment or description of the Prior Art be briefly described below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is the flow chart of the method for a kind of automatic interconnection network of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiment.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
A method for automatic interconnection network, comprising:
Server end starts UDP broadcasts, and sends UDP packets of information; (step 1)
Client UDP packets of information, the IP address that therefrom obtains server; (step 2)
According to the IP address of server, set up TCP network and connect.(step 3)
Preferably, starting UDP at execution server end broadcasts, the step that sends UDP packets of information also comprises step before: in client access network, also completing circuit loads, local IP obtains, be that udhcpc is until server is received data, and sending response in UDP mode, server end starts UDP broadcasts, and sends UDP packets of information; The response that client is sent to server end, completes log-on message configuration automatically according to the IP address of its appointment, has registered rear equipment and is available this specific assigned address and set up stable data with server in the mode of TCP and be connected.
Preferably, carry out according to the IP address of server, set up TCP network connect step after, also comprise server according to predetermined time interval send heartbeat to client, client is made corresponding response; In the time that the time that client is responded exceedes Preset Time, server end is closed TCP thread or is destroyed TCP thread.Due to
Between server and client between communication period, client may be extracted suddenly or be accessed in hot-swappable mode, also may be due to equipment or network failure and cannot with system communication, cause interruption, server can not be reacted and the transmission information that does as usual within the utmost point short time under normal circumstances, data cannot incoming terminal equipment in this case, and server can not be taked countermeasure to equipment immediately.Tradition communication mechanism is almost manually to intervene in broken string situation, re-creates connection, if could not find in time and reconnect server and client will cannot normally be worked in off-state.In order to tackle above-mentioned situation, disconnection reconnecting and intelligent heartbeat mechanism are adopted set up stable connection between server end and client after.After system has been dynamically connected certainly, just produce heartbeat, be to send a heartbeat packet to target several seconds, if equipment nonreply in 2 seconds, expression is connected with server and client are unsuccessful, now server and client all can automatically disconnect between existing connection, client sends log-on message in UDP mode again, sets up TCP mode 1 be connected 1 by auto registration process and server.Once connect, it is normal that heartbeat just recovers, as long as client is received heartbeat always, will each heartbeat be produced and be replied, server receives replys, and server is just in stable connection status, and attendant can understand from the existence of heartbeat the real-time status of client.
Preferably, predetermined time is spaced apart 3-5s.
Preferably, Preset Time is 2s.
The method of automatic interconnection network provided by the invention, can auto registration, disconnection reconnecting, intelligent heartbeat mechanism, allows the whole-process automatic registration of system, connection, detection, without manual intervention, has fully improved stability and the operation ease of system.After equipment inserts, connection procedure is full-automatic, and moment detection mixes use, heartbeat packet with protection, Auto-reconnect, TCP with UDP; Make speed faster, system is more stable.
The foregoing is only preferred embodiment of the present invention, in order to limit the present invention, within the spirit and principles in the present invention not all, any amendment of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.
Claims (5)
1. a method for automatic interconnection network, is characterized in that, comprising:
Server end starts UDP broadcasts, and sends UDP packets of information;
Client UDP packets of information, the IP address that therefrom obtains server;
According to the IP address of server, set up TCP network and connect.
2. the method for a kind of automatic interconnection network as claimed in claim 1, it is characterized in that, starting UDP at execution server end broadcasts, before sending the step of UDP packets of information, also comprise step: in client access network and complete after loaded circuit, send application for registration to server end in the mode of UDP.
3. the method for a kind of automatic interconnection network as claimed in claim 1, it is characterized in that, carrying out according to the IP address of server, after setting up the step of TCP network connection, also comprise server according to predetermined time interval send heartbeat to client, client is made corresponding response; In the time that the time that client is responded exceedes Preset Time, server end is closed TCP thread or is destroyed TCP thread.
4. the method for a kind of automatic interconnection network as claimed in claim 3, is characterized in that, predetermined time is spaced apart 3-5s.
5. the method for a kind of automatic interconnection network as claimed in claim 3, is characterized in that, Preset Time is 2s.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410101541.3A CN103873472A (en) | 2014-03-18 | 2014-03-18 | Method for automatically having access to network |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410101541.3A CN103873472A (en) | 2014-03-18 | 2014-03-18 | Method for automatically having access to network |
Publications (1)
Publication Number | Publication Date |
---|---|
CN103873472A true CN103873472A (en) | 2014-06-18 |
Family
ID=50911599
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410101541.3A Pending CN103873472A (en) | 2014-03-18 | 2014-03-18 | Method for automatically having access to network |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103873472A (en) |
Cited By (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104301155A (en) * | 2014-10-30 | 2015-01-21 | 中移物联网有限公司 | State obtaining method of intelligent peripherals, state display terminal and router |
CN104301407A (en) * | 2014-10-10 | 2015-01-21 | 西安理邦科学仪器有限公司 | Data backing up method and device in distributed type monitoring system |
CN104836683A (en) * | 2015-04-01 | 2015-08-12 | 上海大唐移动通信设备有限公司 | Thread reconnection method and device |
CN105407008A (en) * | 2015-12-17 | 2016-03-16 | 上海斐讯数据通信技术有限公司 | Reconnecting method and system for interrupted TCP (Transmission Control Protocol) connection, terminal and server |
CN105554150A (en) * | 2015-12-29 | 2016-05-04 | 北京捷思锐科技股份有限公司 | Network logging-in method and apparatus |
CN105553762A (en) * | 2015-12-11 | 2016-05-04 | 美的集团股份有限公司 | Communication method and communication system between domestic appliance and mobile terminal and corresponding devices |
CN106231006A (en) * | 2016-08-31 | 2016-12-14 | 珠海市魅族科技有限公司 | Network system, the network equipment and the method obtaining IP address of equipment in real time |
CN106302692A (en) * | 2016-08-09 | 2017-01-04 | 深圳Tcl新技术有限公司 | The discovery method and apparatus of equipment |
CN106375152A (en) * | 2016-08-31 | 2017-02-01 | 北京信而泰科技股份有限公司 | Method for processing communication abnormality of Client/Server (C/S) architecture |
CN106657234A (en) * | 2016-10-09 | 2017-05-10 | 美的智慧家居科技有限公司 | Household electrical appliance, distribution network method and system thereof, and mobile terminal |
CN109495550A (en) * | 2018-10-30 | 2019-03-19 | 广州硕德电子科技有限公司 | A kind of method and apparatus printing manicure |
CN110266778A (en) * | 2019-06-06 | 2019-09-20 | 深圳市灵星雨科技开发有限公司 | How long one kind is multipair connects network communication device and equipment |
CN111224983A (en) * | 2020-01-06 | 2020-06-02 | 武汉烽合智达信息技术有限责任公司 | Method and device for discovering equipment across network segments |
CN111859082A (en) * | 2020-05-27 | 2020-10-30 | 伏羲科技(菏泽)有限公司 | Identification analysis method and device |
CN112911021A (en) * | 2021-03-23 | 2021-06-04 | 厦门四信通信科技有限公司 | Method, device and equipment for actively connecting terminal |
CN114199206A (en) * | 2021-11-02 | 2022-03-18 | 青岛海洋科学与技术国家实验室发展中心 | Water towing type measuring system and Ethernet data wired transmission method |
Citations (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20020055966A1 (en) * | 2000-11-08 | 2002-05-09 | John Border | System and method for reading ahead of content |
US20020178265A1 (en) * | 2001-05-22 | 2002-11-28 | Aiken John Andrew | Methods systems and computer program products for source address selection |
CN1767442A (en) * | 2004-10-25 | 2006-05-03 | 国电南京自动化股份有限公司 | Automatized monitoring system and method for protecting data communication between devices |
US20070288656A1 (en) * | 2004-09-29 | 2007-12-13 | Zhu Liang | Method for establishing peer-to-peer connection |
CN101227278A (en) * | 2007-01-18 | 2008-07-23 | 中国科学院自动化研究所 | Method and system of remote network identification authenticating based on multiple biology characteristics |
CN101420326A (en) * | 2008-12-02 | 2009-04-29 | 华为技术有限公司 | Method, system and apparatus for implementing failure restoration and data backup |
CN101442492A (en) * | 2008-12-26 | 2009-05-27 | 中国科学院计算技术研究所 | Method and system for implementing NAT penetration in P2P network |
CN101741914A (en) * | 2010-02-03 | 2010-06-16 | 上海悠络客电子科技有限公司 | Method and system for penetrating NAT to establish overlay network in P2P network |
CN102123467A (en) * | 2011-03-02 | 2011-07-13 | 深圳市科陆电子科技股份有限公司 | Method for multi-channel self-adaptive switch during terminal communication |
CN102244645A (en) * | 2010-05-14 | 2011-11-16 | 北京快网科技有限公司 | Reliable, transparent and general acceleration gateway system based on UDP protocol |
CN102546632A (en) * | 2012-01-09 | 2012-07-04 | 北京佳讯飞鸿电气股份有限公司 | Automatic configuration method for network element equipment domain name of internet protocol (IP) multimedia subsystem |
CN102967357A (en) * | 2012-10-27 | 2013-03-13 | 广东香山衡器集团股份有限公司 | Electronic weighing instrument system capable of achieving wireless authenticating and authenticating method |
CN103139199A (en) * | 2012-12-31 | 2013-06-05 | 深圳键桥通讯技术股份有限公司 | Method for achieving information interaction among sub systems through platform information bus mechanism |
CN103475907A (en) * | 2013-09-23 | 2013-12-25 | 珠海迈科电子科技有限公司 | Multi-screen control method and device |
CN103581740A (en) * | 2013-10-25 | 2014-02-12 | 中兴通讯股份有限公司 | Distributed IPTV multi-screen gateway and IPTV multi-screen interaction method |
-
2014
- 2014-03-18 CN CN201410101541.3A patent/CN103873472A/en active Pending
Patent Citations (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20020055966A1 (en) * | 2000-11-08 | 2002-05-09 | John Border | System and method for reading ahead of content |
US20020178265A1 (en) * | 2001-05-22 | 2002-11-28 | Aiken John Andrew | Methods systems and computer program products for source address selection |
US20070288656A1 (en) * | 2004-09-29 | 2007-12-13 | Zhu Liang | Method for establishing peer-to-peer connection |
CN1767442A (en) * | 2004-10-25 | 2006-05-03 | 国电南京自动化股份有限公司 | Automatized monitoring system and method for protecting data communication between devices |
CN101227278A (en) * | 2007-01-18 | 2008-07-23 | 中国科学院自动化研究所 | Method and system of remote network identification authenticating based on multiple biology characteristics |
CN101420326A (en) * | 2008-12-02 | 2009-04-29 | 华为技术有限公司 | Method, system and apparatus for implementing failure restoration and data backup |
CN101442492A (en) * | 2008-12-26 | 2009-05-27 | 中国科学院计算技术研究所 | Method and system for implementing NAT penetration in P2P network |
CN101741914A (en) * | 2010-02-03 | 2010-06-16 | 上海悠络客电子科技有限公司 | Method and system for penetrating NAT to establish overlay network in P2P network |
CN102244645A (en) * | 2010-05-14 | 2011-11-16 | 北京快网科技有限公司 | Reliable, transparent and general acceleration gateway system based on UDP protocol |
CN102123467A (en) * | 2011-03-02 | 2011-07-13 | 深圳市科陆电子科技股份有限公司 | Method for multi-channel self-adaptive switch during terminal communication |
CN102546632A (en) * | 2012-01-09 | 2012-07-04 | 北京佳讯飞鸿电气股份有限公司 | Automatic configuration method for network element equipment domain name of internet protocol (IP) multimedia subsystem |
CN102967357A (en) * | 2012-10-27 | 2013-03-13 | 广东香山衡器集团股份有限公司 | Electronic weighing instrument system capable of achieving wireless authenticating and authenticating method |
CN103139199A (en) * | 2012-12-31 | 2013-06-05 | 深圳键桥通讯技术股份有限公司 | Method for achieving information interaction among sub systems through platform information bus mechanism |
CN103475907A (en) * | 2013-09-23 | 2013-12-25 | 珠海迈科电子科技有限公司 | Multi-screen control method and device |
CN103581740A (en) * | 2013-10-25 | 2014-02-12 | 中兴通讯股份有限公司 | Distributed IPTV multi-screen gateway and IPTV multi-screen interaction method |
Cited By (22)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104301407A (en) * | 2014-10-10 | 2015-01-21 | 西安理邦科学仪器有限公司 | Data backing up method and device in distributed type monitoring system |
CN104301407B (en) * | 2014-10-10 | 2018-03-30 | 西安理邦科学仪器有限公司 | The method and apparatus of Backup Data in distributed monitor system |
CN104301155A (en) * | 2014-10-30 | 2015-01-21 | 中移物联网有限公司 | State obtaining method of intelligent peripherals, state display terminal and router |
CN104836683A (en) * | 2015-04-01 | 2015-08-12 | 上海大唐移动通信设备有限公司 | Thread reconnection method and device |
CN104836683B (en) * | 2015-04-01 | 2018-06-05 | 上海大唐移动通信设备有限公司 | A kind of method and device of thread reconnection |
CN105553762A (en) * | 2015-12-11 | 2016-05-04 | 美的集团股份有限公司 | Communication method and communication system between domestic appliance and mobile terminal and corresponding devices |
CN105407008A (en) * | 2015-12-17 | 2016-03-16 | 上海斐讯数据通信技术有限公司 | Reconnecting method and system for interrupted TCP (Transmission Control Protocol) connection, terminal and server |
CN105554150A (en) * | 2015-12-29 | 2016-05-04 | 北京捷思锐科技股份有限公司 | Network logging-in method and apparatus |
WO2018028122A1 (en) * | 2016-08-09 | 2018-02-15 | 深圳Tcl新技术有限公司 | Device discovery method and apparatus |
CN106302692A (en) * | 2016-08-09 | 2017-01-04 | 深圳Tcl新技术有限公司 | The discovery method and apparatus of equipment |
CN106375152A (en) * | 2016-08-31 | 2017-02-01 | 北京信而泰科技股份有限公司 | Method for processing communication abnormality of Client/Server (C/S) architecture |
CN106231006A (en) * | 2016-08-31 | 2016-12-14 | 珠海市魅族科技有限公司 | Network system, the network equipment and the method obtaining IP address of equipment in real time |
CN106657234A (en) * | 2016-10-09 | 2017-05-10 | 美的智慧家居科技有限公司 | Household electrical appliance, distribution network method and system thereof, and mobile terminal |
CN106657234B (en) * | 2016-10-09 | 2020-09-04 | 美智光电科技有限公司 | Network distribution method and system of household appliance, household appliance and mobile terminal |
CN109495550B (en) * | 2018-10-30 | 2021-11-23 | 广州硕德电子科技有限公司 | Method and equipment for printing nail beautification |
CN109495550A (en) * | 2018-10-30 | 2019-03-19 | 广州硕德电子科技有限公司 | A kind of method and apparatus printing manicure |
CN110266778A (en) * | 2019-06-06 | 2019-09-20 | 深圳市灵星雨科技开发有限公司 | How long one kind is multipair connects network communication device and equipment |
CN110266778B (en) * | 2019-06-06 | 2022-05-03 | 深圳市灵星雨科技开发有限公司 | Many-to-many long connection network communication device and equipment |
CN111224983A (en) * | 2020-01-06 | 2020-06-02 | 武汉烽合智达信息技术有限责任公司 | Method and device for discovering equipment across network segments |
CN111859082A (en) * | 2020-05-27 | 2020-10-30 | 伏羲科技(菏泽)有限公司 | Identification analysis method and device |
CN112911021A (en) * | 2021-03-23 | 2021-06-04 | 厦门四信通信科技有限公司 | Method, device and equipment for actively connecting terminal |
CN114199206A (en) * | 2021-11-02 | 2022-03-18 | 青岛海洋科学与技术国家实验室发展中心 | Water towing type measuring system and Ethernet data wired transmission method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103873472A (en) | Method for automatically having access to network | |
JP4103816B2 (en) | Router setting method and router apparatus | |
US11621926B2 (en) | Network device and method for sending BGP information | |
CN105610888A (en) | Method of using socket to push message based on Android and system thereof | |
CN105450779B (en) | The method of one household appliance connection multiserver | |
CN103095749A (en) | Method and system used for achieving discovery of cross-network-segment equipment | |
CN106961426B (en) | Communication method and device of intelligent equipment | |
US10594844B2 (en) | Method and system for wireless network bilateral accelerated transmission | |
CN109586958B (en) | Configuration management method for dual-system device and dual-system device | |
CN104144124B (en) | Data forwarding method, Apparatus and system | |
CN103905579A (en) | Method and system for communication between platform and terminal, platform and relevant devices | |
CN104796484A (en) | Quick search connection method based on display screen control system | |
CN109150766A (en) | The method and apparatus of dynamic addressing server in local area network based on UDP multicast | |
CN105337814A (en) | Network equipment connection method, equipment and system | |
CN104468380A (en) | Interface communication method of access point device and server interaction | |
CN103096300B (en) | Base station virtual local area network identifier automatic obtaining method and system | |
CN107454184B (en) | Method for establishing stable network connection between Android client and server | |
CN101325587A (en) | Method for monitoring DHCP conversation | |
CN103685398A (en) | Communication connection establishment method and communication system | |
CN105554150A (en) | Network logging-in method and apparatus | |
EP2380334B1 (en) | Systems and methods for changing the address of an interface | |
EP3340542B1 (en) | Method for configuring a device connected to a field bus | |
CN108712297A (en) | A kind of method of Internet of things node equipment autonomously switching gateway | |
US9554290B2 (en) | Wireless communication system and method for automatically switching device identifications | |
US20160301755A1 (en) | Method and apparatus for controlling scan of slave devices |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20140618 |