Movatterモバイル変換


[0]ホーム

URL:


CN105072145A - IOT (Internet of Things) communication method and system - Google Patents

IOT (Internet of Things) communication method and system
Download PDF

Info

Publication number
CN105072145A
CN105072145ACN201510386356.8ACN201510386356ACN105072145ACN 105072145 ACN105072145 ACN 105072145ACN 201510386356 ACN201510386356 ACN 201510386356ACN 105072145 ACN105072145 ACN 105072145A
Authority
CN
China
Prior art keywords
server
connection
terminal equipment
message
gateway
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
Application number
CN201510386356.8A
Other languages
Chinese (zh)
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.)
Qingdao Haier Intelligent Home Appliance Technology Co Ltd
Original Assignee
Qingdao Haier Intelligent Home Appliance 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 Qingdao Haier Intelligent Home Appliance Technology Co LtdfiledCriticalQingdao Haier Intelligent Home Appliance Technology Co Ltd
Priority to CN201510386356.8ApriorityCriticalpatent/CN105072145A/en
Publication of CN105072145ApublicationCriticalpatent/CN105072145A/en
Pendinglegal-statusCriticalCurrent

Links

Classifications

Landscapes

Abstract

The invention discloses an IOT (Internet of Things) communication method and system. Through the building of a connection server and a business server, the method and system achieve the stable connection of terminal equipment in the IOT and the high-efficiency processing of business data, and effectively solve a problem that a server in the IOT in the prior art is low in processing efficiency, wherein the connection server is used for connecting the terminal equipment, and the business server is used for processing various types of businesses of the terminal equipment.

Description

Translated fromChinese
一种物联网的通信方法及系统Communication method and system for internet of things

技术领域technical field

本发明涉及通信技术领域,尤其涉及一种物联网的通信方法及系统。The present invention relates to the field of communication technologies, in particular to a communication method and system for the Internet of Things.

背景技术Background technique

近年来随着物联网的发展,越来越多的终端设备都具有网络功能,并且需要连接到服务器,手机app通过服务器可以远程操作终端设备,因此,服务器需要一套高效、稳定的通信系统来支撑设备的连接以及收发数据。随着终端设备的增加,服务器的压力倍增,处理消息能力缓慢,无法高效处理终端设备消息。In recent years, with the development of the Internet of Things, more and more terminal devices have network functions and need to be connected to the server. The mobile app can remotely operate the terminal device through the server. Therefore, the server needs an efficient and stable communication system to support Device connection and sending and receiving data. With the increase of terminal devices, the pressure on the server doubles, and the ability to process messages is slow, making it impossible to efficiently process terminal device messages.

发明内容Contents of the invention

鉴于上述的分析,本发明旨在提供一种物联网的通信方法及系统,用以解决现有技术中物联网中的服务器处理效率低的问题。In view of the above analysis, the present invention aims to provide a communication method and system for the Internet of Things to solve the problem of low processing efficiency of servers in the Internet of Things in the prior art.

为解决上述问题,本发明主要是通过以下技术方案实现的:In order to solve the above problems, the present invention is mainly achieved through the following technical solutions:

一方面,本发明提供了一种物联网的通信方法,该方法包括:On the one hand, the present invention provides a kind of communication method of Internet of things, and this method comprises:

通过网关建立连接服务器与终端设备的连接;Establish a connection between the connection server and the terminal device through the gateway;

所述连接服务器将所述终端设备发来的消息发送给业务服务器进行处理,并将所述业务服务器的处理结果返回给所述终端设备。The connection server sends the message sent by the terminal device to the service server for processing, and returns the processing result of the service server to the terminal device.

优选地,所述连接服务器、所述网关和所述业务服务器均为分布式集群部署。Preferably, the connection server, the gateway and the service server are deployed in a distributed cluster.

优选地,所述连接服务器将所述终端设备发来的消息发送给业务服务器进行处理,并将所述业务服务器的处理结果返回给所述终端设备具体包括:Preferably, the connection server sends the message sent by the terminal device to the service server for processing, and returning the processing result of the service server to the terminal device specifically includes:

所述连接服务器将所述终端设备发来的消息发送给消息队列服务器;所述消息队列服务器是分布式集群部署的;The connection server sends the message sent by the terminal device to the message queue server; the message queue server is deployed in a distributed cluster;

所述消息队列服务器将所述消息发送给所述业务服务器;The message queue server sends the message to the service server;

所述业务服务器根据所述消息进行处理,并将处理结果发送给所述消息队列服务器;The service server performs processing according to the message, and sends the processing result to the message queue server;

所述消息队列服务器将处理结果通过所述连接服务器返回给所述终端设备。The message queue server returns the processing result to the terminal device through the connection server.

优选地,所述通过网关建立连接服务器与终端设备的连接具体包括:Preferably, the establishment of the connection between the connection server and the terminal device through the gateway specifically includes:

所述网关根据所述终端设备的位置,以及各个连接服务器已连接的终端设备的数量,确定所述终端设备所连接的连接服务器,并建立所述终端设备与该连接服务器的连接。The gateway determines the connection server to which the terminal device is connected according to the location of the terminal device and the number of terminal devices connected to each connection server, and establishes a connection between the terminal device and the connection server.

