CN104506567A - Data exchange method for gateway and server of Internet of things - Google Patents

Data exchange method for gateway and server of Internet of things Download PDF

Info

Publication number
CN104506567A
CN104506567A CN201410663133.7A CN201410663133A CN104506567A CN 104506567 A CN104506567 A CN 104506567A CN 201410663133 A CN201410663133 A CN 201410663133A CN 104506567 A CN104506567 A CN 104506567A
Authority
CN
China
Prior art keywords
things
service end
internet gateway
tcp
described service
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201410663133.7A
Other languages
Chinese (zh)
Other versions
CN104506567B (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.)
Next Generation Internet Key Technology And Co ltd Of Erc Of Evaluation And Test Beijing
Original Assignee
Beijing Internet Institute 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 Beijing Internet Institute Co ltd filed Critical Beijing Internet Institute Co ltd
Priority to CN201410663133.7A priority Critical patent/CN104506567B/en
Publication of CN104506567A publication Critical patent/CN104506567A/en
Application granted granted Critical
Publication of CN104506567B publication Critical patent/CN104506567B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)
  • Computer And Data Communications (AREA)

Abstract

The embodiment of the invention discloses a data exchange method of an Internet of things gateway and a server, which is applied to the field of Internet of things. In the embodiment of the invention, the data exchange method of the Internet of things gateway and the server comprises the steps that the Internet of things gateway initiates TCP connection with the server; according to the TCP connection, the gateway of the Internet of things initiates HTTP long polling with the server so as to obtain a control instruction issued by an application to the server. The method completes the control instruction issued by the application through three steps of interaction in an HTTP long polling mode through the gateway of the Internet of things and the server. Compared with the traditional result pushed from the server side, the method has higher safety by actively initiating the request at the gateway side, and solves the problems of passive state of the server side and lack of safety protection of the gateway in the prior art. Meanwhile, the invention separately extracts the server and focuses on the processing control function, thereby balancing the performance overhead required by maintaining long connection.

Description

The method for interchanging data of a kind of things-internet gateway and service end
Technical field
The present invention relates to Internet of Things field, particularly relate to the method for interchanging data of a kind of things-internet gateway and service end.
Background technology
Internet of Things framework can be divided into three layers: sensing layer, network layer and application layer, and sensing layer is made up of various transducer, comprises the perception terminal such as Temperature Humidity Sensor, two-dimension code label, RFID label tag and read write line, camera, infrared ray, GPS.Sensing layer is the source of Internet of Things recognition object, Information Monitoring.Network layer is the maincenter of whole Internet of Things, is responsible for the information transmitted and process sensing layer obtains.Application layer is the interface of Internet of Things and user, and it is combined with industry requirement, realizes the intelligent use of Internet of Things.
Present stage, network layer, by IPization mode, realizes the integrated services of bottom data sensing and upper layer application.But under normal circumstances, the network terminal and transducer are in private network, and upper layer application is in public network, under many circumstances, when user wishes cannot find terminating gateway by during application Reverse Turning Control sensing actuator, this relates to a NAT scene application problem.Two kinds of common approach that current solution NAT penetrates are all based on UDP, one is burrowed by UDP to realize NAT and pass through, one utilizes NAT session transmissions application program STUN, these two kinds of modes based on UDP are transmitted owing to being towards connectionless, relative to TCP, poor reliability on the one hand, need communicating pair frequently mutual on the other hand, flow process is loaded down with trivial details.
What make the transition to the Internet model along with Internet of Things industry develops rapidly, adopting the general http protocol in the Internet to realize gateway sensing equipment communicates also more and more extensive with application side, such Internet of Things can inherit Internet basic standard criterion, the sensing node of Internet of Things is converted into internet node, thus progressively realizes sector application seamlessly transitting to the Internet model.Further expand the service application of Web Service, for developer and engineering construction person set up unitized overall development interface, can the developer of Shi Geng multispan circle different aspects and end user's application.
But traditional http protocol stack is applied directly to Internet of Things system, also there are the following problems:
1) http protocol is the stateless unidirectional protocol based on request-response modes, namely must initiate a request of connecting by client, and server receives request, data is returned to client, then release connection.Initiate another request by client more next time, repeat said process, state that server is in all the time " passive ", in the application of Internet of Things system, most data transmission services requires Always Online", and traditional HTTP connected mode interactive quantity is large, and business procession is loaded down with trivial details.
2) it is all using service end as initiator that traditional Reverse Turning Control realizes, and service end pressure is excessive, and can initiate notice to gateway arbitrarily, makes gateway lack safeguard protection.
Summary of the invention
The object of the invention is to solve " passive " state of server in prior art and the problem of gateway shortage safeguard protection.For solving the problem, embodiments provide the method for interchanging data of a kind of things-internet gateway and service end.
In view of this, the invention provides the method for interchanging data of a kind of things-internet gateway and service end, can comprise:
Things-internet gateway is initiated to set up TCP with service end and is connected;
Connect according to above-mentioned TCP, described things-internet gateway initiates the long poll of HTTP with described service end, to obtain the control command applied and issue to described service end.
The present invention also provides the method for interchanging data of a kind of things-internet gateway and service end, can comprise:
Service end and things-internet gateway are set up the TCP initiated by described things-internet gateway and are connected;
Connect according to above-mentioned TCP, described service end receives the long poll of HTTP that described things-internet gateway is initiated, to obtain the control command applied and issue to described service end.
As can be seen from the above technical solutions, the embodiment of the present invention has the following advantages:
In the embodiment of the present invention, for " passive " state of server in prior art and the problem of gateway shortage safeguard protection, propose the method for interchanging data of a kind of things-internet gateway and service end.The method adopts the long polling mode of HTTP to be completed the control command applied and issue alternately by three steps by things-internet gateway and service end.The present invention initiatively initiates request by gateway side, with traditional to push fail safe compared with result from service end higher, solves the passive state of service end in prior art and the problem of gateway shortage safeguard protection.The present invention simultaneously, owing to detaching out separately by service end, is absorbed in processing controls function, balances the performance cost maintained needed for long connection like this.And present invention, avoiding complicated NAT penetration flow path, use TCP long connected mode gateway and service end to be connected.Popular for internet industry http protocol for a long time is also applied to Internet of Things by the present invention, contributes to traditional industries seamlessly transitting to the Internet.
Term " first ", " second ", " the 3rd " " 4th " etc. (if existence) in specification of the present invention and claims and above-mentioned accompanying drawing are for distinguishing similar object, and need not be used for describing specific order or precedence.The embodiments described herein should be appreciated that the data used like this can be exchanged in the appropriate case, so that can be implemented with the order except the content except here diagram or description.In addition, term " comprises " and " having " and their any distortion, intention is to cover not exclusive comprising, such as, contain those steps or unit that the process of series of steps or unit, method, system, product or equipment is not necessarily limited to clearly list, but can comprise clearly do not list or for intrinsic other step of these processes, method, product or equipment or unit.
The above, above embodiment only in order to technical scheme of the present invention to be described, is not intended to limit; Although with reference to previous embodiment to invention has been detailed description, those of ordinary skill in the art is to be understood that: it still can be modified to the technical scheme described in foregoing embodiments, or carries out equivalent replacement to wherein portion of techniques feature; And these amendments or replacement, do not make the essence of appropriate technical solution depart from the spirit and scope of various embodiments of the present invention technical scheme.
Accompanying drawing explanation
Fig. 1 is the flow chart of a kind of things-internet gateway of the embodiment of the present invention 1 and the method for interchanging data of service end;
Fig. 2 is that the things-internet gateway of the embodiment of the present invention 2 initiates the long poll interaction diagrams of HTTP with service end;
Fig. 3 is the flow chart of a kind of things-internet gateway of the embodiment of the present invention 1 and the method for interchanging data of service end;
Fig. 4 is that the things-internet gateway of the embodiment of the present invention 2 initiates the long poll interaction diagrams of HTTP with service end;
Fig. 5 is the things-internet gateway of the embodiment of the present invention 1 and 2 and the data exchange system structure chart of service end;
Fig. 6 is the sequential flow chart of Signalling exchange between things-internet gateway, application and service end three in the embodiment of the present invention 1 and 2;
Fig. 7 is the things-internet gateway of the embodiment of the present invention 5 and the exemplary plot that communicates of service end;
Fig. 8 is the things-internet gateway of the embodiment of the present invention 5 and the method for interchanging data flow chart of service end.
Embodiment
Embodiments provide the method for interchanging data of a kind of things-internet gateway and service end, when can solve exchanges data in prior art, service end is in the problem that passive state and gateway lack safeguard protection.
The present invention program is understood better in order to make those skilled in the art person, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the embodiment of a part of the present invention, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, should belong to the scope of protection of the invention.
Refer to Fig. 1, be the flow chart of the method for interchanging data embodiment 1 of a kind of things-internet gateway provided by the invention and service end, the present embodiment specifically can comprise:
S101, things-internet gateway are initiated to set up TCP with service end and are connected;
S102, connect according to above-mentioned TCP, described things-internet gateway initiates the long poll of HTTP with described service end, to obtain the control command applied and issue to described service end.
In order to the implementation procedure of the method for interchanging data of this things-internet gateway of clearer understanding and service end, the implementation of concrete steps is described below in detail.
S101, things-internet gateway are initiated to set up TCP with service end and are connected;
Concrete, described things-internet gateway is initiated to set up a TCP length with service end and is connected, and object makes service end to remember things-internet gateway, and preferably, service end can be proxy server.
S102, connect according to above-mentioned TCP, described things-internet gateway initiates the long poll of HTTP with described service end, to obtain the control command applied and issue to described service end;
Concrete, on the basis that the TCP of above-mentioned foundation connects, described things-internet gateway initiates the long poll of HTTP with described service end, so that described things-internet gateway obtains the control command applied and issue to described service end.
In the embodiment of the present invention; for " passive " state of server in prior art and the problem of gateway shortage safeguard protection; have employed the method for interchanging data of a kind of things-internet gateway and service end, described method is initiated to obtain with the long poll of HTTP of described service end the control command applied and issue by things-internet gateway.The present invention initiatively initiates request by gateway side, with traditional to push fail safe compared with result from service end higher, solves the passive state of service end in prior art and the problem of gateway shortage safeguard protection.The present invention simultaneously, owing to detaching out separately by service end, is absorbed in processing controls function, balances the performance cost maintained needed for long connection like this.And present invention, avoiding complicated NAT penetration flow path, use TCP connected mode gateway and service end to be connected.Popular for internet industry http protocol for a long time is also applied to Internet of Things by the present invention, contributes to traditional industries seamlessly transitting to the Internet.
Beneficial effect for the ease of the method for interchanging data to a kind of things-internet gateway provided by the invention and service end has one to understand more intuitively, present invention also offers embodiment 2, composition graphs 1 and Fig. 2, the flow chart of the method for interchanging data of a kind of things-internet gateway and service end, and composition graphs 6 things-internet gateway, the sequential flow chart of Signalling exchange between application and service end three, shown in accompanying drawing 1, the concrete steps of described method are as follows:
S101, things-internet gateway are initiated to set up TCP with service end and are connected;
Concrete, described things-internet gateway is initiated to set up a TCP with service end and is connected, and object makes service end to remember things-internet gateway, and preferably, described service end can be independent agency server, for connecting described application and described things-internet gateway.And each and described service end set up described things-internet gateway that TCP is connected can safeguard one independently TCP connect.
S102, connect according to above-mentioned TCP, described things-internet gateway initiates the long poll of HTTP with described service end, to obtain the control command applied and issue to described service end;
Concrete, on the basis that the TCP of above-mentioned foundation connects, described things-internet gateway initiates the long poll of HTTP with described service end, so that described things-internet gateway obtains the control command that described application issues to described service end.
Concrete, shown in accompanying drawing 2, described things-internet gateway initiates to comprise with the long poll of HTTP of described service end:
S201, described things-internet gateway send the instruction bag carrying the described TCP connection of instruction and connect for Reverse Turning Control to described service end;
If the described service end of S202 receives described instruction bag, then described things-internet gateway receives the response that described service end sends;
S203, described things-internet gateway send instruction request bag to described service end after receiving the response of described service end transmission;
If the described service end of S204 receives the control command that described application issues, and there is described service end and be connected with the TCP of the things-internet gateway in described control command, then described things-internet gateway receives and performs the described control command that described service end sends;
S205, return and perform described things-internet gateway sends step from instruction request bag to described service end, disconnect until described things-internet gateway is connected with the TCP of described service end.
Specific implementation process the following detailed description of the long poll of HTTP:
S201, described things-internet gateway send the instruction bag carrying the described TCP connection of instruction and connect for Reverse Turning Control to described service end;
Concrete, described things-internet gateway, on the above-mentioned basis setting up TCP connection, first sends instruction bag to described service end based on http protocol, and informing that TCP described in described service end connects is connect for the long of Reverse Turning Control, wherein preferred, described service end can be independent agency server.
If the described service end of S202 receives described instruction bag, then described things-internet gateway receives the response that described service end sends;
Concrete, if relevant information can store and respond to described things-internet gateway by described service end after receiving above-mentioned instruction bag simultaneously, inform that described things-internet gateway receives instruction and is bundled into merit, described things-internet gateway receives the response that described service end sends, it should be noted that, only consider the situation receiving described instruction bag herein, do not consider the situation not receiving described instruction bag.
S203, described things-internet gateway send instruction request bag to described service end after receiving the response of described service end transmission;
Concrete, described things-internet gateway wraps after the reception made successfully responds send an instruction request bag to described service end, for asking up-to-date control command to receiving described instruction receiving described service end.
If the described service end of S204 receives the control command that described application issues, and there is described service end and be connected with the TCP of the things-internet gateway in described control command, then described things-internet gateway receives and performs the described control command that described service end sends;
Concrete, be connected with the TCP of the things-internet gateway in described control command if described service end receives up-to-date control command that described application issues and there is described service end, described service end responds to described instruction request bag, and described things-internet gateway receives and performs the described control command of described service end transmission; Detailed process is as follows: first, after described service end receives the control command that described application issues, whether described server side searches exists the described TCP corresponding with the things-internet gateway in described control command connects, then, determine whether respond to described things-internet gateway according to above-mentioned result of searching.Even described service end does not find the described TCP corresponding with described things-internet gateway and connects then to described application FEEDBACK CONTROL failure, if find the described TCP corresponding with described things-internet gateway to connect, respond to described things-internet gateway, for informing described things-internet gateway, it should be noted that, if do not have described application to issue control command, then described things-internet gateway can be in wait instruction state always.
S205, perform described things-internet gateway sends step from instruction request bag to described service end, disconnect until described things-internet gateway is connected with the TCP of described service end;
Concrete, after described things-internet gateway completes the control command that above-mentioned application issues, again send described instruction request bag to described service end, namely again to the up-to-date control command of described service end request, described things-internet gateway is performed in the step of described service end transmission instruction request bag, until described things-internet gateway is connected with the TCP of described service end and disconnects so return.
It should be noted that, described things-internet gateway and described service end are set up after described TCP is connected, and described application uses UDP timing to send heartbeat packet for judging that whether long-time described things-internet gateway is online to described service end.If described service end have received heartbeat packet at the appointed time, can ignore, if do not receive heartbeat packet at the appointed time, then can think that described things-internet gateway goes offline.If judge that described things-internet gateway is online like this, described application can continue to send application controls instruction to described service end, if described things-internet gateway is not online, described application also can not send application controls instruction to described service end.
Present invention also offers embodiment 3, composition graphs 3 and Fig. 4, the flow chart of the method for interchanging data of a kind of things-internet gateway and service end, and composition graphs 6 things-internet gateway, the sequential flow chart of Signalling exchange between application and service end three, shown in accompanying drawing 3, the concrete steps of described method are as follows:
S301, service end and things-internet gateway are set up the TCP initiated by described things-internet gateway and are connected;
Concrete, set up a TCP initiated to described service end by described things-internet gateway between described service end with described things-internet gateway to be connected, object enables described service end remember described things-internet gateway, preferably, described service end can be independent agency server, for connecting described application and described things-internet gateway.And each and described service end set up described things-internet gateway that TCP is connected can safeguard one independently TCP connect.
S302, connect according to above-mentioned TCP, described service end receives the long poll of HTTP that described things-internet gateway is initiated, to obtain the control command applied and issue to described service end.
Concrete, on the basis that above-mentioned TCP connects, described service end receives the long poll of HTTP of being initiated to described service end by described things-internet gateway, to obtain the control command applied and issue to described service end.
Concrete, shown in accompanying drawing 4, the long poll of HTTP that described service end receives the initiation of described things-internet gateway comprises:
S401, described service end receive carrying of described things-internet gateway transmission and indicate described TCP connection to be the instruction bag that Reverse Turning Control connects;
S402, described service end send response to described things-internet gateway after receiving described instruction bag;
If the described things-internet gateway of S403 receives the response that described service end sends, described service end receives the instruction request bag that described things-internet gateway sends;
If the described service end of S404 receives the control command that described application issues, whether described server side searches exists described service end is connected with the TCP of the things-internet gateway in described control command;
Be connected with the TCP of described things-internet gateway if S405 exists described service end, then described service end sends described control command to described things-internet gateway;
S406, perform described service end and receive the step of instruction request bag that described things-internet gateway sends, disconnect until described things-internet gateway is connected with the TCP of described service end.
Specific implementation process the following detailed description of the long poll of HTTP:
S401, described service end receive carrying of described things-internet gateway transmission and indicate described TCP connection to be the instruction bag that Reverse Turning Control connects;
Concrete, establish on the basis that TCP is connected at described service end and described things-internet gateway, described service end receives the instruction bag sended over by described things-internet gateway, described instruction is wrapped for informing that the described TCP that described service end is set up connects for connecting for the long of Reverse Turning Control, wherein preferred, described service end can be independent agency server.
S402, described service end send response to described things-internet gateway after receiving described instruction bag;
Concrete, after described service end receives the described instruction bag that described things-internet gateway sends over, response can be sent to described things-internet gateway, inform that described things-internet gateway reception instruction is bundled into merit.
If the described things-internet gateway of S403 receives the response that described service end sends, described service end receives the instruction request bag that described things-internet gateway sends;
Concrete, when described things-internet gateway receives after the described instruction bag of reception that described service end sends over successfully responds, described service end can receive the instruction request bag sent by described things-internet gateway, for asking up-to-date control command.
If the described service end of S404 receives the control command that described application issues, whether described server side searches exists described service end is connected with the TCP of the things-internet gateway in described control command;
Concrete, after described service end receives the control command that described application issues, whether described service end can be searched exists described service end and is connected with the TCP of the things-internet gateway in described control command.
Be connected with the TCP of described things-internet gateway if S405 exists described service end, then described service end sends described control command to described things-internet gateway;
Concrete, be connected if the result after described server side searches is the TCP existed between described service end with described Internet of Things, then described service end can send to described things-internet gateway the described control command that described application issues.
S406, perform described service end and receive the step of instruction request bag that described things-internet gateway sends, disconnect until described things-internet gateway is connected with the TCP of described service end.
Concrete, after described things-internet gateway executes the control command that above-mentioned application issues, described things-internet gateway can send instruction request bag to described service end again, namely again to the up-to-date control command of described service end request, perform so return the step that described service end receives the instruction request bag that described things-internet gateway sends, disconnect until described things-internet gateway is connected with the TCP of described service end.
It should be noted that, described things-internet gateway and described service end are set up after described TCP is connected, and described application uses UDP timing to send heartbeat packet for judging that whether long-time described things-internet gateway is online to described service end.If described service end have received heartbeat packet at the appointed time, can ignore, if do not receive heartbeat packet at the appointed time, then can think that described things-internet gateway goes offline.If judge that described things-internet gateway is online like this, described application can continue to send application controls instruction to described service end, if described things-internet gateway is not online, described application also can not send application controls instruction to described service end.
In addition, be it can also be seen that by Fig. 5, in the method for interchanging data of things-internet gateway provided by the invention and service end, the function of service end is the bridge as application and things-internet gateway, realizes things-internet gateway and completes applying the control command issued.Content for a more clear understanding of the present invention, present invention also offers embodiment 4.
Shown in accompanying drawing 7, described application is for application A PP1, described service end is for proxy server AG1, described things-internet gateway is for described things-internet gateway GW1, as seen from Figure 7, described proxy server AG1 from be connected with described application A PP1, be connected from lower and described things-internet gateway GW1, describe the specific implementation process of the method for interchanging data of a kind of things-internet gateway and service end in detail to described things-internet gateway GW1 for described application A PP1 sending controling instruction below.Shown in composition graphs 1 and Fig. 7 and Fig. 8,
S101, things-internet gateway are initiated to set up TCP with service end and are connected;
Concrete, described things-internet gateway is initiated to set up a TCP with described service end and is connected, and object makes described service end can remember described things-internet gateway, preferably, described service end can be independent agency server, for connecting described application and described things-internet gateway.And each and described service end set up described things-internet gateway that TCP is connected can safeguard one independently TCP connect.In the present embodiment, concrete, first described things-internet gateway GW1 initiates to set up TCP to described proxy server AG1 and connects.It should be noted that, described things-internet gateway GW1 is in private network, and described proxy server AG1 is in public network.So also can be that the described things-internet gateway GW1 being in private network initiates to set up TCP connection to the described proxy server AG1 being in public network in the present embodiment, namely complete described things-internet gateway and be connected with the TCP between service end.
S102, connect according to above-mentioned TCP, described things-internet gateway initiates the long poll of HTTP with described service end, to obtain the control command applied and issue to described service end;
Concrete, on the long basis connected of the TCP of above-mentioned foundation, described things-internet gateway initiates the long poll of HTTP with described service end, so that described things-internet gateway obtains the control command applied and issue to described service end.
In the present embodiment, concrete, above-mentionedly set up after TCP connects, described things-internet gateway GW1 initiates the long poll of HTTP with described proxy server AG1, so that described things-internet gateway GW1 obtains the control command that described application A PP1 issues to described proxy server AG1.
Concrete, by reference to the accompanying drawings shown in 2, described things-internet gateway initiates to comprise with the long poll of HTTP of described service end::
S201, described things-internet gateway send the instruction bag carrying the described TCP connection of instruction and connect for Reverse Turning Control to described service end;
Concrete, described things-internet gateway, on the above-mentioned basis setting up TCP connection, first sends instruction bag to described service end based on http protocol, and informing that TCP described in described service end connects is connect for the long of Reverse Turning Control, wherein preferred, described service end can be independent agency server.
In the present embodiment, concrete, described things-internet gateway GW1 sets up on the long basis connected of TCP above-mentioned, an instruction bag and SOAP bag is sent based on http protocol to described proxy server AG1, the content of described SOAP bag comprises the URL (http://thisisatest.com/gw/keeplive) of described things-internet gateway GW1, and this is a long connection request for Reverse Turning Control to inform described proxy server AG1.
If the described service end of S202 receives described instruction bag, then described things-internet gateway receives the response that described service end sends;
Concrete, if relevant information can store and respond to described things-internet gateway by described service end after receiving above-mentioned instruction bag simultaneously, inform that described things-internet gateway receives instruction and is bundled into merit, described things-internet gateway receives the response that described service end sends, it should be noted that, only consider the situation receiving described instruction bag herein, do not consider the situation not receiving described instruction bag.
In the present embodiment, concrete, if relevant information can be stored after described proxy server AG1 receives above-mentioned instruction bag, respond to described things-internet gateway GW1 simultaneously, namely inform that described things-internet gateway GW1 receives instruction and is bundled into merit.
S203, described things-internet gateway send instruction request bag to described service end after receiving the response of described service end transmission;
Concrete, described things-internet gateway wraps after the reception made successfully responds send an instruction request bag to described service end, for asking up-to-date control command to receiving described instruction receiving described service end.
In the present embodiment, concrete, described things-internet gateway GW1 receive described proxy server AG1 to reception described instruction bag and SOAP wrap the reception made successfully respond after transmission an instruction request bag, i.e. Article 2 SOAP bag, for asking up-to-date control command, the latest data of the described things-internet gateway GW1 corresponding with it to be obtained such as namely, namely from the control command of described application A PP1, it should be noted that, if without any response, namely any new data is never obtained, then described things-internet gateway GW1 can be in obstruction wait state always.
If the described service end of S204 receives the control command that described application issues, and there is described service end and be connected with the TCP of described things-internet gateway, then described things-internet gateway receives and performs the described control command that described service end sends;
Concrete, be connected with the TCP of the things-internet gateway in described control command if described service end receives up-to-date control command that described application issues and there is described service end, described service end responds to described instruction request bag, and described things-internet gateway receives and performs the described control command of described service end transmission; Detailed process is as follows: first, after described service end receives the control command that described application issues, whether described server side searches exists the described TCP corresponding with the things-internet gateway in described control command connects, then, determine whether respond to described things-internet gateway according to above-mentioned result of searching.Even described service end does not find the described TCP corresponding with the things-internet gateway in described control command and connects then to described application FEEDBACK CONTROL failure, if find the described TCP corresponding with the things-internet gateway in described control command to connect, respond to described things-internet gateway, the control command of described application is returned to described things-internet gateway, it should be noted that, if do not have described application to issue control command, then described things-internet gateway can be in wait instruction state always.
In the embodiment of the present invention, concrete, described proxy server AG1 receives the up-to-date control command that described application A PP1 issues, concrete, this latest command can be the actuator A11 that described application A PP1 needs to control described things-internet gateway GW1 management and control, then described proxy server AG1 will respond to above-mentioned request bag and Article 2 SOAP bag, detailed process is: first, after described proxy server AG1 receives the up-to-date control command that described application A PP1 issues, whether described proxy server AG1 searches exists that corresponding with described things-internet gateway GW1 described TCP is long to be connected, then, determine whether respond to described things-internet gateway GW1 according to above-mentioned result of searching.Even described proxy server AG1 does not find the described TCP corresponding with described things-internet gateway GW1 and connects then to described application program FEEDBACK CONTROL failure, concrete, the content of feedback can be the control of the actuator A11 that can not realize described things-internet gateway GW1 management and control, connect if described proxy server AG1 finds the described TCP corresponding with described things-internet gateway GW1, respond to described things-internet gateway GW1, described control command is returned to described things-internet gateway GW1.
S205, described things-internet gateway complete the control command of described application after receiving the response of described request bag, and again send described request bag to described service end.
Concrete, after described things-internet gateway completes the control command that above-mentioned application issues, again send described instruction request bag to described service end, namely again to the up-to-date control command of described service end request, described things-internet gateway is performed in the step of described service end transmission instruction request bag, until described things-internet gateway is connected with the TCP of described service end and disconnects so return.
In the embodiment of the present invention, concrete, described things-internet gateway GW1 receives described proxy server AG1 and wraps to described request bag and Article 2 SOAP the response made, namely described proxy server AG1 inquires after the described TCP corresponding with described things-internet gateway GW1 connect, the control command that described things-internet gateway GW1 issues according to described application A PP1 completes control, concrete, can be that the actuator A11 that described things-internet gateway GW1 controls described things-internet gateway GW1 management and control according to the control command that described application A PP1 issues makes action, and again send next SOAP request bag to described proxy server AG1, wait for next control command of described application A PP1.
It should be noted that herein, described things-internet gateway GW1 is once establish with described proxy server AG1 that TCP is long to be connected, then described things-internet gateway GW1 can start a heartbeat process, described application A PP1 uses UDP regularly to send heartbeat packet to described proxy server AG1, so that described proxy server AG1 judges that whether long-time described things-internet gateway GW1 is online.If described proxy server AG1 have received heartbeat packet at the appointed time, can ignore, if do not received at the appointed time, then think that described things-internet gateway GW1 goes offline.
In the embodiment of the present invention; for " passive " state of server in prior art and the problem of gateway shortage safeguard protection; have employed the method for interchanging data of a kind of things-internet gateway and service end, described method is initiated to obtain with the long poll of HTTP of described service end the control command applied and issue by things-internet gateway.The present invention initiatively initiates request by gateway side, with traditional to push fail safe compared with result from service end higher, solves the passive state of service end in prior art and the problem of gateway shortage safeguard protection.The present invention simultaneously, owing to detaching out separately by service end, is absorbed in processing controls function, balances the performance cost maintained needed for long connection like this.And present invention, avoiding complicated NAT penetration flow path, use TCP connected mode gateway and service end to be connected.Popular for internet industry http protocol for a long time is also applied to Internet of Things by the present invention, contributes to traditional industries seamlessly transitting to the Internet.

Claims (10)

1. a method for interchanging data for things-internet gateway and service end, is characterized in that, described method comprises:
Things-internet gateway is initiated to set up TCP with service end and is connected;
Connect according to above-mentioned TCP, described things-internet gateway initiates the long poll of HTTP with described service end, to obtain the control command applied and issue to described service end.
2. method according to claim 1, is characterized in that, described service end is independent agency server.
3. method according to claim 1, is characterized in that, described things-internet gateway initiates to comprise with the long poll of HTTP of described service end:
Described things-internet gateway sends the instruction bag carrying the described TCP connection of instruction and connect for Reverse Turning Control to described service end;
If described service end receives described instruction bag, then described things-internet gateway receives the response that described service end sends;
Described things-internet gateway sends instruction request bag to described service end after receiving the response of described service end transmission;
If described service end receives the control command that described application issues, and there is described service end and be connected with the TCP of the things-internet gateway in described control command, then described things-internet gateway receives and performs the described control command that described service end sends;
Perform described things-internet gateway sends step from instruction request bag to described service end, disconnect until described things-internet gateway is connected with the TCP of described service end.
4. method according to claim 3, is characterized in that, described instruction request bag is for asking up-to-date control command.
5. a method for interchanging data for things-internet gateway and service end, is characterized in that, described method comprises:
Service end and things-internet gateway are set up the TCP initiated by described things-internet gateway and are connected;
Connect according to above-mentioned TCP, described service end receives the long poll of HTTP that described things-internet gateway is initiated, to obtain the control command applied and issue to described service end.
6. method according to claim 1, is characterized in that, the long poll of HTTP that described service end receives the initiation of described things-internet gateway comprises:
Described service end receives carrying of described things-internet gateway transmission and indicates described TCP connection to be the instruction bag that Reverse Turning Control connects;
Described service end sends response to described things-internet gateway after receiving described instruction bag;
If described things-internet gateway receives the response that described service end sends, described service end receives the instruction request bag that described things-internet gateway sends;
If described service end receives the control command that described application issues, whether described server side searches exists described service end is connected with the TCP of the things-internet gateway in described control command;
If there is described service end to be connected with the TCP of the things-internet gateway in described control command, then described service end sends described control command to described things-internet gateway;
Perform the step that described service end receives the instruction request bag that described things-internet gateway sends, disconnect until described things-internet gateway is connected with the TCP of service end.
7. method according to claim 6, is characterized in that, is connected with the TCP of described things-internet gateway if there is not described service end, then described service end sends to described application and controls failed response.
8. the method according to any one of claim 5 ~ 7, is characterized in that, described things-internet gateway is initiated to set up with service end after TCP is connected, described application regularly to described service end transmission heartbeat packet for judging that whether described things-internet gateway online.
9. method according to claim 8, is characterized in that, if described service end receives described heartbeat packet at the appointed time, then thinks that described things-internet gateway is online.
10. method according to claim 8, is characterized in that, if described service end does not receive described heartbeat packet at the appointed time, then thinks that described things-internet gateway is not online.
CN201410663133.7A 2014-11-19 2014-11-19 Data exchange method for gateway and server of Internet of things Active CN104506567B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410663133.7A CN104506567B (en) 2014-11-19 2014-11-19 Data exchange method for gateway and server of Internet of things

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410663133.7A CN104506567B (en) 2014-11-19 2014-11-19 Data exchange method for gateway and server of Internet of things

Publications (2)

Publication Number Publication Date
CN104506567A true CN104506567A (en) 2015-04-08
CN104506567B CN104506567B (en) 2017-09-29

Family

ID=52948282

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410663133.7A Active CN104506567B (en) 2014-11-19 2014-11-19 Data exchange method for gateway and server of Internet of things

Country Status (1)

Country Link
CN (1) CN104506567B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106302722A (en) * 2016-08-13 2017-01-04 上海新时达电气股份有限公司 Elevator things-internet gateway and the data transmission method of elevator Internet of Things
CN106375453A (en) * 2016-09-05 2017-02-01 珠海市魅族科技有限公司 Bidirectional communication device, system and method based on HTTP connection
CN106791192A (en) * 2017-02-09 2017-05-31 浙江风向标科技有限公司 Control the method and device of internet of things equipment
CN107241274A (en) * 2017-06-29 2017-10-10 厦门锐谷通信设备有限公司 A kind of integrated service wireless router of Internet of Things and system
CN110113218A (en) * 2019-05-24 2019-08-09 深圳云里物里科技股份有限公司 A kind of gateway configuration method, system, computer storage medium and electronic equipment
CN110365778A (en) * 2019-07-17 2019-10-22 腾讯科技(深圳)有限公司 A kind of method, apparatus of communication control, electronic equipment and storage medium
CN111030862A (en) * 2019-12-13 2020-04-17 重庆宇来通信设备有限公司 Equipment off-line management system based on acquisition terminal
CN113450784A (en) * 2021-06-25 2021-09-28 仿脑科技(深圳)有限公司 Intelligent voice processing method based on common sense understanding and Internet of things system
CN115086389A (en) * 2022-06-10 2022-09-20 武汉思普崚技术有限公司 Remote control system and method based on trusted address communication

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102377814A (en) * 2010-08-25 2012-03-14 汎惪股份有限公司 Remote assistance service method aiming at embedded operation system
CN102497438A (en) * 2011-12-19 2012-06-13 镇江绿能环保科技有限公司 Environmental monitoring system for outdoor microalga cultivation of wireless sensor network
CN202535391U (en) * 2012-03-20 2012-11-14 魏烈祥 Plug-and-play type household goods union protocol wireless repeater without router
CN103200249A (en) * 2013-03-26 2013-07-10 大连理工大学 Method for achieving Internet of things intelligent data gateway system
US20140143400A1 (en) * 2004-06-30 2014-05-22 Kaseya International Limited Remote computer management using network communications protocol that enables communication through a firewall and/or gateway

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140143400A1 (en) * 2004-06-30 2014-05-22 Kaseya International Limited Remote computer management using network communications protocol that enables communication through a firewall and/or gateway
CN102377814A (en) * 2010-08-25 2012-03-14 汎惪股份有限公司 Remote assistance service method aiming at embedded operation system
CN102497438A (en) * 2011-12-19 2012-06-13 镇江绿能环保科技有限公司 Environmental monitoring system for outdoor microalga cultivation of wireless sensor network
CN202535391U (en) * 2012-03-20 2012-11-14 魏烈祥 Plug-and-play type household goods union protocol wireless repeater without router
CN103200249A (en) * 2013-03-26 2013-07-10 大连理工大学 Method for achieving Internet of things intelligent data gateway system

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106302722A (en) * 2016-08-13 2017-01-04 上海新时达电气股份有限公司 Elevator things-internet gateway and the data transmission method of elevator Internet of Things
CN106375453A (en) * 2016-09-05 2017-02-01 珠海市魅族科技有限公司 Bidirectional communication device, system and method based on HTTP connection
CN106791192A (en) * 2017-02-09 2017-05-31 浙江风向标科技有限公司 Control the method and device of internet of things equipment
CN107241274A (en) * 2017-06-29 2017-10-10 厦门锐谷通信设备有限公司 A kind of integrated service wireless router of Internet of Things and system
CN107241274B (en) * 2017-06-29 2023-04-25 厦门锐谷通信设备有限公司 Internet of things integrated service wireless router and system
CN110113218A (en) * 2019-05-24 2019-08-09 深圳云里物里科技股份有限公司 A kind of gateway configuration method, system, computer storage medium and electronic equipment
CN110365778A (en) * 2019-07-17 2019-10-22 腾讯科技(深圳)有限公司 A kind of method, apparatus of communication control, electronic equipment and storage medium
CN110365778B (en) * 2019-07-17 2021-09-07 腾讯科技(深圳)有限公司 Communication control method and device, electronic equipment and storage medium
CN111030862A (en) * 2019-12-13 2020-04-17 重庆宇来通信设备有限公司 Equipment off-line management system based on acquisition terminal
CN111030862B (en) * 2019-12-13 2023-04-18 重庆宇来通信设备有限公司 Equipment off-line management system based on acquisition terminal
CN113450784A (en) * 2021-06-25 2021-09-28 仿脑科技(深圳)有限公司 Intelligent voice processing method based on common sense understanding and Internet of things system
CN115086389A (en) * 2022-06-10 2022-09-20 武汉思普崚技术有限公司 Remote control system and method based on trusted address communication

Also Published As

Publication number Publication date
CN104506567B (en) 2017-09-29

Similar Documents

Publication Publication Date Title
CN104506567A (en) Data exchange method for gateway and server of Internet of things
CN110300050A (en) Information push method, device, computer equipment and storage medium
CN103108089B (en) Connection establishment management method of network system and related system thereof
CN101789981B (en) Method and equipment for dual-stack data transmission
RU2013114348A (en) UNIFIED RE-CONNECTION TO MULTIPLE REMOTE SERVERS
CN102754400B (en) For based on the method and system realizing the integrated networking telephone in the network of cloud
JP2008098888A (en) Relay server
CN110839046B (en) Multi-protocol intercommunication method and system
WO2011144154A1 (en) Method, device and system for allocating internet protocol address of external network in network address translation pass-through
KR20050077688A (en) System and method for reestablishing the session between terminal and server
CN102845123A (en) Virtual private cloud connection method and tunnel proxy server
US10015204B2 (en) Method, terminal, and server for restoring transmission of session content
CN105577851A (en) P2P communication method, P2P server and terminal
CN106604119A (en) Network penetrating method and system of intelligent TV private cloud equipment
CN101778425A (en) Method for dynamically balancing broadband access server load in wireless local area network
EP4360288A1 (en) Systems and methods for performing automatic session control function change over
CN103685398B (en) Communication connection method for building up and communication system
CN106936935B (en) Remote control method and device
CN104954321A (en) Connection switching method, device and system
CN102647432A (en) Authentication information transmission method, device and authentication middleware
US20090077230A1 (en) Call processing system and method
CN104243473A (en) Data transmission method and device
CN107454178B (en) Data transmission method and device
CN102932470B (en) Handheld device controls the method and system of computer terminal
CN103297532A (en) Direct access storage method by ONVIF (Open Network Video Interface Forum) protocol

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20220516

Address after: Room 101, 1st floor, building 5, yard 58, Jinghai fifth road, East Road, economic and Technological Development Zone, Daxing District, Beijing 100176

Patentee after: Next Generation Internet key technology and Co.,Ltd. of ERC of evaluation and test Beijing

Address before: No. 124, 1st floor, zone 3, No. 12, Hongda North Road, economic and Technological Development Zone, Daxing District, Beijing 100176

Patentee before: Beijing Internet Institute Co.,Ltd.

TR01 Transfer of patent right