Disclosure of Invention
Because the types of the accessed devices are various, the acquisition point tables of the data acquisition devices are different, the corresponding relation between the monitored object and the data acquisition devices is relatively complex, and the data in the system is difficult to form a standard, the data in the aspects of data storage, data application and the like are messy, so that the use, operation and maintenance of the system are serious problems, the invention discloses a configuration method applied to a system configuration submodule, which comprises the following steps:
s1: collecting attribute information of the monitored objects according to the difference of the monitored objects, classifying attribute variables of the monitored objects, inducing attribute variable templates, and configuring monitored object attribute variables and attribute variable templates;
the attribute variable parameters comprise variable names, variable types, variable groups, value types, function codes, data addresses and byte lengths;
s2: configuring a monitored object variable according to the field data acquisition condition;
the monitoring object variable parameters comprise monitoring object numbers, variable templates, data acquisition equipment addresses and acquisition channel serial numbers;
s3: configuring the selected data acquisition equipment variable and the acquisition channel variable according to different acquisition attributes of the monitored object variable;
the variable parameters of the data acquisition equipment comprise an equipment address, timeout time, retransmission times and an acquisition channel sequence number;
the acquisition channel variable parameters comprise communication protocols, channel serial numbers, port information, communication frames and communication intervals;
s4: classifying the communication frame variables according to a communication seeking instruction which is sought and sent to the data acquisition equipment by the acquisition channel, summarizing the communication frame template, and configuring the communication frame variables and the communication frame template;
the communication frame variable parameters comprise data acquisition equipment addresses, function codes, data starting addresses and data lengths;
s5: setting an upper alarm early warning value of the monitored object attribute, and configuring an alarm early warning information variable;
the alarm early warning information variable parameters comprise an alarm type, an alarm value, alarm information and an alarm grade. The alarm types comprise alarm when the analog quantity packet is higher than the upper limit, alarm when the analog quantity is lower than the lower limit, early warning when the analog quantity is higher than the upper limit, early warning when the analog quantity is lower than the lower limit, alarm when the signal quantity is in fault and alarm when the signal quantity is in displacement.
S6: and associating the monitored object with the data acquisition equipment according to the field configuration.
Further, a configurable data acquisition system of the internet of things comprises: the system comprises a data acquisition module, a system software module and an application software module;
the data acquisition module transmits the attribute information of the acquired monitored object to the system software module through an acquisition channel;
and the system software module stores and processes the received attribute information and then transmits the attribute information to the application software module.
Further: the system software module comprises a data transmission sub-module, a real-time library sub-module, a relational library sub-module, an alarm early warning information sub-module, a system configuration sub-module and a data interface sub-module;
when data configuration is carried out in the system configuration submodule, configuration data are stored in the relational database submodule;
the data transmission submodule receives the attribute information transmitted by the data acquisition module, stores the received real-time data into the real-time library submodule and stores historical data into the relational library submodule; the real-time data storage function is realized by adopting hash Hashes, and historical data is stored in a variable grouping mode at intervals;
the alarm early warning information submodule compares the attribute information transmitted by the data transmission submodule with an upper limit threshold and a lower limit threshold of the attribute of the monitored object set by the configuration submodule, when an alarm early warning condition is triggered, the attribute information is stored in the real-time library submodule, and an alarm record is stored in the relation library submodule;
and the data interface module transmits the received attribute information transmitted by the data transmission submodule to the application software module through a WebService technology.
Further: the system software module also comprises a remote control submodule which carries out remote operation on the analog quantity and the semaphore of the data acquisition module through an acquisition channel by calling a remote control remote adjustment interface of the data transmission submodule.
Further: the system software module also comprises a system log submodule, and the system log submodule is used for storing a configuration log of the system configuration submodule, a transmission log of the data transmission submodule, an alarm early-warning log of the alarm early-warning information submodule, a remote control log of the remote control submodule and a data interface log of the data interface submodule.
By adopting the technical scheme, the data configuration method and the data acquisition system of the Internet of things are configurable for system construction, support the operations of modification, addition, deletion and the like of information of a monitored object, data acquisition equipment and the like, enable the system to be rapidly built by using a variable template and a communication frame template, have high repeatable utilization rate of system resources, improve the system performance and use convenience, carry out data association between the monitored object and the data acquisition equipment in a one-to-one, one-to-many and many-to-one mode, fully ensure the flexibility of data acquisition and processing of the monitored object, meet the requirements of data acquisition and application of the Internet of things, construct the system by using the monitored object as a basis, and organize functional data such as data storage, alarm early warning, remote control, data interfaces and the like of the system on the basis of the monitored object, the data is stored in the real-time library in a hash mode, and the data is stored in the relational library in a variable grouping mode, so that the data storage and application standards are efficient, and the application of the data by the internal part of the system and a third party is facilitated.
Detailed Description
In order to make the technical solutions and advantages of the present invention clearer, the following describes the technical solutions in the embodiments of the present invention clearly and completely with reference to the drawings in the embodiments of the present invention:
a configurable data collection system of the internet of things, as shown in fig. 1, which is now partially illustrated in an oil field data collection system of the internet of things, and fig. 2 is a block diagram of an embodiment of the system, the configurable data collection system of the internet of things includes: data acquisition module 100, system software module 200, and application software module 300;
the data acquisition module 100 acquires attribute information of a monitored object and transmits the attribute information to the system software module 200 through an acquisition channel;
the system software module 200 stores and processes the received attribute information and then transmits the attribute information to the application software module 300.
The application software module 300 includes a Web application and a mobile phone APP application.
A firewall is arranged between the system software module 200 and the application software module 300.
The acquisition channels are communication links between the data acquisition module 100 and the system software module 200, and each acquisition channel can mount one or more data acquisition devices corresponding to an internet of things gateway, a PLC, an RTU or the like.
The data acquisition module consists of a plurality of data acquisition devices;
the system software module 200 comprises a data transmission sub-module 201, a real-time library sub-module 202, a relational library sub-module 203, an alarm early warning information sub-module 204, a system configuration sub-module 205 and a data interface sub-module 206;
when data configuration is performed in the system configuration sub-module 205, configuration data is stored in the relational database sub-module 203;
the data transmission submodule 201 receives the attribute information transmitted by the data acquisition module 100, stores the received real-time data in the real-time library submodule 202, and stores the historical data in the relational library submodule 203;
the alarm and early warning information sub-module 204 compares the attribute information transmitted by the data transmission sub-module 201 with the upper threshold and the lower threshold of the monitored object attribute set by the configuration sub-module 205, when the alarm and early warning condition is triggered, the attribute information is stored in the real-time library sub-module 202, and the alarm record is stored in the relation library sub-module 203;
the data interface module 206 transmits the received attribute information transmitted by the data transmission sub-module 201 to the application software module 300, and the real-time data can be acquired by transmitting the monitoring object number and the variable name through the WebService technology.
Further, the system software module 200 further includes a remote control sub-module 207, and the remote control sub-module 207 performs remote operation on the analog quantity and the signal quantity of the data acquisition module 100 through a remote control remote adjustment interface of the data transmission sub-module 201 via an acquisition channel;
further, the system software module 200 further includes a system log sub-module 208, and the system log sub-module 208 is configured to store a configuration log of the system configuration sub-module 205, a transmission log of the data transmission sub-module 201, an alarm pre-warning log of the alarm pre-warning information sub-module 204, a remote control log of the remote control sub-module 207, and a data interface log of the data interface sub-module 206.
Further, the relational database supported by the relational database submodule 203 includes MySQL, Oracle, PostgreSQL, and Microsoft SQL Server. The historical data is stored in a variable grouping mode at configuration intervals, each variable grouping is a data table, fields of the data table comprise monitoring object numbers, data time and variable names, each variable of the variable grouping is a field, the monitoring object numbers and the data time are combined main keys of the table, the latest real-time data of the monitoring objects and the alarm early warning message pushing service are stored, and the method is achieved through Redis. The real-time data storage function is realized by adopting hash Hashes, wherein keys of the Hashes are serial numbers of monitoring objects, fields are variable names of the monitoring objects, and values are variable values; the alarm early warning message push service is realized by adopting a publish/subscribe function of Redis.
The real-time library sub-module 202 in the system software module 200 is used for storing the latest real-time data and the warning and early warning message push service. For example, the real-time temperature value of the 1# oil well can be obtained through 'hmget yj1 wd', the information configured by the alarm and early warning submodule 204 is analyzed, the alarm and early warning information is issued to Redis when alarm and early warning occurs, and the alarm and early warning information can be received by an application subscribing to the Redis.
The relational database submodule 203 of the system software module 200 of this embodiment is implemented by using a MySQL database, and is configured to store configuration information and historical data of a monitoring object, where three variables of this embodiment are grouped: the variable group 1, the variable group 2 and the variable group 3 establish three historical data tables for storing historical data of corresponding variables, and the storage intervals of the three variable groups are all configured to be 1 minute.
This oil field thing networking data acquisition system's control object includes 3 oil wells: 1# oil well, 2# oil well, 3# oil well and 2 measurement stations, it constitutes to be 1# measurement station and 2# measurement stations respectively, data acquisition module 100 comprises 3 temperature sensor, 3 pressure sensor, 2 ammeters, the collection passageway comprises 3 RTU (communication protocol is IEC104, communication port is 2404) and 2 PLC (communication protocol is ModbusTCP, communication port is 502), 5 collection passageways communicate with system software module 200 with the mode of industrial ethernet, the IP is 192.168.1.11 ~ 15.
The relationship among each monitored object, the data acquisition equipment and the acquisition channel in the embodiment is as follows: the method comprises the following steps that temperature and pressure data are collected through a temperature sensor and a pressure sensor respectively in a 1# oil well, a 2# oil well and a 3# oil well, and the corresponding temperature sensor and the corresponding pressure sensor correspond to a 1# RTU, a 2# RTU and a 3# RTU; the 1# metering station and the 2# metering station respectively acquire current data of the A phase, the B phase and the C phase through electric meters, and the corresponding electric meters correspond to the 1# PLC and the 2# PLC; meanwhile, the 3# oil well also needs to acquire active power and reactive power data, and the active power and reactive power data of the 3# oil well are acquired through an electric meter of the 2# metering station by considering project cost and actual construction.
The configuration method of the system configuration submodule in the embodiment comprises the following steps:
s1: the method comprises the following steps of collecting attribute information according to different types of 1# oil wells, 2# oil wells, 3# oil wells, 1# metering stations and 2# metering stations, namely: the method comprises the following steps that temperature and pressure data are collected through a temperature sensor and a pressure sensor respectively in a 1# oil well, a 2# oil well and a 3# oil well, and the corresponding temperature sensor and the corresponding pressure sensor correspond to a 1# RTU, a 2# RTU and a 3# RTU; the 1# metering station and the 2# metering station respectively acquire current data of the A phase, the B phase and the C phase through electric meters, and the corresponding electric meters correspond to the 1# PLC and the 2# PLC; meanwhile, the 3# oil well also needs to collect active power and reactive power data, classify attribute variables of the monitored object, induce attribute variable templates and configure the monitored object attribute variables and the attribute variable templates;
the attribute variable parameters comprise variable names, variable types, variable groups, value types, function codes, data addresses and byte lengths;
the variable types described include telemetry, telemetry.
The described variable grouping can perform detailed grouping on the variables of one variable template, and the historical data storage of the system is performed by establishing a plurality of data tables on the basis of the variable grouping for performing timed storage.
The value types described refer to analytic types of variable values, including boolean, integer, floating point.
The function code described refers to the specific function code that the variable represents under the specific communication protocol.
The described data address refers to the address of the acquisition point of the data acquisition equipment corresponding to the variable.
The byte length described refers to the length of the byte stream occupied by the variable.
The variable template is a set of related variables, which can be reused by the monitored object, and the monitored objects with the same variable can be associated and configured to the same variable template.
The attribute variable parameters for this embodiment are shown in table 1:
TABLE 1
S2: configuring a monitored object variable according to the field data acquisition condition;
the monitoring object variable parameters comprise monitoring object numbers, variable templates, data acquisition equipment addresses and acquisition channel serial numbers; the monitored object number is the identification of the monitored object in the system and has uniqueness. The variable template name is the name of the variable template associated with the monitoring object, and the variable information of the monitoring object is defined by the variable in the associated variable template. The data acquisition device address is an address of a data acquisition device associated with the monitored object. The monitored object variable parameters of this embodiment are shown in table 2:
monitoring object
|
Monitoring object numbering
|
Variable template
|
Data acquisition device address
|
Number of acquisition channel
|
No. 1 oilWell
|
yj1
|
Variable template A
|
1,2
|
1
|
2# oil well
|
yj2
|
Variable template A
|
1,2
|
2
|
3# oil well
|
yj3
|
Variable template C
|
1,2;1
|
3,4
|
1# metering station
|
jlz1
|
Variable template B
|
1
|
4
|
2# metering station
|
jlz2
|
Variable template B
|
1
|
5 |
TABLE 2
S3: configuring the selected data acquisition equipment variable and the acquisition channel variable according to different acquisition attributes of the monitored object variable;
the variable parameters of the data acquisition equipment comprise an equipment address, timeout time, retransmission times and an acquisition channel sequence number; the acquisition channel variable parameters comprise communication protocols, channel serial numbers, port information, communication frames and communication intervals; the communication protocol comprises a ModbusRTU communication protocol, a ModbusTCP communication protocol, an IEC104 communication protocol and an OPC communication protocol, and the communication interval is the integral polling time interval of the communication frames of the acquisition channel.
The data acquisition device variable parameters of this embodiment are shown in table 3:
data acquisition equipment
|
Device address
|
Number of acquisition channel
|
Time-out
|
Number of retransmissions
|
1# temperature sensor
|
1
|
1
|
5
|
2
|
1# pressure sensor
|
2
|
1
|
5
|
2
|
2# temperature sensor
|
1
|
2
|
5
|
2
|
2# pressure sensor
|
2
|
2
|
5
|
2
|
3# temperature sensor
|
1
|
3
|
5
|
2
|
3# pressure sensor
|
2
|
3
|
5
|
2
|
1# electric meter
|
1
|
4
|
5
|
2
|
2# electric meter
|
1
|
5
|
5
|
2 |
TABLE 3
The acquisition channel variable parameters of the system are shown in table 4:
collection channel
|
Communication protocol
|
Port information
|
Channel number
|
Communication frame
| Communication interval |
|
1#RTU
|
IEC104
|
tcp/ip|192.168.0.11:2404
|
1
|
Communication frame template A
|
10
|
2#RTU
|
IEC104
|
tcp/ip|192.168.0.12:2404
|
2
|
Communication frame template A
|
10
|
3#RTU
|
IEC104
|
tcp/ip|192.168.0.13:2404
|
3
|
Communication frame template A
|
10
|
1#PLC
|
ModbusTCP
|
tcp/ip|192.168.0.14:502
|
4
|
Communication frame template B
|
10
|
2#PLC
|
ModbusTCP
|
tcp/ip|192.168.0.15:502
|
5
|
Communication frame template C
|
10 |
TABLE 4
The above steps S1, S2, and S3 may be performed in an exchange order;
s4: classifying the communication frame variables according to a communication seeking instruction which is sought and sent to the data acquisition equipment by the acquisition channel, summarizing the communication frame template, and configuring the communication frame variables and the communication frame template; the communication frame variable parameters comprise data acquisition equipment addresses, function codes, data starting addresses and data lengths; the communication frame is a group of communication request commands sent to the data acquisition equipment by the acquisition channel, the communication frame template is a group of related communication frame set and can be repeatedly utilized by the acquisition channel, and the acquisition channels with the same communication frame can be associated and configured to the same communication frame template;
the communication frame template and the communication frame of this embodiment are shown in table 5:
communication frame template
|
Communication frame
|
Communication frame template A
|
1|136-0-1,2|136-1-1
|
Communication frame template B
|
1|3-0-5
|
Communication frame template C
|
1|3-0-3 |
TABLE 5
S5: setting an alarm early warning value of the attribute of a monitored object, and configuring an alarm early warning information variable;
the alarm early warning information variable parameters comprise alarm types, alarm values, alarm information and alarm levels, and the alarm types are divided into alarm when the analog quantity is higher than the upper limit, alarm when the analog quantity is lower than the lower limit, early warning when the analog quantity is higher than the upper limit, early warning when the analog quantity is lower than the lower limit, fault alarm of the signal quantity and displacement alarm of the signal quantity. The first four analog quantity alarm warnings are respectively provided with corresponding upper limit threshold and lower limit threshold, when the acquired data value exceeds the set threshold, the alarm warning is triggered, the semaphore fault alarm is a system fault alarm generated when the semaphore reaches 0 or 1, and the semaphore displacement alarm is a semaphore change alarm generated when the semaphore changes from 1 to 0 or from 0 to 1. The alarm grade represents the severity of the alarm in the system and can be flexibly defined according to the actual situation. The alarm and early warning information variable parameters of this embodiment are shown in table 6:
monitoring object numbering
|
Variables of
|
Alarm type
|
Alarm value
|
Alarm information
|
Alarm rating
|
yj1
|
wd
|
Alarm for lower limit
|
2.5
|
Alarm when temperature is lower
|
6
|
yj1
|
wd
|
Lower limit early warning
|
5
|
Early warning when temperature is lower
|
5
|
yj1
|
yl
|
Alarm for exceeding upper limit
|
1.2
|
Alarm for pressure exceeding upper limit
|
8
|
yj1
|
yl
|
Early warning for exceeding upper limit
|
0.8
|
Early warning of pressure exceeding upper limit
|
7 |
TABLE 6
S6: and associating the monitored object with the data acquisition equipment according to the field configuration.
A 1# temperature sensor and a 2# pressure sensor of the 1# RTU associated with the 1# oil well, a 1# temperature sensor and a 2# pressure sensor of the 2# RTU associated with the 2# oil well, a 1# temperature sensor and a 2# pressure sensor of the 3# RTU associated with the 3# oil well and a 1# ammeter of the 1# PLC, a 1# ammeter of the 1# metering station associated with the 1# PLC, a 2# ammeter of the 2# metering station associated with the 2# PLC,
the data interface sub-module 206 of this embodiment may obtain the corresponding real-time data by transmitting the number of the monitoring object in table 2 and the name of the variable corresponding to table 1.
The application software module 300 may implement the application of the data related to the present embodiment through the data interface sub-module 206 of the system software module 200.
Further, the acquisition method of the data acquisition system of the internet of things comprises the following steps:
s1: analyzing the monitored object information and the alarm early warning information thereof;
the data transmission sub-module 201 reads the data in table 2 stored in the relational database sub-module 203 by the system configuration sub-module 205, initializes the variable information according to the variable template information in table 1, and prepares for association with the data acquired by the acquisition channel.
Meanwhile, alarm early warning information analysis is carried out on variables related to the monitored object, and the analysis is shown in table 6, so that preparation is made for alarm early warning of the system.
S2: analyzing the information of the acquisition channel and the data acquisition equipment;
and the data transmission submodule analyzes the data in the table 4 stored in the relational database, initializes the communication frame information according to the table 5 and initializes the information in the table 3 at the same time, and prepares for data acquisition and analysis.
S3: starting an acquisition channel to acquire data;
data acquisition was initiated for the five acquisition channels of table 4. When the communication frame corresponding to a certain data acquisition device fails to finish communication within the configured overtime time range, retransmission is carried out, the retransmission times are exceeded, and the device is determined to be offline in communication. And the communication interval set by the acquisition channel is 10 seconds, and data acquisition is carried out every 10 seconds.
S4: storing real-time data to the real-time library sub-module 202 according to the incidence relation between the monitored object and the data acquisition equipment and the acquisition channel;
and storing real-time data into the real-time library sub-module 202 according to the incidence relation between the monitored object and the data acquisition equipment and the acquisition channel in the table 2.
S5: if alarm early warning occurs, processing is carried out;
and 6, analyzing the table 6, if the data reaches the alarm early warning condition, triggering the alarm early warning, and pushing the information to Redis.
S6: historical data is stored at regular intervals to the relational database.
And storing the data of the monitored object into a corresponding variable grouping historical data table according to the configured 1-minute interval.
Then, next data acquisition is carried out, and S4, S5 and S6 are executed in a circulating mode.
The local part of the oil field internet of things data acquisition system is selected only for more clearly and more specifically explaining the technical scheme and the advantages, and if the method extends to the implementation, operation and maintenance of the whole project of the actual oil field internet of things data acquisition system, the types, the number, the incidence relation and the like of the monitoring object, the data acquisition equipment and the acquisition channel reach a certain magnitude, the technical scheme and the advantages of the invention are more obviously embodied.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art should be considered to be within the technical scope of the present invention, and the technical solutions and the inventive concepts thereof according to the present invention should be equivalent or changed within the scope of the present invention.