CN109040204A - For the data processing method of gateway, gateway component and sensor network - Google Patents
For the data processing method of gateway, gateway component and sensor network Download PDFInfo
- Publication number
- CN109040204A CN109040204A CN201810784046.5A CN201810784046A CN109040204A CN 109040204 A CN109040204 A CN 109040204A CN 201810784046 A CN201810784046 A CN 201810784046A CN 109040204 A CN109040204 A CN 109040204A
- Authority
- CN
- China
- Prior art keywords
- gateway
- data
- node
- sensor
- acquisition
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000003672 processing method Methods 0.000 title description 6
- 238000000034 method Methods 0.000 claims abstract description 45
- 230000005540 biological transmission Effects 0.000 claims abstract description 31
- 238000004891 communication Methods 0.000 claims description 35
- 238000012545 processing Methods 0.000 claims description 27
- 238000012790 confirmation Methods 0.000 claims description 10
- 235000006508 Nelumbo nucifera Nutrition 0.000 claims 1
- 240000002853 Nelumbo nucifera Species 0.000 claims 1
- 235000006510 Nelumbo pentapetala Nutrition 0.000 claims 1
- 235000013399 edible fruits Nutrition 0.000 claims 1
- 230000007423 decrease Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000013144 data compression Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/12—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/16—Threshold monitoring
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/12—Avoiding congestion; Recovering from congestion
- H04L47/125—Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
- H04L67/1004—Server selection for load balancing
- H04L67/1008—Server selection for load balancing based on parameters of servers, e.g. available memory or workload
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/568—Storing data temporarily at an intermediate stage, e.g. caching
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Computer Hardware Design (AREA)
- General Engineering & Computer Science (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Description
技术领域technical field
本发明涉及物联网领域,具体地,涉及一种用于网关的数据处理方法、一种执行该数据处理方法的网关组件和一种包括给网关组件的传感器网络。The present invention relates to the field of the Internet of Things, in particular to a data processing method for a gateway, a gateway component for executing the data processing method, and a sensor network including the gateway component.
背景技术Background technique
传感器网络作为物联网的重要组成部分,包括多个传感器节点和多个网关,所述传感网络担负着获取物理世界信息并传输给后台应用的作用。其中,传感器节点的主要功能是采集数据,网关用于对其对应的传感器节点传送的数据进行处理(例如,数据压缩整合、或者协议转换)后,上传至后台服务器,供后台应用使用。As an important part of the Internet of Things, a sensor network includes multiple sensor nodes and multiple gateways, and the sensor network is responsible for acquiring physical world information and transmitting it to background applications. Among them, the main function of the sensor node is to collect data, and the gateway is used to process the data transmitted by its corresponding sensor node (for example, data compression integration, or protocol conversion), and then upload it to the background server for use by the background application.
对于一些检测环境比较复杂的传感器网络,往往会存在某一个或网关接收数据过多无法及时处理、而其他网关工作量较少的情况,不仅降低了数据处理效率,还会造成资源的浪费。For some sensor networks with complex detection environments, there will often be situations where a certain gateway receives too much data and cannot be processed in time, while other gateways have less workload, which not only reduces the data processing efficiency, but also causes waste of resources.
因此,如何提高传感器网络的数据处理效率、提高传感器网络的利用率成为本领域亟待解决的技术问题。Therefore, how to improve the data processing efficiency of the sensor network and improve the utilization rate of the sensor network has become a technical problem to be solved urgently in this field.
发明内容Contents of the invention
本发明的目的在于提供一种用于网关的数据处理方法、一种执行该数据处理方法的网关组件和一种包括给网关组件的传感器网络。所述数据方法可以提高数据的处理效率并提高资源利用率。It is an object of the present invention to provide a data processing method for a gateway, a gateway component performing the data processing method, and a sensor network included to the gateway component. The data method can improve data processing efficiency and resource utilization.
为了实现上述目的,作为本发明的一个方面,提供了一种用于网关的数据传输方法,所述网关用于包括多个传感器节点的传感器网络中,且所述网关对应多个传感器节点,其中,所述数据传输方法包括:In order to achieve the above object, as an aspect of the present invention, a data transmission method for a gateway is provided, the gateway is used in a sensor network including a plurality of sensor nodes, and the gateway corresponds to a plurality of sensor nodes, wherein , the data transmission method includes:
接收与所述网关对应的用作采集节点的传感器节点发送的采集数据;receiving the collection data sent by the sensor node corresponding to the gateway and used as a collection node;
判断所述网关的当前工作负荷是否超过第一预定负荷;judging whether the current workload of the gateway exceeds a first predetermined load;
当所述网关的当前工作负荷未超过所述第一预定负荷时,接收所述采集节点发送的采集数据;When the current workload of the gateway does not exceed the first predetermined load, receive the collection data sent by the collection node;
当所述网关的当前工作负荷超过所述第一预定负荷时,向发送所述采集数据的采集节点发送等待指示信号;When the current workload of the gateway exceeds the first predetermined load, sending a waiting indication signal to the collection node that sends the collection data;
当所述网关的工作负荷由超过所述第一预定负荷降低至所述第一预定负荷以下时,向用作暂存节点的传感器节点以及用作采集节点的传感器节点发送数据获取请求。When the workload of the gateway decreases from exceeding the first predetermined load to below the first predetermined load, a data acquisition request is sent to the sensor node serving as a temporary storage node and the sensor node serving as a collection node.
优选地,所述数据传输方法包括:Preferably, the data transmission method includes:
当同时接受到来自所述采集节点的采集数据和来自所述暂存节点的数据时,优先处理来自所述暂存节点的数据。When the collection data from the collection node and the data from the temporary storage node are received at the same time, the data from the temporary storage node is preferentially processed.
优选地,所述数据传输方法还包括:Preferably, the data transmission method further includes:
当所述网关的工作负荷超过所述第一预定负荷的时间超过预定时间时,向后台服务器发出协助处理指令;When the time for which the workload of the gateway exceeds the first predetermined load exceeds a predetermined time, send an assisting processing instruction to the background server;
当接收到所述后台服务器发送的协助确认指令后,向所述暂存节点和所述采集节点发送转发指令,所述转发指令包括备用网关的地址,所述备用网关的当前工作负荷小于第二预定负荷,且所述第二预定负荷小于所述第一预定负荷;After receiving the assistance confirmation instruction sent by the background server, a forwarding instruction is sent to the temporary storage node and the collection node, the forwarding instruction includes the address of the backup gateway, and the current workload of the backup gateway is less than that of the second a predetermined load, and the second predetermined load is less than the first predetermined load;
发送所述转发指令后,当所述网关的工作负荷降低至所述第一预定负荷以下时,向所述后台服务器发送取消协助指令。After the forwarding instruction is sent, when the workload of the gateway drops below the first predetermined load, a cancel assistance instruction is sent to the background server.
优选地,所述数据传输方法还包括:Preferably, the data transmission method further includes:
当接收到协助处理指令时,接收来自不与所述网关对应、且用作采集节点的传感器的数据以及不与所述网关对应且用作暂存节点的传感器的数据;receiving data from a sensor that does not correspond to the gateway and serves as a collection node and data from a sensor that does not correspond to the gateway and serves as a temporary storage node when the assisting processing instruction is received;
当同时接收到不与所述网关对应、且用作采集节点的传感器的数据以及不与所述网关对应且用作暂存节点的传感器的数据时,优先处理来自用作暂存节点的传感器的数据。When the data of the sensor that does not correspond to the gateway and is used as the collection node and the data of the sensor that does not correspond to the gateway and is used as the temporary storage node are received at the same time, the data from the sensor that is used as the temporary storage node is preferentially processed. data.
作为本发明的第二个方面,提供了一种网关组件,所述网关组件用于包括多个传感器节点的传感器网络中,所述网关组件对应有多个传感器节点,其中,所述网关组件包括网关、通信模块、判断模块和控制模块;As a second aspect of the present invention, a gateway component is provided, the gateway component is used in a sensor network including a plurality of sensor nodes, the gateway component corresponds to a plurality of sensor nodes, wherein the gateway component includes Gateway, communication module, judgment module and control module;
所述通信模块用于接收与所述网关对应的用作采集节点的传感器节点发送的采集数据;The communication module is used to receive the collected data sent by the sensor node corresponding to the gateway and used as a collection node;
所述判断模块用于判断所述网关的当前工作负荷是否超过第一预定负荷,并生成判断结果;The judging module is used to judge whether the current workload of the gateway exceeds the first predetermined load, and generate a judging result;
所述控制模块用于在所述网关的当前工作负荷未超过所述第一预定负荷时,控制所述通信模块接收与所述网关对应的采集节点发送的采集数据;The control module is configured to control the communication module to receive the collection data sent by the collection node corresponding to the gateway when the current workload of the gateway does not exceed the first predetermined load;
所述控制模块用于在接收到判定所述网关的当前工作负荷超过所述第一预定负荷的判断结果时生成等待指示信号,并控制所述通信模块将所述等待指示信号发送至发送所述采集数据的采集节点;The control module is configured to generate a waiting indication signal when receiving a judgment result that the current workload of the gateway exceeds the first predetermined load, and control the communication module to send the waiting indication signal to the A collection node for collecting data;
所述控制模块还用于在接收到判定所述网关的当前工作负荷超过所述第一预定负荷的判断结果后又接收到判定所述网关的当前工作负荷未超过所述第一预定负荷的判断结果时生成数据获取信号,并控制所述通信模块将所述数据获取信号发送至所述暂存节点和所述采集节点。The control module is further configured to receive a judgment that the current workload of the gateway does not exceed the first predetermined load after receiving a judgment result that the current workload of the gateway exceeds the first predetermined load As a result, a data acquisition signal is generated, and the communication module is controlled to send the data acquisition signal to the temporary storage node and the collection node.
优选地,所述控制模块用于在所述通信模块同时接受到来自所述采集节点的采集数据和来自所述暂存节点的数据时,控制所述网关优先处理来自所述暂存节点的数据。Preferably, the control module is configured to control the gateway to preferentially process the data from the temporary storage node when the communication module simultaneously receives the collected data from the collection node and the data from the temporary storage node .
优选地,所述控制模块用于在所述网关的工作负荷超过所述第一预定负荷的时间超过预定时间时生成协助处理指令,并控制所述通信模块将所述协助处理指令发送至后台服务器;Preferably, the control module is configured to generate an assisting processing instruction when the workload of the gateway exceeds the first predetermined load for a predetermined time, and control the communication module to send the assisting processing instruction to the background server ;
所述控制模块还用于在通过所述通信模块接收到所述后台服务器发送的协助确认指令后,通过所述通信模块向所述暂存节点和所述采集节点发送转发指令,所述转发指令包括备用网关的地址,所述备用网关的当前工作负荷小于第二预定负荷,且所述第二预定负荷小于所述第一预定负荷;The control module is further configured to send a forwarding instruction to the temporary storage node and the collection node through the communication module after receiving the assistance confirmation instruction sent by the background server through the communication module, and the forwarding instruction including an address of a backup gateway, the current workload of the backup gateway is less than a second predetermined load, and the second predetermined load is less than the first predetermined load;
所述控制模块还用于在发送所述转发指令后,当所述网关的工作负荷降低至所述第一预定负荷以下时,生成取消协助指令,并通过所述通信模块向所述后台服务器发送取消协助指令。The control module is further configured to generate a cancellation assistance instruction when the workload of the gateway drops below the first predetermined load after sending the forwarding instruction, and send it to the background server through the communication module Cancel assist order.
优选地,所述控制模块还用于在通过所述通信模块接收到协助处理指令后,通过所述通信模块同时接收来自不与所述网关对应、且用作采集节点的传感器的数据以及不与所述网关对应且用作暂存节点的传感器的数据并发送至所述网关时,所述控制模块还用于控制所述网关优先处理来自用作暂存节点的传感器的数据。Preferably, the control module is further configured to simultaneously receive, through the communication module, data from a sensor not corresponding to the gateway and used as a collection node and not associated with When the gateway corresponds to the data of the sensor used as the temporary storage node and sends it to the gateway, the control module is also used to control the gateway to preferentially process the data from the sensor used as the temporary storage node.
作为本发明的第三个方面,提供了一种传感器网络,所述传感器网络包括多个传感器节点和多个网关组件,所述传感器节点与根据预定规则与预定的网关组件相对应,其中,所述网关组件为本发明所提供的所述网关组件;As a third aspect of the present invention, a sensor network is provided, the sensor network includes a plurality of sensor nodes and a plurality of gateway components, and the sensor nodes correspond to predetermined gateway components according to predetermined rules, wherein the The gateway component is the gateway component provided by the present invention;
所述传感器节点用于在接收到等待指示信号后向用作暂存节点的传感器节点发送采集数据;The sensor node is used to send the collected data to the sensor node used as a temporary storage node after receiving the waiting indication signal;
所述传感器节点还用于接收其他传感器节点发送的采集数据;The sensor node is also used to receive collected data sent by other sensor nodes;
所述传感器节点还用于在接收到数据获取请求时,将数据发送至相应的网关组件。The sensor node is also configured to send data to a corresponding gateway component when receiving a data acquisition request.
优选地,所述传感器网络还包括后台服务器Preferably, the sensor network also includes a background server
所述后台服务器用于在接收到协助处理指令后向用作备用网关的网关发送所述协助处理指令;The background server is configured to send the assisting processing instruction to a gateway serving as a backup gateway after receiving the assisting processing instruction;
所述后台服务器还用于在接收到所述消协助指令时,将所述取消协助指令发送至用作备用网关的网关。The background server is further configured to, when receiving the cancel assistance instruction, send the cancel assistance instruction to a gateway serving as a standby gateway.
附图说明Description of drawings
附图是用来提供对本发明的进一步理解,并且构成说明书的一部分,与下面的具体实施方式一起用于解释本发明,但并不构成对本发明的限制。在附图中:The accompanying drawings are used to provide a further understanding of the present invention, and constitute a part of the description, together with the following specific embodiments, are used to explain the present invention, but do not constitute a limitation to the present invention. In the attached picture:
图1是本发明所提供的用于网关的数据处理方法的流程图;Fig. 1 is the flow chart of the data processing method for gateway provided by the present invention;
图2是本发明所提供的网关组件的模块示意图;Fig. 2 is the module schematic diagram of the gateway component provided by the present invention;
图3是本发明所提供的传感器网络的模块示意图。Fig. 3 is a block diagram of the sensor network provided by the present invention.
附图标记说明Explanation of reference signs
210:网关 220:通信模块210: gateway 220: communication module
230:判断模块 240:控制模块230: judgment module 240: control module
311~316:传感器节点311~316: sensor nodes
320:后台服务器320: background server
具体实施方式Detailed ways
以下结合附图对本发明的具体实施方式进行详细说明。应当理解的是,此处所描述的具体实施方式仅用于说明和解释本发明,并不用于限制本发明。Specific embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. It should be understood that the specific embodiments described here are only used to illustrate and explain the present invention, and are not intended to limit the present invention.
作为本发明的一个方面,提供一种用于网关的数据传输方法,所述网关用于包括多个传感器节点的传感器网络中,且所述网关对应多个传感器节点,其中,如图1所示,所述数据传输方法包括:As an aspect of the present invention, a data transmission method for a gateway is provided, the gateway is used in a sensor network including a plurality of sensor nodes, and the gateway corresponds to a plurality of sensor nodes, wherein, as shown in FIG. 1 , the data transmission method includes:
在步骤S110中,接收与所述网关对应的用作采集节点的传感器节点发送的采集数据;In step S110, receiving the collection data sent by the sensor node used as the collection node corresponding to the gateway;
在步骤S120中,判断所述网关的当前工作负荷是否超过第一预定负荷;In step S120, judging whether the current workload of the gateway exceeds a first predetermined load;
在步骤S130中,当所述网关的当前工作负荷未超过所述第一预定负荷时,接收所述采集节点发送的采集数据;In step S130, when the current workload of the gateway does not exceed the first predetermined load, receive the collection data sent by the collection node;
在步骤S140中,当所述网关的当前工作负荷超过所述第一预定负荷时,向发送所述采集数据的采集节点发送等待指示信号;In step S140, when the current workload of the gateway exceeds the first predetermined load, a waiting indication signal is sent to the collection node that sends the collected data;
在步骤S150中,当所述网关的工作负荷由超过所述第一预定负荷降低至所述第一预定负荷以下时,向用作暂存节点的传感器节点以及用作采集节点的传感器节点发送数据获取请求。In step S150, when the workload of the gateway decreases from exceeding the first predetermined load to below the first predetermined load, send data to the sensor node used as a temporary storage node and the sensor node used as a collection node Get request.
在所述传感器网络中,包括多个传感器节点和多个网关。其中,传感器节点与网关之间存在着对应关系,例如,一个网关可以对应多个传感器。在本发明中,对如何选定暂存节点并不做特殊要求,例如,可以将闲置的传感器节点作为暂存节点。In the sensor network, multiple sensor nodes and multiple gateways are included. There is a corresponding relationship between sensor nodes and gateways, for example, one gateway may correspond to multiple sensors. In the present invention, there is no special requirement on how to select temporary storage nodes, for example, idle sensor nodes can be used as temporary storage nodes.
在本发明中,对所述第一预定负荷并没有特殊的要求。用户可以根据网关的性能参数确定所述第一预定负荷。例如,所述第一预定负荷可以为所述网关满负荷的70%。In the present invention, there is no special requirement on the first predetermined load. The user may determine the first predetermined load according to performance parameters of the gateway. For example, the first predetermined load may be 70% of the full load of the gateway.
当网关的当前工作负荷超过所述第一预定负荷时,数据处理速度会下降。在本发明中,当判断出所述网关的当前工作负荷超过所述第一预定负荷时,不再接收采集节点发送的采集数据,仅处理该网关已经接收到的数据,提高处理速度。与此同时,所述网关向发送所述采集数据的采集节点发送等待指示信号,该采集节点在接收到所述等待指示信号后,向用作暂存节点的传感器节点发送采集数据,从而可以充分利用所述传感器网络中的闲置节点。When the current workload of the gateway exceeds the first predetermined load, the data processing speed will decrease. In the present invention, when it is judged that the current workload of the gateway exceeds the first predetermined load, the collected data sent by the collection node is no longer received, and only the data already received by the gateway is processed to increase the processing speed. At the same time, the gateway sends a waiting indication signal to the collection node that sends the collected data, and the collection node sends the collection data to the sensor node used as a temporary storage node after receiving the waiting indication signal, so that it can fully Utilize idle nodes in the sensor network.
如上文中所述,当所述网关的当前工作负荷超过所述第一预定负荷后,不再接收新的数据,因此,所述网关工作一段时间后,其负荷会降至所述第一预定负荷之下,在这种情况下,向用作暂存节点的传感器节点发送数据获取请求,该暂存节点在接收到数据获取请求后,将暂存在该节点的数据发送至所述网关,由所述网关继续进行处理。As mentioned above, when the current workload of the gateway exceeds the first predetermined load, no new data will be received. Therefore, after the gateway works for a period of time, its load will drop to the first predetermined load Next, in this case, a data acquisition request is sent to the sensor node used as a temporary storage node, and the temporary storage node sends the data temporarily stored in the node to the gateway after receiving the data acquisition request, and the The gateway continues processing.
本发明所提供的数据传输方法中,既能够确保网关的数据处理速度,又可以充分利用物联网中的设备。In the data transmission method provided by the present invention, the data processing speed of the gateway can be ensured, and the devices in the Internet of Things can be fully utilized.
容易理解的是,当步骤S120中的判断结果为“所述网关的当前工作符合未超过所述第一预定负荷”时,所述网关继续接收来自采集节点的采集数据。It is easy to understand that, when the judgment result in step S120 is "the current work of the gateway does not exceed the first predetermined load", the gateway continues to receive the collected data from the collection node.
为了及时地处理数据,优选地,所述数据传输方法包括:In order to process data in a timely manner, preferably, the data transmission method includes:
在步骤S160中,当同时接受到来自所述采集节点的采集数据和来自所述暂存节点的数据时,优先处理来自所述暂存节点的数据。In step S160, when the collection data from the collection node and the data from the temporary storage node are received at the same time, the data from the temporary storage node is preferentially processed.
为了便于描述,将步骤S160中来自暂存节点的数据称之为数据A,将步骤S160中来自采集节点的数据称之为数据B。容易理解的是,数据A也是采集节点所采集的,并且采集节点采集数据A的时间早于采集数据B的时间。因此,通过步骤S160可以提高网关处理数据的实时性。For ease of description, the data from the temporary storage node in step S160 is called data A, and the data from the collection node in step S160 is called data B. It is easy to understand that the data A is also collected by the collection node, and the collection node collects the data A earlier than the collection data B. Therefore, the real-time performance of data processing by the gateway can be improved through step S160.
优选地,所述数据传输方法还包括:Preferably, the data transmission method further includes:
在步骤S170中,当所述网关的工作负荷超过所述第一预定负荷且超过所述第一预定负荷的时间超过预定时间时,向后台服务器发出协助处理指令;In step S170, when the workload of the gateway exceeds the first predetermined load and the time exceeding the first predetermined load exceeds a predetermined time, send an assisting processing instruction to the background server;
在步骤S180中,当接收到所述后台服务器发送的协助确认指令后,向所述暂存节点和所述采集节点发送转发指令,所述转发指令包括备用网关的地址,所述备用网关的当前工作负荷小于第二预定负荷,且所述第二预定负荷小于所述第一预定负荷。In step S180, after receiving the assistance confirmation instruction sent by the background server, a forwarding instruction is sent to the temporary storage node and the collection node, the forwarding instruction includes the address of the standby gateway, the current address of the standby gateway The workload is less than a second predetermined load, and the second predetermined load is less than the first predetermined load.
在本发明中,利用处于相对闲置状态的备用网关处理当前网关无暇处理的数据,既可以提高传感器网络的利用率,又可以提高数据处理的效率。In the present invention, using the standby gateway in a relatively idle state to process the data that the current gateway has no time to process can not only improve the utilization rate of the sensor network, but also improve the efficiency of data processing.
当所述网关的负荷降低至所述第一预定负荷以下时,可以继续接收采集数据。相应地,应当解除备用网关的备用状态。具体地,所述数据传输方法还包括:When the load of the gateway drops below the first predetermined load, the collected data may continue to be received. Accordingly, the standby state of the standby gateway should be released. Specifically, the data transmission method also includes:
向所述暂存节点和所述采集节点发送转发指令后,当所述网关的当前工作负荷低于所述第一预定负荷时,向所述后台服务器发送取消协助指令。After the forwarding instruction is sent to the temporary storage node and the collection node, when the current workload of the gateway is lower than the first predetermined load, a cancel assistance instruction is sent to the background server.
需要指出的是,所述备用网关与当前网关同属于一个传感器网络。也就是说,在同一个传感器网络中,任意一个网关都可能用作备用网关。相应地,所述数据传输方法还包括:It should be pointed out that the backup gateway and the current gateway belong to the same sensor network. That is to say, in the same sensor network, any gateway may be used as a backup gateway. Correspondingly, the data transmission method also includes:
在步骤S191中,当接收到协助处理指令时,接收来自不与所述网关对应、且用作采集节点的传感器的数据以及不与所述网关对应且用作暂存节点的传感器的数据;In step S191, when the assisting processing instruction is received, data from a sensor not corresponding to the gateway and used as a collection node and data from a sensor not corresponding to the gateway and used as a temporary storage node are received;
在步骤S192中,当同时接收到不与所述网关对应、且用作采集节点的传感器的数据以及不与所述网关对应且用作暂存节点的传感器的数据时,优先处理来自用作暂存节点的传感器的数据。In step S192, when data from a sensor not corresponding to the gateway and used as a collection node and data from a sensor not corresponding to the gateway and used as a temporary storage node are received at the same time, preferentially process data from a sensor used as a temporary storage node Store the sensor data of the node.
进一步地,所述数据传输方法还包括:Further, the data transmission method also includes:
当接收到取消协助指令后,向所述后台服务器发送确认取消协助指令。After receiving the cancellation assistance instruction, send a confirmation cancellation assistance instruction to the background server.
作为本发明的第二个方面,提供一种网关组件,所述网关组件用于包括多个传感器节点的传感器网络中,所述网关组件对应有多个传感器节点,其中,如图2所示,所述网关组件包括网关210、通信模块220、判断模块230和控制模块240。As a second aspect of the present invention, a gateway component is provided, the gateway component is used in a sensor network including a plurality of sensor nodes, and the gateway component corresponds to a plurality of sensor nodes, wherein, as shown in FIG. 2 , The gateway component includes a gateway 210 , a communication module 220 , a judgment module 230 and a control module 240 .
需要指出的是,本发明所提供的网关组件用于执行本发明所提供的上述数据传输方法。It should be pointed out that the gateway component provided by the present invention is used to implement the above data transmission method provided by the present invention.
通信模块220用于执行步骤S110,即,通信模块220用于接收与所述网关对应的用作采集节点的传感器节点发送的采集数据。The communication module 220 is used to execute step S110, that is, the communication module 220 is used to receive the collection data sent by the sensor node corresponding to the gateway and used as a collection node.
判断模块230用于执行步骤S120,即,判断模块230用于判断网关210的当前工作负荷是否超过第一预定负荷,并生成判断结果。The judging module 230 is configured to execute step S120, that is, the judging module 230 is configured to judge whether the current workload of the gateway 210 exceeds the first predetermined load, and generate a judging result.
控制模块240用于执行步骤S130至步骤S150。即,控制模块240用于在网关210的当前工作负荷未超过所述第一预定负荷时,控制通信模块220接收与网关210对应的采集节点发送的采集数据。The control module 240 is used for executing step S130 to step S150. That is, the control module 240 is configured to control the communication module 220 to receive the collection data sent by the collection node corresponding to the gateway 210 when the current workload of the gateway 210 does not exceed the first predetermined load.
控制模块240还用于在接收到判定网关210的当前工作负荷超过所述第一预定负荷的判断结果时生成等待指示信号,并控制通信模块220将所述等待指示信号发送至发送所述采集数据的采集节点。The control module 240 is also configured to generate a waiting indication signal when receiving the judgment result that the current workload of the gateway 210 exceeds the first predetermined load, and control the communication module 220 to send the waiting indication signal to the collection node.
控制模块240还用于在接收到判定网关210的当前工作负荷超过所述第一预定负荷的判断结果后又接收到判定网关210的当前工作负荷未超过所述第一预定负荷的判断结果时生成数据获取信号,并控制通信模块220将所述数据获取信号发送至所述暂存节点和所述采集节点。The control module 240 is further configured to generate a data acquisition signal, and control the communication module 220 to send the data acquisition signal to the temporary storage node and the collection node.
上文中已经详细介绍了本发明所提供的数据传输方法的优点以及有益效果,这里不再赘述。The advantages and beneficial effects of the data transmission method provided by the present invention have been introduced in detail above, and will not be repeated here.
为了及时处理数据,优选地,控制模块230还用于执行步骤S160,即,控制模块240用于在通信模块220同时接受到来自所述采集节点的采集数据和来自所述暂存节点的数据时,控制网关210优先处理来自所述暂存节点的数据。In order to process the data in time, preferably, the control module 230 is also used to execute step S160, that is, the control module 240 is used to receive the collected data from the collection node and the data from the temporary storage node at the same time when the communication module 220 , the control gateway 210 preferentially processes the data from the temporary storage node.
优选地,控制模块240还用于执行步骤S170和步骤S180。具体地,控制模块240用于在网关210的工作负荷超过所述第一预定负荷的时间超过预定时间时生成协助处理指令,并控制通信模块220将所述协助处理指令发送至后台服务器。Preferably, the control module 240 is also used to execute step S170 and step S180. Specifically, the control module 240 is configured to generate an assisting processing instruction when the workload of the gateway 210 exceeds the first predetermined load for a predetermined time, and control the communication module 220 to send the assisting processing instruction to the background server.
控制模块240还用于在通过通信模块220接收到所述后台服务器发送的协助确认指令后,通过通信模块220向所述暂存节点和所述采集节点发送转发指令,所述转发指令包括备用网关的地址,所述备用网关的当前工作负荷小于第二预定负荷,且所述第二预定负荷小于所述第一预定负荷。The control module 240 is also configured to send a forwarding instruction to the temporary storage node and the collection node through the communication module 220 after receiving the assistance confirmation instruction sent by the background server through the communication module 220, and the forwarding instruction includes a backup gateway address, the current workload of the standby gateway is less than a second predetermined load, and the second predetermined load is less than the first predetermined load.
优选地,控制模块240还用于在发送所述转发指令后,当网关210的工作负荷降低至所述第一预定负荷以下时,生成取消协助指令,并通过通信模块220向所述后台服务器发送取消协助指令。Preferably, the control module 240 is further configured to generate a cancellation assistance instruction when the workload of the gateway 210 drops below the first predetermined load after sending the forwarding instruction, and send it to the background server through the communication module 220 Cancel assist order.
如上文所述,所述网关组件中的网关也可以用作备用网关,相应地,控制模块240还用于在通过通信模块220接收到协助处理指令时,控制通信模块220接收来自与所述网关不对应、且用作采集节点的传感器的数据以及与所述网关不对应且用作暂存节点的传感器的数据并发送至网关210,并控制网关210优先处理来自用作暂存节点的传感器的数据。As mentioned above, the gateway in the gateway component can also be used as a standby gateway. Correspondingly, the control module 240 is also used to control the communication module 220 to receive the The data of the sensor that does not correspond to and is used as the collection node and the data of the sensor that does not correspond to the gateway and is used as the temporary storage node are sent to the gateway 210, and the gateway 210 is controlled to preferentially process the data from the sensor that is used as the temporary storage node. data.
作为本发明的第三个方面,提供一种传感器网络,如图3所示,所述传感器网络包括多个传感器节点和多个网关组件,所述传感器节点与根据预定规则与预定的网关组件相对应,其中,所述网关组件为本发明所提供的上述网关组件。As a third aspect of the present invention, a sensor network is provided. As shown in FIG. 3 , the sensor network includes a plurality of sensor nodes and a plurality of gateway components, and the sensor nodes communicate with predetermined gateway components according to predetermined rules. Correspondingly, the gateway component is the above-mentioned gateway component provided by the present invention.
传感器节点用于在接收到等待指示信号后向用作暂存节点的传感器节点发送采集数据,并且传感器节点还用于接收其他传感器节点发送的采集数据,以及传感器节点还用于在接收到数据获取请求时,将数据发送至相应的网关组件。The sensor node is used to send the collected data to the sensor node used as a temporary storage node after receiving the waiting indication signal, and the sensor node is also used to receive the collected data sent by other sensor nodes, and the sensor node is also used to receive the data acquisition When requested, data is sent to the corresponding gateway component.
在本发明中,对所述预定规则不做特殊的限定。例如,所述预定规则可以包括:距离所述网关组件不超过X米的传感器节点均为与所述网关组件相对应的传感器节点。相应地,与所述网关组件之间的距离超过X米的传感器组件均为不与该网关组件对应的传感器节点。In the present invention, there is no special limitation on the predetermined rule. For example, the predetermined rule may include: sensor nodes that are no more than X meters away from the gateway component are sensor nodes corresponding to the gateway component. Correspondingly, the sensor components that are more than X meters away from the gateway component are sensor nodes that do not correspond to the gateway component.
图3中示出了传感器节点311、312、313、314、315、316、网关组件A和网关组件B。网关组件A与传感器节点311、312、313对应,网关组件B与传感器节点314、315、316对应。Sensor nodes 311 , 312 , 313 , 314 , 315 , 316 , gateway component A and gateway component B are shown in FIG. 3 . Gateway component A corresponds to sensor nodes 311 , 312 , 313 , and gateway component B corresponds to sensor nodes 314 , 315 , 316 .
如上文中所述,每个传感器节点都既可以用作采集节点,又可以用作暂存节点。As mentioned above, each sensor node can be used as both a collection node and a temporary storage node.
当用过暂存节点的传感器节点接收到转发指令后,将该暂存节点接收到的暂存的数据发送至用作备用网关的网关。After the sensor node that has used the temporary storage node receives the forwarding instruction, it sends the temporarily stored data received by the temporary storage node to the gateway used as the backup gateway.
优选地,所述传感器网络还包括后台服务器320,该后台服务器320用于在接收到协助处理指令后向用作备用网关的网关发送所述协助处理指令。并且,后台服务器320还用于在在接收到所述消协助指令时,将所述取消协助指令发送至用作备用网关的网关。Preferably, the sensor network further includes a background server 320, and the background server 320 is configured to send the assisting processing instruction to a gateway serving as a standby gateway after receiving the assisting processing instruction. Moreover, the background server 320 is further configured to, when receiving the cancel assistance instruction, send the cancel assistance instruction to a gateway serving as a standby gateway.
下面结合图3介绍本发明所提供的传感器网络的工作原理。如图3所示,所述传感器网络包括传感器节点311、312、313、314、315、316、网关组件A和网关组件B。网关组件A与传感器节点311、312、313对应,网关组件B与传感器节点314、315、316对应。The working principle of the sensor network provided by the present invention will be introduced below with reference to FIG. 3 . As shown in FIG. 3 , the sensor network includes sensor nodes 311 , 312 , 313 , 314 , 315 , and 316 , a gateway component A and a gateway component B. Gateway component A corresponds to sensor nodes 311 , 312 , 313 , and gateway component B corresponds to sensor nodes 314 , 315 , 316 .
为了便于解释,将传感器节点311用作向网关组件A发送数据的采集节点,当网关组件A中网关的当前工作负荷超过第一预定负荷时,指定传感器节点312作为暂存节点。For ease of explanation, the sensor node 311 is used as a collection node for sending data to the gateway component A, and when the current workload of the gateway in the gateway component A exceeds the first predetermined load, the sensor node 312 is designated as a temporary storage node.
具体地,当网关组件A中网关的当前工作负荷超过第一预定负荷时,网关组件A向传感器节点311发送等待指示信号;Specifically, when the current workload of the gateway in the gateway component A exceeds the first predetermined load, the gateway component A sends a waiting indication signal to the sensor node 311;
传感器节点311接收到等待指示信号后,向传感器节点312发送采集数据,传感器节点312暂存所述数据;After the sensor node 311 receives the waiting instruction signal, it sends the collected data to the sensor node 312, and the sensor node 312 temporarily stores the data;
网关组件A中网关的工作负荷下降至第一预定负荷以下时,向传感器节点311和传感器节点312发送数据获取请求;When the workload of the gateway in the gateway component A drops below the first predetermined load, a data acquisition request is sent to the sensor node 311 and the sensor node 312;
传感器节点311和传感器节点312接收到数据获取请求后,传感器节点311直接向网关组件A发送采集数据,传感器节点312将暂存的数据发送至网关组件A;After the sensor node 311 and the sensor node 312 receive the data acquisition request, the sensor node 311 directly sends the collected data to the gateway component A, and the sensor node 312 sends the temporarily stored data to the gateway component A;
网关组件A接收到来自传感器节点311的数据和传感器节点312的数据后,优先处理传感器节点312发送的数据;After the gateway component A receives the data from the sensor node 311 and the data from the sensor node 312, it preferentially processes the data sent by the sensor node 312;
若预定时间(例如,一个小时)后,网关组件A中网关的工作负荷仍然超过第一预定负荷,网关组件A向后台服务器320发送协助处理指令;If after a predetermined time (for example, one hour), the workload of the gateway in the gateway component A still exceeds the first predetermined load, the gateway component A sends an assisting processing instruction to the background server 320;
后台服务器320接收到协助处理指令后,查询所述传感器网络中工作负荷低于第二预定负荷的网关组件(例如,网关组件B),并将其作为备用网关,后台服务器320将所述协助处理指令发送至备用网关;After the background server 320 receives the assisting processing instruction, it queries the gateway component (for example, gateway component B) whose workload is lower than the second predetermined load in the sensor network, and uses it as a backup gateway, and the background server 320 performs the assisting processing The command is sent to the backup gateway;
接收到网关组件B的确认信息后,后台服务器320向网关组件A发送协助确认指令;After receiving the confirmation information of the gateway component B, the background server 320 sends an assistance confirmation instruction to the gateway component A;
网关组件A接收到协助确认指令后,向传感器节点311和传感器节点312发送转发指令,所述转发指令包括网关组件B中网关的地址;After the gateway component A receives the assistance confirmation instruction, it sends a forwarding instruction to the sensor node 311 and the sensor node 312, and the forwarding instruction includes the address of the gateway in the gateway component B;
传感器节点311和传感器节点312将数据发送至网关组件B;Sensor node 311 and sensor node 312 send data to gateway component B;
当网关组件A中网关的当前工作负荷低于第一预定负荷之时,向后台服务器320发送取消协助指令;When the current workload of the gateway in the gateway component A is lower than the first predetermined load, a cancel assistance instruction is sent to the background server 320;
后台服务器320接收到取消协助指令后,向网关组件B发送取消协助指令;After the background server 320 receives the cancellation assistance instruction, it sends the cancellation assistance instruction to the gateway component B;
网关组件A向传感器节点311、传感器节点312发送数据获取指令;The gateway component A sends a data acquisition instruction to the sensor node 311 and the sensor node 312;
网关组件A、网关组件B、传感器节点311、传感器节点312恢复正常的工作状态。The gateway component A, the gateway component B, the sensor node 311, and the sensor node 312 resume normal working states.
可以理解的是,以上实施方式仅仅是为了说明本发明的原理而采用的示例性实施方式,然而本发明并不局限于此。对于本领域内的普通技术人员而言,在不脱离本发明的精神和实质的情况下,可以做出各种变型和改进,这些变型和改进也视为本发明的保护范围。It can be understood that, the above embodiments are only exemplary embodiments adopted for illustrating the principle of the present invention, but the present invention is not limited thereto. For those skilled in the art, various modifications and improvements can be made without departing from the spirit and essence of the present invention, and these modifications and improvements are also regarded as the protection scope of the present invention.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810784046.5A CN109040204A (en) | 2018-07-17 | 2018-07-17 | For the data processing method of gateway, gateway component and sensor network |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810784046.5A CN109040204A (en) | 2018-07-17 | 2018-07-17 | For the data processing method of gateway, gateway component and sensor network |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN109040204A true CN109040204A (en) | 2018-12-18 |
Family
ID=64643074
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201810784046.5A Pending CN109040204A (en) | 2018-07-17 | 2018-07-17 | For the data processing method of gateway, gateway component and sensor network |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN109040204A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116582488A (en) * | 2023-07-14 | 2023-08-11 | 中创(深圳)物联网有限公司 | Data transmission method, device, equipment and storage medium |
Citations (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101107595A (en) * | 2005-01-19 | 2008-01-16 | 丰田自动车株式会社 | Fault diagnosis data recording system and method |
| CN103501276A (en) * | 2013-10-09 | 2014-01-08 | 中国联合网络通信集团有限公司 | Method and device for communication between server and sensor nodes |
| CN103888994A (en) * | 2012-12-21 | 2014-06-25 | 中国科学院计算技术研究所 | Multi-gateway processing method with thermal disaster recovery capability and system |
| CN104618960A (en) * | 2010-09-28 | 2015-05-13 | 华为技术有限公司 | Gateway data transmission method, device and system |
| CN106453082A (en) * | 2016-11-08 | 2017-02-22 | 浙江工商大学 | Fair delay-tolerant network node cooperation stimulation method based on credit strategy |
| CN107302575A (en) * | 2017-06-19 | 2017-10-27 | 深圳市盛路物联通讯技术有限公司 | A method and system for synchronizing the time of an Internet of Things access node and a convergence unit |
| CN108174397A (en) * | 2017-12-08 | 2018-06-15 | 南京邮电大学 | A Task-Driven Multi-Gateway Collaboration Method |
| KR20180072319A (en) * | 2016-12-21 | 2018-06-29 | 창신대학교 산학협력단 | Method for controlling packet load of gateway in IoT network |
-
2018
- 2018-07-17 CN CN201810784046.5A patent/CN109040204A/en active Pending
Patent Citations (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101107595A (en) * | 2005-01-19 | 2008-01-16 | 丰田自动车株式会社 | Fault diagnosis data recording system and method |
| CN104618960A (en) * | 2010-09-28 | 2015-05-13 | 华为技术有限公司 | Gateway data transmission method, device and system |
| CN103888994A (en) * | 2012-12-21 | 2014-06-25 | 中国科学院计算技术研究所 | Multi-gateway processing method with thermal disaster recovery capability and system |
| CN103501276A (en) * | 2013-10-09 | 2014-01-08 | 中国联合网络通信集团有限公司 | Method and device for communication between server and sensor nodes |
| CN106453082A (en) * | 2016-11-08 | 2017-02-22 | 浙江工商大学 | Fair delay-tolerant network node cooperation stimulation method based on credit strategy |
| KR20180072319A (en) * | 2016-12-21 | 2018-06-29 | 창신대학교 산학협력단 | Method for controlling packet load of gateway in IoT network |
| CN107302575A (en) * | 2017-06-19 | 2017-10-27 | 深圳市盛路物联通讯技术有限公司 | A method and system for synchronizing the time of an Internet of Things access node and a convergence unit |
| CN108174397A (en) * | 2017-12-08 | 2018-06-15 | 南京邮电大学 | A Task-Driven Multi-Gateway Collaboration Method |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116582488A (en) * | 2023-07-14 | 2023-08-11 | 中创(深圳)物联网有限公司 | Data transmission method, device, equipment and storage medium |
| CN116582488B (en) * | 2023-07-14 | 2023-10-13 | 中创(深圳)物联网有限公司 | Data transmission method, device, equipment and storage medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN106250500A (en) | The dynamic management approach of database connection pool and system | |
| CN106506392B (en) | A kind of network congestion processing method and device | |
| WO2014000450A1 (en) | Method, device, and system for performing scheduling in multi-processor core system | |
| CN105007337A (en) | Cluster system load balancing method and system thereof | |
| CN105024939A (en) | A Distributed Controller System Based on OpenFlow in SDN Network Environment | |
| CN103618590B (en) | A kind of manufacture timeout control method and device of transaction process | |
| CN108234149B (en) | Network request management method and device | |
| CN103631873B (en) | A kind of data compression method and storage system | |
| CN106533805A (en) | Micro-service request processing method, micro-service controller and micro-service architecture | |
| US10621018B2 (en) | Link optimization for callout request messages | |
| CN105049485B (en) | A kind of Load-aware cloud computing system towards real time video processing | |
| CN105516024A (en) | Queue-based task flow monitoring method and system | |
| CN102202094A (en) | Method and device for processing service request based on HTTP (hyper text transfer protocol) | |
| CN102724123A (en) | Network traffic control method and network traffic control device | |
| CN107168853A (en) | A kind of server performance information acquisition method, system and substrate control manager | |
| CN110708234A (en) | Message transmission processing method, message transmission processing device and storage medium | |
| CN109040204A (en) | For the data processing method of gateway, gateway component and sensor network | |
| CN111343239A (en) | Communication request processing method, communication method, communication request processing device, and transaction system | |
| CN104702530A (en) | Method and device for sending Goose message in ring network | |
| CN107040476A (en) | A kind of dynamic towards real-time stream calculation counter-pressure method step by step | |
| JP2018164179A (en) | Image forming device, information processing system, and program | |
| CN109104334B (en) | Management method and device for nodes in monitoring system | |
| CN114466079B (en) | Request processing method, device, proxy server and storage medium | |
| CN111338580A (en) | A method and device for optimizing disk performance | |
| CN105094942A (en) | HSM session management method, management virtual machine and server |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| RJ01 | Rejection of invention patent application after publication | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20181218 |