优选地,所述终端设备包括家电终端设备和移动终端设备;Preferably, the terminal equipment includes home appliance terminal equipment and mobile terminal equipment;

所述网关建立连接服务器与终端设备的连接具体包括:The gateway establishing a connection between the connection server and the terminal device specifically includes:

所述网关将家电终端设备和移动终端设备分别连接在不同的连接服务器上。The gateway connects the home appliance terminal equipment and the mobile terminal equipment to different connection servers.

本发明再一方面提供了一种物联网的通信系统,该系统包括:Another aspect of the present invention provides a communication system of the Internet of Things, the system includes:

网关,用于建立连接服务器与终端设备的连接,并将所述连接服务器发送来的处理结果发送给所述终端设备;a gateway, configured to establish a connection between the connection server and the terminal device, and send the processing result sent by the connection server to the terminal device;

所述连接服务器,用于将所述网关发来的消息发送给业务服务器,并将所述业务服务器发来的处理结果发送给所述网关;The connection server is configured to send the message sent by the gateway to the service server, and send the processing result sent by the service server to the gateway;

所述业务服务器,用于根据所述连接服务器发送来的消息进行处理,并将处理结果返回给所述连接服务器。The service server is configured to process according to the message sent by the connection server, and return the processing result to the connection server.

优选地,所述连接服务器、所述网关和所述业务服务器均为分布式集群部署。Preferably, the connection server, the gateway and the service server are deployed in a distributed cluster.

优选地,该系统还包括:分布式集群部署的消息队列服务器;Preferably, the system also includes: a message queue server deployed in a distributed cluster;

所述连接服务器还用于,将所述网关发来的消息发送给所述消息队列服务器,接收所述消息队列服务器发来的处理结果,并发送给所述网关;The connection server is further configured to send the message sent by the gateway to the message queue server, receive the processing result sent by the message queue server, and send it to the gateway;

所述消息队列服务器,用于将所述消息发送给所述业务服务器,接收所述业务服务器发来的处理结果,并将所述处理结果发送给所述连接服务器;The message queue server is configured to send the message to the service server, receive the processing result sent by the service server, and send the processing result to the connection server;

所述业务服务器,用于根据所述消息进行处理,并将处理结果发送给所述消息队列服务器。The service server is configured to process according to the message, and send the processing result to the message queue server.

优选地,所述网关具体用于,根据所述终端设备的位置,以及各个连接服务器所连接的终端设备的数量,确定所述终端设备具体所连接的连接服务器,并建立所述终端设备与该连接服务器的连接。Preferably, the gateway is specifically configured to, according to the location of the terminal device and the number of terminal devices connected to each connection server, determine the specific connection server to which the terminal device is connected, and establish the connection between the terminal device and the Connection to the server.

优选地,所述终端设备包括家电终端设备和移动终端设备;Preferably, the terminal equipment includes home appliance terminal equipment and mobile terminal equipment;

所述网关具体用于,将家电终端设备和移动终端设备分别连接在不同的连接服务器上。The gateway is specifically used to connect the home appliance terminal device and the mobile terminal device to different connection servers.

本发明有益效果如下:The beneficial effects of the present invention are as follows:

本发明通过建立连接服务器和业务服务器,其中,连接服务器用于与终端设备连接,业务服务器用于处理终端设备的各种业务,从而实现物联网中终端设备的稳定连接,以及业务数据的高效处理,有效解决了现有技术中物联网中的服务器处理效率低的问题。The present invention establishes a connection server and a service server, wherein the connection server is used to connect with terminal equipment, and the service server is used to process various services of the terminal equipment, thereby realizing stable connection of terminal equipment in the Internet of Things and efficient processing of business data , effectively solving the problem of low server processing efficiency in the Internet of Things in the prior art.

本发明的其他特征和优点将在随后的说明书中阐述,并且部分的从说明书中变得显而易见,或者通过实施本发明而了解。本发明的目的和其他优点可通过在所写的说明书、权利要求书、以及附图中所特别指出的结构来实现和获得。Additional features and advantages of the invention will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.

附图说明Description of drawings

图1为本发明实施例的一种物联网的通信方法的流程图;FIG. 1 is a flowchart of a communication method for the Internet of Things according to an embodiment of the present invention;

图2为本发明实施例的一种物联网的通信系统的连接结构示意图;2 is a schematic diagram of a connection structure of a communication system of the Internet of Things according to an embodiment of the present invention;

图3为本发明实施例的另一种物联网的通信系统的连接结构示意图。FIG. 3 is a schematic diagram of a connection structure of another communication system of the Internet of Things according to an embodiment of the present invention.

具体实施方式Detailed ways

下面结合附图来具体描述本发明的优选实施例,其中,附图构成本申请一部分,并与本发明的实施例一起用于阐释本发明的原理。为了清楚和简化目的,当其可能使本发明的主题模糊不清时,将省略本文所描述的器件中已知功能和结构的详细具体说明。Preferred embodiments of the present invention will be specifically described below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of the application and are used together with the embodiments of the present invention to explain the principle of the present invention. For the sake of clarity and simplicity, detailed descriptions of known functions and constructions in the devices described herein will be omitted when it may obscure the subject matter of the present invention.

本发明实施例的主要目的是提供一种物联网的通信方法及系统,本发明通过将现有的物联网中的服务器划分为连接服务器、消息队列服务器以及业务服务器,从而实现物联网中终端设备的稳定连接,以及业务数据的高效处理,下面就通过几个具体实施例对本发明的技术方案进行详细说明。The main purpose of the embodiments of the present invention is to provide a communication method and system for the Internet of Things. The present invention divides the existing servers in the Internet of Things into connection servers, message queue servers, and service servers, so as to realize the communication of terminal devices in the Internet of Things. stable connection and efficient processing of business data, the technical solution of the present invention will be described in detail below through several specific embodiments.

方法实施例method embodiment

本发明实施例提供的一种物联网的通信方法,参见图1和图2,该方法包括:A communication method for the Internet of Things provided by an embodiment of the present invention, see FIG. 1 and FIG. 2, the method includes:

S101、通过网关建立连接服务器与终端设备的连接;S101. Establish a connection between the connection server and the terminal device through the gateway;

S102、连接服务器将所述终端设备发来的消息发送给业务服务器进行处理,并将所述业务服务器的处理结果返回给所述终端设备。S102. The connection server sends the message sent by the terminal device to the service server for processing, and returns the processing result of the service server to the terminal device.

本发明通过建立连接服务器和业务服务器,其中,连接服务器用于与终端设备连接,业务服务器用于处理终端设备的各种业务,从而实现物联网中终端设备的稳定连接,以及业务数据的高效处理,有效解决了现有技术中物联网中的服务器处理效率低的问题。The present invention establishes a connection server and a service server, wherein the connection server is used to connect with terminal equipment, and the service server is used to process various services of the terminal equipment, thereby realizing stable connection of terminal equipment in the Internet of Things and efficient processing of business data , effectively solving the problem of low server processing efficiency in the Internet of Things in the prior art.

需要说明的是,本发明实施例所述的终端设备为任意的智能的联网设备,如家电终端设备和移动终端设备等等,本发明对通信方式并不限制,只要支持标准的TCP/IP就能接入本系统。It should be noted that the terminal device described in the embodiment of the present invention is any intelligent networked device, such as home appliance terminal device and mobile terminal device, etc. The present invention does not limit the communication method, as long as it supports standard TCP/IP can access the system.

本发明实施例所述的移动终端设备为APP智能终端设备,具体为,安装有智能控制应用程序(Application,app)的手机等移动终端,本发明用户通过手机app可以实时控制终端设备,并实时查看设备状态。The mobile terminal device described in the embodiment of the present invention is an APP intelligent terminal device, specifically, a mobile terminal such as a mobile phone installed with an intelligent control application program (Application, app). The user of the present invention can control the terminal device in real time through the mobile phone app, and control the terminal device in real time. Check device status.

本发明实施例的步骤S101具体包括:Step S101 of the embodiment of the present invention specifically includes:

所述网关根据所述终端设备的位置,以及各个连接服务器所连接的终端设备的数量,确定所述终端设备具体所连接的连接服务器,并建立所述终端设备与该连接服务器的连接。The gateway determines the specific connection server to which the terminal device is connected according to the location of the terminal device and the number of terminal devices connected to each connection server, and establishes a connection between the terminal device and the connection server.

即,由于现有的物联网终端设备分布在全国各地,通过引入网关,动态分别不同区域的连接服务器,从而提高终端设备连接的稳定性。That is, since the existing Internet of Things terminal devices are distributed all over the country, by introducing gateways, the connection servers in different regions can be dynamically separated, thereby improving the stability of terminal device connections.

并且,由于家电终端设备在连接以后一般是比较稳定,除非特殊原因,如断电等情况,才与连接设备断开,而移动终端设备则是断续的与连接服务器进行连接,针对该特征,本发明的网关将家电终端设备和移动终端设备分别连接在不同的连接服务器上,即本发明针对终端设备的连接特性,将终端设备分别进行区分连接,也就是说,本发明是针对移动终端设备连接的随机性,为其划分出更多的连接服务器,而对家电终端设备连接的稳定性,为其划分出预定的连接服务器,以更好的满足用户的需求,并使用户获得更好的体验。Moreover, since the home appliance terminal equipment is generally relatively stable after being connected, it is disconnected from the connected equipment unless there are special reasons, such as power failure, etc., while the mobile terminal equipment is intermittently connected to the connection server. For this feature, The gateway of the present invention connects the home appliance terminal equipment and the mobile terminal equipment to different connection servers, that is, the present invention aims at the connection characteristics of the terminal equipment, and distinguishes and connects the terminal equipment respectively, that is to say, the present invention is aimed at mobile terminal equipment The randomness of the connection divides more connection servers for it, and for the stability of the connection of home appliance terminal equipment, it divides a predetermined connection server for it, so as to better meet the needs of users and enable users to obtain better experience.

针对连接的终端设备终端的问题,本发明引入网关和连接服务器,并且本发明的网关和连接服务器可动态扩展,从而使本发明可支持亿级的终端设备的连接。Aiming at the problem of connected terminal devices, the present invention introduces a gateway and a connection server, and the gateway and connection server of the present invention can be dynamically expanded, so that the present invention can support the connection of hundreds of millions of terminal devices.

图3为本发明实施例的另一种物联网的通信系统的连接结构示意图,如图3所示,本发明实施例所述方法还可包括消息队列服务器,具体的,Fig. 3 is a schematic diagram of the connection structure of another communication system of the Internet of Things according to an embodiment of the present invention. As shown in Fig. 3, the method described in the embodiment of the present invention may also include a message queue server, specifically,

所述连接服务器将所述终端设备发来的消息发送给业务服务器进行处理,并将所述业务服务器的处理结果返回给所述终端设备具体包括:The connection server sends the message sent by the terminal device to the service server for processing, and returns the processing result of the service server to the terminal device, specifically including:

所述连接服务器将所述终端设备发来的消息发送给所述消息队列服务器;The connection server sends the message sent by the terminal device to the message queue server;

所述消息队列服务器将所述消息依次发送给所述业务服务器;The message queue server sequentially sends the messages to the service server;

所述业务服务器根据所述消息进行处理,并将处理结果发送给所述消息队列服务器;The service server performs processing according to the message, and sends the processing result to the message queue server;

所述消息队列服务器依次将处理结果通过所述连接服务器返回给所述终端设备。The message queue server sequentially returns the processing results to the terminal device through the connection server.

需要说明的是,本发明实施例所述连接服务器、所述网关、所述消息队列服务器和所述业务服务器均为分布式集群部署,通过分布式集群部署的连接服务器、网关、消息队列服务器和业务服务器可以大大条服务器的处理效率。It should be noted that the connection server, the gateway, the message queue server, and the service server in the embodiment of the present invention are all deployed in a distributed cluster, and the connection server, gateway, message queue server, and The business server can greatly improve the processing efficiency of the server.

本发明实施例所述的连接服务器主要保持TCP/IP的socket长连接状态的服务器,不具有任何业务处理能力,只负责设备socket连接持有以及收发消息。The connection server described in the embodiment of the present invention mainly maintains the server of the TCP/IP socket long connection state, does not have any business processing capability, and is only responsible for holding the socket connection of the device and sending and receiving messages.

本发明实施例所述的消息队列服务器:负责连接服务器和业务服务器中间的消息传递。连接服务器接收到消息通知消息队列服务器,然后再通知业务服务器,业务处理完消息再通知消息队列服务器,然后通知连接服务器推送消息给终端设备。The message queue server described in the embodiment of the present invention is responsible for the message transfer between the connection server and the service server. The connection server notifies the message queue server after receiving the message, and then notifies the business server, and then notifies the message queue server after the business has processed the message, and then notifies the connection server to push the message to the terminal device.

本发明实施例所述的业务服务器仅负责从消息队列里接收消息,并处理具体业务逻辑处理,处理完结果返回给队列服务器,并发送给连接服务器,连接服务器发送消息给对应设备。The business server described in the embodiment of the present invention is only responsible for receiving messages from the message queue, and processing specific business logic processing, and returns the processing result to the queue server, and sends it to the connection server, and the connection server sends the message to the corresponding device.

本发明实施例所述的网关,或者称为网关服务器具体是根据终端设备所在地域以及其它因素,将终端设备分配到最近且最稳定的连接服务器。The gateway described in the embodiment of the present invention, or referred to as a gateway server, specifically assigns the terminal device to the nearest and most stable connection server according to the region where the terminal device is located and other factors.

下面将结合几个具体例子对本发明所述的方法进行详细的说明:The method described in the present invention will be described in detail below in conjunction with several specific examples:

1)本发明终端设备接入流程具体包括:1) The terminal device access process of the present invention specifically includes:

步骤a.终端设备上电启动,发送请求登录网关服务器。Step a. The terminal device is powered on and starts, and sends a request to log in to the gateway server.

步骤b.网关根据终端的上报信息分配相应连接服务器的ip地址。Step b. The gateway allocates the ip address of the corresponding connection server according to the information reported by the terminal.

步骤c.网关服务器保存设备的mac,分配的ip地址到数据库中。Step c. The gateway server saves the mac of the device and the assigned ip address in the database.

步骤d.网关服务器把分配的好的ip地址发送给终端设备。Step d. The gateway server sends the assigned ip address to the terminal device.

步骤e.终端设备根据网关服务器分配的ip地址连接服务器。Step e. The terminal device connects to the server according to the IP address assigned by the gateway server.

需要说明的是:It should be noted:

本发明步骤b中终端设备上电发送请求信息到网关,网关是根据终端设备的mac地址和ip地址分配连接服务器的ip地址的。连接服务器都是分多台集群部署的,且连接服务器都是分布在全国各地,网关服务器的职责为分配设备距离离得最近且连接数最少的服务器。In step b of the present invention, the terminal device is powered on and sends request information to the gateway, and the gateway allocates the ip address of the connection server according to the mac address and ip address of the terminal device. The connection servers are deployed in multiple clusters, and the connection servers are distributed all over the country. The responsibility of the gateway server is to allocate the server with the closest distance to the device and the fewest number of connections.

本发明步骤c中需要保存mac的地址以及分配的ip地址到数据库中,此为方便查询哪台设备连接了哪台连接服务器。In the step c of the present invention, the address of the mac and the assigned ip address need to be saved in the database, which is convenient for querying which connection server is connected to which device.

本发明步骤e中根据网关服务器分配的ip地址,终端设备可以连接相应的连接服务器,这样连接服务器可以水平扩展,可以支持亿级的设备连接。In step e of the present invention, according to the ip address allocated by the gateway server, the terminal device can connect to the corresponding connection server, so that the connection server can be expanded horizontally and can support hundreds of millions of device connections.

2)本发明终端设备发送消息流程包括:2) The process of sending a message by the terminal device of the present invention includes:

步骤a.设备发送状态消息;Step a. The device sends a status message;

步骤b.连接服务器收到设备的状态消息;Step b. The connection server receives the status message of the device;

步骤c.连接服务器把消息发送到接收消息队列服务器;Step c. connect the server and send the message to the receiving message queue server;

步骤d.判断接收消息队列是否有消息,如果有则业务服务器获取消息,并处理消息,否则返回;Step d. Judging whether there is a message in the receiving message queue, if there is, the business server obtains the message and processes the message, otherwise returns;

步骤e.业务服务器处理完消息,处理结果放入发送消息队列服务器;Step e. The business server finishes processing the message, and the processing result is put into the sending message queue server;

步骤f.连接服务器获取发送消息队列服务器消息,发送消息给设备。Step f. Connect to the server to obtain the message from the sending message queue server, and send the message to the device.

需要说明的是,本发明步骤c和e中接收,发送队列消息服务器与连接服务器和业务服务器是分布式集群部署的,这样可以支持亿级的设备同时发送消息。连接服务器只负责设备连接的保持,不负责业务逻辑的处理,业务逻辑处理由业务服务器单独处理,处理完后放到发送队列服务器中,然后连接服务器通过发送队列发送给设备消息。It should be noted that, in steps c and e of the present invention, the receiving and sending queue message server, the connection server and the business server are deployed in a distributed cluster, which can support hundreds of millions of devices to send messages at the same time. The connection server is only responsible for maintaining the device connection, not for the processing of business logic. The business logic processing is handled by the business server alone. After processing, it is placed in the sending queue server, and then the connection server sends messages to the device through the sending queue.

3)本发明手机app终端发送控制消息流程具体包括:3) The mobile phone app terminal of the present invention sends a control message flow specifically including:

步骤a.手机app发送控制消息控制设备;Step a. The mobile phone app sends a control message to control the device;

步骤b.连接服务器接收到手机发送的消息;Step b. The connection server receives the message sent by the mobile phone;

步骤c.连接服务器发送控制消息到接收队列中;Step c. connect to the server and send the control message to the receiving queue;

步骤d.业务服务器接收到队列中的控制消息并做业务处理;Step d. The business server receives the control message in the queue and performs business processing;

步骤e.业务服务器根据控制消息判断手机app控制的是哪个设备,解析出相应的mac地址;Step e. The business server judges which device is controlled by the mobile app according to the control message, and resolves the corresponding mac address;

步骤f.业务服务器根据mac地址获取需要发送的服务器;Step f. The business server obtains the server to be sent according to the mac address;

步骤g.业务服务器发送给发送消息队列服务器;Step g. The business server sends it to the sending message queue server;

步骤h.发送队列服务器通知连接服务器有消息,并发送设备消息。Step h. The send queue server notifies the connection server that there is a message, and sends the message to the device.

需要说明的是,本发明步骤a中手机app连接的连接服务器与设备连接的连接服务器是不同类型的服务器,因为app的连接不会一直保持,一般都是用户打开app时才连接,关闭app时连接关闭,而设备连接是只要设备不断电设备就一直连接服务器,所以app与设备分开部署这样有利于系统的稳定性和高效性。It should be noted that the connection server connected to the mobile phone app in step a of the present invention is a different type of server from the connection server connected to the device, because the connection of the app will not be maintained all the time, and it is generally connected when the user opens the app, and when the app is closed The connection is closed, and the device connection is always connected to the server as long as the device is not powered off, so the separate deployment of the app and the device is conducive to the stability and efficiency of the system.

上述步骤c中接收消息队列服务器为app的消息队列服务器,与设备的接收消息队列服务器不同,分开部署的原因同上。In the above step c, the receiving message queue server is the message queue server of the app, which is different from the receiving message queue server of the device, and the reason for separate deployment is the same as above.

