Internet of things equipment heartbeat packet data acquisition methodTechnical Field
The invention relates to the technical field of communication, in particular to a heartbeat packet data acquisition method for equipment of the Internet of things.
Background
With the help of industrial internet of things technology or platforms, enterprises can connect and monitor elements such as people, machines, materials, methods, rings, tests and the like of workshops in real time, and a plurality of elements are interconnected, so that high requirements are imposed on the performance, throughput and response time of components such as system platforms and networks. Taking a traditional plastic weaving manufacturing industry as an example, production line equipment of the plastic weaving manufacturing industry mainly comprises a wire drawing machine, a circular weaving machine, a printing machine, a buckle folding machine, a hemming machine, a wagon balance and the like, wherein each piece of equipment is provided with about 5-8 pulse counting sensors on average, 1-2 PLCs (programmable logic controllers), about one-family-type-middle-class-type-left and about-family-type-right producers, the equipment is approximately 220 machines, in order to collect all production data of the equipment, about 1500 Internet of things terminal equipment are required to be equipped, and the Internet of things terminal equipment is connected with a pulse counting sensor, the PLCs and a wagon balance serial. The terminal equipment of the internet of things sends the acquired data to the monitoring platform server through the network so as to be convenient for a manager to check in real time or provide basic data for further deep mining. The terminal devices send some necessary information to the platform in the form of heartbeat packets, and meanwhile, 1.5Gb bandwidth is needed to process the heartbeat packets of 150000 terminal devices, which has quite high requirements on network bandwidth, number of servers, server cluster scheduling and the like.
Disclosure of Invention
The invention aims to provide a heartbeat packet data acquisition method of Internet of things equipment, which can increase the effective load of a single heartbeat packet and reduce the network bandwidth.
In order to achieve the purpose, the invention provides the following technical scheme: the utility model provides a thing networking equipment heartbeat package data acquisition method, provides a thing networking communication system, thing networking communication system includes a plurality of terminal equipment and monitor platform server, monitor platform server and a plurality of the terminal equipment communication is connected, a plurality of terminal equipment are used for gathering on-the-spot physical parameter in real time, monitor platform server is used for receiving the heartbeat data that terminal equipment sent, and heartbeat package data acquisition method includes preprocessing step and data acquisition step, preprocessing step includes:
a representative device selecting substep, selecting a plurality of representative devices from the terminal devices, wherein each representative device is used for receiving heartbeat data of a plurality of terminal devices corresponding to the representative device and sending all the heartbeat data to a monitoring platform server in the form of heartbeat packets;
a reference heartbeat data acquisition substep, selecting one piece of heartbeat data from historical heartbeat data sent to the monitoring platform server by the representative equipment as reference heartbeat data, and writing the reference heartbeat data into the representative equipment and the monitoring platform server in advance;
a heartbeat table establishing sub-step, namely acquiring all heartbeat data of all terminal devices, comparing the heartbeat data with reference heartbeat data respectively to generate a difference code of each heartbeat data, establishing a heartbeat table according to the difference codes and the heartbeat data corresponding to the difference codes, and writing the heartbeat table into the representative device and the monitoring platform server in advance;
the data acquisition step comprises:
a heartbeat code query substep, wherein the representative device receives heartbeat data from the terminal device and queries a heartbeat table according to the heartbeat data to obtain a difference code corresponding to the heartbeat data,
a heartbeat packet generation substep, namely forming a characteristic code list by the difference codes corresponding to a plurality of heartbeat data received by the representative equipment, and writing the characteristic code list into a heartbeat packet of the representative equipment;
a heartbeat packet sending sub-step; the representative devices send heartbeat packets to the monitoring platform server according to the first heartbeat time;
and a resolution substep: and the monitoring platform server decodes the heartbeat packet received by the monitoring platform server, wherein the decoding operation comprises decoding the heartbeat packet according to the reference heartbeat data and generating a heartbeat data sub-packet.
Preferably, the reference heartbeat data acquiring step includes acquiring all heartbeat data sent to the monitoring platform server by the representative device in any selected time period, and selecting heartbeat data with the highest frequency of occurrence as reference heartbeat data; and acquiring all heartbeat data sent to the monitoring platform server by the representative equipment in any selected time period, and selecting the heartbeat data with the minimum difference value with other heartbeat data as reference heartbeat data.
Preferably, the reference heartbeat data acquiring step includes acquiring all heartbeat data sent by the representative device to the monitoring platform server in any selected time period, and selecting heartbeat data with the minimum difference value with other heartbeat data as reference heartbeat data.
Preferably, the pre-processing step further includes a heartbeat cooperation sub-step, configured to synchronize the time of the terminal device with the time of the representative device.
Preferably, the heartbeat data information of the terminal device includes a timestamp, a device ID number, and status information representing the operation status of the device.
Preferably, the representative device election substep is configured with an election policy, and the election policy includes classifying the terminal devices according to device types, acquiring historical transmission rates of all terminal devices in the same class, and electing a terminal device with the highest transmission rate as the representative device.
Preferably, the representative device election substep is configured with an election policy, and the election policy includes election of a terminal device with the highest hardware processing capability as the representative device.
Preferably, the representative device election substep is configured with an election policy, the election policy includes classifying the terminal devices according to device types, obtaining historical transmission rates and location information of all terminal devices in the same category, where the location information includes a sum of location distances from other terminal devices, weighting the historical transmission rates and the location information of the terminal devices according to a certain weight proportion to generate a priority queue, and electing one or more terminal devices with the highest priority as the representative devices according to the number of the terminal devices in the category.
Preferably, one of the representative devices is connected to at most 20 terminal devices.
Preferably, the length of the difference code is 1/3-3/5 of the heartbeat data length of the terminal device.
Compared with the prior art, the invention has the beneficial effects that:
the representative equipment is selected from the terminal equipment by setting a representative equipment selecting sub-step, the representative equipment uniformly sends heartbeat data of the terminal equipment to the monitoring platform server for management, and the effective load of a single heartbeat packet is increased; in addition, a heartbeat table is established, heartbeat data are respectively compared with reference heartbeat data to generate difference codes of each heartbeat data, the difference codes of the heartbeat data of the terminal equipment are formed into a characteristic code list, and the characteristic code list is written into a heartbeat packet of the representative equipment, so that the network bandwidth of the whole heartbeat data transmission is reduced.
Drawings
Fig. 1 is a circuit connection block diagram of a heartbeat packet data acquisition method of an internet of things device according to the present invention;
fig. 2 is a flow chart of a preprocessing step in the internet of things device heartbeat packet data acquisition method of the present invention;
fig. 3 is a flow chart of a data acquisition step in the heartbeat packet data acquisition method of the internet of things device according to the present invention.
In the figure: 1. a monitoring platform server; 2. a first terminal device; 3. representing a first device; 4. a second terminal device; 5. representing a second device.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 1, in an embodiment provided by the present invention, a method for acquiring heartbeat packet data of an internet of things device provides an internet of things communication system, where the internet of things communication system includes a plurality of terminal devices and a monitoring platform server 1, a representative device is selected from the plurality of terminal devices, and the representative device sends heartbeat packets of all the terminal devices and the representative device to the monitoring platform server 1; the firstterminal device 2 belongs to the same category of terminal devices, the state information of the running conditions of the same category of device is the same, the different ID numbers of the device can judge which specific terminal device can be, so the length of the difference code of the terminal devices under the same category can be reduced, the problem of insufficient bandwidth of a heartbeat data transmission network caused by redundant data is reduced, the monitoring platform server 1 is in communication connection with a plurality of terminal devices, the terminal devices are used for collecting the physical parameters or the electrical parameters of a field in real time, the monitoring platform server 1 is used for receiving heartbeat data sent by the terminal devices, and the heartbeat packet data collecting method comprises a preprocessing step and a data collecting step.
As shown in fig. 2, the flow chart of the preprocessing step in the internet of things device heartbeat packet data collection method of the present invention is shown, and the preprocessing step includes: a representative device selecting substep S101, selecting a plurality of representative devices from the terminal devices, where each representative device is configured to receive heartbeat data of a plurality of terminal devices corresponding to the representative device, and send all heartbeat data to the monitoring platform server 1 in the form of heartbeat packets;
a reference heartbeat data obtaining substep S102, selecting heartbeat data from historical heartbeat data sent from the representative device to the monitoring platform server 1 as reference heartbeat data, and writing the reference heartbeat data into the representative device and the monitoring platform server 1 in advance;
a heartbeat table establishing substep S103, acquiring all heartbeat data of all terminal devices, comparing the heartbeat data with reference heartbeat data respectively to generate a difference code of each heartbeat data, establishing a heartbeat table according to the difference code and the heartbeat data corresponding to the difference code, and writing the heartbeat table into the representative device and the monitoring platform server 1 in advance.
As shown in fig. 3, the present invention is a flow chart of a data acquisition step in a heartbeat packet data acquisition method of an internet of things device, where the data acquisition step includes: a heartbeat code query substep S201, in which the representative device receives heartbeat data from the terminal device, and queries a heartbeat table according to the heartbeat data to obtain a difference code corresponding to the heartbeat data,
a heartbeat packet generation substep S202, which is to form a feature code list by the difference codes corresponding to a plurality of heartbeat data received by the representative equipment and write the feature code list into the heartbeat packet of the representative equipment;
a heartbeat packet sending substep S203; the representative devices send heartbeat packets to the monitoring platform server 1 according to the first heartbeat time;
resolution substep S204: and the monitoring platform server 1 decodes the heartbeat packet received by the monitoring platform server, wherein the decoding operation comprises decoding the heartbeat packet according to the reference heartbeat data and generating a heartbeat data sub-packet.
Preferably, the reference heartbeat data acquiring step includes acquiring all heartbeat data sent by the representative device to the monitoring platform server 1 in any selected time period, and selecting heartbeat data with the highest frequency of occurrence as reference heartbeat data; and acquiring all heartbeat data sent to the monitoring platform server 1 by the representative equipment in any selected time period, and selecting the heartbeat data with the minimum difference value with other heartbeat data as reference heartbeat data.
Preferably, the reference heartbeat data acquiring step includes acquiring all heartbeat data sent by the representative device to the monitoring platform server 1 in any selected time period, and selecting heartbeat data with the minimum difference value from the heartbeat data as reference heartbeat data.
Preferably, the pre-processing step further includes a heartbeat cooperation sub-step, configured to synchronize the time of the terminal device with the time of the representative device. The problem of information asynchronization caused by hardware aging is reduced.
Preferably, the heartbeat data information of the terminal device includes a timestamp, a device ID number, and status information representing the operation status of the device. The time stamp includes transmission time information of the heartbeat data, whereby heartbeat transmission times of different terminal devices can be calibrated.
Preferably, the representative device election substep is configured with an election policy, and the election policy includes classifying the terminal devices according to device types, acquiring historical transmission rates of all terminal devices in the same class, and electing a terminal device with the highest transmission rate as the representative device.
Because the representative equipment uniformly sends the heartbeat data of the terminal equipment to the monitoring platform server 1 for management, the terminal equipment with the highest transmission efficiency is selected as the representative equipment, so that the communication efficiency of the whole internet of things system can be improved.
Preferably, the representative device election substep is configured with an election policy, and the election policy includes election of a terminal device with the highest hardware processing capability as the representative device.
The high hardware processing capacity can improve the load capacity of a single terminal device and increase the effective load of a single heartbeat packet.
Preferably, the representative device election substep is configured with an election policy, the election policy includes classifying the terminal devices according to device types, obtaining historical transmission rates and location information of all terminal devices in the same category, where the location information includes a sum of location distances from other terminal devices, weighting the historical transmission rates and the location information of the terminal devices according to a certain weight proportion to generate a priority queue, and electing one or more terminal devices with the highest priority as the representative devices according to the number of the terminal devices in the category.
Preferably, at most 20 terminal devices are connected to one representative device, and the specific situation is determined according to the load carrying capacity of the representative device, but the number of the terminal devices connected to one representative device cannot be too large, and after the number of the terminal devices exceeds 20, although normal network data communication can be performed, the communication quality and the communication efficiency of the internet of things system are seriously reduced.
Preferably, the byte length of the differential coding is 1/3-3/5 of the byte length of the heartbeat data of the terminal device, the heartbeat data are respectively compared with the reference heartbeat data by setting a heartbeat table to generate the differential coding of each heartbeat data, the redundant parts of the heartbeat data of different devices in the same category are reduced, and the data processing capacity is reduced.
The working principle is as follows: the representative equipment is selected from the terminal equipment by setting a representative equipment selecting sub-step, the representative equipment uniformly sends heartbeat data of the terminal equipment to the monitoring platform server 1 for management, the effective load of a single heartbeat packet is increased, the redundant parts of the heartbeat data of different equipment in the same category are reduced, and the data processing capacity is reduced; in addition, a heartbeat table is established, heartbeat data are respectively compared with reference heartbeat data to generate difference codes of each heartbeat data, the difference codes of the heartbeat data of the terminal equipment are formed into a characteristic code list, and the characteristic code list is written into a heartbeat packet of the representative equipment, so that the network bandwidth of the whole heartbeat data transmission is reduced.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned.