CN104754038B - A kind of monitoring method and device to grain in distributed grain depot - Google Patents
A kind of monitoring method and device to grain in distributed grain depot Download PDFInfo
- Publication number
- CN104754038B CN104754038B CN201510100028.7A CN201510100028A CN104754038B CN 104754038 B CN104754038 B CN 104754038B CN 201510100028 A CN201510100028 A CN 201510100028A CN 104754038 B CN104754038 B CN 104754038B
- Authority
- CN
- China
- Prior art keywords
- list
- data
- day
- grain
- remote control
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
- H04L67/025—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01D—MEASURING NOT SPECIALLY ADAPTED FOR A SPECIFIC VARIABLE; ARRANGEMENTS FOR MEASURING TWO OR MORE VARIABLES NOT COVERED IN A SINGLE OTHER SUBCLASS; TARIFF METERING APPARATUS; MEASURING OR TESTING NOT OTHERWISE PROVIDED FOR
- G01D21/00—Measuring or testing not otherwise provided for
- G01D21/02—Measuring two or more variables by means not covered by a single other subclass
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1097—Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Selective Calling Equipment (AREA)
- Computer And Data Communications (AREA)
Abstract
The invention discloses a kind of monitoring method and device to grain in distributed grain depot, belong to stored grain monitoring technical field.This monitoring method comprises the following steps:S1:Remote control terminal gathers the grain quality parameter and/or grain storage environment parameter in grain depot everywhere, and the remote control terminal sends the device coding corresponding to the parameter collected and remote control terminal to buffer storage;User's application system is after one day first powers on, create the same day list on the data acquisition equipment start same day, and the day before yesterday list created when starting shooting to data acquisition equipment is last is filed, the day before yesterday list data that the storage creation day before yesterday list same day is gathered;S2:User's application system extracts data from the buffer storage, and the data of extraction are preserved into the same day list.The present invention has carried out appropriate storage to the data monitored, to fully understand that grain quality parameter and grain storage environment parameter provide safety assurance.
Description
Technical field
The invention belongs to stored grain monitoring technical field, more particularly to a kind of monitoring side to grain in distributed grain depot
Method and device.
Background technology
It is the appropriate key for managing stored grain to understand grain quality parameter and/or grain storage environment parameter in time, if
The information such as grain quality parameter and/or the grain storage environment parameter of stored grain cannot be understood in time, then can directly affect grain
The storage of food.Such as stored grain moisture is excessive, its vital movement is vigorous, and to be easy to cause grain mouldy, rotten too early, very
Extremely rot.If stored grain moisture is too low, not only mitigate the weight of grain, but also grain also needs to certain moisture
The vital movement of its bottom line is maintained, its Measurement for Grain Moisture Content is even more important kind of grain.
In order to ensure that grain is stored under an optimal environment, the existing grain by monitoring device to stored grain
Food quality parameter and/or grain storage environment parameter are monitored in real time.Further according to the data monitored, stored grain is taken
Next step safeguard measure.However, during monitoring, large quantities of monitoring data are had, can if cannot properly be stored
Cause the loss of monitoring data, and then cannot fully understand grain quality parameter and/or grain storage environment parameter, so as to influence
The storage of grain.
The content of the invention
The present invention is in order to overcome the above-mentioned deficiencies of the prior art, there is provided a kind of monitoring side to grain in distributed grain depot
Method, this monitoring method have carried out appropriate storage to the data monitored, to fully understand grain quality parameter and grain storage
Environmental parameter provides safety assurance.
To achieve the above object, present invention employs following technical scheme:
A kind of monitoring method to grain in distributed grain depot, comprises the following steps:
S1:Remote control terminal gathers the grain quality parameter and/or grain storage environment parameter in grain depot everywhere, described
Remote control terminal is by corresponding to the grain quality parameter collected and/or grain storage environment parameter and remote control terminal
Device coding send to buffer storage;
User's application system in data acquisition equipment creates the data acquisition equipment start same day after one day first powers on
Same day list, and the day before yesterday list that while starting shooting to data acquisition equipment is last is created is filed, the day before yesterday list
The data gathered on the day of storage creation day before yesterday list;
S2:User's application system extracts data from the buffer storage, and the data of extraction are handled, are protected
Deposit into the same day list.
The present invention can also further be realized by following steps.
Preferably, the step of establishing the same day list is as follows:
S11:User's application system in the data acquisition equipment reads system time during start one day, thus obtains
On the collection date of data, then open and corresponding work as annual data with the collection date in the database according to the collection date
Storehouse, searches whether to have generated the of that month list being consistent with the collection date in database then;
S12:If this month list exists, step S14 is transferred to;Otherwise, it is transferred to step S13;
S13:It is automatic in database then to establish the of that month list being consistent with the collection date and preserve, Ran Houzhuan
Enter step S14;
S14:Search whether to have generated the same day list being consistent with the collection date in database then;
S15:If the same day list exists, terminate to create same day list;Otherwise, it is transferred to step S16;
S16:Automatic establish gathers same day list that the date is consistent and preserves with described in database then, and by institute
The day before yesterday list created when data acquisition equipment is last to start shooting is stated to be filed.
Preferably, the step of filing the day before yesterday list is as follows:
S21:User's application system in the data acquisition equipment opens database then when creating same day list
And of that month list, database is current database then at this time;To method of the collection date to successively decrease one by one in same day list
The virtual day before yesterday list name of N days before generation;
S22:In the virtual day before yesterday list name for extracting proxima luce (prox. luc) one by one successively from the virtual day before yesterday list name of N days of generation
Year information, and judge whether the year information identical with the year information of the current database when front opening;
S23:If the year information in virtual day before yesterday list name is identical with the year information of current database, step is transferred to
S24;Otherwise, it is transferred to step S25;
S24:Search whether there is the day list of the same name with virtual day before yesterday list in current database, if there is with void
Intend day before yesterday list day list of the same name, then the day list of the same name found is day list to be archived, is transferred to step S26;It is no
Then, it is transferred to step S22;
S25:Database then is closed, opens the year before last database corresponding to upper 1 year, the year before last database becomes new and works as
Preceding database, searches whether there is the day list of the same name with virtual day before yesterday list in new current database, if there is with
Virtual day before yesterday list day list of the same name, then the day list of the same name found is day list to be archived, is transferred to step S26;
Otherwise, it is transferred to step S22;
S26:Month information is extracted from day list name to be archived, the moon list to be filed is obtained, by day to be archived
The data recorded in list are added in this month list in current database one by one.
Preferably, the remote control terminal is acquired data according to the collection period T1 of setting, and will collect
Data creating is transmitted into message, and the data in the message are refreshed according to collection period T1;The remote control terminal
Message is uploaded from buffer storage described in trend according to the sending cycle T2 of setting;The remote control terminal is by the A/ of acquisition parameter
D conversion values are directly stored into message.
Preferably, the automatic operation mode of the data acquisition equipment is as follows:
S31:Automatic operation mode is selected on the data acquisition equipment;
S32:The buffer storage receive automatically remote control terminal upload message, and add receive message system when
Between be used as data acquisition time;
S33:User's application system extracts message from the buffer storage, then extracts grain from the message of extraction
Device coding corresponding to quality parameter and/or grain storage environment parameter and remote control terminal, and to the data of extraction into
Row resolves and processing, obtains the data of setting form, the data of these setting forms and data acquisition time is become a note
Record, is automatically added in the same day list;
S34:Judge whether to need the data for detecting the collection of assigning remote control terminal;
S35:If desired the data of assigning remote control terminal collection are detected, then are transferred to step S36;Otherwise, it is transferred to step
S39;
S36:User's application system automatically stores the device coding corresponding to assigning remote control terminal to user
In the remote control terminal device coding variable of application system itself;
S37:According to the device coding in the message being currently received, judge the device coding whether with remote control terminal
Device coding variate-value is that the device coding being stored in remote control terminal device coding variable is identical;
S38:If the device coding is identical with remote control terminal device coding variate-value, the data after processing are shown
In the text display box specified in user's application system;
S39:Judge whether to stop to receive message automatically, if being off receiving message automatically, stop automatic reception message;
Otherwise, it is transferred to step S32.
Preferably, user's application system is resolved and handled to the data of extraction described in step S33, which includes
Setting in message will be included into the character string easy to display, the processing with the data conversion of bytewise storage in messages
Standby coding is obtained and the corresponding user name of the device coding, institute from being stored in the basic list of the user in data acquisition equipment
State the basic list of user and house device coding corresponding to all remote control terminals, user name, enabling time, contact person,
Contact method, remarks.
The grain quality parameter of the remote control terminal collection includes Measurement for Grain Moisture Content, cereal temperature, described long-range
The grain storage environment parameter of control terminal collection includes temperature, the humidity of grain depot, the remote control terminal also collecting device
State code, equipment fault code, total run time, day operation time, operating parameter;The day list is included with character string shape
The device coding that formula is shown, data acquisition time, equipment state code, equipment fault code, total run time, during day operation
Between, operating parameter;The fund of operating parameter and the operating parameter in the message in the day list is adapted.
A kind of on-Line Monitor Device, including with lower part:
Grain monitoring device;For monitoring grain quality parameter and grain storage environment parameter;
Drying unit, for adjusting moisture in grain;
Remote control terminal, the signal input part of the remote control terminal and the signal output of the grain monitoring device
End is connected, and the signal input part of the signal output part of the remote control terminal also with the drying unit is connected;
Data transmission unit, that is, DTU, for serial data to be converted to IP data or IP data are converted to serial data,
Two-way communication link between the data transmission unit and the remote control terminal;
Buffer storage, the data sent for receiving and preserving the data transmission unit, the buffer storage with it is described
Connected between data transmission unit by network communication;
Data acquisition equipment, is resolved and is handled for the data extracted from buffer storage, and by the data of extraction
After store into database, two-way communication link between the data acquisition equipment and the buffer storage.
Preferably, the grain monitoring device is arranged to multiple in the diverse location of same silo, the multiple grain prison
Signal input part of the signal output part of device respectively with the remote control terminal is surveyed to be connected.
Preferably, the multiple grain monitoring device, drying unit, remote control terminal and the common structure of data transmission unit
Into a wireless remote monitoring unit, the buffer storage passes through GPRS/INTERNET nets between multiple monitoring unit respectively
Network carries out both-way communication connection, and the multiple monitoring unit monitors the grain quality parameter and grain of grain in different silos respectively
Storage environment parameter.
The beneficial effects of the present invention are:
1) data sended in the present invention by establishing day list the remote control terminal that is encoded to distinct device
Stored, day list be named with the collection date of data, and then store all data of collection date, according to when
Between sequencing, be stored in by multiple days lists filing to moon list, then by moon list in annual data storehouse, the database
Including multiple annual data storehouses, the data monitored in this monitoring method are stored in order, avoid the loss of data, also for
Fully understand that grain quality parameter and grain storage environment parameter provide one and safe and efficient check approach.
2) appropriate filing has been carried out to day before yesterday list in the present invention, it, which is filed, can be achieved across month filing, can also be real
The data monitored have been carried out effective storage, have avoided Missing data by now across time filing.
3) report is made in multinomial subdata by medium-long range control terminal generation message of the present invention, the remote control terminal
Text, user's application system system time that automatic addition receives the message when receiving message automatically are recorded as day list
" time " field, using the device coding received in message in data receiver thread, is searched in equipment basic condition list
Go out with the user name corresponding to the device coding, and the user name of acquisition is stored in day list together, i.e., data are being transmitted across
Cheng Zhong, does not transmit the user name and data acquisition time of remote control terminal.The length of message is the method reduce, facilitates number
According to transmission, also so that the step of its transmitting procedure becomes succinct, orderly, the efficiency of gathered data can be improved, reduce user
Use cost.
4) a frame message is each made in the data collected by each remote control terminal in the present invention, and the message is with remote
The device coding of process control terminal is mark, and is stored with bytewise, and user's application system is taken out the message received
Take, extract the subdata in the subitem of message, and subdata is resolved and handled, be processed into the Sino-Japan table of user's application system
Single display format, contain a plurality of record data, a plurality of record data and multiple remote control terminals in each day list
The data collected are one-to-one relationship.
Brief description of the drawings
Fig. 1 is the block diagram connection diagram of on-Line Monitor Device in the present invention;
Fig. 2 is the work flow diagram that day list is established in the present invention;
Fig. 3 is the work flow diagram that data store in message in the present invention.
The implication of label symbol is as follows in figure:
10-grain monitoring device 20-drying unit, 30-remote control terminal
40-data transmission unit, 50-data acquisition equipment
Embodiment
Below in conjunction with the attached drawing in the embodiment of the present invention, the technical solution in the embodiment of the present invention is carried out clear, complete
Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, those of ordinary skill in the art are obtained every other without making creative work
Embodiment, belongs to the scope of protection of the invention.
A kind of on-Line Monitor Device to grain in distributed grain depot, including with lower part:
Grain monitoring device 10, for monitoring grain quality parameter and grain storage environment parameter;The grain monitoring dress
Put 10 and include at least the grain moisture content monitor for being used for monitoring the temperature of moisture and grain local environment in grain;
Drying unit 20, for adjusting moisture in grain, the drying unit includes motor, control motor rotates
Control board, the output shaft of the motor are connected with flabellum, and the control board is electrically connected with motor;
Remote control terminal 30, the signal input part of the remote control terminal 30 and the letter of the grain monitoring device 10
Number output terminal is connected, the letter of the signal output part of the remote control terminal 30 also with control board in the drying unit 20
Number input terminal is connected;
Data transmission unit 40 is DTU, for serial data to be converted to IP data or IP data are converted to serial ports number
According to two-way communication link between the data transmission unit 40 and remote control terminal 30;
Buffer storage, the data sent for receiving and preserving the data transmission unit 40, the buffer storage and institute
State and connected by GPRS/INTERNET network communications between data transmission unit 40;
Data acquisition equipment 50, is resolved and is located for the data extracted from buffer storage, and by the data of extraction
Storage is into database after reason, two-way communication link between the data acquisition equipment 50 and the buffer storage.
In order to enable grain quality parameter and the data of grain storage environment parameter monitoring are more accurate, the grain monitoring
Device 10 is arranged to multiple in the diverse location of same silo, the signal output part of the multiple grain monitoring device 10 respectively with
The signal input part of the remote control terminal 30 is connected.
The multiple grain monitoring device 10, drying unit 20, remote control terminal 30 and data transmission unit 40 are common
A wireless remote monitoring unit is formed, the buffer storage passes through network, that is, GPRS/ between multiple monitoring unit respectively
INTERNET carries out both-way communication connection, and the multiple monitoring unit monitors the grain quality parameter of grain in different silos respectively
With grain storage environment parameter.
The remote control terminal 30 is programmable controller.The programmable controller and the data transfer list
It is bi-directionally connected between member 40 by serial communication.
Further, the GPRS-INTERNET gateway kimonos that the buffer storage provides for Beijing day with Cheng Ye Co., Ltds
Business device;Connected between the server and the data transmission unit by GPRS/INTERNET gateways both-way communication;It is described
GPRS/INTERNET gateways are to be used for realization between GPRS/INTERNET networks to interconnect, namely the GPRS/INTERNET nets
Pass is internetwork connector or protocol converter;The data acquisition equipment 50 is the individual containing application programming interface
Computer;Communicated between the data acquisition equipment 50 and buffer storage by message queue, so as to fulfill data exchange.
The wireless serial application interface wlserAPI for having used Beijing day to be provided with Cheng Ye Co., Ltds in the data acquisition equipment 50,
And it is set user's application system is run under multi-thread mechanism in running background.The data receiver thread provided using the API
And data queue, received so as to fulfill the automatic of data is sent to the remote control terminal.Can using this multi-thread mechanism
To send data and monitoring DTU working conditions in the case where not interrupting reception data.Microsoft ACCESS is also utilized, establishes data
Storehouse, and the ACCESS database operation methods provided using Microsoft, are managed customer data base.
The grain monitoring device 10 monitors the grain quality parameter and grain storage environment ginseng of same silo diverse location
Number, and the device coding corresponding to the data monitored and remote control terminal is transferred to the remote control terminal 30, institute
The data for stating the collection of remote control terminal 30 further include equipment state code, equipment fault code, total run time, during day operation
Between, operating parameter etc., the remote control terminal 30 and by the device coding corresponding to remote control terminal and the number collected
According to message is fabricated to, message transmissions are given to the data acquisition equipment 50 by the data transmission unit 40.The data are adopted
Collection equipment 50 can receive the message sended over for monitoring multiple remote control terminals 30 of different silos.The data acquisition
User's application system docks received message and is stored, filed and shown in equipment 50.
If one day is on January 3rd, 2015, the day list created when being first powered on to data acquisition equipment is the same day
List, if data acquisition equipment last time was first powered on the day of on December 30th, 2014, on December 30th, 2014 when starting shooting
When the day list that creates be day before yesterday list;
Alternatively, if one day is on December 3rd, 2014, the day list created when being first powered on to data acquisition equipment
For same day list, if the start of data acquisition equipment last time is on November 30th, 2014, the same day on November 30th, 2014 is first
The day list created during start is day before yesterday list.
It is a kind of to be used for the monitoring method in the on-Line Monitor Device of grain in distributed grain depot, comprise the following steps:
S1:Remote control terminal 30 gathers grain quality parameter and/or grain storage environment parameter in grain depot everywhere;Institute
Stating the grain quality parameter of remote control terminal collection includes Measurement for Grain Moisture Content, cereal temperature but is not limited only to grain moisture content and contains
Amount, cereal temperature, the grain storage environment parameter of the remote control terminal collection include the temperature of grain depot, humidity but not only limit
Temperature, humidity in grain depot, the remote control terminal 30 are acquired data according to the collection period T1 of setting, and will collection
To data creating be transmitted into message, the data in the message are refreshed according to collection period T1, the collection period
T1 values are less than sending cycle T2 values;The remote control terminal 30 is according to the sending cycle T2 of setting from buffer storage described in trend
Upload message, the value range of sending cycle T2 8~20 minutes;The thing that the remote control terminal 30 detects sensor
The A/D conversion values of reason amount are directly stored into message, such as the temperature value collected is converted to hexadecimal by temperature sensor
The shaping amount of form, and in the message that shaping amount deposit remote control terminal 30 is made, and temperature in hexadecimal form
In the message that angle value deposit remote control terminal 30 makes, the remote control terminal 30 need not be by the temperature of Hexadecimal form
Angle value is transmitted again after being converted into the temperature value of relocatable;The remote control terminal 30 goes back collecting device state code,
Equipment fault code, total run time, day operation time, operating parameter;The equipment state code, equipment fault code, always
Run time, day operation time, operating parameter are the data of relevant device in this detection device;
S2:The remote control terminal 30 sends out the device coding corresponding to the data collected and remote control terminal 30
Send to buffer storage, data acquisition equipment 50 by wlserAPI accessed cache devices in the form of message queue existing for it is long-range
The message that control terminal 30 sends over;User's application system in the data acquisition equipment 50 creates data acquisition equipment 50
The same day list on start same day one day (if one day is on January 3rd, 2015), and start shooting to data acquisition equipment 50 is last
The day before yesterday list that (if last time start by December 30th, 2014) creates is filed, day before yesterday list storage creation
The data gathered on the day of day before yesterday list;In start, its buffer storage starts to receive long-range control the data acquisition equipment 50
The message that terminal 30 processed sends over, its user's application system also begin to create same day list and filing day before yesterday list;
S3:User's application system extracts data from the buffer storage, and the data of extraction are handled, are protected
Deposit into the same day list;User's application system is resolved and handled to the data of extraction, which includes will be with
The data conversion of bytewise storage in messages into the character string easy to display, compile by the equipment which is included in message
Code is obtained from the basic list of user to be housed all remote with the corresponding user name of the device coding, the basic list of user
Device coding corresponding to process control terminal 30, user name, enabling time, contact person, contact method, remarks.
The day list includes the device coding that is shown with character string forms, data acquisition time, equipment state code, if
Standby failure code, total run time, day operation time, operating parameter;Operating parameter in the message with transporting in the day list
The fund of row parameter is adapted.
The moon list includes the day list arranged according to date sequencing, and the annual data storehouse was included according to the time
The day list and moon list for data filing of sequencing arrangement, it is suitable according to time order and function that the database includes several
The annual data and the basic list of user of sequence arrangement.
The step of establishing the same day list is as follows, as shown in Figure 2:
S11:User's application system in the data acquisition equipment 50 is read when January 3 first powered within 2015
Unite the collection date of date i.e. 2015 on January 3, as data, then according to gathering date i.e. 2015 on January 3, in database
Middle opening and the collection date corresponding database then, that is, annual data storehouse DB_2015, are looked into annual data DB_2015 storehouses
Look for the of that month list front-month list TABLE_JAN for whether having generated and being consistent on January 3, with collection date i.e. 2015;
S12:If the moon list TABLE_JAN exists, step S14 is transferred to;Otherwise, it is transferred to step S13;
S13:Establish moon list TABLE_JAN automatically in the DB_2015 of annual data storehouse and preserve, be then transferred to step S14;
S14:Search whether to have generated and collection date i.e. 2015 phase on January 3, in the DB_2015 of annual data storehouse
The list same day, the list this day TABLE_2015_1_3 met;
S15:If the day list TABLE_2015_1_3 exists, terminate to create day list TABLE_2015_1_3;It is no
Then, it is transferred to step S16;
S16:Establish day list TABLE_2015_1_3 automatically in the DB_2015 of annual data storehouse and preserve, and by the number
The list day before yesterday, the list this day TABLE_2014_12_ created during according to i.e. December 30 in 2014 of last start of collecting device 50
30 are filed.
The step of filing the day before yesterday list is as follows:
S21:User's application system in the data acquisition equipment opens database then when creating same day list
And of that month list, database is current database then at this time, and the date in same day list is generated in the method successively decreased one by one
Virtual day list name array DataTableName [the 0]-DataTableName [N-1] of first N days, makes I=0, bFind=
false;
S22:The information in extraction time from day list name DataTableName [I];If the year information and current number
It is consistent according to the year information in storehouse, it is transferred to step S23;Otherwise, it is transferred to step S25;
S23:Search whether there is the day list of the same name with day list DataTableName [I] in current database, such as
There is the day list of the same name with day list DataTableName [I] in fruit, make flag bit bFind=true;String variable is assigned
Value tableName=DataTableName [I], is transferred to step S27;Otherwise, assignment I=I+1, is transferred to step S24;
S24:If I<=N-1, then be transferred to step S22;If I>N-1, then be transferred to step S27;
S25:Current database is closed, opens upper 1 year corresponding the year before last database;The year before last database becomes current
Database;Search whether there is the day list of the same name with day list DataTableName [I] in current database, if deposited
In the day list of the same name with day list DataTableName [I], make flag bit bFind=true;To string variable assignment
TableName=DataTableName [I], is transferred to step S27;Otherwise, assignment I=I+1, is transferred to step S26;
S26:If I<=N-1, then be transferred to step S26;I>N-1, then be transferred to step S27;
S27:Judge whether bFind is equal to true, if bFind=true, month information is extracted from tableName, is obtained
To the moon list to be filed, then by the data recorded in identical with talbeName names day list in current database one by one
Addition is in this month list;Otherwise, current database is closed.
The step of filing the day list TABLE_2014_12_30 is as follows:
S21:User's application system in the data acquisition equipment is opened when creating day list TABLE_2015_1_3
Annual data storehouse DB_2015 and moon list TABLE_JAN, annual data storehouse DB_2015 is current database at this time, to day list
Date in TABLE_2015_1_3 is as follows with the virtual day list name array of N days before the method generation successively decreased one by one:
DataTableName [0]-DataTableName [N-1],
DataTableName [0]=TABLE_2015_1_2,
DataTableName [1]=TABLE_2015_1_1,
DataTableName [2]=TABLE_2014_12_31,
DataTableName [3]=TABLE_2014_12_30,
DataTableName [4]=TABLE_2014_12_29,
DataTableName [5]=TABLE_2014_12_28,
DataTableName [6]=TABLE_2014_12_27, makes I=0, bFind=false;
S22:The information in extraction time from day list name array DataTableName [I], when the initial value of I is 0,
Year information is extracted from DataTableName [0]=TABLE_2015_1_2 2015;The year information 2015 with it is current
The year information of the current database DB_2015 of opening is consistent;
S23:It is not present and day list name array DataTableName [0]=TABLE_2015_1_ in current database
2 day lists of the same name, then assignment I=I+1=1;
S24:Extract the time from DataTableName [1]=TABLE_2015_1_1 to believe 2015, the year information
2015 consistent with the year information of the current database DB_2015 when front opening;
S25:It is not present and day list name array DataTableName [1]=TABLE_2015_1_ in current database
1 day list of the same name, then assignment I=I+1=2;
S26:Year information is extracted from DataTableName [2]=TABLE_2014_12_31 2014;The time believes
The year information of the breath current database DB_2015 with working as front opening in 2014 is inconsistent;
S27:Annual data storehouse DB_2015 is closed, opens the annual data storehouse DB_2014 of upper 1 year as current database;
It is not present in current database DB_2014 of the same name with day list name array DataTableName [2]=TABLE_2014_12_31
Day list, assignment I=I+1=3;
S28:Year information is extracted from DataTableName [3]=TABLE_2014_12_30 2014;The time believes
The year information of the breath current database DB_2014 with working as front opening in 2014 is consistent;
S29:Exist and day list name array DataTableName [3]=TABLE_2014_12_ in current database
30 day lists of the same name, make flag bit bFind=true, to string variable assignment tableName=DataTableName
[3];Month information, that is, December is extracted from tableName, the moon list TABLE_DEC to be filed is obtained, then by current number
Added one by one according to the data recorded in day list TABLE_2014_12_30 identical with talbeName names in the DB_2014 of storehouse
In moon list TABLE_DEC.
Comprising the following steps that in the message that user's application system access receives, as shown in Figure 3:
S31:The buffer storage receives the message of the upload of remote control terminal 30 automatically, and the message received is stored in
In data queue, wait user's application system to extract message from data queue, judge to receive the enabler flags position of message
Whether it is true;
S32:If enabler flags position is true, that is, " gathered data " button is pressed, then reads present system time;Otherwise terminate
Receive message;
S33:Judge that user's application system extracts the operating mode of message as automatic operation mode or manual work
Pattern,
S34:If automatic operation mode, i.e. user selects " automatic " work in user's application system on user application interface
Operation mode, then be transferred to step S41;If manual work pattern, i.e. user selects in user's application system on user application interface
" manual " operating mode is selected, then is transferred to step S51;
S41:The message that the reception remote control terminal 30 uploads is extracted from the data queue in the buffer storage,
The present system time read is added as data acquisition time;
S42:Grain quality parameter and/or grain storage environment parameter and remote control terminal are extracted from the message of extraction
Device coding corresponding to 30, and the data of extraction are resolved and handled, data of the user's application system to extraction
Resolved and handled, the resolving include by with bytewise storage data conversion in messages into the character easy to display
String, the device coding which is included in message obtain and the corresponding user of the device coding from the basic list of user
Name, obtains the data of string format in the same day list, the data after these processing and data acquisition time is become one
Bar records, and is automatically added in the same day list;
S43:Judge whether to need the data for detecting the collection of assigning remote control terminal 30, i.e. user is in the user interface
The no message box for clicking on the device coding corresponding to assigning remote control terminal 30;
S44:If desired the data of the collection of assigning remote control terminal 30 are detected, then are transferred to step S45;Otherwise, it is transferred to step
Rapid S48;
S45:User's application system automatically stores the device coding corresponding to assigning remote control terminal 30 to remote
In process control terminal device encoding variable;
S46:According to the device coding in the message being currently received, judge the device coding whether with remote control terminal
30 device coding variate-values are that the device coding being stored in 30 device coding variable of remote control terminal is identical;
S47:If the device coding is identical with 30 device coding variate-value of remote control terminal, will be currently processed after number
In the text display box specified according to being shown in user's application system;
S48:It is false to judge whether enabler flags position, i.e., whether presses " stopping collection " button;
S49:If enabler flags position is false, then stop automatic reception message;Otherwise, it is transferred to step S41.
S51:" manual " operating mode is to whether just test data that the data acquisition equipment 50 receives
Really, setting needs to receive the number for uploading message in the text box of " receiving message number " in user's application system;
S52:User's application systems software receives the number for uploading message according to the needs of setting;Automatic adjustment is used to store
The dynamic array size of data;It is automatic from data receiver thread, that is, buffer storage to extract the message received in message queue, add
Add the present system time of reading as data acquisition time;
S53:Data are extracted from the message of extraction, and the data of extraction are resolved and handled, obtain the day table
The data of string format in list, user's application system are resolved and handled to the data of extraction, which includes will
Equipment in message is included into the character string easy to display, the processing with the data conversion of bytewise storage in messages
Coding is obtained from the basic list of user and the corresponding user name of the device coding, adopts the data after these processing and data
Collecting the time becomes a record, is stored in dynamic array and is shown in specified display box, and the reception for being zero to initial value
Packet accouter carries out plus 1 operation;
S54:Whether the count value for judging to receive packet accouter is the integral multiple for needing message frame number to be shown;
S55:If the count value for receiving packet accouter is equal to the integral multiple for needing message frame number to be shown, removes and specify
The data of display, otherwise, are transferred to step S53 in display box;
S56:If it is enabled to reset reception equal to the number for specifying reception to upload message for the count value for receiving packet accouter
Flag bit, even if enabler flags position is false;
S57:If enabler flags position is false, stop receiving message;
S58:Judge whether to need the data after processing being stored in the same day list, that is, judge that " writing data form " presses
Whether button is pressed;
S59:If " writing data form " button is pressed, the data in dynamic array are stored in the same day list;
Otherwise, the data in dynamic array are not stored in the same day list.
User's application system is sent in slow using wireless serial application interface wlserAPI with the remote control terminal 30
Message queue in cryopreservation device carries out data exchange;The message queue includes being used to send the instruction for uploading message and receives report
The data queue of text, sends the state queue of state, for sending whether support order and data for monitoring instruction and message
The command queue being transmitted.
Claims (5)
1. a kind of monitoring method to grain in distributed grain depot, it is characterised in that comprise the following steps:
S1:Remote control terminal gathers the grain quality parameter and/or grain storage environment parameter in grain depot everywhere, described long-range
Control terminal is by setting corresponding to the grain quality parameter collected and/or grain storage environment parameter and remote control terminal
Standby coding is sent to buffer storage;
User's application system in data acquisition equipment creates working as the data acquisition equipment start same day after one day first powers on
Day list, and the day before yesterday list that while starting shooting to data acquisition equipment is last is created is filed, the day before yesterday list has been deposited
Storage creates the data gathered on the day of day before yesterday list;
S2:User's application system extracts data from the buffer storage, and the data of extraction are handled, preserve to
In the same day list;
The step of establishing the same day list is as follows:
S11:User's application system in the data acquisition equipment reads system time during start one day, thus obtains data
The collection date, then according to collection the date open in the database with it is described collection date corresponding database then,
Search whether to have generated the of that month list being consistent with the collection date in database then;
S12:If this month list exists, step S14 is transferred to;Otherwise, it is transferred to step S13;
S13:It is automatic in database then to establish the of that month list being consistent with the collection date and preserve, then it is transferred to step
Rapid S14;
S14:Search whether to have generated the same day list being consistent with the collection date in database then;
S15:If the same day list exists, terminate to create same day list;Otherwise, it is transferred to step S16;
S16:Automatic establish gathers same day list that the date is consistent and preserves with described in database then, and by the number
The day before yesterday list created when starting shooting according to collecting device is last is filed;
The step of filing the day before yesterday list is as follows:
S21:User's application system in the data acquisition equipment opens database then when creating same day list and works as
Month list, database is current database then at this time;The collection date in same day list is generated in the method successively decreased one by one
The virtual day before yesterday list name of first N days;
S22:Extract the year in the virtual day before yesterday list name of proxima luce (prox. luc) one by one successively from the virtual day before yesterday list name of N days of generation
Part information, and judge whether the year information is identical with the year information of the current database when front opening;
S23:If the year information in virtual day before yesterday list name is identical with the year information of current database, step S24 is transferred to;
Otherwise, it is transferred to step S25;
S24:Search whether there is the day list of the same name with virtual day before yesterday list in current database, if there is with it is virtual before
Day list day list of the same name, then the day list of the same name found is day list to be archived, is transferred to step S26;Otherwise, turn
Enter step S22;
S25:Database then is closed, opens the year before last database corresponding to upper 1 year, the year before last database becomes new current number
According to storehouse, search whether there is the day list of the same name with virtual day before yesterday list in this new current database, if there is with void
Intend day before yesterday list day list of the same name, then the day list of the same name found is day list to be archived, is transferred to step S26;It is no
Then, it is transferred to step S22;
S26:Month information is extracted from day list name to be archived, the moon list to be filed is obtained, by day list to be archived
The data of middle record are added in this month list in current database one by one;
The remote control terminal is acquired data according to the collection period T1 of setting, and by the data creating collected into report
Text is transmitted, and the data in the message are refreshed according to collection period T1;The remote control terminal is according to the hair of setting
Cycle T 2 is sent to upload message from buffer storage described in trend;The remote control terminal is direct by the A/D conversion values of acquisition parameter
Storage is into message;
The automatic operation mode of the data acquisition equipment is as follows:
S31:Automatic operation mode is selected on the data acquisition equipment;
S32:The buffer storage receives the message of remote control terminal upload automatically, and adds the system time work for receiving message
For data acquisition time;
S33:User's application system extracts message from the buffer storage, then extracts grain quality from the message of extraction
Device coding corresponding to parameter and/or grain storage environment parameter and remote control terminal, and the data of extraction are solved
Calculate and handle, obtain the data of setting form, the data of these setting forms and data acquisition time is become a record, certainly
It is dynamic to be added in the same day list;
S34:Judge whether to need the data for detecting the collection of assigning remote control terminal;
S35:If desired the data of assigning remote control terminal collection are detected, then are transferred to step S36;Otherwise, it is transferred to step S39;
S36:Device coding corresponding to assigning remote control terminal is stored to user and applied by user's application system automatically
In the remote control terminal device coding variable of system itself;
S37:According to the device coding in the message being currently received, judge the device coding whether with remote control terminal equipment
Encoding variable value is that the device coding being stored in remote control terminal device coding variable is identical;
S38:If the device coding is identical with remote control terminal device coding variate-value, by the data after processing include with
In the text display box specified in the application system of family;
S39:Judge whether to stop to receive message automatically, if being off receiving message automatically, stop automatic reception message;It is no
Then, it is transferred to step S32;
User's application system is resolved and handled to the data of extraction described in step S33, which includes will be with byte shape
For formula storage data conversion in messages into the character string easy to display, which includes device coding in message from depositing
Obtained in the basic list of user being placed in data acquisition equipment basic with the corresponding user name of the device coding, the user
House the device coding corresponding to all remote control terminals in list, user name, enabling time, contact person, contact method,
Remarks.
2. the monitoring method according to claim 1 to grain in distributed grain depot, it is characterised in that:The remote control
The grain quality parameter of terminal collection includes Measurement for Grain Moisture Content, cereal temperature;The grain of the remote control terminal collection is deposited
Storage environmental parameter includes temperature, the humidity of grain depot;The remote control terminal also collecting device state code, equipment fault generation
Code, total run time, day operation time, operating parameter;The day list includes the device coding shown with character string forms, number
According to acquisition time, equipment state code, equipment fault code, total run time, day operation time, operating parameter;The day table
The fund of operating parameter and the operating parameter in the message in list is adapted.
3. a kind of on-Line Monitor Device for realizing the monitoring method described in claim 1, it is characterised in that including with lower part:
Grain monitoring device (10), for monitoring grain quality parameter and grain storage environment parameter;
Drying unit (20), for adjusting moisture in grain;
Remote control terminal (30), the signal input part of the remote control terminal (30) and the grain monitoring device (10)
Signal output part is connected, and the signal output part of the remote control terminal (30) is also inputted with the signal of the drying unit (20)
End is connected;
Data transmission unit (40) i.e. DTU, for serial data to be converted to IP data or IP data are converted to serial data,
Two-way communication link between the data transmission unit (40) and the remote control terminal (30);
Buffer storage, for receive and preserve the data transmission unit (40) transmission data, the buffer storage with it is described
Data transmission unit is connected between (40) by network communication;
Data acquisition equipment (50), is resolved and is handled for the data extracted from buffer storage, and by the data of extraction
After store into database, two-way communication link between the data acquisition equipment (50) and the buffer storage.
4. on-Line Monitor Device according to claim 3, it is characterised in that:The grain monitoring device (10) is in same grain
The diverse location in storehouse is arranged to multiple, the signal output part of the multiple grain monitoring device (10) respectively with the remote control
The signal input part of terminal (30) is connected.
5. on-Line Monitor Device according to claim 4, it is characterised in that:The multiple grain monitoring device (10), dry
Equipment for drying (20), remote control terminal (30) and data transmission unit (40) collectively form a wireless remote monitoring unit, institute
State buffer storage communication is carried out by GPRS/INTERNET networks between multiple monitoring unit respectively and be connected, the multiple prison
Survey unit monitors the grain quality parameter and grain storage environment parameter inside different silos respectively.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510100028.7A CN104754038B (en) | 2015-03-06 | 2015-03-06 | A kind of monitoring method and device to grain in distributed grain depot |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510100028.7A CN104754038B (en) | 2015-03-06 | 2015-03-06 | A kind of monitoring method and device to grain in distributed grain depot |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104754038A CN104754038A (en) | 2015-07-01 |
CN104754038B true CN104754038B (en) | 2018-04-13 |
Family
ID=53593125
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510100028.7A Active CN104754038B (en) | 2015-03-06 | 2015-03-06 | A kind of monitoring method and device to grain in distributed grain depot |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104754038B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112020738B (en) * | 2018-04-23 | 2022-09-27 | 陈浩能 | Method and apparatus for product monitoring |
CN110196251A (en) * | 2019-06-13 | 2019-09-03 | 六盘水市食品药品检验检测所 | A kind of sampling system and method for food inspection |
CN115250241B (en) * | 2022-09-23 | 2022-12-20 | 四川墨比品牌优创科技有限公司 | Food processing remote control method and control system based on Internet of things |
CN116107248A (en) * | 2023-02-01 | 2023-05-12 | 青岛海尔空调器有限总公司 | Crop storage monitoring method, apparatus and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2004051386A1 (en) * | 2002-11-29 | 2004-06-17 | Honda Motor Co.,Ltd. | Part ordering system and part ordering method |
CN103412539A (en) * | 2013-08-07 | 2013-11-27 | 江苏丹玉集团有限公司 | Wireless remote movable intelligent green grain storage monitoring system |
CN104034492A (en) * | 2014-06-04 | 2014-09-10 | 青岛中瑞泰软控技术有限公司 | Water pressure testing curve and parameter processing method |
CN104199427A (en) * | 2014-09-17 | 2014-12-10 | 彭宏伟 | Distribution-type environment monitoring and control system and method |
-
2015
- 2015-03-06 CN CN201510100028.7A patent/CN104754038B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2004051386A1 (en) * | 2002-11-29 | 2004-06-17 | Honda Motor Co.,Ltd. | Part ordering system and part ordering method |
CN103412539A (en) * | 2013-08-07 | 2013-11-27 | 江苏丹玉集团有限公司 | Wireless remote movable intelligent green grain storage monitoring system |
CN104034492A (en) * | 2014-06-04 | 2014-09-10 | 青岛中瑞泰软控技术有限公司 | Water pressure testing curve and parameter processing method |
CN104199427A (en) * | 2014-09-17 | 2014-12-10 | 彭宏伟 | Distribution-type environment monitoring and control system and method |
Also Published As
Publication number | Publication date |
---|---|
CN104754038A (en) | 2015-07-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104754038B (en) | A kind of monitoring method and device to grain in distributed grain depot | |
CN107240247A (en) | A kind of ammeter data acquisition system based on NB IoT | |
CN104717306A (en) | Greenhouse Internet-of-Things measurement and control system, and data synchronization method thereof | |
CN102969796A (en) | Near-real-time electric quantity monitoring and dispatching management system for rural power grid | |
US7741976B2 (en) | Server and method for processing meter data into a common format | |
CN103354562B (en) | Energy consumption collector, energy consumption collecting system and energy consumption collecting method | |
CN104979909B (en) | Adapted electric industry business acquisition system and method | |
CN108737453A (en) | Telemetry method for organizing and device for Internet of Things Network Communication | |
CN110113777A (en) | A kind of collecting method | |
CN102520685A (en) | Data acquisition system capable of monitoring and controlling industrial field and acquisition method thereof | |
CN104865860A (en) | Sampling, storing and inquiring method and device of WTGS (Wind Turbine Generator System) state monitoring system | |
CN115542754A (en) | Intelligent control system for home gateway | |
CN110087034A (en) | A kind of coal bed gas remote supervision system | |
US7688220B2 (en) | Device and method for processing meter data from multiple meters | |
CN108600372A (en) | A kind of information interaction system based on more transmission facility inspection devices and control terminal | |
CN106899678B (en) | High-efficiency data transmission method and system for dynamically balancing energy Internet network bandwidth | |
CN202486579U (en) | Data acquisition system capable of monitoring and controlling industrial field | |
CN107979647A (en) | One kind realizes the seismographic data recovery method of untethered memory-type | |
CN202190279U (en) | Remote information network management system | |
CN107942963A (en) | A kind of electric power operational system based on coordinated signals and cloud platform | |
CN202696825U (en) | Set top box information management system | |
CN110209088A (en) | A kind of configuration monitoring system and method based on HTML5 | |
CN109274587A (en) | A kind of energy source gateway for supporting multi-protocols | |
CN1905590B (en) | Single chip information acquiring method | |
KR102423039B1 (en) | Real-time packet data storing method and apparatus for mass network monitoring |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |