CN110555044A - Data processing method, programmable logic controller and data processing system - Google Patents

Data processing method, programmable logic controller and data processing system Download PDF

Info

Publication number
CN110555044A
CN110555044A CN201910840694.2A CN201910840694A CN110555044A CN 110555044 A CN110555044 A CN 110555044A CN 201910840694 A CN201910840694 A CN 201910840694A CN 110555044 A CN110555044 A CN 110555044A
Authority
CN
China
Prior art keywords
real
statistical
time data
wine
report
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.)
Pending
Application number
CN201910840694.2A
Other languages
Chinese (zh)
Inventor
何新开
张君
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Siemens Factory Automation Engineering Ltd
Original Assignee
Siemens Factory Automation Engineering Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Siemens Factory Automation Engineering Ltd filed Critical Siemens Factory Automation Engineering Ltd
Priority to CN201910840694.2A priority Critical patent/CN110555044A/en
Publication of CN110555044A publication Critical patent/CN110555044A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/248Presentation of query results

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Testing And Monitoring For Control Systems (AREA)

Abstract

The invention provides a data processing method, a programmable logic controller and a data processing system, wherein the method is applied to a PLC and comprises the following steps: presetting a real-time report and a statistical report, and presetting at least one query condition according to the statistical report; updating real-time data acquired by the PLC in real time into a real-time report; inquiring real-time data corresponding to the at least one inquiry condition from the real-time report; updating the real-time data corresponding to the at least one query condition into a data buffer area of the PLC; acquiring real-time data corresponding to each statistical object in the statistical form from the data buffer area; updating the statistical report according to the acquired real-time data corresponding to each statistical object; and sending the updated statistical report to the HMI for displaying. The invention provides a data processing method, a programmable logic controller and a data processing system, which can reduce data transmission delay.

Description

Data processing method, programmable logic controller and data processing system
Technical Field
The present invention relates to the field of control, and in particular, to a data processing method, a programmable logic controller, and a data processing system.
background
A PLC (Programmable Logic Controller) can acquire real-time data of various instruments in real time and display the real-time data in an HMI (Human Machine Interface). With the demand for informatization becoming higher and higher, the HMI is required by the user to be able to display statistical data obtained by processing real-time data as required.
in the prior art, the PLC transmits real-time data to a remote server via the internet, and processes the real-time data as required by data processing software on the server to generate statistical data. The server returns the statistical data and displays the statistical data on the HMI.
As can be seen from the above description, the processing of real-time data needs a remote server to complete, and in the process, data needs to be transmitted through the internet, and there is necessarily a long data transmission delay.
Disclosure of Invention
the embodiment of the invention provides a data processing method, a programmable logic controller and a data processing system, which can reduce data transmission delay, realize real-time data updating and improve production efficiency.
in a first aspect, an embodiment of the present invention provides a data processing method, which is applied in a PLC and includes:
presetting a real-time report and a statistical report, and presetting at least one query condition according to the statistical report;
updating the real-time data acquired by the PLC in real time into the real-time report;
Inquiring real-time data corresponding to the at least one inquiry condition from the real-time report;
updating the real-time data corresponding to the at least one query condition into a data buffer of the PLC;
acquiring real-time data corresponding to each statistical object in the statistical form from the data buffer area;
updating the statistical report according to the acquired real-time data corresponding to each statistical object;
And sending the updated statistical report to the HMI for displaying.
alternatively,
the querying the real-time data corresponding to the at least one query condition from the real-time report, and storing the real-time data corresponding to the at least one query condition into a data buffer of the PLC includes:
A0: initializing i-1, j-1;
a1: inquiring real-time data corresponding to the ith statistical object from the real-time report, determining real-time data meeting the jth inquiry condition in the real-time data corresponding to the ith statistical object, and updating the real-time data meeting the jth inquiry condition into the data buffer area;
a2: judging whether i is equal to n, if so, executing A3, otherwise, executing A6;
A3: judging whether j waits for m, if so, executing A4, otherwise, executing A5;
A4: j 1, i 1, return a 1;
A5: j +1, i 1, return a 1;
a6: i ═ i +1, return a 1;
Wherein n is the total number of the statistical objects, and m is the total number of the query conditions.
alternatively,
The updating the real-time data corresponding to the at least one query condition to the data buffer of the PLC includes:
For each of the query conditions, performing:
determining a statistical object corresponding to each piece of real-time data corresponding to the current query condition;
Taking a statistical object corresponding to each piece of real-time data as an index, and setting the index for each piece of real-time data;
updating each piece of real-time data corresponding to the current query condition after the index is set into a data buffer area of the PLC;
the obtaining of the real-time data corresponding to each statistical object in the statistical form from the data buffer includes:
for each of the statistical objects, performing:
and acquiring real-time data which takes the current statistical object as an index from the real-time data corresponding to the at least one query condition in the data buffer area.
alternatively,
updating the statistical report according to the acquired real-time data corresponding to each statistical object, including:
Determining the items to be counted corresponding to each statistical object in the statistical report;
for each of the statistical objects, performing:
According to the acquired real-time data corresponding to the current statistical object, performing statistics on each item to be counted corresponding to the current statistical object, and generating statistical information of each item to be counted corresponding to the current statistical object;
and updating the statistical information of each item to be counted corresponding to the current statistical object into the statistical report.
Alternatively,
The real-time data comprises: the brand of the wine in each wine tank, the storage amount of the wine in each wine tank, the inlet and outlet states of the wine in each wine tank and the temperature of the wine in each wine tank;
the statistical object comprises: the brand of the wine;
The at least one query condition includes: in which wine cans each brand of wine is stored, the inventory of each brand of wine in the wine cans.
in a second aspect, an embodiment of the present invention provides a PLC, including:
the storage unit is used for storing a real-time report form, a statistical report form and at least one query condition set according to the statistical report form;
The acquisition unit is used for updating real-time data acquired by the PLC in real time into the real-time report;
the query unit is used for querying the real-time data corresponding to the at least one query condition from the real-time report and updating the real-time data corresponding to the at least one query condition into a data buffer area of the PLC;
the acquisition unit is used for acquiring real-time data corresponding to each statistical object in the statistical form from the data buffer area;
the statistical unit is used for updating the statistical report according to the acquired real-time data corresponding to each statistical object;
and the sending unit is used for sending the updated statistical form to the HMI for displaying.
alternatively,
The query unit is configured to perform:
A0: initializing i-1, j-1;
A1: inquiring real-time data corresponding to the ith statistical object from the real-time report, determining real-time data meeting the jth inquiry condition in the real-time data corresponding to the ith statistical object, and updating the real-time data meeting the jth inquiry condition into the data buffer area;
A2: judging whether i is equal to n, if so, executing A3, otherwise, executing A6;
a3: judging whether j waits for m, if so, executing A4, otherwise, executing A5;
a4: j 1, i 1, return a 1;
A5: j +1, i 1, return a 1;
a6: i ═ i +1, return a 1;
wherein n is the total number of the statistical objects, and m is the total number of the query conditions.
Alternatively,
the query unit is configured to, for each query condition, perform:
Determining a statistical object corresponding to each piece of real-time data corresponding to the current query condition;
taking a statistical object corresponding to each piece of real-time data as an index, and setting the index for each piece of real-time data;
updating each piece of real-time data corresponding to the current query condition after the index is set into a data buffer area of the PLC;
the obtaining unit is configured to, for each of the statistical objects, perform:
and acquiring real-time data which takes the current statistical object as an index from the real-time data corresponding to the at least one query condition in the data buffer area.
alternatively,
The statistical unit is used for executing:
Determining the items to be counted corresponding to each statistical object in the statistical report;
for each of the statistical objects, performing:
according to the acquired real-time data corresponding to the current statistical object, performing statistics on each item to be counted corresponding to the current statistical object, and generating statistical information of each item to be counted corresponding to the current statistical object;
And updating the statistical information of each item to be counted corresponding to the current statistical object into the statistical report.
alternatively,
The real-time data comprises: the brand of the wine in each wine tank, the storage amount of the wine in each wine tank, the inlet and outlet states of the wine in each wine tank and the temperature of the wine in each wine tank;
The statistical object comprises: the brand of the wine;
the at least one query condition includes: in which wine cans each brand of wine is stored, the inventory of each brand of wine in the wine cans.
in a third aspect, an embodiment of the present invention provides a data processing system, including:
The HMI and the PLC of any of the second aspects;
The PLC is connected with the HMI;
and the HMI is used for displaying the statistical report sent by the PLC.
In the embodiment of the invention, a real-time report and a statistical report are preset, a query condition is set according to the statistical report, real-time data required by updating the statistical report can be queried based on the query condition, the queried real-time data is stored in a data buffer area, real-time data corresponding to each statistical object is acquired from the data buffer area, the real-time data corresponding to each statistical object is updated to the statistical report after being counted, and the PLC directly sends the statistical report to the HMI for displaying. In the embodiment of the invention, the data processing process is finished in the PLC, and the processed data is directly sent to the HMI through the PLC without transmitting the data through the Internet, so that the data transmission delay is reduced, the real-time data updating is realized, and the production efficiency is improved.
drawings
in order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a flow chart of a method of data processing provided by an embodiment of the invention;
FIG. 2 is a flow diagram of another method of data processing provided by one embodiment of the invention;
FIG. 3 is a schematic diagram of a PLC provided by an embodiment of the present invention;
FIG. 4 is a schematic diagram of a data processing system according to an embodiment of the present invention.
Detailed Description
in order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer and more complete, the technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention, and based on the embodiments of the present invention, all other embodiments obtained by a person of ordinary skill in the art without creative efforts belong to the scope of the present invention.
as shown in fig. 1, an embodiment of the present invention provides a data processing method, which is applied in a PLC and may include the following steps:
step 101: presetting a real-time report and a statistical report, and presetting at least one query condition according to the statistical report;
step 102: updating the real-time data acquired by the PLC in real time into the real-time report;
Step 103: inquiring real-time data corresponding to the at least one inquiry condition from the real-time report;
step 104: updating the real-time data corresponding to the at least one query condition into a data buffer of the PLC;
step 105: acquiring real-time data corresponding to each statistical object in the statistical form from the data buffer area;
step 106: updating the statistical report according to the acquired real-time data corresponding to each statistical object;
Step 107: and sending the updated statistical report to the HMI for displaying.
in the embodiment of the invention, a real-time report and a statistical report are preset, a query condition is set according to the statistical report, real-time data required by updating the statistical report can be queried based on the query condition, the queried real-time data is stored in a data buffer area, real-time data corresponding to each statistical object is acquired from the data buffer area, the real-time data corresponding to each statistical object is updated to the statistical report after being counted, and the PLC directly sends the statistical report to the HMI for displaying. In the embodiment of the invention, the data processing process is completed in the PLC, and the processed data is directly sent to the HMI through the PLC without transmitting the data through the Internet, so that the data transmission delay is reduced, the real-time data updating is realized, and the production efficiency is improved.
in the embodiment of the invention, the data needing to be written into the real-time report can be directly collected from various sensors and other devices. For example: the real-time data may include: the amount of wine in each wine tank, the temperature of the wine in each wine tank, and the like, the PLC can acquire the amount of wine in each wine tank through a liquid level sensor, and the PLC can acquire the temperature of the wine in each wine tank through a temperature sensor.
In step 102, the real-time data is updated to the real-time report in real time, so that the data in the real-time report is the latest, and the data in the statistical report seen by the user is also the latest.
After the real-time data corresponding to the query condition is stored in the data buffer, the real-time data corresponding to each statistical object is obtained from the real-time data corresponding to the at least one query condition in the data buffer, and then the obtained real-time data can be counted according to the statistical report to generate the data required by the statistical report. In the process of determining the real-time data corresponding to the query condition and the process of acquiring the real-time data corresponding to the statistical object, the real-time data is classified and sorted, and the real-time data is counted after the classification and sorting, so that the real-time data is easier to calculate, the calculation amount is smaller, and the load of the PLC is greatly reduced.
for example, the query condition is that the brand of each wine is stored in which wine cans, the wine can in which the brand of each wine is located can be obtained through the query condition, the statistical object is brand 1, then real-time data corresponding to brand 1, that is, information (for example, identification of the wine cans) of the wine with brand 1 is stored is obtained from the data buffer area, the data required by the statistical report is the number of the wine cans in which the wine with brand 1 is stored, and the data can be determined through simple addition calculation directly according to the information of the wine cans in which the wine with brand 1 is stored.
in step 102, if the latest collected real-time data is different from the real-time data recorded in the real-time report, the latest collected real-time data is used to replace the corresponding real-time data in the real-time report. For example, in the real-time report, the temperature in wine jar 1 is 2.1 deg.C, the temperature in the newly collected wine jar 1 is 1.7 deg.C, and then the temperature in wine jar 1 in the real-time report is updated to 1.7 deg.C.
In step 104, if the real-time data corresponding to a certain newly queried query condition a is different from the real-time data corresponding to the query condition a in the data buffer, the real-time data corresponding to the newly queried query condition a is used to cover the real-time data corresponding to the query condition a in the data buffer.
in step 106, if the data of the item a to be counted in the latest determined statistical form is different from the data of the item a to be counted recorded in the statistical form, the data of the item a to be counted recorded in the statistical form is replaced by the data of the item a to be counted, which is latest determined by the user.
in step 101, when the query condition is set, the query condition may be set according to the item to be counted in the statistical form, so that the real-time data corresponding to the query condition may be simply counted to obtain the statistical data required by the item to be counted.
in an embodiment of the present invention, the querying, from the real-time report, the real-time data corresponding to the at least one query condition, and storing the real-time data corresponding to the at least one query condition in a data buffer of the PLC includes:
A0: initializing i-1, j-1;
A1: inquiring real-time data corresponding to the ith statistical object from the real-time report, determining real-time data meeting the jth inquiry condition in the real-time data corresponding to the ith statistical object, and updating the real-time data meeting the jth inquiry condition into the data buffer area;
a2: judging whether i is equal to n, if so, executing A3, otherwise, executing A6;
a3: judging whether j waits for m, if so, executing A4, otherwise, executing A5;
A4: j 1, i 1, return a 1;
A5: j +1, i 1, return a 1;
a6: i ═ i +1, return a 1;
wherein n is the total number of the statistical objects, and m is the total number of the query conditions.
In the embodiment of the invention, each query condition is queried one by one, and the first query condition is queried again after the last query condition is queried, and so on, so as to form a cyclic query process. The real-time data in the data buffer can be ensured to be up-to-date through the circular query, so that the data in the statistical report is up-to-date.
in addition, in the embodiment of the invention, the query conditions are queried one by one, rather than two or more query conditions which are queried in parallel, the query mode can reduce the load of the PLC and ensure the smooth operation of the PLC.
for example, the at least one query condition includes: query condition 1, query condition 2. The statistical objects are brands of wine, and 3 brands of wine are total, namely brand 1, brand 2 and brand 3. Then n is 3 and m is 2.
The method comprises the following specific steps:
b1: inquiring real-time data corresponding to brand 1 from the real-time report, determining real-time data meeting the inquiry condition 1 in the real-time data corresponding to the brand 1, updating the real-time data meeting the inquiry condition 1 into a data buffer area, then sequentially inquiring the inquiry condition 1 aiming at brand 2 and brand 3, and executing B2 after processing brand 2 and brand 3;
B2: inquiring real-time data corresponding to brand 1 from the real-time report, determining real-time data meeting the inquiry condition 2 in the real-time data corresponding to the brand 1, updating the real-time data meeting the inquiry condition 2 into a data buffer area, then sequentially inquiring the inquiry condition 2 according to the brand 2 and the brand 3, completing a cycle after processing the brand 2 and the brand 3, and returning to B1.
in the embodiment of the present invention, there may also be no real-time data meeting the jth query condition in the real-time data corresponding to the ith statistical object, and in this case, it is not necessary to write data into the data buffer.
In an embodiment of the present invention, the updating the real-time data corresponding to the at least one query condition into the data buffer of the PLC includes:
for each of the query conditions, performing:
determining a statistical object corresponding to each piece of real-time data corresponding to the current query condition;
Taking a statistical object corresponding to each piece of real-time data as an index, and setting the index for each piece of real-time data;
Updating each piece of real-time data corresponding to the current query condition after the index is set into a data buffer area of the PLC;
the obtaining of the real-time data corresponding to each statistical object in the statistical form from the data buffer includes:
for each of the statistical objects, performing:
and acquiring real-time data which takes the current statistical object as an index from the real-time data corresponding to the at least one query condition in the data buffer area.
in the embodiment of the invention, when the real-time data is written into the data buffer area, the statistical object corresponding to each piece of real-time data is used as the index, and when the real-time data corresponding to each statistical object is acquired in the data buffer area, the statistical object is directly used as the index to search the real-time data corresponding to the statistical object, so that the speed of acquiring the data from the data buffer area can be greatly increased, and the load of a PLC (programmable logic controller) is reduced.
for example, the statistical objects are brand 1 and brand 2, the query condition 1 is which wine cans each brand of wine is stored in, and the real-time data corresponding to the query condition 1 includes: a first piece of real-time data stored in the wine tanks 1, 3 and 4 for brand 1 and a second piece of real-time data stored in the wine tank 10 for brand 2. Then, the statistical object corresponding to the first piece of real-time data is brand 1, and the statistical object corresponding to the second piece of real-time data is brand 2. Brand 1 is used as an index for the first piece of real-time data, and the index is set for the first piece of real-time data. Brand 2 is used as an index for the second piece of real-time data, which is set. When the real-time data of each statistical object is obtained, a first piece of real-time data with the brand 1 as an index is obtained from the data buffer area aiming at the brand 1, and a second piece of real-time data with the brand 2 as an index is obtained from the data buffer area aiming at the brand 2.
In the embodiment of the invention, the real-time data is recorded and stored in the data buffer area in an index mode to form a closed-loop data recording system.
In an embodiment of the present invention, the updating the statistical form according to the acquired real-time data corresponding to each statistical object includes:
Determining the items to be counted corresponding to each statistical object in the statistical report;
For each of the statistical objects, performing:
according to the acquired real-time data corresponding to the current statistical object, performing statistics on each item to be counted corresponding to the current statistical object, and generating statistical information of each item to be counted corresponding to the current statistical object;
and updating the statistical information of each item to be counted corresponding to the current statistical object into the statistical report.
In the embodiment of the present invention, after the real-time data corresponding to the statistical object is obtained from the data buffer, the real-time data may not be directly written into the statistical form, and the data required by the statistical form may be data obtained by performing statistical sorting on the real-time data. The items to be counted in the statistical report are the data required by the statistical report, when the real-time data is counted, the statistics can be performed for each item to be counted, and the statistical information generated after the statistics is updated to the corresponding items to be counted in the statistical report.
For example, one item to be counted 1 in the statistical report is the number of wine cans storing the current brand, one statistical object is the brand 1, and the real-time data corresponding to the brand 1 acquired from the data buffer area is the brand 1 and is stored in the wine cans 1, 3 and 4. For the item 1 to be counted, the real-time data cannot be directly written into the item 1 to be counted. And counting the to-be-counted item 1 corresponding to the brand 1 according to the piece of real-time data to obtain the statistical information of the to-be-counted item 1 corresponding to the brand 1, wherein the statistical information is 3 of the number of the wine cans storing the brand 1, and then writing the 3 into the statistical report under the to-be-counted item 1 corresponding to the brand 1.
In an embodiment of the present invention, the real-time data includes: the brand of the wine in each wine tank, the storage amount of the wine in each wine tank, the inlet and outlet states of the wine in each wine tank and the temperature of the wine in each wine tank;
The statistical object comprises: the brand of the wine;
The at least one query condition includes: in which wine cans each brand of wine is stored, the inventory of each brand of wine in the wine cans.
the method for processing data provided by the embodiment of the invention is described in detail below by taking a PLC in a winery as an example, and the method is applied to the PLC, and may include the following steps:
Step 201: the method comprises the steps of presetting a real-time report and a statistical report, and presetting at least one query condition according to the statistical report.
Specifically, the real-time report may be as shown in table 1.
TABLE 1
wine pot 1 wine pot 2 wine pot 3 Wine pot 4 Wine pot 5 wine pot 6 wine pot 7 wine pot 8 wine pot 9
brand 1 brand 19 brand 1 Brand 1 brand 6 brand 28 brand 24 Brand 14 brand 6
819 1391 4064 3717 2353 2320 4636 4202 2332
1.8 1.9 1.7 2.1 1.8 2.0 2.1 1.7 1.9
the first row of table 1 is the name of the wine tank, the second row is the name of the brand, the third row is the stock amount of wine in the wine tank (in hl, hl is hundred liters), the fourth row is the in and out state of wine in the wine tank ("↓" indicates in, and "↓" indicates in), and the fifth row is the temperature of wine in the wine tank (in degrees c).
Taking the first column as an example, the following information is included in the first column: the brand of the wine in the wine tank 1 is brand 1, the stock of the wine in the wine tank 1 is 819hl, the wine in the wine tank 1 is in a discharged state, and the temperature of the wine in the wine tank 1 is 1.8 ℃.
and real-time data such as freshness, pressure and the like can be added into the real-time report according to needs.
the statistics report may be as shown in table 2.
TABLE 2
in table 2, the first column indicates the brand name, the second column indicates the total amount of wine of the current brand, the third column indicates the number of wine tanks storing wine of the current brand, and the fourth and subsequent columns indicate information on the wine tanks storing wine of the current brand (specifically, the name of the wine tank, the amount of wine in the wine tank, and the in-out state of wine in the wine tank). And counting the items to be counted of the report when the second column, the third column, the fourth column and the columns after the fourth column are all. The total inventory of all wine (i.e. the sum of the second column of data), the total number of wine cans (i.e. the sum of the third column of data) may also be included in table 2.
taking the first row as an example, the first row contains the following information: total inventory of brand 1 wine was 8600 hl; the number of wine cans storing brand 1 wine is 3; the information of the wine tank 1 storing the brand 1 wine includes that the stock of the wine in the wine tank 1 is 819hl, and the wine in the wine tank 1 is in an out state; the information of the wine tank 3 storing the wine of brand 1 comprises that the stock of the wine in the wine tank 3 is 4064hl, and the wine in the wine tank 3 is in an advancing state; the information on the wine tank 4 storing the brand 1 wine includes that the amount of wine stored in the wine tank 4 is 3717hl, and the wine in the wine tank 4 is in the discharged state.
The at least one query condition includes: in which wine cans each brand of wine is stored, the inventory of each brand of wine in the wine cans.
step 202: and updating the real-time data acquired by the PLC in real time into a real-time report.
for example, after the last collection, a real-time report is formed as shown in table 1, and the temperature of the wine in the wine tank 1 obtained after the current collection is 2.0, then, in this step 202, the temperature of the wine in the wine tank 1 in the real-time report is updated from 1.8 to 2.0.
Step 203: and inquiring the real-time data corresponding to the at least one inquiry condition from the real-time report.
Specifically, the at least one query condition includes: in which wine cans each brand of wine is stored, the inventory of each brand of wine in the wine cans.
and inquiring each brand in turn according to the inquiry condition of the brand of each wine stored in which wine tanks, after all brands are inquired, inquiring each brand in turn according to the inquiry condition of the stock of each brand of wine in each wine tank, after all brands are inquired, inquiring again according to the inquiry condition of the brand of each wine stored in which wine tanks, and repeating the steps.
the real-time data is classified and sorted continuously through the step, and the real-time data in the data buffer area is updated continuously, so that the real-time data in the data buffer area is kept up to date.
Step 204: for each of the query conditions, performing: determining a statistical object corresponding to each piece of real-time data corresponding to the current query condition, taking the statistical object corresponding to each piece of real-time data as an index, setting the index for each piece of real-time data, and updating each piece of real-time data corresponding to the current query condition after the index is set into a data buffer area of the PLC.
for example, for the query condition that each brand of wine is stored in which wine cans, the following two pieces of real-time data are queried: brand 6 is stored in wine jar 5, brand 6 is stored in wine jar 9; two pieces of real-time data are inquired according to the inquiry condition of the stock of each brand of wine in the wine tank: the inventory of brand 6 in the wine tank 5 is 2353 and the inventory of brand 6 in the wine tank 9 is 2332. The statistical objects corresponding to the above four pieces of real-time data are brand 6, and brand 6 is used as an index of the four pieces of real-time data.
Step 205: for each of the statistical objects, performing: and acquiring real-time data which takes the current statistical object as an index from the real-time data corresponding to the at least one query condition in the data buffer area.
for example, for the statistical object of brand 6, real-time data indexed by brand 6 is obtained from the data cache, and the following real-time data can be obtained through the index of brand 6: the brand 6 is stored in the wine tank 5, the brand 6 is stored in the wine tank 9, the inventory of the brand 6 in the wine tank 5 is 2353, and the inventory of the brand 6 in the wine tank 9 is 2332.
Step 206: determining the items to be counted corresponding to each statistical object in the statistical report, and executing the following steps aiming at each statistical object: and counting each item to be counted corresponding to the current statistical object according to the acquired real-time data corresponding to the current statistical object, generating statistical information of each item to be counted corresponding to the current statistical object, and updating the statistical information of each item to be counted corresponding to the current statistical object into the statistical report.
for example, the items to be counted in table 2 include: the total amount of wine of the current brand, the number of wine tanks storing the wine of the current brand, and information on the wine tanks storing the wine of the current brand. Taking brand 6 as an example, the real-time data corresponding to brand 6 includes: the brand 6 is stored in the wine tank 5, the brand 6 is stored in the wine tank 9, the inventory of the brand 6 in the wine tank 5 is 2353, and the inventory of the brand 6 in the wine tank 9 is 2332. Aiming at the item to be counted, namely the total storage quantity of the wine of the current brand, calculating the sum of 2353 and 2332 to obtain the total storage quantity of the wine of the brand 6 as 4685, and writing 4685 into a cell corresponding to the brand 6 in the second column of the statistical report. Aiming at the item to be counted of the number of the wine cans storing the current brand of wine, the number of the wine cans storing the current brand of wine is calculated to be 2 according to the two pieces of real-time data of the brand 6 stored in the wine cans 5 and the brand 6 stored in the wine cans 9, and the 2 is written into the cell corresponding to the brand 6 in the third column in the statistical report.
Step 207: and sending the updated statistical report to the HMI for displaying.
in the production process of a winery, brewing and packaging can be carried out based on a statistical report and a real-time report, when the stock of a certain brand is low, a prompt is sent, and then a saccharification feeding plan is determined, wherein the saccharification feeding plan comprises a feeding brand, a feeding amount and the like, so that the concept of zero stock can be met, the shortest retention time of wine in a wine tank can be ensured, and the freshness of the wine can be kept to the maximum extent.
In the production process of the winery, the beer accounting and data statistics can be carried out between the wine cellar and the packaging area by using the PLC terminal for data processing. And reminding information of low stock quantity and the like provide first-hand data for the scheduling plan.
In the embodiment of the invention, the PLC terminal is used for carrying out millisecond processing speed to acquire data, the data are classified and counted to form a real-time report and a statistical report, and the statistical report is directly displayed on the HMI through the PLC, so that the real-time performance of the data displayed on the HMI is greatly improved.
As shown in fig. 3, an embodiment of the present invention provides a PLC including:
a saving unit 301, configured to save a real-time report, a statistical report, and at least one query condition set according to the statistical report;
The acquisition unit 302 is used for updating real-time data acquired by the PLC in real time into the real-time report;
The query unit 303 is configured to query the real-time data corresponding to the at least one query condition from the real-time report, and update the real-time data corresponding to the at least one query condition into a data buffer of the PLC;
an obtaining unit 304, configured to obtain, from the data buffer, real-time data corresponding to each statistical object in the statistical form;
a statistical unit 305, configured to update the statistical report according to the acquired real-time data corresponding to each statistical object;
And the sending unit 306 is configured to send the updated statistical form to the HMI for display.
In an embodiment of the present invention, the querying unit 303 is configured to perform:
a0: initializing i-1, j-1;
A1: inquiring real-time data corresponding to the ith statistical object from the real-time report, determining real-time data meeting the jth inquiry condition in the real-time data corresponding to the ith statistical object, and updating the real-time data meeting the jth inquiry condition into the data buffer area;
A2: judging whether i is equal to n, if so, executing A3, otherwise, executing A6;
A3: judging whether j waits for m, if so, executing A4, otherwise, executing A5;
A4: j 1, i 1, return a 1;
a5: j +1, i 1, return a 1;
A6: i ═ i +1, return a 1;
wherein n is the total number of the statistical objects, and m is the total number of the query conditions.
In an embodiment of the present invention, the querying unit 303 is configured to, for each query condition, perform:
Determining a statistical object corresponding to each piece of real-time data corresponding to the current query condition;
taking a statistical object corresponding to each piece of real-time data as an index, and setting the index for each piece of real-time data;
updating each piece of real-time data corresponding to the current query condition after the index is set into a data buffer area of the PLC;
the obtaining unit 304 is configured to, for each statistical object, perform:
And acquiring real-time data which takes the current statistical object as an index from the real-time data corresponding to the at least one query condition in the data buffer area.
in an embodiment of the present invention, the statistic unit 305 is configured to perform:
Determining the items to be counted corresponding to each statistical object in the statistical report;
For each of the statistical objects, performing:
according to the acquired real-time data corresponding to the current statistical object, performing statistics on each item to be counted corresponding to the current statistical object, and generating statistical information of each item to be counted corresponding to the current statistical object;
and updating the statistical information of each item to be counted corresponding to the current statistical object into the statistical report.
in an embodiment of the present invention, the real-time data includes: the brand of the wine in each wine tank, the storage amount of the wine in each wine tank, the inlet and outlet states of the wine in each wine tank and the temperature of the wine in each wine tank;
The statistical object comprises: the brand of the wine;
The at least one query condition includes: in which wine cans each brand of wine is stored, the inventory of each brand of wine in the wine cans.
as shown in fig. 4, an embodiment of the present invention provides a data processing system, including:
HMI 401 and PLC 402 as described in any of the embodiments of the present invention;
the PLC 402 is connected with the HMI 401;
the HMI 401 is configured to display the statistical report sent by the PLC 402.
in the embodiment of the invention, the PLC and the HMI can be connected through a serial port.
the process instrument system provided by the invention at least has the following beneficial effects:
1. In the embodiment of the invention, a real-time report and a statistical report are preset, a query condition is set according to the statistical report, real-time data required by updating the statistical report can be queried based on the query condition, the queried real-time data is stored in a data buffer area, real-time data corresponding to each statistical object is acquired from the data buffer area, the real-time data corresponding to each statistical object is updated to the statistical report after being counted, and the PLC directly sends the statistical report to the HMI for displaying. In the embodiment of the invention, the data processing process is completed in the PLC, and the processed data is directly sent to the HMI through the PLC without transmitting the data through the Internet, so that the data transmission delay is reduced, the real-time data updating is realized, and the production efficiency is improved.
2. in the embodiment of the present invention, after the real-time data corresponding to the query condition is stored in the data buffer, the real-time data corresponding to each statistical object is obtained from the real-time data corresponding to the at least one query condition in the data buffer, and then the obtained real-time data can be counted according to the statistical report to generate the data required by the statistical report. In the process of determining the real-time data corresponding to the query condition and the process of acquiring the real-time data corresponding to the statistical object, the real-time data is classified and sorted, and the real-time data is counted after the classification and sorting, so that the real-time data is easier to calculate, the calculation amount is smaller, and the load of the PLC is greatly reduced.
3. In the embodiment of the invention, the query conditions are queried one by one, rather than two or more query conditions in parallel, the query mode can reduce the load of the PLC and ensure the smooth operation of the PLC.
4. In the embodiment of the invention, when the real-time data is written into the data buffer area, the statistical object corresponding to each piece of real-time data is used as the index, and when the real-time data corresponding to each statistical object is acquired in the data buffer area, the statistical object is directly used as the index to search the real-time data corresponding to the statistical object, so that the speed of acquiring the data from the data buffer area can be greatly increased, and the load of a PLC (programmable logic controller) is reduced.
it is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other similar elements in a process, method, article, or apparatus that comprises the element.
finally, it is to be noted that: the above description is only a preferred embodiment of the present invention, and is only used to illustrate the technical solutions of the present invention, and not to limit the protection scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (11)

1. a data processing method is characterized in that the method is applied to a Programmable Logic Controller (PLC), a real-time report and a statistical report are preset, and at least one query condition is preset according to the statistical report;
the data processing method comprises the following steps:
Updating the real-time data acquired by the PLC in real time into the real-time report;
inquiring real-time data corresponding to the at least one inquiry condition from the real-time report;
updating the real-time data corresponding to the at least one query condition into a data buffer of the PLC;
acquiring real-time data corresponding to each statistical object in the statistical form from the data buffer area;
updating the statistical report according to the acquired real-time data corresponding to each statistical object;
and sending the updated statistical form to a human-machine interface HMI for displaying.
2. the method of claim 1,
the querying the real-time data corresponding to the at least one query condition from the real-time report, and storing the real-time data corresponding to the at least one query condition into a data buffer of the PLC includes:
a0: initializing i-1, j-1;
a1: inquiring real-time data corresponding to the ith statistical object from the real-time report, determining real-time data meeting the jth inquiry condition in the real-time data corresponding to the ith statistical object, and updating the real-time data meeting the jth inquiry condition into the data buffer area;
a2: judging whether i is equal to n, if so, executing A3, otherwise, executing A6;
a3: judging whether j waits for m, if so, executing A4, otherwise, executing A5;
a4: j 1, i 1, return a 1;
a5: j +1, i 1, return a 1;
a6: i ═ i +1, return a 1;
Wherein n is the total number of the statistical objects, and m is the total number of the query conditions.
3. the method of claim 1,
The updating the real-time data corresponding to the at least one query condition to the data buffer of the PLC includes:
For each of the query conditions, performing:
Determining a statistical object corresponding to each piece of real-time data corresponding to the current query condition;
taking a statistical object corresponding to each piece of real-time data as an index, and setting the index for each piece of real-time data;
Updating each piece of real-time data corresponding to the current query condition after the index is set into a data buffer area of the PLC;
the obtaining of the real-time data corresponding to each statistical object in the statistical form from the data buffer includes:
for each of the statistical objects, performing:
And acquiring real-time data which takes the current statistical object as an index from the real-time data corresponding to the at least one query condition in the data buffer area.
4. The method of claim 1,
updating the statistical report according to the acquired real-time data corresponding to each statistical object, including:
determining the items to be counted corresponding to each statistical object in the statistical report;
For each of the statistical objects, performing:
according to the acquired real-time data corresponding to the current statistical object, performing statistics on each item to be counted corresponding to the current statistical object, and generating statistical information of each item to be counted corresponding to the current statistical object;
and updating the statistical information of each item to be counted corresponding to the current statistical object into the statistical report.
5. the method according to any one of claims 1 to 4,
the real-time data comprises: the brand of the wine in each wine tank, the storage amount of the wine in each wine tank, the inlet and outlet states of the wine in each wine tank and the temperature of the wine in each wine tank;
the statistical object comprises: the brand of the wine;
the at least one query condition includes: in which wine cans each brand of wine is stored, the inventory of each brand of wine in the wine cans.
6. a programmable logic controller, PLC, comprising:
the device comprises a storage unit (301) for storing a real-time report, a statistical report and at least one query condition set according to the statistical report;
the acquisition unit (302) is used for updating real-time data acquired by the PLC in real time into the real-time report;
the query unit (303) is used for querying the real-time data corresponding to the at least one query condition from the real-time report and updating the real-time data corresponding to the at least one query condition into a data buffer area of the PLC;
an obtaining unit (304) for obtaining real-time data corresponding to each statistical object in the statistical form from the data buffer;
a statistical unit (305) for updating the statistical report according to the acquired real-time data corresponding to each statistical object;
And the sending unit (306) is used for sending the updated statistical form to a human-machine interface HMI for displaying.
7. the PLC of claim 6,
the querying unit (303) is configured to perform:
A0: initializing i-1, j-1;
A1: inquiring real-time data corresponding to the ith statistical object from the real-time report, determining real-time data meeting the jth inquiry condition in the real-time data corresponding to the ith statistical object, and updating the real-time data meeting the jth inquiry condition into the data buffer area;
A2: judging whether i is equal to n, if so, executing A3, otherwise, executing A6;
a3: judging whether j waits for m, if so, executing A4, otherwise, executing A5;
a4: j 1, i 1, return a 1;
a5: j +1, i 1, return a 1;
A6: i ═ i +1, return a 1;
wherein n is the total number of the statistical objects, and m is the total number of the query conditions.
8. the PLC of claim 6,
The query unit (303) is configured to, for each query condition, perform:
Determining a statistical object corresponding to each piece of real-time data corresponding to the current query condition;
taking a statistical object corresponding to each piece of real-time data as an index, and setting the index for each piece of real-time data;
updating each piece of real-time data corresponding to the current query condition after the index is set into a data buffer area of the PLC;
the acquisition unit (304) is configured to, for each of the statistical objects, perform:
And acquiring real-time data which takes the current statistical object as an index from the real-time data corresponding to the at least one query condition in the data buffer area.
9. The PLC of claim 6,
the statistical unit (305) is configured to perform:
determining the items to be counted corresponding to each statistical object in the statistical report;
for each of the statistical objects, performing:
According to the acquired real-time data corresponding to the current statistical object, performing statistics on each item to be counted corresponding to the current statistical object, and generating statistical information of each item to be counted corresponding to the current statistical object;
and updating the statistical information of each item to be counted corresponding to the current statistical object into the statistical report.
10. The PLC of any of claims 6-9,
the real-time data comprises: the brand of the wine in each wine tank, the storage amount of the wine in each wine tank, the inlet and outlet states of the wine in each wine tank and the temperature of the wine in each wine tank;
the statistical object comprises: the brand of the wine;
the at least one query condition includes: in which wine cans each brand of wine is stored, the inventory of each brand of wine in the wine cans.
11. A data processing system, comprising:
A human machine interface HMI (401) and a programmable logic controller PLC (402) according to any of claims 6 to 10;
The PLC (402) is connected with the HMI (401);
the HMI (401) is used for displaying the statistical report sent by the PLC (402).
CN201910840694.2A 2019-09-06 2019-09-06 Data processing method, programmable logic controller and data processing system Pending CN110555044A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910840694.2A CN110555044A (en) 2019-09-06 2019-09-06 Data processing method, programmable logic controller and data processing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910840694.2A CN110555044A (en) 2019-09-06 2019-09-06 Data processing method, programmable logic controller and data processing system

Publications (1)

Publication Number Publication Date
CN110555044A true CN110555044A (en) 2019-12-10

Family

ID=68739314

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910840694.2A Pending CN110555044A (en) 2019-09-06 2019-09-06 Data processing method, programmable logic controller and data processing system

Country Status (1)

Country Link
CN (1) CN110555044A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114715453A (en) * 2022-03-28 2022-07-08 西门子(中国)有限公司 Valve array control method, valve array control device, conveying system, electronic equipment and storage medium

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1510890A (en) * 2002-12-26 2004-07-07 华为技术有限公司 Statistical method for realtime business information
CN101770232A (en) * 2009-08-25 2010-07-07 上海市离心机械研究所有限公司 Data access method of compressed configuration software variable
CN102854870A (en) * 2012-05-09 2013-01-02 上海西门子工业自动化有限公司 Distributed control system and data report generating method
CN103310660A (en) * 2013-06-27 2013-09-18 苏州创智宏云信息科技有限公司 Intelligent carport monitoring system in parking lot
CN103454987A (en) * 2012-05-31 2013-12-18 建大橡胶(中国)有限公司 Tire vulcanization group control system
CN104850105A (en) * 2015-05-15 2015-08-19 大连海事大学 Remote monitoring system for ship waste gas desulfurization and denitrification process
CN204818477U (en) * 2015-06-29 2015-12-02 东南(福建)汽车工业有限公司 Car technology robot welding monitored control system that counts
CN106200546A (en) * 2016-09-09 2016-12-07 聊城职业技术学院 Switch board electronic component searching system and control method thereof
CN107728575A (en) * 2017-12-06 2018-02-23 成都量之星科技有限公司 A kind of control system of the power station wastewater treatment based on PLC
CN108427772A (en) * 2018-04-10 2018-08-21 携程商旅信息服务(上海)有限公司 Online report form generation method, system, equipment and storage medium
CN109214723A (en) * 2018-11-13 2019-01-15 中国兵器装备集团自动化研究所 A kind of intelligent manufacturing cell integrated monitoring system

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1510890A (en) * 2002-12-26 2004-07-07 华为技术有限公司 Statistical method for realtime business information
CN101770232A (en) * 2009-08-25 2010-07-07 上海市离心机械研究所有限公司 Data access method of compressed configuration software variable
CN102854870A (en) * 2012-05-09 2013-01-02 上海西门子工业自动化有限公司 Distributed control system and data report generating method
CN103454987A (en) * 2012-05-31 2013-12-18 建大橡胶(中国)有限公司 Tire vulcanization group control system
CN103310660A (en) * 2013-06-27 2013-09-18 苏州创智宏云信息科技有限公司 Intelligent carport monitoring system in parking lot
CN104850105A (en) * 2015-05-15 2015-08-19 大连海事大学 Remote monitoring system for ship waste gas desulfurization and denitrification process
CN204818477U (en) * 2015-06-29 2015-12-02 东南(福建)汽车工业有限公司 Car technology robot welding monitored control system that counts
CN106200546A (en) * 2016-09-09 2016-12-07 聊城职业技术学院 Switch board electronic component searching system and control method thereof
CN107728575A (en) * 2017-12-06 2018-02-23 成都量之星科技有限公司 A kind of control system of the power station wastewater treatment based on PLC
CN108427772A (en) * 2018-04-10 2018-08-21 携程商旅信息服务(上海)有限公司 Online report form generation method, system, equipment and storage medium
CN109214723A (en) * 2018-11-13 2019-01-15 中国兵器装备集团自动化研究所 A kind of intelligent manufacturing cell integrated monitoring system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114715453A (en) * 2022-03-28 2022-07-08 西门子(中国)有限公司 Valve array control method, valve array control device, conveying system, electronic equipment and storage medium
CN114715453B (en) * 2022-03-28 2024-02-06 西门子(中国)有限公司 Valve array control method, device, conveying system, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US10726026B2 (en) Dynamic sustainability search engine
CN103092856A (en) Search result ordering method, search result ordering equipment, searing method and searching equipment
CN108920498B (en) Data query method, device and equipment
CN110704486B (en) Data processing method, device, system, storage medium and server
CN110555044A (en) Data processing method, programmable logic controller and data processing system
CN113052651A (en) Intelligent retail management method and system based on big data
CN111125128A (en) Cache updating method, device and system
CN110503456B (en) Fresh product production guiding method and system
CN105956037A (en) Factory database system
CN104835067A (en) Real-time bidding system of network advertisement
CN113554400A (en) Inventory data updating method, device, equipment and storage medium
US10922680B2 (en) Method of processing card number data and device
CN112579629A (en) Method for helping purchasers of electronic component enterprises to accurately find products
CN108073464A (en) A kind of time series data abnormal point detecting method and device based on speed and acceleration
CN108255819A (en) A kind of value-added tax data integration method and system based on analysis tool SPARK
CN112488771B (en) Method, apparatus, device and storage medium for automatically setting commodity price
CN114912668A (en) Fund price prediction system and application
US20100268748A1 (en) System and method of updating supplier information
CN114549125A (en) Item recommendation method and device, electronic equipment and computer-readable storage medium
CN113407587A (en) Data processing method, device and equipment for online analysis processing engine
CN113177036A (en) Storage method, query method and display method of monitoring data
CN112016866A (en) Order data processing method and device, electronic equipment and readable medium
CN117436936B (en) Sales prediction and BOM finished product processing system and method
CN106919683B (en) Method and system for quickly querying data
US20120265781A1 (en) Semantics-based information input

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20191210