CN114257623B - Internet of things equipment communication method based on stream processing - Google Patents

Internet of things equipment communication method based on stream processing Download PDF

Info

Publication number
CN114257623B
CN114257623B CN202210194977.6A CN202210194977A CN114257623B CN 114257623 B CN114257623 B CN 114257623B CN 202210194977 A CN202210194977 A CN 202210194977A CN 114257623 B CN114257623 B CN 114257623B
Authority
CN
China
Prior art keywords
internet
stream processing
message
equipment
accessed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210194977.6A
Other languages
Chinese (zh)
Other versions
CN114257623A (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.)
China Energy Saving Jinghe Technology Co ltd
Original Assignee
China Energy Saving Jinghe 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 China Energy Saving Jinghe Technology Co ltd filed Critical China Energy Saving Jinghe Technology Co ltd
Priority to CN202210194977.6A priority Critical patent/CN114257623B/en
Publication of CN114257623A publication Critical patent/CN114257623A/en
Application granted granted Critical
Publication of CN114257623B publication Critical patent/CN114257623B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16YINFORMATION AND COMMUNICATION TECHNOLOGY SPECIALLY ADAPTED FOR THE INTERNET OF THINGS [IoT]
    • G16Y30/00IoT infrastructure
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/24Negotiation of communication capabilities

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a communication method of internet of things equipment based on stream processing, which comprises the following steps: acquiring communication configuration parameters of equipment to be accessed and an Internet of things platform; setting a stream processing engine gateway comprising at least one stream processing node, configuring an input end and an output end of the stream processing node based on the acquired communication configuration parameters, and stream processing logic of the stream processing node; configuring communication parameters of equipment to be accessed, wherein the communication parameters are adapted to the input end of a stream processing node corresponding to the equipment; and the corresponding stream processing nodes in the stream processing engine gateway process the information reported by the equipment to be accessed and report the processed information to the Internet of things platform, or process the information issued by the Internet of things platform and output the processed information to the equipment to be accessed. The method can support the bidirectional communication between the equipment and the platform and between the equipment cross-protocols while improving the high efficiency and the real-time performance of the gateway of the platform of the Internet of things for processing the information.

Description

Internet of things equipment communication method based on stream processing
Technical Field
The invention relates to the technical field of communication of the Internet of things, in particular to a communication method of equipment of the Internet of things based on stream processing.
Background
With the continuous development of the internet of things technology, internet of things platforms, big data processing and the like have been widely applied to various industries. The communication between devices based on the Internet of things platform is used as a core component of the application of the Internet of things technology, and the performance of the communication plays a key role in the whole Internet of things service.
However, although the existing internet of things device communication technology has been successfully applied to various aspects of society, the following disadvantages still exist in terms of processing communication between a large number of different types of devices:
Firstly, the traditional communication between the internet of things platform devices is often based on a single protocol, and a platform gateway is required to support the analysis and split charging of the protocol. Different types of equipment adopt different protocols, so that the different types of equipment cannot realize cross-protocol communication, the gateway of the platform of the Internet of things is required to support analysis and split charging of multiple equipment protocols, and a larger threshold can exist in the aspects of realization difficulty and business complexity.
Secondly, as the types of devices are more and more, the traditional internet of things platform gateway has a certain performance bottleneck facing mass communication messages among devices, cannot process all the messages efficiently, and can cause phenomena of delay, loss and the like.
Similar technologies of the communication method of the Internet of things equipment in the current home and abroad products and patents comprise:
The technical scheme disclosed in the China patent of the invention, "communication method of Internet of things and cloud gateway" with publication number CN109167829A converts industrial data with different communication protocols into OPC UA standard data through protocol conversion, then converts the obtained OPCUA standard data into MQTT standard data, finally communicates the converted data with the Internet of things through MQTT protocol, and adopts a non-blocking mode to perform protocol conversion and transmission task scheduling. According to the scheme, the internet of things platform for reporting the industrial data of different protocols is realized on the basis of a single gateway, and meanwhile, the real-time performance of communication is improved to a certain extent, but the coverage of the protocols is limited. The following disadvantages are specific:
(1) Protocols such as HTTP, coAP and the like which can be directly communicated with the Internet of things platform still need 2 times of protocol conversion (conversion to OPCUA and then to MQTT) from equipment to the Internet of things platform, and clearly have obvious defects in the aspects of compatibility and generality;
(2) In the aspect of task scheduling, although the non-blocking mode is adopted, the tasks are arranged according to the time sequence and the same non-blocking task scheduling function is used, 4 kinds of tasks exist in the same scheduling queue at the same time, and a database is stored by an in-memory database. When the equipment quantity reaches a certain quantity, delay is unavoidable, the execution time of each task is different, and after the number of task executors reaches an upper limit, a plurality of factors can influence the instantaneity;
(3) The method only involves a device-to-platform reporting process and does not support a scenario where two-way communication (device-to-device, device-to-platform) requests and at the same time a response is required to be returned.
The Chinese patent application No. CN111444291A discloses a communication method between Internet of things devices, internet of things devices and a storage medium, and provides a communication method between Internet of things devices, wherein the first Internet of things device sends an interaction instruction to a server, and the interaction instruction comprises identification information of the first Internet of things device so that the server sends the interaction instruction to each second Internet of things device in a predetermined group session according to the identification information of the first Internet of things device; receiving interaction response data corresponding to at least one second internet-connected device sent by a server; and outputting the interaction instruction and each interaction response data, so that the first Internet of things equipment can send an instruction and also can receive a response instruction of the second Internet of things, and communication between the equipment is realized. However, the method needs the information of the second internet of things device of the predetermined group session, and the communication protocol used by the method is not clear, but only the issuing instruction of the first internet of things device and the perception of the devices in the group session range are realized, other devices outside the defined range cannot be perceived, the function levels of the devices are unequal, strictly speaking, the devices are unidirectional, and the real interaction theory should be that the mutual request and the response are perceived. The method mainly has the following defects:
(1) Only communication between different types of devices is involved, but different protocols are not introduced, and the scenarios of multiple different protocol communication are not illustrated and supported. (2) In addition, the method needs to define a plurality of rules in advance, needs to preset response of instructions, and has the defect of poor compatibility in the aspect of expandability.
Disclosure of Invention
Based on the background, the invention provides the communication method of the Internet of things equipment based on the stream processing, so that the high efficiency and the real-time performance of the gateway of the Internet of things platform for processing the information are improved, and meanwhile, the bidirectional communication between the equipment and the platform and between the equipment can be supported, thereby enhancing the overall performance of the gateway of the Internet of things platform in the equipment communication.
In order to achieve the above purpose, the invention adopts the following technical scheme:
a communication method of an Internet of things device based on stream processing comprises the following steps:
Acquiring communication configuration parameters of equipment to be accessed and an Internet of things platform, wherein the communication configuration parameters comprise a communication protocol and a message body format of the equipment to be accessed, and a communication protocol and a universal message body format of the Internet of things platform;
Setting a stream processing engine gateway comprising at least one stream processing node, configuring an input end and an output end of the stream processing node based on the acquired communication configuration parameters, and stream processing logic of the stream processing node;
Configuring communication parameters of equipment to be accessed, wherein the communication parameters are adapted to the input end of a stream processing node corresponding to the equipment;
The corresponding stream processing nodes in the stream processing engine gateway process the information reported by the equipment to be accessed and report the processed information to the platform of the Internet of things;
Or the corresponding stream processing node in the stream processing engine gateway processes the message issued by the Internet of things platform and outputs the message to the equipment to be accessed.
Further, configuring the input of the stream processing node based on the acquired communication configuration parameters includes:
Configuring a communication analysis protocol of an input end according to a communication protocol used by equipment to be accessed;
or configuring a communication analysis protocol used by the input end according to a communication protocol and a general message body format used by the service issued by the Internet of things platform.
Further, configuring the output end of the stream processing node based on the acquired communication configuration parameter includes:
configuring a packaging protocol and a general message body format used by an output end according to a communication protocol and the general message body format used by the access service of the platform of the Internet of things;
Or configuring the encapsulation protocol and the message body format used by the output end according to the communication protocol configuration and the message body format used by the device to be accessed.
Further, the stream processing logic for configuring the stream processing node includes:
According to the message body format configuration and analysis of the device to be accessed, the field required to be acquired is converted into the packaging protocol and the general message body format required by the output end;
or the fields required to be acquired are analyzed according to the general message body format configuration used by the Internet of things platform, and are converted into the encapsulation protocol and the message body format required by the output end.
Further, the fields required to be acquired according to the message body format configuration analysis used by the device to be accessed include one or more of device codes, message data parts, names and parameters of calling methods and time stamps generated by the messages;
The fields required to be acquired according to the general message body format configuration analysis used by the Internet of things platform comprise one or more of equipment codes, time stamps generated by the messages, message data parts, names and parameters of calling methods, protocol types, equipment IP addresses and port numbers and topics subscribed by the messages.
Further, the communication parameters configuring the device to be accessed include the protocol used by the device to be accessed and parameters required by the protocol.
Further, processing the message reported by the device to be accessed through the corresponding stream processing node in the stream processing engine gateway and reporting the processed message to the platform of the internet of things comprises:
The stream processing node analyzes the communication protocol used by the equipment and analyzes the message according to the corresponding communication protocol to obtain a data stream;
carrying out corresponding data extraction on the data stream obtained by analysis according to the message body format of the equipment;
according to the general message body format required by the Internet of things platform, converting and packaging the extracted data into a message with a corresponding format;
and outputting the packaged information through an output end according to the format and the transmission mode of the protocol according to the communication protocol supported by the Internet of things platform.
Further, processing the message issued by the internet of things platform through the corresponding stream processing node in the stream processing engine gateway and outputting the processed message to the device to be accessed comprises:
The stream processing section analyzes a communication protocol used by the internet of things platform and obtains a data stream according to a corresponding communication protocol analysis message;
carrying out corresponding data extraction on the data stream obtained by analysis according to a general message body format of the Internet of things platform;
according to the message body format required by the equipment, converting and packaging the extracted data into a message with a corresponding format;
and outputting the packaged information through an output end according to the format and the transmission mode of the protocol according to the communication protocol supported by the equipment.
Further, the method further comprises:
The corresponding stream processing node in the stream processing engine gateway processes the message reported by the first equipment to be accessed and reports the message to the Internet of things platform;
the internet of things platform directly forwards or processes the message reported by the first equipment to be accessed according to the service configuration and forwards the message to the streaming processing engine gateway;
And the corresponding flow processing nodes in the flow processing engine gateway process the corresponding messages issued by the Internet of things platform and then output the processed messages to the second equipment to be accessed.
Further, the method further comprises:
the corresponding stream processing node in the stream processing engine gateway receives the response message of the second device to be accessed, processes the response message and reports the processed response message to the Internet of things platform;
The internet of things platform directly forwards the response message or forwards the response message to a streaming processing engine gateway after processing the response message according to service configuration;
And the corresponding stream processing node in the stream processing engine gateway processes the response message issued by the Internet of things platform and outputs the response message to the first device to be accessed.
Further, the method further comprises:
the corresponding stream processing node in the first stream processing engine gateway processes the message reported by the first equipment to be accessed and reports the message to the Internet of things platform;
the internet of things platform directly forwards or processes the message reported by the first equipment to be accessed according to the service configuration and forwards the message to the second streaming engine gateway;
and the corresponding flow processing node in the second flow processing engine gateway processes the corresponding message issued by the Internet of things platform and outputs the processed message to the second device to be accessed.
Further, the method further comprises:
A corresponding stream processing node in the second stream processing engine gateway receives and processes the response message of the second device to be accessed and reports the response message to the Internet of things platform;
the internet of things platform directly forwards the response message or forwards the response message to the first flow processing engine gateway after processing the response message according to service configuration;
And the corresponding stream processing node in the first stream processing engine gateway processes the response message issued by the Internet of things platform and outputs the response message to the first device to be accessed.
The beneficial effects of the invention are as follows:
1) By adopting a stream processing engine (the processing units can be distributed and deployed, the upper limit is determined along with the number of physical devices and can be transversely expanded), the high efficiency and the real-time performance of the communication message processing between the devices and the Internet of things platform or between the devices and other devices through the Internet of things platform are improved.
2) Based on the stream processing engine, protocol conversion can be customized and configured, so that different protocol conversion is compatible. The streaming processing node is configured to be capable of self-defining and analyzing the communication protocols and data formats which flow in and out, so that the communication cost of different types of protocols is greatly reduced, and the supporting range of equipment types is improved.
3) The cross-network-segment communication is supported (when a plurality of stream processing engine gateways are deployed in different network segments, devices in different network segments can communicate through the stream processing engine gateways), the control range of the Internet of things platform is improved, and the application prospect of the Internet of things platform is greatly expanded.
Drawings
FIG. 1 is a schematic diagram of internal processing logic of a flow processing engine gateway in accordance with an embodiment of the present invention.
Fig. 2 is a schematic diagram of unidirectional communication data flow of a platform-device in an embodiment of the invention.
Fig. 3 is a schematic diagram of a unidirectional communication data flow of a device-platform in an embodiment of the invention.
Fig. 4 is a schematic diagram of a device-platform bidirectional communication data flow in an embodiment of the present invention.
Fig. 5 is a schematic diagram of a device-platform-device bidirectional communication data flow in an embodiment of the present invention.
Fig. 6 is a schematic flow chart showing that an analog device reports a message to an internet of things platform using http through mqtt protocol in an embodiment of the present invention.
Fig. 7 is a schematic diagram illustrating the use of MQTTBox analog devices and configuration of communication parameters in an embodiment of the present invention.
Fig. 8 is a schematic diagram illustrating an analog device sending a report message in an embodiment of the present invention.
Fig. 9 is a schematic diagram of an internet of things platform receiving a message reported by a device through an HTTP protocol in an embodiment of the present invention.
Detailed Description
For a further understanding of the present invention, preferred embodiments of the invention are described below in conjunction with the examples, but it should be understood that these descriptions are merely intended to illustrate further features and advantages of the invention, and are not limiting of the claims of the invention.
The invention provides a communication method of internet of things equipment based on stream processing, which comprises the following steps:
firstly, acquiring communication configuration parameters of equipment to be accessed and an internet of things platform, wherein the acquired communication configuration parameters comprise the type of the equipment to be accessed, a communication protocol and a message body format used by the equipment to be accessed, and the communication protocol and the general message body format of the internet of things platform.
Then, a stream processing engine gateway comprising at least one stream processing node is provided, the input and output of the stream processing node is configured based on the acquired communication configuration parameters, and stream processing logic of the stream processing node.
In some embodiments, configuring the input of the streaming node based on the acquired communication configuration parameters comprises:
Configuring a communication analysis protocol of an input end according to a communication protocol used by equipment to be accessed;
or configuring a communication analysis protocol used by the input end according to a communication protocol and a general message body format used by the service issued by the Internet of things platform.
In some embodiments, configuring the output of the streaming node based on the acquired communication configuration parameters comprises:
configuring a packaging protocol and a general message body format used by an output end according to a communication protocol and the general message body format used by the access service of the platform of the Internet of things;
Or configuring the encapsulation protocol and the message body format used by the output end according to the communication protocol configuration and the message body format used by the device to be accessed.
In some embodiments, the stream processing logic that configures the stream processing node comprises:
According to the message body format configuration and analysis of the device to be accessed, the field required to be acquired is converted into the packaging protocol and the general message body format required by the output end;
or the fields required to be acquired are analyzed according to the general message body format configuration used by the Internet of things platform, and are converted into the encapsulation protocol and the message body format required by the output end.
In some illustrative examples, the fields required for parsing according to the message body format configuration to be used by the device to be accessed include one or more of device code, message data portion, name and parameters of the calling method, and timestamp of message generation.
In some illustrative examples, the fields required to be acquired for parsing according to the general message body format configuration used by the internet of things platform include one or more of device code, timestamp of message generation, message data portion, name and parameters of calling method, protocol type, device IP address and port number, subject matter of message subscription.
In one illustrative example, taking siddhi streaming nodes as an example, the configuration method includes:
Step 1, writing siddhi application configuration files, including an input end (source capable of analyzing various internet of things protocols such as HTTP, MQTT, TCP and the like) of data, processing logic (sql-like language) of the data, and an output end (sink) of the data after processing.
Step 2: starting the siddhi streaming processing node requires configuration of the environment of version 1.8 java. Each siddhi application configuration file can be operated as an independent stream processing node, so that a plurality of siddhi stream processing nodes can be rapidly deployed to finish operations such as data filtering, transparent transmission, data conversion, data storage integration and aggregation configured according to requirements.
And then configuring communication parameters of the equipment to be accessed, wherein the configured communication parameters are matched with the input end of the streaming processing node corresponding to the equipment.
In some embodiments, the communication parameters configuring the device to be accessed include the protocol to be used by the device to be accessed and parameters required by the protocol.
In some illustrative examples, if the device to be accessed communicates using HTTP, TCP, etc., it is necessary to configure an IP address and a communication port number; if the MQTT and other information subscription communication is used, the IP and the port of the communication server, the account and the password checked by the equipment and the like are required to be configured.
And then, respectively starting the equipment to be accessed, the stream processing engine gateway containing the stream processing node and the Internet of things platform, and carrying out communication between the equipment and the Internet of things platform or between the equipment and the Internet of things platform. For example, the device to be accessed reports data (information of the device, including the type of the message, the state of the device, the sensed data monitored by the device, etc.) to the stream processing engine gateway through the internet of things communication protocol (MQTT, HTTP, coAP, etc.).
Referring to fig. 1, in some embodiments, the communication includes the following modes:
the corresponding stream processing nodes in the stream processing engine gateway 201 process the messages reported by the devices 101 and 102 to be accessed and report the messages to the internet of things platform 301.
Or the corresponding stream processing node in the stream processing engine gateway 201 processes the message issued by the internet of things platform 301 and outputs the message to the devices 101 and 102 to be accessed.
In an illustrative example, processing a message reported by a device to be accessed and reporting the processed message to an internet of things platform specifically includes:
the stream processing node analyzes the communication protocol used by the device and obtains the data stream according to the corresponding communication protocol analysis message (different analysis is needed for different protocols, such as binary data and text data);
The data flow obtained by analysis is subjected to corresponding data extraction according to the message body format of the equipment (extracting the data information in the equipment report message, such as equipment coding, report time stamp, data content, method for requesting call, etc.);
According to the general message body format required by the Internet of things platform, the extracted data is converted and packaged into a message with a corresponding format (converted into the general message body format, such as json and xml format);
And outputting the packaged information through an output end according to the format and transmission mode of the protocol according to a communication protocol supported by the Internet of things platform (reporting the information reported by the equipment data to the platform according to the mode or protocol agreed with the Internet of things platform, wherein the protocol usually comprises HTTP and MQTT, including through middleware such as kafka, rabbitMQ and the like).
In an illustrative example, processing a message issued by an internet of things platform and outputting the processed message to a device to be accessed specifically includes:
The stream processing section analyzes a communication protocol used by the internet of things platform and obtains a data stream according to a corresponding communication protocol analysis message;
carrying out corresponding data extraction on the data stream obtained by analysis according to a general message body format of the Internet of things platform;
according to the message body format required by the equipment, converting and packaging the extracted data into a message with a corresponding format;
and outputting the packaged information through an output end according to the format and the transmission mode of the protocol according to the communication protocol supported by the equipment.
Through the above flow, the internet of things platform 301 shown in fig. 2 can send a message to the devices 101 and 102 in one direction through the stream processing engine gateway 201 (a scenario includes, for example, the platform sends a message for lowering the light brightness, and the device receives the message and then lowers the brightness), or the devices 101 and 102 shown in fig. 3 send data to the internet of things platform 301 in one direction through the stream processing engine gateway 201 (a scenario includes, for example, the message of the device is sent to the platform (electric quantity, brightness of the lamp, and current switch state).
In further embodiments, the method of the present invention further comprises:
The corresponding stream processing node in the stream processing engine gateway processes the message reported by the first equipment to be accessed and reports the message to the Internet of things platform;
the internet of things platform directly forwards or processes the message reported by the first equipment to be accessed according to the service configuration and forwards the message to the streaming processing engine gateway;
And the corresponding flow processing nodes in the flow processing engine gateway process the corresponding messages issued by the Internet of things platform and then output the processed messages to the second equipment to be accessed.
Further, a corresponding stream processing node in the stream processing engine gateway receives a response message of the second device to be accessed, processes the response message and reports the processed response message to the Internet of things platform;
The internet of things platform directly forwards the response message or forwards the response message to a streaming processing engine gateway after processing the response message according to service configuration;
And the corresponding stream processing node in the stream processing engine gateway processes the response message issued by the Internet of things platform and outputs the response message to the first device to be accessed.
Through the flow, according to the platform service requirement, since the reported and issued messages are all in a universal message format, the devices belonging to the same gateway range can communicate with each other. For example, the devices 101 and 102 shown in fig. 4 communicate with the internet of things platform 301 through the two-way communication between the gateway 201 of the streaming engine (scenario 1, (platform-device-platform) the platform needs to acquire the current real-time data of the first device (temperature sensor) and the second device (humidity sensor) immediately, and needs to issue a message first and then return the response of the devices to the platform.
In further embodiments, the method of the present invention further comprises:
the corresponding stream processing node in the first stream processing engine gateway processes the message reported by the first equipment to be accessed and reports the message to the Internet of things platform;
the internet of things platform directly forwards or processes the message reported by the first equipment to be accessed according to the service configuration and forwards the message to the second streaming engine gateway;
and the corresponding flow processing node in the second flow processing engine gateway processes the corresponding message issued by the Internet of things platform and outputs the processed message to the second device to be accessed.
Further, a corresponding stream processing node in the second stream processing engine gateway receives a response message of the second device to be accessed, processes the response message and reports the processed response message to the Internet of things platform;
the internet of things platform directly forwards the response message or forwards the response message to the first flow processing engine gateway after processing the response message according to service configuration;
And the corresponding stream processing node in the first stream processing engine gateway processes the response message issued by the Internet of things platform and outputs the response message to the first device to be accessed.
Through the flow, when a plurality of stream processing engine gateways exist, if the gateways are deployed in different networks, the communication between devices of different network segments can be realized. For example, the device 101 shown in fig. 5 performs communication with the device 102 through the stream processing engine gateway 201, the internet of things platform 301 and the stream processing engine gateway 202 (for example, a scenario includes that the device one (a light controller) needs to acquire data of the device two (a light sensor) in different network segments, and whether to switch on or off a light is determined according to the value of the data).
The flow of message forwarding and processing by the streaming processing node in the present invention is further illustrated by a specific example.
1) Referring to fig. 6, the simulation device reports the message to the internet of things platform using http through mqtt protocol.
2) The streaming processing nodes are configured, input stream, output stream and processing logic (all fields reported are transparent). The specific implementation mode is as follows:
3) Configuration device:
3.1 configuration of equipment end (protocol, ip: port, other protocol parameters, etc.), see fig. 7 for a specific configuration mode;
3.2 sending a message (send message payload to specified topic (/ test), message format json); see in particular fig. 8.
4) The platform end interface receives the message reported by the device message as shown in fig. 9.
The example protocols in the illustration are:
Protocol 1: MQTT;
protocol 2: HTTP.
The fields are explained as follows:
deviceId: a unique code of the device; ts: a time stamp of the message generation;
values: a message data portion; method of: the name of the called method;
params: calling parameters of a method; protocol: a protocol type;
ip: an ip address; port: a port number;
topic: the topic to which the message is subscribed.
The fields above are optional according to the actual communication protocol type, devices and ts are optional, and the rest are optional.
In this illustrated example, the message body format reported by the device is illustrated as:
{
"deviceId":"NO1"
"ts": 1632817365000,
"values": {
"key1": "value1",
"key2": "value2"
}
"method": "resetTemperature",
"params": {}
}
Examples of common message body formats reported to the platform are:
{
"deviceId":"NO1"
"ts": 1632817365000,
"values": {
"key1": "value1",
"key2": "value2"
}
"method": "resetTemperature",
"params": {}
}
examples of generic message formats issued by the platform are:
{
protocol:
ip:
port:
topic:
"deviceId":NO1
"ts": 1632817365000,
"values": {
"key1": "value1",
"key2": "value2"
}
"method": "resetTemperature",
"params": {}
}
the control cancellation example issued to the device after gateway processing is:
{
"deviceId":"NO1"
"ts": 1632817365000,
"values": {
"key1": "value1",
"key2": "value2"
}
"method": "resetTemperature",
"params": {}
}
The above description of the embodiments is only for aiding in the understanding of the method of the present invention and its core ideas. It should be noted that it will be apparent to those skilled in the art that various modifications and adaptations of the invention can be made without departing from the principles of the invention and these modifications and adaptations are intended to be within the scope of the invention as defined in the following claims.