上述步骤f中app发送控制消息给设备,业务服务器需要从消息中解析需要发送的设备的mac,根据mac地址选择需要发送的发送消息队列服务器。In the above step f, the app sends a control message to the device, and the service server needs to analyze the mac of the device to be sent from the message, and select the message queue server to be sent according to the mac address.

装置实施例Device embodiment

本发明实施例提供了一种物联网的通信系统,参见图2,该装置包括:The embodiment of the present invention provides a communication system of the Internet of Things, referring to Fig. 2, the device includes:

网关,用于建立连接服务器与终端设备的连接,并将所述连接服务器发送来的处理结果发送给所述终端设备;a gateway, configured to establish a connection between the connection server and the terminal device, and send the processing result sent by the connection server to the terminal device;

所述连接服务器,用于将所述网关发来的消息发送给业务服务器,并将所述业务服务器发来的处理结果发送给所述网关;The connection server is configured to send the message sent by the gateway to the service server, and send the processing result sent by the service server to the gateway;

所述业务服务器,用于根据所述连接服务器发送来的消息进行处理,并将处理结果返回给所述连接服务器。The service server is configured to process according to the message sent by the connection server, and return the processing result to the connection server.

本发明通过建立连接服务器和业务服务器,其中,连接服务器用于与终端设备连接,业务服务器用于处理终端设备的各种业务,从而实现物联网中终端设备的稳定连接,以及业务数据的高效处理,有效解决了现有技术中物联网中的服务器处理效率低的问题。The present invention establishes a connection server and a service server, wherein the connection server is used to connect with terminal equipment, and the service server is used to process various services of the terminal equipment, thereby realizing stable connection of terminal equipment in the Internet of Things and efficient processing of business data , effectively solving the problem of low server processing efficiency in the Internet of Things in the prior art.

本发明实施例所述连接服务器、所述网关和所述业务服务器均为分布式集群部署。The connection server, the gateway, and the service server in the embodiment of the present invention are all deployed in a distributed cluster.

需要说明的是,本发明实施例所述的终端设备为任意的智能的联网设备,如家电终端设备和移动终端设备等等,本发明对通信方式并不限制,只要支持标准的TCP/IP就能接入本系统。It should be noted that the terminal device described in the embodiment of the present invention is any intelligent networked device, such as home appliance terminal device and mobile terminal device, etc. The present invention does not limit the communication method, as long as it supports standard TCP/IP can access the system.

本发明实施例所述的移动终端设备为APP智能终端设备,具体为,安装有智能控制应用程序(Application,app)的手机等移动终端,本发明用户通过手机app可以实时控制终端设备,并实时查看设备状态。The mobile terminal device described in the embodiment of the present invention is an APP intelligent terminal device, specifically, a mobile terminal such as a mobile phone installed with an intelligent control application program (Application, app). The user of the present invention can control the terminal device in real time through the mobile phone app, and control the terminal device in real time. Check device status.

本发明还提供了一种优选的实施例,具体为,该系统还包括:分布式集群部署的消息队列服务器,具体参见图3;The present invention also provides a preferred embodiment, specifically, the system further includes: a message queue server deployed in a distributed cluster, see FIG. 3 for details;

所述连接服务器还用于,将所述终端设备发来的消息发送给所述消息队列服务器,接收所述消息队列服务器发来的处理结果,并发送给所述网关;The connection server is further configured to send the message sent by the terminal device to the message queue server, receive the processing result sent by the message queue server, and send it to the gateway;

所述消息队列服务器,用于将所述消息依次发送给所述业务服务器,接收所述业务服务器发来的处理结果,并将所述处理结果依次发送给所述连接服务器;The message queue server is configured to sequentially send the messages to the service server, receive the processing results sent by the service server, and sequentially send the processing results to the connection server;

所述业务服务器,用于根据所述消息进行处理,并将处理结果发送给所述消息队列服务器。The service server is configured to process according to the message, and send the processing result to the message queue server.

优选地,本发明实施例所述的网关具体用于,根据所述终端设备的位置,以及各个连接服务器所连接的终端设备的数量,确定所述终端设备具体所连接的连接服务器,并建立所述终端设备与该连接服务器的连接。Preferably, the gateway described in the embodiment of the present invention is specifically used to determine the specific connection server connected to the terminal device according to the location of the terminal device and the number of terminal devices connected to each connection server, and establish the connection server. The connection between the terminal device and the connection server.

即,由于现有的物联网终端设备分布在全国各地,通过引入网关,动态分别不同区域的连接服务器,从而提高终端设备连接的稳定性。That is, since the existing Internet of Things terminal devices are distributed all over the country, by introducing gateways, the connection servers in different regions can be dynamically separated, thereby improving the stability of terminal device connections.

并且,由于家电终端设备在连接以后一般是比较稳定,除非特殊原因,如断电等情况才与连接设备断开,而移动终端设备则是断续的与连接服务器进行连接,针对该特征,本发明的网关将家电终端设备和移动终端设备分别连接在不同的连接服务器上,即本发明针对终端设备的连接特性,将终端设备分别进行区分连接,或者可以说,本发明是针对移动终端设备连接的随机性,为其划分出更多的连接服务器,而对家电终端设备连接的稳定性,为其划分出预定的连接服务器,以更好的满足用户的需求,并使用户获得更好的体验。Moreover, since home appliance terminal equipment is generally relatively stable after being connected, it is disconnected from the connected equipment unless there are special reasons, such as power failure, etc., while mobile terminal equipment is intermittently connected to the connection server. The gateway of the invention connects the home appliance terminal equipment and the mobile terminal equipment to different connection servers, that is, the present invention aims at the connection characteristics of the terminal equipment, and distinguishes and connects the terminal equipment respectively, or it can be said that the present invention is aimed at connecting the mobile terminal equipment. For the randomness of the network, more connection servers are allocated for it, and for the stability of the connection of home appliance terminal equipment, a predetermined connection server is allocated for it, so as to better meet the needs of users and enable users to obtain a better experience .

本发明实施例所述终端设备包括家电终端设备和移动终端设备;The terminal device described in the embodiment of the present invention includes a home appliance terminal device and a mobile terminal device;

所述网关还用于,将家电终端设备和移动终端设备分别连接在不同的连接服务器上。The gateway is also used to connect the home appliance terminal device and the mobile terminal device to different connection servers.

需要说明的是,本发明实施例所述连接服务器、所述网关、所述消息队列服务器和所述业务服务器均为分布式集群部署,通过分布式集群部署的连接服务器、网关、消息队列服务器和业务服务器可以大大条服务器的处理效率。It should be noted that the connection server, the gateway, the message queue server, and the service server in the embodiment of the present invention are all deployed in a distributed cluster, and the connection server, gateway, message queue server, and The business server can greatly improve the processing efficiency of the server.

本发明实施例所述的连接服务器主要保持TCP/IP的socket长连接状态的服务器,不具有任何业务处理能力,只负责设备socket连接持有以及收发消息。The connection server described in the embodiment of the present invention mainly maintains the server of the TCP/IP socket long connection state, does not have any business processing capability, and is only responsible for holding the socket connection of the device and sending and receiving messages.

本发明实施例所述的消息队列服务器:负责连接服务器和业务服务器中间的消息传递。连接服务器接收到消息通知消息队列服务器,然后再通知业务服务器,业务处理完消息再通知消息队列服务器,然后通知连接服务器推送消息给终端设备。The message queue server described in the embodiment of the present invention is responsible for the message transfer between the connection server and the service server. The connection server notifies the message queue server after receiving the message, and then notifies the business server, and then notifies the message queue server after the business has processed the message, and then notifies the connection server to push the message to the terminal device.

本发明实施例所述的业务服务器仅负责从消息队列里接收消息,并处理具体业务逻辑处理,处理完结果返回给队列服务器,并发送给连接服务器,连接服务器发送消息给对应设备。The business server described in the embodiment of the present invention is only responsible for receiving messages from the message queue, and processing specific business logic processing, and returns the processing result to the queue server, and sends it to the connection server, and the connection server sends the message to the corresponding device.

本发明实施例所述的网关,或者称为网关服务器具体是根据终端设备所在地域以及其它因素,将终端设备分配到最近且最稳定的连接服务器。The gateway described in the embodiment of the present invention, or referred to as a gateway server, specifically assigns the terminal device to the nearest and most stable connection server according to the region where the terminal device is located and other factors.

本发明实施例的装置中的内容可参考方法部分的相关内容进行理解,在此不再赘述。The content in the device in the embodiment of the present invention can be understood with reference to the relevant content in the method part, and details are not repeated here.

本发明至少能够带来以下有益效果:The present invention can at least bring the following beneficial effects:

本发明通过将现有的物联网的服务器改为连接服务器、消息队列服务器以及业务服务器,每个服务器负责不同功能,从而实现物联网中终端设备的稳定连接,以及业务数据的高效处理,有效解决了现有技术中物联网中的服务器处理效率低的问题。The present invention changes the existing server of the Internet of Things into a connection server, a message queue server, and a business server, and each server is responsible for different functions, thereby realizing stable connection of terminal devices in the Internet of Things and efficient processing of business data, effectively solving the problem of The problem of low server processing efficiency in the Internet of Things in the prior art is solved.

以上所述,仅为本发明较佳的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应该以权利要求书的保护范围为准。The above is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of changes or modifications within the technical scope disclosed in the present invention. Replacement should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be determined by the protection scope of the claims.

Claims (10)

CN201510386356.8A2015-06-302015-06-30IOT (Internet of Things) communication method and systemPendingCN105072145A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201510386356.8ACN105072145A (en)2015-06-302015-06-30IOT (Internet of Things) communication method and system

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201510386356.8ACN105072145A (en)2015-06-302015-06-30IOT (Internet of Things) communication method and system

Publications (1)

Publication NumberPublication Date
CN105072145Atrue CN105072145A (en)2015-11-18

Family

ID=54501424

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201510386356.8APendingCN105072145A (en)2015-06-302015-06-30IOT (Internet of Things) communication method and system

Country Status (1)

CountryLink
CN (1)CN105072145A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106844068A (en)*2017-02-152017-06-13厦门科立安信息技术有限公司A kind of wisdom parking lot management general module docking calculation and management system
CN108989467A (en)*2018-08-312018-12-11安徽江淮汽车集团股份有限公司Centralized addressing method
CN109361720A (en)*2017-12-282019-02-19广州Tcl智能家居科技有限公司Method, system, storage medium and server based on product category access cluster
CN110417629A (en)*2019-07-262019-11-05深圳市浩科电子有限公司The method and system of one kind of multiple different types of internet of things equipment access Internet of Things
CN112565334A (en)*2020-11-042021-03-26深圳市宏电技术股份有限公司Access method and device of Internet of things equipment and MQTT gateway
CN113992686A (en)*2021-11-122022-01-28江苏智联天地科技有限公司Data transmission system of Internet of things

Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101859134A (en)*2009-04-092010-10-13广州市聚晖电子科技有限公司Intelligent home appliance remote control system and method
CN102638460A (en)*2012-03-262012-08-15华为终端有限公司Residential gateway, cloud server and method for communicating residential gateway and cloud server
US20140289366A1 (en)*2013-03-202014-09-25Korea Advanced Institute Of Science And TechnologyService providing method and system for instance hosting
CN104363278A (en)*2014-11-132015-02-18许继电气股份有限公司Mass terminal communication access system
CN104660498A (en)*2015-03-172015-05-27联想(北京)有限公司Gateway equipment and information processing method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101859134A (en)*2009-04-092010-10-13广州市聚晖电子科技有限公司Intelligent home appliance remote control system and method
CN102638460A (en)*2012-03-262012-08-15华为终端有限公司Residential gateway, cloud server and method for communicating residential gateway and cloud server
US20140289366A1 (en)*2013-03-202014-09-25Korea Advanced Institute Of Science And TechnologyService providing method and system for instance hosting
CN104363278A (en)*2014-11-132015-02-18许继电气股份有限公司Mass terminal communication access system
CN104660498A (en)*2015-03-172015-05-27联想(北京)有限公司Gateway equipment and information processing method

Cited By (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106844068A (en)*2017-02-152017-06-13厦门科立安信息技术有限公司A kind of wisdom parking lot management general module docking calculation and management system
CN109361720A (en)*2017-12-282019-02-19广州Tcl智能家居科技有限公司Method, system, storage medium and server based on product category access cluster
CN108989467A (en)*2018-08-312018-12-11安徽江淮汽车集团股份有限公司Centralized addressing method
CN110417629A (en)*2019-07-262019-11-05深圳市浩科电子有限公司The method and system of one kind of multiple different types of internet of things equipment access Internet of Things
CN112565334A (en)*2020-11-042021-03-26深圳市宏电技术股份有限公司Access method and device of Internet of things equipment and MQTT gateway
CN112565334B (en)*2020-11-042022-10-25深圳市宏电技术股份有限公司Access method and device of Internet of things equipment and MQTT gateway
CN113992686A (en)*2021-11-122022-01-28江苏智联天地科技有限公司Data transmission system of Internet of things

Similar Documents

PublicationPublication DateTitle
CN105072145A (en)IOT (Internet of Things) communication method and system
CN102761864B (en)Data transmission method, system and device
CN110071984A (en)A kind of network identity mapping method and system and terminal, mark gateway
CN103874035B (en)A kind of Mobile terminal message push method and equipment
CN104468649B (en)Server, terminal, data delivery system and data push method
CN103312528B (en)A kind of heartbeat message sending method and user terminal
CN102595208A (en)Cloud terminal control networking video image processing streaming media service system and method
CN103096435A (en)Connection keeping method, device, mobile terminal and data transmitting method
RU2010146258A (en) METHOD, DEVICE AND SYSTEM FOR DISTRIBUTING MESSAGES
CN102960006A (en) Internet of things information processing method, device and management control system
CN106101171B (en) Server connection method and device
CN108200158A (en)request transmission system, method, device and storage medium
CN104486327A (en)Method and client side of communication between pages and long connection servers
CN104243719B (en) Method, system and device for determining heartbeat period of long connection in mobile communication network
CN103188611B (en)Method, device and system for multicast communication of Internet of Things
CN104780082B (en)A kind of means of communication of mobile device and home intelligent terminal
CN108781215B (en)Network service implementation method, service controller and communication system
CN107659930A (en)A kind of AP connection control methods and device
CN106302626A (en)A kind of elastic expansion method, Apparatus and system
CN105681266B (en)A kind of communication cluster method and device of mediaphone MMTel
CN105515936A (en)Method, server and system for message communication
CN106254103B (en)A kind of dynamically configurable method and device of RTMP group system
CN103581107A (en)Server and working mode setting method thereof
KR20140060637A (en)Method, system and apparatus for balancing load
CN115334066A (en)Distributed cluster system and method for processing synchronous request response

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication
RJ01Rejection of invention patent application after publication

Application publication date:20151118


[8]ページ先頭

©2009-2025 Movatter.jp