Content of the invention
In order to solve problem of the prior art, integrated use technology of Internet of things of the present invention, embedded technology, acquisition system skill
Art and development of Mobile Internet technology etc., there is provided a kind of intelligent remote data acquisition system based on Internet of Things.Realize industry is set
The distributed mobile monitoring of received shipment row, also takes into account the opening of acquisition system, convenience, versatility.
In order to solve above-mentioned technical problem, the invention provides a kind of intelligent remote data collection system based on Internet of Things
System is it is characterised in that described system includes multichannel asynchronous data collection module, multi-protocols middleware module, parameter management mould
Block, data transmitting module, emergency management module and self diagnosis and power down process module, wherein:
Described multichannel asynchronous data collection module, for being set using the multiple Industry Control of acquisition system equipment automatic data collection
Perceptual parameters in standby and control data, described industrial control equipment includes Universal Digital Collecting Equipment, plc, industrial computer;Also may be used
By multiple interfaces and consensus standard, to gather ic card reader, rfid read write line, bar code scanner, dimensional code scanner
Middle related data;
Described multi-protocols middleware module, the packet that the industrial control equipment for processing different manufacturers is sent, by parsing
With coding protocols data packet signal and dynamic supporting interface method, shield different manufacturers, different times and different industrial standard
The agreement difference of interface, different protocol conversions is that unified consensus standard carries out data exchange with data center;Described work
Control equipment includes plc, industrial computer, dcs or cnc;Described different agreement includes modbus, profibus, tcp/ip, ppi and mpi
Multiple industry-standard protocol;
Described parameter management module, for receive and store user data center according to predefined interface specification and
The configuration parameter table of the filled in submission of function call, and according to described configuration parameter table, acquisition system is configured;Described join
Put and in parameter list, include acquisition system id, file directory and filename.
Described data transmitting module, is used for realizing acquisition system equipment to data center and data center to acquisition system
Between bi-directional data transmission;By multithreading data compress technique, need are transmitted with data data characteristic, transmission are excellent
First level carries out intelligent packet, creates task queue, realizes the transmission of multi-channel parallel flowing water and the batch processing of data;;Transmission number
According to using custom protocol packet encoder, using multiple the Internets or mobile Internet transportation protocol, as data transfer and control
Passage;Described the Internet or mobile Internet transportation protocol include wifi, or Ethernet, or gprs, or cdma, or 3g;
Described emergency management module, for receiving, by acquisition system, the industrial control equipment generation that acquisition system is monitored
Emergency or exception, according to described emergency or abnormal send automatic paging to data center, make data center to institute
State emergency or extremely processed;
Described self diagnosis and power down process module are abnormal for detecting system itself, by self-inspection function, from device power
With hardware check, the fault reading configuration file and network etc., the system failure is processed and is repaired.
In one embodiment of the present of invention, described multichannel asynchronous data collection module includes parameter read module, generation
Protocol package module, transmission packet module and receiving data bag module, wherein:
Described parameter read module, for reading acquisition parameter from storage device, acquisition parameter is by parameter management module
There is provided, it is long that parameter includes unit type, protocol type, frequency acquisition, baud rate, depositor, address, data type and data
Degree;
Described generation protocol package module, for device parameter is submitted to multi-protocols middleware module, and obtains and equipment
The protocol data bag of coupling;
Described transmission packet module, for the protocol data bag of generation is sent to collected equipment, such as plc;Adopted
Collection equipment includes industrial control equipment and sensor, and wherein industrial control equipment includes plc, industrial computer, dcs and cnc etc., and sensor includes temperature
Degree, humidity, electric current, voltage sensor, by way of sending instruction to collected equipment, the equipment that obtains runs number to acquisition system
According to;
Described receiving data bag module, for obtaining the real-time running data of collected equipment, the packet receiving leads to
After crossing protocol algorithm parsing, packet is generated with user-defined format, and pass to data transmitting module.
In one embodiment of the present of invention, described multi-protocols middleware module includes protocol conversion algoritic module, packet
Generation module data Packet analyzing module, wherein:
Described protocol conversion algoritic module, built-in many kinds of industrial standards of modbus, profibus, tcp/ip, ppi and mpi
Agreement, provides protocol conversion function by public function for other modules, solves opening and the compatibility of acquisition system, realizes
The Homogeneous of system under isomerous environment;
Described packet generation module, for generating the packet being sent to collected equipment, will include data form, number
Pass through protocol conversion algorithm according to the packet of length information and generate the protocol data bag that collected equipment is supported.
Described resolve packet module, for processing the packet receiving from collected equipment, to the packet receiving
Parsed, including data point, data type, data value, to obtain the data of collection.
In one embodiment of the present of invention, described parameter intelligent configuration module includes parameter and updates management module, automatically divides
Join acquisition parameter module;Wherein:
Described parametric distribution management module, for reading acquisition parameter from memorizer, and to acquisition parameter according to cycle, class
Type, quantity are grouped, and improve the efficiency of data acquisition.
Described parameter automatically updates management module, is used for automatically updating acquisition parameter, and acquisition parameter configuration completes on backstage,
Acquisition system passes through data transmitting module timing scan backstage, alignment parameters modification time, automatically updates up-to-date acquisition parameter,
Ensure the accuracy of acquisition parameter.
In one embodiment of the present of invention, described data transmitting module includes network protocol management module, socket connects
Module, data package module data transport module, wherein:
Described network protocol management module, for supporting multiple network agreement, including wired, wifi, gprs, cdma, with
Adapt to different network application environments;
Described socket link block, for realizing the communication of acquisition system and background service, acquisition system and backstage clothes
The communication mode of business includes udp and tcp, and the selection of socket connected mode such as gathers week according to the parameter characteristic of acquisition system
Phase, data package size, reliability requirement, transmission speed determine;
Described data package module, for being packaged to the packet collecting, data encapsulation adopts user-defined format,
User-defined format includes address, packet number, data length, check code, and data package length limits and need to consider to transmit simultaneously
Efficiency and network transmission limit;
Described data transmission module, for sending packet to given network address.
In one embodiment of the present of invention, described emergency management module includes event configuration management module, at event
Reason module, auto-alarming module;
Described Configuration Manager, for managing acquisition system local emergency allocation list, is regularly updated by backstage,
Allocation list includes event identifier and event description;
Described event processing module, for, in acquisition system running, finding emergency or exception, automatic
Emergency processing function, searched events allocation list, locating events reason or phenomenon;
Described auto-alarming module, the emergency that event processing module is produced, automatically send a warning message in real time.
In one embodiment of the present of invention, described self diagnosis and power down process module include system detectio module and network inspection
Survey module;
Described system detectio module, for self-inspection during system operation, and anti-locking system leads to because of a variety of causes
The regular check function of system in case of system halt situation setting;
Described network detection module, supports that timing sends network Heartbeat, for maintaining or judging network-in-dialing state.
Present system is directed to numerical control device remote data acquisition it is proposed that a kind of intelligent remote data based on Internet of Things
Acquisition system.The present invention can realize the remote data acquisition of plurality of devices model, multiple connection and host-host protocol.Concrete and
Speech, the present invention has the advantage that
(1) data acquisition adopts multichannel collecting and tranmission techniques, it is possible to achieve the collection of big data quantity and transmission, sends
Adopt asynchronous system with reception, channel block can be prevented effectively from;
(2) due to system built-in multi-protocols middleware, largely improve the autgmentability of system, multiple industry can be supported
Standard and agreement, support the communications protocol of different manufacturers distinct device, shielding different manufacturers, different times and different industrial standard
The agreement difference of interface;
(3) systematic parameter management module automatically update upgrade function, make system possess very strong adaptivity.
(4) networking mode flexibly, using technology of Internet of things, supports that the various ways such as wired, wireless, gprs, cdma are realized
The transmission of data;
(5) good reliability, system possesses automatic detection function and automatic upgrade function, it is possible to achieve the automatic upgrading of system
With the automatic recovery of the system failure, the normal table operation of safeguards system;
(6) the emergency processing function of system, can effectively lifting means anomalous event diagnosis and disposal ability.
Specific embodiment
In order that the objects, technical solutions and advantages of the present invention become more apparent, below in conjunction with drawings and Examples, right
The present invention is further elaborated.It should be appreciated that specific embodiment described herein is used only for explaining the present invention, and
It is not used in the restriction present invention.As long as additionally, involved technical characteristic in each embodiment of invention described below
The conflict of not constituting each other just can be mutually combined.
As shown in figure 1, the present invention is included based on the intelligent remote data acquisition system of Internet of Things: multichannel asynchronous data is adopted
Collect module, multi-protocols middleware module, parameter management module, data transmitting module, emergency management module, self diagnosis and break
Electric treatment module, wherein:
Described multichannel asynchronous data collection module, automatic for passing through multichannel asynchronous system using acquisition system equipment
Gather the perceptual parameters in multiple industrial control equipments and control data, described industrial control equipment includes general many data acquisitions
Equipment, programmable logic controller (PLC) (programmable logic controller, plc), industrial computer;It is additionally operable to by many
Kind of interface and consensus standard, collection ic card reader, radio frequency identification (radio frequency identification,
Rfid) read write line, bar code scanner, related data in dimensional code scanner;The multiple industrial control equipment of acquisition module Real-time Collection
Middle data, by the data summarization of collection, encapsulation;Acquisition system can also execute long-range operational order, authorize and realize to industry control
The reading and writing of equipment, the operation such as open, stop;
Described multi-protocols middleware, the packet that the industrial control equipment for processing different manufacturers is sent, by parsing and translating
Code protocol data bag signal and dynamic supporting interface method, shielding different manufacturers, different times and different industry standard interface
Agreement difference, by different protocol conversions be unified consensus standard and data center carries out data exchange;Described industry control sets
Standby inclusion programmable logic controller (PLC) (programmable logic controller, plc), industrial computer, distributed AC servo system system
System (distributed control system, dcs) or computer digital control machine tool (computer numerical
Control, cnc);Described different agreement includes modbus, profibus, tcp/ip, Siemens's point-to- point communication (point to
Point interface, ppi) and Siemens's multi-point communication (multi-point interface, mpi) multiple industrial standard association
View;Can be to realize by modes such as serial ports, Ethernet interfaces, with the industrial control equipment of different manufacturers (as plc, industrial computer, dcs and cnc
Deng) communication, support the multiple data communication mode of collection site (as serial ports rs232/485, zigbee and bluetooth etc.)
Described parameter management module, for receive and store user data center according to predefined interface specification and
The configuration parameter table of the filled in submission of function call, and according to described configuration parameter table, acquisition system is configured;Described join
Put and in parameter list, include acquisition system id, file directory and filename;
Described data transmitting module, is used for realizing acquisition system equipment to data center and data center to acquisition system
Between bi-directional data transmission;By multithreading data compress technique, need are transmitted with data data characteristic, transmission are excellent
First level carries out intelligent packet, creates task queue, realizes the transmission of multi-channel parallel flowing water and the batch processing of data;Transmission data
Using custom protocol packet encoder, by multiple the Internets or mobile Internet transportation protocol, as data transfer and control passage;
Described the Internet or mobile Internet transportation protocol include Wireless Fidelity (wireless-fidelity, wifi), Ethernet,
General packet radio service technology (general packet radio service, gprs), CDMA (code
Division multiple access, cdma), G mobile communication (3rd-generation, 3g);
Described emergency management module, for receiving, by acquisition system, the industrial control equipment generation that acquisition system is monitored
Emergency or exception, according to described emergency or abnormal send automatic paging to data center, make data center to institute
State emergency or extremely processed;
Described self diagnosis and power down process module are abnormal for detecting system itself, by self-inspection function, from device power
With hardware check, the fault reading configuration file and network etc., the system failure is processed and is repaired.
It is described in further detail below for each module in the intelligent remote data acquisition system based on Internet of Things.
As shown in figure 1, described multichannel asynchronous data collection module, including parameter read module, generate protocol package module,
Send packet module and receiving data bag module;Wherein:
Described parameter read module, for reading acquisition parameter from storage device, acquisition parameter is by parameter management module
There is provided, it is long that parameter includes unit type, protocol type, frequency acquisition, baud rate, depositor, address, data type and data
Degree;
Described generation protocol package module, for device parameter is submitted to multi-protocols middleware module, and obtains and equipment
The protocol data bag of coupling;
Described transmission packet module, for the protocol data bag of generation is sent to collected equipment, such as plc;Adopted
Collection equipment includes industrial control equipment and sensor, and wherein industrial control equipment includes plc, industrial computer, dcs and cnc etc., sensor include as
Temperature, humidity, electric current, voltage sensor, by way of sending instruction to collected equipment, the equipment that obtains runs acquisition system
Data;
In actual application environment, collected equipment often has multiple collection addresses or an acquisition parameter, different locality
Location might have different requirements to collection period, such as overload, cycle and motor axle temperature, system can according to configuration requirement,
Automatically collection address is grouped it is stipulated that every group at most not can exceed that 20 addresses, and is opened acquisition channel thread, each is led to
Road has independent thread;And different collection addresses, acquisition parameter and collection period can be corresponded to, data acquisition in passage is adopted
Use asynchronous collecting pattern, frequency acquisition and response efficiency can be improved, also avoid channel block.By testing the different of acquisition system
Under step mode, 100ms can be reached to the highest frequency acquisition of plc;
As shown in Fig. 2 example explanation acquisition system supports mpi agreement, the flow process of acquisition parameter from plc, enter collection
After thread, terminal sends request (request) to plc first, and request packet voice form is shown in read command presented hereinbefore, plc
After receiving request, bag is judged, and returns to terminal check information (ack frame), then send Frame to
Terminal, terminal receives returned packet, and successfully resolved is sent communication module, completed a collection period.After the completion of one collection period,
The sleep interval time (cycle of typically setting such as 15 minutes), it is then turned on next collection period.
Wherein, data acquisition scheme is divided into the passive collection of timing, remote command collection and template configuration collection etc..Wherein fixed
When passive collection refer to acquisition system by the collection of predetermined sampling period in advance (as every the fixing collection of 1s once);Remote command gathers
Refer to first be authorized by data center and send collection request instruction, acquisition system receives instruction and just industrial control equipment is acquired operating;
Template configuration collection refers to user in advance in the policy template of the self-defined collection in data center end fault monitor, performance monitor,
Acquisition system is passed through to download this template execution acquisition operations.
As shown in figure 3, after data collecting system is opened, system will read acquisition configuration parameter, to collection address according to ginseng
Number rule (as using the cycle, using address etc.) is grouped, and will open separate threads as acquisition channel for every group, each
The collection period of collection group is identical, and in order to carry out batch capture, in group, address does not allow more than 20 addresses, and collection group is independently transported
OK, it is independent of each other, do not complete acquisition tasks, transfer data to transport module.Acquisition system provides remote command simultaneously
Operating function, for collected equipment being carried out with simple operationss such as reading and writing, opening, stop, acquisition system individually opens remote operation work(
Energy thread, so that the operational order at real-time monitored data center, and is responded, in remote command operation Inform when done data
Heart performance.
Described receiving data bag module, for obtaining the real-time running data of collected equipment, the packet receiving leads to
After crossing protocol algorithm parsing, packet is generated with user-defined format, and pass to data transmitting module.
As shown in figure 1, multi-protocols middleware module includes protocol conversion algoritic module, packet generation module, packet
Parsing module.
The multiple industrial standard of protocol conversion algoritic module built-in modbus, profibus, tcp/ip, ppi and mpi etc. is assisted
View, provides protocol conversion function by public function for other modules, solves opening and the compatibility of acquisition system, realizes
The Homogeneous of system under isomerous environment;Protocol conversion algoritic module provides public function to call to other modules;
Multi-protocols middleware, proposing one kind can be in same acquisition system, by data communication interface (as rs232/
Rs485, modbus, profibus, Ethernet and canbus etc.) with multiple controllable devices (as plc, industrial computer, cnc, dcs,
Rtu and dtu etc.) interconnection, carry out data interaction by supporting multiple industry-standard protocol such as tcp/ip, ppi, mpi, by algorithm
Concentrate parsing, decoding and process the packet sent of different manufacturers industrial control equipment, solve the opening of acquisition system with and
Capacitive, realizes the Homogeneous data collection of multiple equipment under isomerous environment.Table 1 below defines for device type structure, knot
Can be with designated equipment type (acquisition system built-in device type dictionary), using cycle, interface baud rate, collection address lattice in structure
Formula and address list etc. information.
Table 1
Sequence number |
Title |
Type |
Description |
1 |
plcprototype |
short |
Device type |
2 |
samplingperiod |
int |
Using the cycle |
3 |
plcbaudrate |
int |
Baud rate |
4 |
addresscount |
short |
Address number |
5 |
listaddress |
char[] |
Address list |
Described resolve packet module, for processing the packet receiving from collected equipment, to the packet receiving
Parsed, including data point, data type, data value, to obtain the data of collection;
Described packet generation module, for generating the packet being sent to collected equipment, will include data form, number
Pass through protocol conversion algorithm according to the packet of length information and generate the protocol data bag that collected equipment is supported.Form 2, illustrates
Clear mpi agreement reading order structure definition: mpi reading order, when reading data, the request frame format of host computer is as follows, this frame
Occupy 38 byte lengths:
Table 2
sd |
le |
ler |
sd |
da |
sa |
fc |
dasp |
ssap |
fs |
uu |
gu |
du |
fcs |
end |
Sd le ler sd occupies 4 byte lengths, for fixation;
Da sa fc dsap ssap fs respectively occupies 7 bytes
Uu occupies 6 byte lengths, is fixed value
Gu occupies 6 byte lengths, can be operated during mixing read-write
Du unit occupies 12 byte lengths from 23 to 26, and this 4 byte is fixed numbers
27 and 28 this 2 byte represent the data amount check of reading jointly, represent word when being i, q, m, db when the memory block read
Section number, represents the enumerator of reading or the number of intervalometer when being c, t when memory block
35 is frame check code, adopts and remainder algorithm
31 represent memory block type
36th, 37 is end mark, is fixed value, respectively equal to 16 e5.
As shown in figure 1, described parameter management module includes parametric distribution management module and parameter automatically updates management module;
Wherein:
Described parametric distribution management module, for reading acquisition parameter from memorizer, and to acquisition parameter according to cycle, class
Type, quantity are grouped, and improve the efficiency of data acquisition.
Described parameter automatically updates management module, is used for automatically updating acquisition parameter, because acquisition parameter configures on backstage
Complete, acquisition system passes through timing scan backstage, alignment parameters modification time, automatically updates up-to-date acquisition parameter it is ensured that adopting
The accuracy of collection parameter.
The relevant parameter configuration of acquisition system end carries out predefined configuration by data center end, and configuration parameter includes sampling and sets
The information such as standby number, model, sample frequency, collection address, data form and baud rate.
Data center provides the definition option to various equipment and parameter, as shown in table 3:
Table 3
Sequence number |
Title |
Type |
Description |
1 |
register |
char[4] |
Depositor |
2 |
dbdatablocknumber |
int |
Data block number |
3 |
datalength |
short |
Data length |
4 |
address |
char[10] |
Address |
5 |
datatype |
short |
Data type |
6 |
samplingperiod |
int |
Using the cycle |
As shown in figure 1, described multi-channel parallel data transmitting module includes network protocol management module, socket connection mode
Block, data package module data transport module;
Acquisition system is set up with data center after being connected, and can set up data conveying link, automatically turn on multi-thread data and pass
Send pattern, to realize the multi-channel parallel data transmission of acquisition system and data center, multichannel is interacted with data center, reduces
Queuing time.
Described network protocol management module, for supporting multiple network agreement, such as wired, wifi, gprs, cdma etc.,
To adapt to different network application environments, particularly the support of mobile network protocol (gprs, cdma) be can be very good to solve
The network communication problem of adverse circumstances;
Described socket link block, for realizing the communication of acquisition system and background service, acquisition system and backstage clothes
The communication mode of business mainly has two kinds, and the selection of udp and tcp, socket connected mode can be according to the parameter characteristic of acquisition system
As collection period, data package size, reliability requirement, transmission speed etc.;Acquisition system as needed to collection address (or ginseng
Number) it is grouped, data transmission module can be set up corresponding thread and accept grouped data, data transmission module independence also to be set up simultaneously
Equipment operation thread and configuration inspection thread, realize multichannel and interact with data center.
Described data package module, for being packaged to the packet collecting, data encapsulation adopts user-defined format,
User-defined format includes address, packet number, data length, check code etc., and data package length limits and must examine simultaneously
Consider efficiency of transmission and network transmission limits;
Described data transmission module, for sending packet to given network address.
As shown in figure 1, described emergency management module include event configuration management module, event processing module and from
Dynamic alarm module;
Emergency management module comprises 2 application services, Terminal Emergency event call tep and emergency event supervision port
Esp is managed, and acquisition system resets and automatically loads service after starting.When there is emergency or exception in collected equipment,
As overheated in its cpu or industrial control equipment is abnormal, industrial computer box fan speed is opened less than cabinet in threshold values, system operation,
Acquisition system meeting automatic seeking looks into the configuration mapping code in setting table, sends automatic paging, and paging code can pass through data
Center remote setting and renewal, to distinguish event of different nature, are conveniently managed collectively and operate.
Described Configuration Manager, for managing acquisition system local emergency allocation list, is regularly updated by backstage,
Allocation list includes event identifier and event description;
Described event processing module, for, in acquisition system running, finding emergency or exception, automatic
Emergency processing function, searched events allocation list, locating events reason or phenomenon;
Described auto-alarming module, the emergency that event processing module is produced, automatically send a warning message in real time.
As shown in figure 1, self diagnosis and power down process module include system detectio module and network detection module;
Described system detectio module, for self-inspection during system operation, and anti-locking system leads to because of a variety of causes
The regular check function of system in case of system halt situation setting;
System has the function of detecting itself exception, by self-inspection function, from device power and hardware check, reading configuration
The fault of links is detailed when file and data check, sampling processing, message tissue, data is activation and reception, network pair etc.,
Quick lookup failure cause, and process in time, recover normal and run.
Various exceptions in system synchronization real-time monitoring collection and transmission, are sent in data after there is exception first
The heart, relatively more simple abnormal as message error, bust thiss etc., the automatic repetitive operation of terminal, big abnormal as RAM leakage,
Configuration error etc. will lead to system to automatically reset, to recover mistake.
Described network detection module, supports that timing sends network Heartbeat, for maintaining or judging network-in-dialing state.
As it will be easily appreciated by one skilled in the art that the foregoing is only presently preferred embodiments of the present invention, it is not used to
Limit the present invention, all any modification, equivalent and improvement made within the spirit and principles in the present invention etc., all should comprise
Within protection scope of the present invention.