Claims (9)

1. The communication method of the internet of things equipment based on the stream processing is characterized by comprising the following steps of:
Acquiring communication configuration parameters of equipment to be accessed and an Internet of things platform, wherein the communication configuration parameters comprise a communication protocol and a message body format of the equipment to be accessed, and a communication protocol and a universal message body format of the Internet of things platform;
setting a stream processing engine gateway comprising a plurality of stream processing nodes, configuring an input end and an output end of the stream processing nodes based on the acquired communication configuration parameters, and stream processing logic of the stream processing nodes;
Configuring communication parameters of equipment to be accessed, wherein the communication parameters are adapted to the input end of a stream processing node corresponding to the equipment;
The corresponding stream processing nodes in the stream processing engine gateway process the information reported by the equipment to be accessed and report the processed information to the platform of the Internet of things;
Or the corresponding stream processing node in the stream processing engine gateway processes the message issued by the Internet of things platform and outputs the message to the equipment to be accessed;
The method comprises the steps of configuring an input end and an output end of the stream processing node based on the acquired communication configuration parameters, and stream processing logic of the stream processing node specifically comprises:
According to a communication protocol used by the equipment to be accessed or a communication protocol used by the service issued by the internet of things platform and a communication analysis protocol of the general message body configuration input end; according to the communication protocol and the general message body format used by the access service of the platform of the Internet of things, or the communication protocol configuration and the message body format used by the equipment to be accessed, the packaging protocol and the general message body format used by the output end are configured; and converting the fields required to be acquired into an encapsulation protocol and a general message body format required by an output end according to the message body format used by the equipment to be accessed or the general message body format configuration used by the Internet of things platform.
2. The method for communication between devices in internet of things based on stream processing according to claim 1, wherein the fields required to be acquired for parsing according to the message body format configuration used by the device to be accessed include one or more of device code, message data part, name and parameters of calling method, and timestamp of message generation;
The fields required to be acquired according to the general message body format configuration analysis used by the Internet of things platform comprise one or more of equipment codes, time stamps generated by the messages, message data parts, names and parameters of calling methods, protocol types, equipment IP addresses and port numbers and topics subscribed by the messages.
3. The method for communication between devices of internet of things based on stream processing according to claim 1, wherein the communication parameters configuring the device to be accessed include a protocol used by the device to be accessed and parameters required by the protocol.
4. The method for communication between devices of internet of things based on stream processing according to claim 1, wherein processing a message to be reported by a device to be accessed through a corresponding stream processing node in the gateway of the stream processing engine and reporting the processed message to the platform of internet of things comprises:
The stream processing node analyzes the communication protocol used by the equipment and analyzes the message according to the corresponding communication protocol to obtain a data stream;
carrying out corresponding data extraction on the data stream obtained by analysis according to the message body format of the equipment;
according to the general message body format required by the Internet of things platform, converting and packaging the extracted data into a message with a corresponding format;
and outputting the packaged information through an output end according to the format and the transmission mode of the protocol according to the communication protocol supported by the Internet of things platform.
5. The method for communication between devices of internet of things based on stream processing as set forth in claim 1, wherein the processing the message issued by the platform of internet of things by the corresponding stream processing node in the gateway of the stream processing engine and outputting the processed message to the device to be accessed comprises:
The stream processing section analyzes a communication protocol used by the internet of things platform and obtains a data stream according to a corresponding communication protocol analysis message;
carrying out corresponding data extraction on the data stream obtained by analysis according to a general message body format of the Internet of things platform;
according to the message body format required by the equipment, converting and packaging the extracted data into a message with a corresponding format;
and outputting the packaged information through an output end according to the format and the transmission mode of the protocol according to the communication protocol supported by the equipment.
6. The method for communication between devices of the internet of things based on stream processing according to any one of claims 1 to 5, further comprising:
The corresponding stream processing node in the stream processing engine gateway processes the message reported by the first equipment to be accessed and reports the message to the Internet of things platform;
the internet of things platform directly forwards or processes the message reported by the first equipment to be accessed according to the service configuration and forwards the message to the streaming processing engine gateway;
And the corresponding flow processing nodes in the flow processing engine gateway process the corresponding messages issued by the Internet of things platform and then output the processed messages to the second equipment to be accessed.
7. The method for communication between devices of internet of things based on stream processing as set forth in claim 6, further comprising:
the corresponding stream processing node in the stream processing engine gateway receives the response message of the second device to be accessed, processes the response message and reports the processed response message to the Internet of things platform;
The internet of things platform directly forwards the response message or forwards the response message to a streaming processing engine gateway after processing the response message according to service configuration;
And the corresponding stream processing node in the stream processing engine gateway processes the response message issued by the Internet of things platform and outputs the response message to the first device to be accessed.
8. The method for communication between devices of the internet of things based on stream processing according to any one of claims 1 to 5, further comprising:
the corresponding stream processing node in the first stream processing engine gateway processes the message reported by the first equipment to be accessed and reports the message to the Internet of things platform;
the internet of things platform directly forwards or processes the message reported by the first equipment to be accessed according to the service configuration and forwards the message to the second streaming engine gateway;
and the corresponding flow processing node in the second flow processing engine gateway processes the corresponding message issued by the Internet of things platform and outputs the processed message to the second device to be accessed.
9. The method for communication between devices of internet of things based on stream processing according to claim 8, further comprising:
A corresponding stream processing node in the second stream processing engine gateway receives and processes the response message of the second device to be accessed and reports the response message to the Internet of things platform;
the internet of things platform directly forwards the response message or forwards the response message to the first flow processing engine gateway after processing the response message according to service configuration;
And the corresponding stream processing node in the first stream processing engine gateway processes the response message issued by the Internet of things platform and outputs the response message to the first device to be accessed.
CN202210194977.6A 2022-03-02 2022-03-02 Internet of things equipment communication method based on stream processing Active CN114257623B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210194977.6A CN114257623B (en) 2022-03-02 2022-03-02 Internet of things equipment communication method based on stream processing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210194977.6A CN114257623B (en) 2022-03-02 2022-03-02 Internet of things equipment communication method based on stream processing

Publications (2)

Publication Number Publication Date
CN114257623A CN114257623A (en) 2022-03-29
CN114257623B true CN114257623B (en) 2024-06-04

Family

ID=80797241

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210194977.6A Active CN114257623B (en) 2022-03-02 2022-03-02 Internet of things equipment communication method based on stream processing

Country Status (1)

Country Link
CN (1) CN114257623B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115361447A (en) * 2022-08-09 2022-11-18 神州顶联科技有限公司 Internet of things gateway data processing method of water operation billing equipment

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6711162B1 (en) * 1995-09-08 2004-03-23 3Com Corporation Method and apparatus for providing proxy service, route selection, and protocol conversion for service endpoints within data networks
CN102355696A (en) * 2011-08-08 2012-02-15 上海理工大学 Large scale Internet of things gateway system and realization method thereof
CN103428627A (en) * 2012-05-22 2013-12-04 中国移动通信集团江苏有限公司 Method for transferring data in internet of things, internet of things system and corresponding device
CN110351257A (en) * 2019-06-27 2019-10-18 绿漫科技有限公司 A kind of distribution Internet of Things safety access system
CN110460521A (en) * 2019-09-19 2019-11-15 北京中电普华信息技术有限公司 A kind of edge calculations AnyRouter
CN110971614A (en) * 2019-12-17 2020-04-07 软通动力信息技术(集团)有限公司 Internet of things adaptation method and system, computer equipment and storage medium
CN111787066A (en) * 2020-06-06 2020-10-16 王科特 Internet of things data platform based on big data and AI
CN112333227A (en) * 2020-09-11 2021-02-05 浙江工业大学 Internet of things platform of mixed type protocol based on rule engine
CN112422565A (en) * 2020-11-18 2021-02-26 青岛海尔科技有限公司 Message processing method and device, storage medium and electronic device
CN112734054A (en) * 2020-12-24 2021-04-30 大唐互联科技(武汉)有限公司 Equipment remote diagnosis operation and maintenance method and system based on Internet of things
CN112788125A (en) * 2020-12-31 2021-05-11 浙江航天恒嘉数据科技有限公司 Internet of things platform and method based on data access, circulation and linkage
CN113542411A (en) * 2021-07-16 2021-10-22 江苏有熊安全科技有限公司 Fire control thing networking integrated management platform

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10798183B2 (en) * 2018-12-13 2020-10-06 Sap Se Tunneling protcol and gateway for distributed computing environments

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6711162B1 (en) * 1995-09-08 2004-03-23 3Com Corporation Method and apparatus for providing proxy service, route selection, and protocol conversion for service endpoints within data networks
CN102355696A (en) * 2011-08-08 2012-02-15 上海理工大学 Large scale Internet of things gateway system and realization method thereof
CN103428627A (en) * 2012-05-22 2013-12-04 中国移动通信集团江苏有限公司 Method for transferring data in internet of things, internet of things system and corresponding device
CN110351257A (en) * 2019-06-27 2019-10-18 绿漫科技有限公司 A kind of distribution Internet of Things safety access system
CN110460521A (en) * 2019-09-19 2019-11-15 北京中电普华信息技术有限公司 A kind of edge calculations AnyRouter
CN110971614A (en) * 2019-12-17 2020-04-07 软通动力信息技术(集团)有限公司 Internet of things adaptation method and system, computer equipment and storage medium
CN111787066A (en) * 2020-06-06 2020-10-16 王科特 Internet of things data platform based on big data and AI
CN112333227A (en) * 2020-09-11 2021-02-05 浙江工业大学 Internet of things platform of mixed type protocol based on rule engine
CN112422565A (en) * 2020-11-18 2021-02-26 青岛海尔科技有限公司 Message processing method and device, storage medium and electronic device
CN112734054A (en) * 2020-12-24 2021-04-30 大唐互联科技(武汉)有限公司 Equipment remote diagnosis operation and maintenance method and system based on Internet of things
CN112788125A (en) * 2020-12-31 2021-05-11 浙江航天恒嘉数据科技有限公司 Internet of things platform and method based on data access, circulation and linkage
CN113542411A (en) * 2021-07-16 2021-10-22 江苏有熊安全科技有限公司 Fire control thing networking integrated management platform

Also Published As

Publication number Publication date
CN114257623A (en) 2022-03-29

Similar Documents

Publication Publication Date Title
CN109889551B (en) Method for accessing intelligent hardware to Internet of things cloud platform
CN109391500B (en) Configuration management method, device and equipment
CN107018147B (en) Internet of things communication method and system and gateway module
CN111031034A (en) Multi-protocol convergence edge computing gateway
CN109756559B (en) Construction and use method for distributed data distribution service of embedded airborne system
CN112769938A (en) Kubernetes cloud edge communication system and method based on QUIC
CN108769017B (en) Data communication method and device
CN110768882B (en) Data monitoring method and system, monitoring equipment and vehicle
CN114257623B (en) Internet of things equipment communication method based on stream processing
CN112817539A (en) Industrial data storage method and system, electronic device and storage medium
US7787599B2 (en) Method and system for protocol embedded automated test control
Azzara et al. The icsi m2m middleware for iot-based intelligent transportation systems
CN113347195B (en) Dynamic mounting system and method for communication protocol packet of Internet of things equipment
WO2016149342A2 (en) Method and system for transferring messages between messaging systems
CN117615028A (en) Method and system for transmitting IEC104 protocol data based on electric power Internet of things management platform
CN117478765A (en) Information interaction method based on Internet of things multi-protocol adaptation
CN115150207B (en) Industrial network equipment identification method and device, terminal equipment and storage medium
CN112714153B (en) Processing method and device compatible with multiple TCPs (Transmission control protocol) based on Internet of things system
CN111614612B (en) Communication protocol implementation method, device, network management server and storage medium
CN114945031B (en) Cloud original Internet of things platform supporting access of mass equipment multi-communication protocol and message protocol
CN110868317B (en) Equipment monitoring method and device, electronic equipment and storage medium
CN111711563B (en) Medical internet of things gateway
Yang et al. Design of Adaptive Power Distribution Protocol Conversion System based on MQTT Cloud Edge Interaction
CN109314651B (en) Management information base oriented protocol for high-efficiency http management process
CN117749905A (en) Industrial Ethernet protocol conversion device and method

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
TA01 Transfer of patent application right

Effective date of registration: 20240418

Address after: No. 689, aixihu North Road, high tech Industrial Development Zone, Nanchang City, Jiangxi Province

Applicant after: China energy saving Jinghe Technology Co.,Ltd.

Country or region after: China

Address before: 310000 3002-23, Tianren building, No. 188, Liyi Road, ningwei street, Xiaoshan District, Hangzhou City, Zhejiang Province

Applicant before: Cecep Jinghe Smart City Technology (Zhejiang) Co.,Ltd.

Country or region before: China

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant