CN113382007A - Industrial internet data acquisition and transmission method and system - Google Patents
Industrial internet data acquisition and transmission method and system Download PDFInfo
- Publication number
- CN113382007A CN113382007A CN202110661312.7A CN202110661312A CN113382007A CN 113382007 A CN113382007 A CN 113382007A CN 202110661312 A CN202110661312 A CN 202110661312A CN 113382007 A CN113382007 A CN 113382007A
- Authority
- CN
- China
- Prior art keywords
- udp
- data
- configuring
- transmission module
- data packet
- 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.)
- Withdrawn
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/08—Protocols for interworking; Protocol conversion
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/03—Protocol definition or specification
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
- H04L69/164—Adaptation or special uses of UDP protocol
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/18—Multiprotocol handlers, e.g. single devices capable of handling multiple protocols
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/26—Special purpose or proprietary protocols or architectures
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computing Systems (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention belongs to the technical field of industrial internet, and particularly relates to an industrial internet data acquisition and transmission method, which comprises the steps of acquiring data from an OPC server or an InfluxDB database, packaging the data into UDP data packets according to a UDP protocol and transmitting the UDP data packets; and acquiring definition analysis data of the UDP data packet according to the UDP data packet format, and sending the data to an MQTT server, storing the data in an InfluxDB time sequence database and storing the data in a trendDB time sequence database according to the requirement. The method mainly aims to solve the problems of low acquisition frequency, large data volume and poor transmission timeliness of the original data acquisition product; transmitting and processing the acquired data in different nodes through UDP packet specification; through the technical scheme of the invention, a solid foundation is laid for the development of the future platform.
Description
Technical Field
The invention belongs to the technical field of industrial internet, and particularly relates to an industrial internet data acquisition and transmission method and system.
Background
The Industrial Internet (Industrial Internet) is an open, global network that connects people, data, and machines, belonging to the category of catalogs of the ubiquitous Internet. It is a high integration of global industrial system and advanced computing, analyzing, sensing technology and internet. The essence of the industrial internet is that equipment, production lines, factories, suppliers, products and customers are closely connected and fused through an open and global industrial-level network platform, various element resources in industrial economy are efficiently shared, so that the cost is reduced and the efficiency is increased through an automatic and intelligent production mode, the manufacturing industry can be helped to elongate an industrial chain, cross-equipment, cross-system, cross-factory and cross-regional interconnection and intercommunication are formed, the efficiency is improved, and the intelligence of the whole manufacturing service system is promoted. The method is also beneficial to promoting the melting development of the manufacturing industry, realizing the crossing development between the manufacturing industry and the service industry and efficiently sharing various key resources of the industrial economy.
The existing industrial internet platform completes the main function development of an application layer, and a platform layer and an infrastructure layer are deployed locally. In order to perfect the overall architecture of the platform and realize comprehensive autonomy, edge layer products need to be developed at present to replace the original data acquisition products, and the problems of low acquisition frequency, large data volume and poor transmission timeliness of the original data acquisition products are mainly solved.
Disclosure of Invention
The invention aims to provide an industrial internet data acquisition and transmission method and system, and mainly aims to solve the problems of low acquisition frequency, large data volume and poor transmission timeliness of the original data acquisition product.
In order to achieve the purpose, the technical scheme adopted by the invention is as follows:
a data acquisition and transmission method for industrial Internet is characterized in that: collecting data from an OPC server or an InfluxDB database, packaging the data into a UDP data packet according to a UDP protocol and sending the UDP data packet; and acquiring definition analysis data of the UDP data packet according to the UDP data packet format, and sending the data to an MQTT server, storing the data in an InfluxDB time sequence database and storing the data in a trendDB time sequence database according to the requirement.
The utility model provides an industry internet data acquisition transmission system which characterized in that: the system comprises the following modules:
data acquisition:
1) an OPC-UDP transmission module: collecting data from a designated OPC server, packaging the collected data into a UDP data packet according to a UDP protocol, and sending the UDP data packet to a designated destination IP and a designated port;
2) the InfluxDB-UDP transmission module: collecting data from a specified InfluxDB database, packaging the collected data into a UDP data packet according to a UDP protocol, and sending the UDP data packet to a specified destination IP and a specified port;
data forwarding:
1) a UDP-UDP transmission module: acquiring a UDP data packet, and forwarding the UDP data packet according to the configuration information;
data processing:
1) UDP-MQTT transmission module: receiving a UDP data packet, analyzing data according to the definition of the UDP data packet format, and sending the analyzed data to an MQTT server of the edge node;
2) UDP-InfluxDB transmission module: receiving a UDP (user Datagram protocol) data packet, analyzing data according to the definition of the UDP data packet format, and storing the analyzed data into an InfluxDB time sequence database;
3) UDP-TrendDB transmission module: and receiving the UDP data packet, analyzing the data according to the definition of the UDP data packet format, and storing the analyzed data into a trendDB time sequence database at the center side.
Further, during the data acquisition, forwarding and processing processes, link state display is performed according to the UDP state specification.
Further, the OPC-UDP transmission module is configured to: configuring nodes, configuring an OPC protocol, configuring an acquisition period, and configuring IP and port numbers of UDP destination terminals; the OPC-UDP transmission module acquires data of a designated node from an OPC server through an OPC protocol, packages the data into a data packet in a UDP format according to a data structure defined by the UDP protocol, transmits the data packet to a designated destination UDP receiving terminal, and simultaneously sends a state packet to the UDP receiving terminal every 30 seconds;
configuring an InfluxDB-UDP transmission module: configuring a node, configuring InfluxDB database information, configuring an acquisition cycle, and configuring a UDP destination IP and a port number; the InfluxDB-UDP transmission module acquires the latest data of the designated node from the InfluxDB database through an HTTP protocol, then encapsulates the latest data into a data packet in a UDP format according to a data structure defined by the UDP protocol, transmits the data packet to a designated destination UDP receiving terminal, and simultaneously transmits a status packet to the UDP receiving terminal every 30 seconds.
Furthermore, the OPC-UDP transmission module and the InfluxDB-UDP transmission module both create a thread pool, and execute data acquisition tasks at a fixed speed in the thread pool.
Further, the UDP-UDP transport module is configured to: configuring transmission frequency, configuring overtime setting, configuring IP and port number of a UDP receiving end, and configuring IP and port number of a UDP destination end; the UDP-UDP transmission module discards or directly forwards the received UPD data packet to a designated UDP receiving end; and if the UDP-UDP transmission module does not receive the UDP data packet transmitted by the upper link within the overtime set time, a new state packet is created by the UDP-UDP transmission module to be transmitted downwards.
Further, the UDP-UDP transmission module creates a thread pool and starts a forwarding task, forwards the received first UDP packet according to the transmission frequency X, discards the 2 nd to the X-1 th UDP packets, forwards the X-th UDP packet, and calculates the number of the received UDP packets from 1.
Further, configuring the UDP-MQTT transmission module: configuring a measuring point, configuring transmission frequency, configuring overtime setting, configuring IP and port number of a UDP receiving terminal and MQTT server information; the UDP-MQTT transmission module analyzes the received UPD data packet according to a UDP protocol, integrates the UPD data packet with the measuring point information, converts the integrated data into an MQTT message queue, reports the MQTT message queue to an MQTT server, and transmits the data outwards in a subscription mode; if the UDP-MQTT transmission module receives a UDP state packet transmitted by an upper link within the overtime setting, displaying the link state; if the UDP data packet transmitted by the upper link is not received within the overtime set time, the upper link information is cleared;
configuring a UDP-InfluxDB transmission module: configuring a measuring point, configuring a storage frequency, configuring overtime setting, configuring an IP (Internet protocol) and a port number of a UDP (user Datagram protocol) receiving end and configuring information of an InfluxDB time sequence database; the UDP-InfluxDB transmission module analyzes the received UPD data packet according to a UDP protocol, integrates the UPD data packet with the measuring point information, and stores the integrated data into an InfluxDB time sequence database in real time; if the UDP-InfluxDB transmission module receives a UDP state packet transmitted by an upper link within the overtime set time, the link state is displayed; if the UDP data packet transmitted by the upper link is not received within the overtime set time, the upper link information is cleared;
configuring a UDP-TrendDB transmission module: configuring a measuring point, configuring a storage frequency, configuring overtime setting and configuring UDP receiving end information: IP and port number, configuration TrendDB interface address; the UDP-trendDB transmission module analyzes the received UPD data packet according to a UDP protocol, integrates the UPD data packet with the measuring point information, and stores the integrated data into a trendDB time sequence database in real time; if the UDP-TrendDB transmission module receives a UDP state packet transmitted by an upper link within the overtime set time, displaying the link state; and if the UDP data packet transmitted by the upper link is not received within the time set by the overtime, clearing the upper link information.
Further, the UDP-MQTT transmission module, the UDP-InfluxDB transmission module and the UDP-TrendDB transmission module are all provided with a UDP receiving thread:
1) the UDP-MQTT transmission module receives UDP data packets, discards the UDP data packets or analyzes the UDP data packets into MQTT messages according to the transmission frequency and sends the MQTT messages to the MQTT server;
the UDP-InfluxDB transmission module receives the UDP data packets, discards the UDP data packets or analyzes the UDP data packets according to the sending frequency and stores the UDP data packets into the InfulxDB;
the UDP-trendDB transmission module receives UDP data packets, discards the UDP data packets according to the sending frequency or analyzes and uses a trendDB interface;
2) and receiving the UDP state packet, analyzing and displaying the link state under the condition that the overtime setting is not exceeded, and only displaying the state of the UDP state packet if the overtime setting is exceeded.
The invention has the beneficial effects that: the method mainly aims to solve the problems of low acquisition frequency, large data volume and poor transmission timeliness of the original data acquisition product. And transmitting and processing the acquired data in different nodes through UDP packet specification. The invention connects the platform layer finished by the existing industrial internet platform with the infrastructure layer; the data are read from the infrastructure in real time by adopting an OPC protocol, accurately converted into a protocol which can be supported by an edge side server for data transmission and report, forwarded by adopting a UDP protocol, transmitted to an MQTT server by adopting an MQTT protocol and then uploaded to a cloud end, so that the function of cloud of the data is realized. And providing a function of storing data into time sequence databases InfluxDB and TrendDB. The scheme defines a data communication standard and a state communication standard based on a data transmission mode in the industry, and greatly improves the real-time performance and the accuracy of data transmission. Through the state communication specification, the tracking of data among all edge side nodes is realized, a complete tracking link is formed, and the problem node can be quickly and accurately positioned through the link. Through the technical scheme of the invention, a solid foundation is laid for the development of the future platform.
Drawings
Fig. 1 is a schematic diagram of an industrial internet data acquisition and transmission system.
Fig. 2 is a schematic diagram of an OPC-UDP transport module.
Fig. 3 is a schematic diagram of an infiluxdb-UDP transport module.
Fig. 4 is a schematic diagram of a UDP-UDP transport module.
FIG. 5 is a schematic diagram of the UDP-MQTT transmission module.
Fig. 6 is a schematic diagram of a UDP-infiluxdb transport module.
Fig. 7 is a schematic diagram of a UDP-trendddb transport module.
Detailed Description
In order to better understand the present invention, the following embodiments are further described.
A data acquisition and transmission method for industrial Internet comprises the steps of acquiring data from an OPC server or an InfluxDB database, packaging the data into UDP data packets according to a UDP protocol and sending the UDP data packets; and acquiring definition analysis data of the UDP data packet according to the UDP data packet format, and sending the data to an MQTT server, storing the data in an InfluxDB time sequence database and storing the data in a trendDB time sequence database according to the requirement. And in the processes of data acquisition, forwarding and processing, link state display is carried out according to the UDP state specification.
Software for realizing the method is an industrial internet data acquisition and transmission system, as shown in fig. 1, and comprises the following modules:
data acquisition:
1. an OPC-UDP transmission module: as shown in fig. 2, data is collected from a designated OPC server, and the collected data is encapsulated into UDP packets according to the UDP protocol and sent to a designated destination IP and port.
Configuring an OPC-UDP transmission module:
1) managing nodes requiring collection
a) Nodes can be led in batch from csv files
b) Node can be added manually
c) Deletable node
d) Nodes can be inquired according to different conditions
2) Configuring OPC protocol
a) IP with OPC Server
b) Login username and password
c) OPC service name
3) The acquisition frequency is configured to be accurate to millisecond, and the minimum can be 500 millisecond according to specific service
4) Configuring UDP destination end information: IP and port number.
To ensure continuous, fixed-rate data collection from an OPC server, a thread pool may be created in which data collection tasks are performed at a fixed rate; and reading data from the OPC server every x milliseconds according to the number of milliseconds set by the acquisition frequency, packaging the data into a UDP data packet, and transmitting the UDP data packet to a UDP server.
The OPC-UDP transmission module acquires data of a designated node from an OPC server through an OPC protocol, packages the data into a data packet in a UDP format according to a data structure defined by the UDP protocol, transmits the data packet to a designated destination UDP receiving terminal, and simultaneously sends a state packet to the UDP receiving terminal every 30 seconds;
2. the InfluxDB-UDP transmission module: as shown in fig. 3, data is collected from a designated infiluxdb database, and the collected data is encapsulated into UDP packets according to the UDP protocol and sent to a designated destination IP and port.
Configuring an InfluxDB-UDP transmission module:
1) managing nodes requiring collection
a) Nodes can be led in batch from csv files
b) Node can be added manually
c) Deletable node
d) Nodes can be inquired according to different conditions
2) Configuring InfluxDB database information
a) InfluxDB database IP and port
b) Login username and password
c) Database name and table name
3) The acquisition frequency is configured to be accurate to millisecond, and the minimum can be 500 millisecond according to specific service
4) Configuring UDP destination end information: IP and port number.
In order to ensure that data is continuously acquired from the InfluxDB at a fixed rate, a thread pool can be created, and data acquisition tasks are executed in the thread pool at the fixed rate; and reading the latest and most complete batch of data from a specified table on the InfluxDB database every x milliseconds according to the number of milliseconds set by the acquisition frequency, packaging the latest and most complete batch of data into a UDP data packet, and transmitting the UDP data packet to a UDP server.
The InfluxDB-UDP transmission module acquires the latest data of the designated node from the InfluxDB database through an HTTP protocol, then encapsulates the latest data into a data packet in a UDP format according to a data structure defined by the UDP protocol, transmits the data packet to a designated destination UDP receiving terminal, and simultaneously transmits a status packet to the UDP receiving terminal every 30 seconds.
Data forwarding:
1. a UDP-UDP transmission module: as shown in fig. 4, a UDP packet is obtained and forwarded according to the configuration information.
Configuring a UDP-UDP transmission module:
1) configuring transmission frequency
2) Configuration timeout setting, unit: second of
3) Configuring UDP receiving end information: IP and port number
4) Configuring UDP destination end information: IP and port number.
The UDP-UDP transmission module discards or directly forwards the received UPD data packet to a designated UDP receiving end, so that the node information does not need to be configured.
And if the UDP-UDP transmission module does not receive the UDP data packet transmitted by the upper link within the overtime set time, a new state packet is created by the UDP-UDP transmission module to be transmitted downwards.
When the above configurations all exist, a thread pool can be created and a forwarding task is started, the received first UDP data packet is forwarded according to the transmission frequency X, the 2 nd to the X-1 th UDP data packets are discarded, the X-th UDP data packet is forwarded, and the number of the received UDP packets is calculated from 1.
Data processing:
1. UDP-MQTT transmission module: as shown in fig. 5, receiving the UDP packet, parsing the data according to the definition of the UDP packet format, and sending the parsed data to the MQTT server of the edge node.
Configuring a UDP-MQTT transmission module:
1) configuring transmission frequency
2) Configuration measuring point
3) Configuration timeout setting, unit: second of
4) Configuring UDP receiving end information: IP and port number
5) Configuring MQTT server information: broker address and port, ClienID, theme.
When the above configurations all exist, a UDP reception thread may be created:
1) the UDP-MQTT transmission module receives UDP data packets, discards the UDP data packets or analyzes the UDP data packets into MQTT messages according to the transmission frequency and sends the MQTT messages to the MQTT server;
2) and receiving the UDP state packet, analyzing and displaying the link state under the condition that the overtime setting is not exceeded, and only displaying the state of the UDP state packet if the overtime setting is exceeded.
The UDP-MQTT transmission module analyzes the received UPD data packet according to a UDP protocol, integrates the UPD data packet with the measuring point information, converts the integrated data into an MQTT message queue, reports the MQTT message queue to an MQTT server, and transmits the data outwards in a subscription mode.
If the UDP-MQTT transmission module receives a UDP state packet transmitted by an upper link within the overtime setting, displaying the link state; and if the UDP data packet transmitted by the upper link is not received within the time set by the overtime, clearing the upper link information.
2. UDP-InfluxDB transmission module: as shown in fig. 6, receiving the UDP packet, parsing the data according to the definition of the UDP packet format, and storing the parsed data in the infiluxdb time-series database.
Configuring a UDP-InfluxDB transmission module:
1) configuring transmission frequency
2) Configuration measuring point
3) Configuration timeout setting, unit: second of
4) Configuring UDP receiving end information: IP and port number
5) Configuring InfluxDB database information: IP and port numbers, user name and password, database name and table name.
When the above configurations all exist, a UDP reception thread may be created:
1) the UDP-InfluxDB transmission module receives the UDP data packets, discards the UDP data packets or analyzes the UDP data packets according to the sending frequency and stores the UDP data packets into the InfulxDB;
2) and receiving the UDP state packet, analyzing and displaying the link state under the condition that the overtime setting is not exceeded, and only displaying the state of the UDP state packet if the overtime setting is exceeded.
The UDP-InfluxDB transmission module analyzes the received UPD data packet according to a UDP protocol, integrates the UPD data packet with the measuring point information, and stores the integrated data into an InfluxDB time sequence database in real time.
If the UDP-InfluxDB transmission module receives a UDP state packet transmitted by an upper link within the overtime set time, the link state is displayed; if the UDP data packet transmitted by the upper link is not received within the overtime set time, the upper link information is cleared.
3. UDP-TrendDB transmission module: as shown in fig. 7, the UDP packet is received, data is analyzed according to the definition of the UDP packet format, and the analyzed data is stored in the trendb time-series database on the center side.
When the modules are all deployed on a server where the trendDB time sequence database is located, a UDP-trendDB transmission module is required to be used.
Configuring a UDP-TrendDB transmission module:
1) configuring transmission frequency
2) Configuration measuring point
3) Configuration timeout setting, unit: second of
4) Configuring UDP receiving end information: IP and port number
5) And configuring the TrendDB interface address.
When the above configurations all exist, a UDP reception thread may be created:
1) the UDP-trendDB transmission module receives UDP data packets, discards the UDP data packets according to the sending frequency or analyzes and uses a trendDB interface;
2) and receiving the UDP state packet, analyzing and displaying the link state under the condition that the overtime setting is not exceeded, and only displaying the state of the UDP state packet if the overtime setting is exceeded.
And the UDP-trendDB transmission module analyzes the received UPD data packet according to a UDP protocol, integrates the UPD data packet with the measuring point information, and stores the integrated data into a trendDB time sequence database in real time.
If the UDP-TrendDB transmission module receives a UDP state packet transmitted by an upper link within the overtime set time, displaying the link state; and if the UDP data packet transmitted by the upper link is not received within the time set by the overtime, clearing the upper link information.
Definition of data communication specifications
The UDP protocol is used for transmitting data among all modules of the system software, and the format of a data packet is defined. According to the standard, system software defines and analyzes data packets transmitted among various types of interfaces, and functions of data acquisition, transmission, storage and the like are realized.
1. Communication protocol
UDP is selected as a communication protocol, two communication parties negotiate to determine that the data unidirectional transmission does not accept the response information of a receiving party, and the specific data packet format is as shown in the following table.
Serial number | Field(s) | Type (B) | Description of the invention | Length of |
1 | PacketType | byte | Type of bag (data packet, status packet) | 1 |
2 | Length | int | Frame length | 4 |
3 | ServerNo | short | Receiving end serial number | 2 |
4 | DataType | byte | Data type (switching value, analog value) | 1 |
5 | Index | short | Index of measuring points | 2 |
6 | DataNum | short | Number of data | 2 |
7 | PackTime | long | Time of data packet transmission | 8 |
8 | DataTime | long | Time of data | 8 |
9 | Data | Data area | ||
10 | CRC | int | Check area | 4 |
Frame head: the receiving end serial number, the data type, the data index, the data number, the data packet sending time and the data time.
2. Description of frame unit
1. Bag type (PacketType)
Packets passed in the DataHunter software fall into two categories: data packets and status packets. The data packet is 0 and the status packet is 1.
2. Frame Length (Length)
The frame length is the sum of the frame header, the data region, and does not include its own length.
3. Receiving end sequence number (ServerNo)
The receiving end receives the serial number of the program and the data receiving end provides a number.
4. Data type (DataType)
The type of data transmitted by the data frame is 0, the switching value is 0, the analog value is 1, and only one data type can be transmitted by one data frame.
5. Data Index (Index)
The data sent for each frame is of the same type and is the consecutive measure in the point table, and the index indicates that the first data of the frame is counted from 0 for the measure of the corresponding type in the point table.
6. Number of data (DataNum)
The field indicates the number of data in a data frame, the maximum switching value cannot exceed 720, the maximum analog value cannot exceed 288, and the total size of each frame cannot exceed 1472 bytes.
7. Data packet transmission time (PackTime)
Timestamp, type long, unit: milliseconds.
8. Data time (DataTime)
Timestamp, type long, unit: milliseconds. A value of 0 indicates no time, and the receiver can use its own local time.
9. Data area
The data area stores real-time data, the switching value type is TagValue _ DI, the analog value type is TagValue _ AI, and the data length must be consistent with the number in the header information. The length of the region is: DataNum sizerof (TagValue _ DI) or DataNum sizerof (TagValue _ AI).
10. Check code
The check code is a CRC32 check code for the header and the data fields.
3. Definition of data structures
Definition of State communication Specifications
The system software transmits data among various interfaces, the system needs to track the data transmission state, and the format of a state packet is defined. According to the specification, the operation states of the current node and each node in the upstream transmission link in the data transmission process are stored in the state packet.
1. Communication protocol
UDP can be selected as a communication protocol, two communication parties negotiate to decide that data unidirectional transmission does not accept response information of a receiving party, and a specific data packet format is as follows.
Serial number | Field(s) | Type (B) | Description of the invention | Length of |
1 | PacketType | byte | Type of bag (data packet, status packet) | 1 |
2 | Length | int | Frame length | 4 |
3 | DataNum | short | Number of data | 2 |
4 | PackTime | Long | Status packet transmission time | 8 |
5 | Data | Data area | ||
6 | CRC | int | Check area | 4 |
Frame head: data number and data packet sending time.
2. Description of frame unit
1. Bag type (PacketType)
Packets passed in the DataHunter software fall into two categories: data packets and status packets. The data packet is 0 and the status packet is 1.
2. Frame Length (Length)
The frame length is the sum of the frame header, the data region, and does not include its own length.
3. Number of data (DataNum)
This field indicates the number of states in a state, which does not exceed 31, ensuring that the total size of each frame cannot exceed 1472 bytes.
4. State packet transmission time (PackTime)
The type of system time when a packet is transmitted is long integer, and the unit is millisecond.
5. Data area
The data area stores state data, the state data structure refers to LinkStatusNode, and the data length must be consistent with the number in the header information. The length of the region is: DataNum size of (status).
6. Check code
The check code is a CRC32 check code for the header and the data fields.
3. Definition of data structures
The above description is only an application example of the present invention, and certainly, the present invention should not be limited by this application, and therefore, the present invention is still within the protection scope of the present invention by equivalent changes made in the claims of the present invention.
Claims (9)
1. A data acquisition and transmission method for industrial Internet is characterized in that: collecting data from an OPC server or an InfluxDB database, packaging the data into a UDP data packet according to a UDP protocol and sending the UDP data packet; and acquiring definition analysis data of the UDP data packet according to the UDP data packet format, and sending the data to an MQTT server, storing the data in an InfluxDB time sequence database and storing the data in a trendDB time sequence database according to the requirement.
2. The industrial internet data acquisition and transmission system is characterized by comprising the following modules:
data acquisition:
1) an OPC-UDP transmission module: collecting data from a designated OPC server, packaging the collected data into a UDP data packet according to a UDP protocol, and sending the UDP data packet to a designated destination IP and a designated port;
2) the InfluxDB-UDP transmission module: collecting data from a specified InfluxDB database, packaging the collected data into a UDP data packet according to a UDP protocol, and sending the UDP data packet to a specified destination IP and a specified port;
data forwarding:
1) a UDP-UDP transmission module: acquiring a UDP data packet, and forwarding the UDP data packet according to the configuration information;
data processing:
1) UDP-MQTT transmission module: receiving a UDP data packet, analyzing data according to the definition of the UDP data packet format, and sending the analyzed data to an MQTT server of the edge node;
2) UDP-InfluxDB transmission module: receiving a UDP (user Datagram protocol) data packet, analyzing data according to the definition of the UDP data packet format, and storing the analyzed data into an InfluxDB time sequence database;
3) UDP-TrendDB transmission module: and receiving the UDP data packet, analyzing the data according to the definition of the UDP data packet format, and storing the analyzed data into a trendDB time sequence database at the center side.
3. The industrial internet data acquisition and transmission method according to claim 2, wherein: and in the processes of data acquisition, forwarding and processing, link state display is carried out according to the UDP state specification.
4. The industrial internet data acquisition and transmission method according to claim 2, wherein: configuring an OPC-UDP transmission module: configuring nodes, configuring an OPC protocol, configuring an acquisition period, and configuring IP and port numbers of UDP destination terminals; the OPC-UDP transmission module acquires data of a designated node from an OPC server through an OPC protocol, packages the data into a data packet in a UDP format according to a data structure defined by the UDP protocol, transmits the data packet to a designated destination UDP receiving terminal, and simultaneously sends a state packet to the UDP receiving terminal every 30 seconds;
configuring an InfluxDB-UDP transmission module: configuring a node, configuring InfluxDB database information, configuring an acquisition cycle, and configuring a UDP destination IP and a port number; the InfluxDB-UDP transmission module acquires the latest data of the designated node from the InfluxDB database through an HTTP protocol, then encapsulates the latest data into a data packet in a UDP format according to a data structure defined by the UDP protocol, transmits the data packet to a designated destination UDP receiving terminal, and simultaneously transmits a status packet to the UDP receiving terminal every 30 seconds.
5. The industrial internet data acquisition and transmission method according to claim 4, wherein: the OPC-UDP transmission module and the InfluxDB-UDP transmission module both create thread pools, and data acquisition tasks are executed in the thread pools at a fixed speed.
6. The industrial internet data acquisition and transmission method according to claim 5, wherein: configuring a UDP-UDP transmission module: configuring transmission frequency, configuring overtime setting, configuring IP and port number of a UDP receiving end, and configuring IP and port number of a UDP destination end; the UDP-UDP transmission module discards or directly forwards the received UPD data packet to a designated UDP receiving end; and if the UDP-UDP transmission module does not receive the UDP data packet transmitted by the upper link within the overtime set time, a new state packet is created by the UDP-UDP transmission module to be transmitted downwards.
7. The industrial internet data acquisition and transmission method according to claim 6, wherein: the UDP-UDP transmission module creates a thread pool and starts a forwarding task, forwards the received first UDP data packet according to the transmission frequency X, discards the 2 nd to the X-1 th UDP data packets, forwards the X-th UDP data packet, and calculates the number of the received UDP packets from 1.
8. The industrial internet data acquisition and transmission method according to claim 7, wherein: configuring a UDP-MQTT transmission module: configuring a measuring point, configuring transmission frequency, configuring overtime setting, configuring IP and port number of a UDP receiving terminal and MQTT server information; the UDP-MQTT transmission module analyzes the received UPD data packet according to a UDP protocol, integrates the UPD data packet with the measuring point information, converts the integrated data into an MQTT message queue, reports the MQTT message queue to an MQTT server, and transmits the data outwards in a subscription mode; if the UDP-MQTT transmission module receives a UDP state packet transmitted by an upper link within the overtime setting, displaying the link state; if the UDP data packet transmitted by the upper link is not received within the overtime set time, the upper link information is cleared;
configuring a UDP-InfluxDB transmission module: configuring a measuring point, configuring a storage frequency, configuring overtime setting, configuring an IP (Internet protocol) and a port number of a UDP (user Datagram protocol) receiving end and configuring information of an InfluxDB time sequence database; the UDP-InfluxDB transmission module analyzes the received UPD data packet according to a UDP protocol, integrates the UPD data packet with the measuring point information, and stores the integrated data into an InfluxDB time sequence database in real time; if the UDP-InfluxDB transmission module receives a UDP state packet transmitted by an upper link within the overtime set time, the link state is displayed; if the UDP data packet transmitted by the upper link is not received within the overtime set time, the upper link information is cleared;
configuring a UDP-TrendDB transmission module: configuring a measuring point, configuring a storage frequency, configuring overtime setting and configuring UDP receiving end information: IP and port number, configuration TrendDB interface address; the UDP-trendDB transmission module analyzes the received UPD data packet according to a UDP protocol, integrates the UPD data packet with the measuring point information, and stores the integrated data into a trendDB time sequence database in real time; if the UDP-TrendDB transmission module receives a UDP state packet transmitted by an upper link within the overtime set time, displaying the link state; and if the UDP data packet transmitted by the upper link is not received within the time set by the overtime, clearing the upper link information.
9. The industrial internet data acquisition and transmission method according to claim 8, wherein: the UDP-MQTT transmission module, the UDP-InfluxDB transmission module and the UDP-TrendDB transmission module are all provided with a UDP receiving thread:
1) the UDP-MQTT transmission module receives UDP data packets, discards the UDP data packets or analyzes the UDP data packets into MQTT messages according to the transmission frequency and sends the MQTT messages to the MQTT server;
the UDP-InfluxDB transmission module receives the UDP data packets, discards the UDP data packets or analyzes the UDP data packets according to the sending frequency and stores the UDP data packets into the InfulxDB;
the UDP-trendDB transmission module receives UDP data packets, discards the UDP data packets according to the sending frequency or analyzes and uses a trendDB interface;
2) and receiving the UDP state packet, analyzing and displaying the link state under the condition that the overtime setting is not exceeded, and only displaying the state of the UDP state packet if the overtime setting is exceeded.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110661312.7A CN113382007A (en) | 2021-06-15 | 2021-06-15 | Industrial internet data acquisition and transmission method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110661312.7A CN113382007A (en) | 2021-06-15 | 2021-06-15 | Industrial internet data acquisition and transmission method and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113382007A true CN113382007A (en) | 2021-09-10 |
Family
ID=77574347
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110661312.7A Withdrawn CN113382007A (en) | 2021-06-15 | 2021-06-15 | Industrial internet data acquisition and transmission method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113382007A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114531479A (en) * | 2022-02-21 | 2022-05-24 | 上海汉中诺软件科技有限公司 | General data acquisition system based on MQTT |
CN117880338A (en) * | 2024-03-12 | 2024-04-12 | 时代云英(深圳)科技有限公司 | Data acquisition system based on internet of things equipment |
-
2021
- 2021-06-15 CN CN202110661312.7A patent/CN113382007A/en not_active Withdrawn
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114531479A (en) * | 2022-02-21 | 2022-05-24 | 上海汉中诺软件科技有限公司 | General data acquisition system based on MQTT |
CN114531479B (en) * | 2022-02-21 | 2024-05-07 | 上海汉中诺软件科技有限公司 | General data acquisition system based on MQTT |
CN117880338A (en) * | 2024-03-12 | 2024-04-12 | 时代云英(深圳)科技有限公司 | Data acquisition system based on internet of things equipment |
CN117880338B (en) * | 2024-03-12 | 2024-05-14 | 时代云英(深圳)科技有限公司 | Data acquisition system based on internet of things equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107390650B (en) | A kind of data collection system based on Internet of Things and the data compression method based on the system | |
CN111031034A (en) | Multi-protocol convergence edge computing gateway | |
CN108769121A (en) | Intelligent industrial equips the method for uploading of internet of things data acquisition system and gathered data | |
CN113382007A (en) | Industrial internet data acquisition and transmission method and system | |
CN100486250C (en) | Multiple interface multiple protocol detecting method based on WAP/MMS service | |
CN108400993A (en) | The Internet of things system and storage medium that intelligent industrial apparatus components formula is set up | |
CN112866096A (en) | Intelligent Internet of things gateway for industrial Internet of things | |
CN102855571B (en) | A kind of resource information processing method and device | |
CN103248512A (en) | Method and system for generating topological structure of application layer in communication network | |
WO2021197353A1 (en) | Data distribution method and apparatus, and device and medium | |
CN110855493A (en) | Application topological graph drawing device for mixed environment | |
CN102355696A (en) | Large scale Internet of things gateway system and realization method thereof | |
CN110278280A (en) | Building site data integrated system and integration method based on Internet of Things | |
CN108401004A (en) | A kind of agricultural intelligent networking gateway design method | |
KR100906568B1 (en) | Interface apparatus for semiconductor equipment and monitoring system using it | |
CN116319953B (en) | Semiconductor device data acquisition method | |
CN110602719A (en) | Device for realizing self-adaptive access network selection of communication gateway between machines | |
CN108810053A (en) | Internet of things application processing method and internet of things application system | |
CN102904967A (en) | Intelligent Internet of things data exchange platform scheme based on hardware electromechanical field | |
CN114172979A (en) | Message parsing method, platform, gateway and storage medium | |
CN109739192B (en) | Control method and system under intelligent logistics system | |
CN109639693B (en) | Intelligent distribution and utilization electricity business arrangement method and distribution and utilization electricity communication integrated terminal | |
CN112422663B (en) | Data centralization system of industrial Internet of things and data aggregation, processing and storage method | |
CN108156191A (en) | A kind of Intelligent internet of things data exchange platform scheme system based on electric business field | |
CN100356731C (en) | Method for tracking communication information between net elements |
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 | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20210910 |
|
WW01 | Invention patent application withdrawn after publication |