CN-121979927-A - Method and related system for rapid data statistics of industrial time sequence data
Abstract
The invention belongs to the field of database maintenance, and discloses a method and a related system for rapid data statistics of industrial time sequence data, which are characterized in that a client data statistics request is analyzed, a label and a statistics task are extracted, the standardization and the structuring of the statistical logic are realized, semantic differences of different databases in the aspects of statistical functions, aggregation rules, time window definition and the like are avoided, and the statistical tasks can be executed in a unified logic model. The invention divides the statistical task into a plurality of time periods according to the time region, so that the system can independently execute the statistical operation in different time windows. The sectional calculation not only improves the parallel calculation efficiency, but also avoids deviation caused by different time index precision of the bottom layer of the database, and effectively ensures the consistency and comparability of the statistical result.
Inventors
- LI XINBIN
- WANG ZHIXIANG
- LIU TAO
- YANG BIN
- SUN CHONGWU
- WANG BINGLI
- ZHOU LIWEI
- HE QING
- HAN XIUQING
- LI XUELI
Assignees
- 华能国际电力股份有限公司日照电厂
- 西安热工研究院有限公司
- 华能山东发电有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260114
Claims (10)
- 1. A method for rapid data statistics of industrial time series data, comprising the steps of: Acquiring a data statistics request of a client, and analyzing the data statistics request to obtain a tag name and a statistics task of the data statistics request; Dividing a statistical task into a plurality of time periods according to the required time region, and inquiring statistical values in a historical library according to the mark and the time periods to form corresponding statistical values of different time periods; combining the corresponding statistical values of different time periods to obtain a final statistical value, and packaging the final statistical value, the time region and the tag name into a statistical result; And sending the statistical result to the target client.
- 2. The method for rapid data statistics of industrial time series data according to claim 1, wherein after obtaining the data statistics request of the client, task statistics queuing is performed on the data statistics request; when the data statistics request is analyzed, the data statistics request is acquired from the task statistics queue for analysis.
- 3. The method for rapid statistics of industrial time series data according to claim 1, wherein the statistical task is divided into a plurality of time periods according to the required time region, the statistical value query is performed in the history base according to the label and the time periods, and when corresponding statistical values of different time periods are formed, if there are no values in the statistical values: Packing the time period and the tag name with the non-existing statistic value into a calculation task group, and calculating the calculation task group to obtain the statistic value; if the time period of the statistic value meets the requirement of storing the statistic history library, packaging the statistic value, the time period and the tag name, storing the packaged statistic value, the time period and the tag name into the statistic history library, merging the corresponding statistic values of different time periods to obtain a final statistic value, and packaging the final statistic value, the time region and the tag name into a statistic result; If the time period of the statistic value does not meet the requirement of the stored statistic history library, packaging the statistic value, the time period and the tag name, carrying out data statistics, combining the corresponding statistic values of different time periods to obtain a final statistic value, and packaging the final statistic value, the time region and the tag name into a statistic result.
- 4. The method for rapid data statistics of industrial time series data according to claim 1, wherein the tag name is traversed regularly, and the statistics history base is interacted with to obtain the statistics value of whether the latest time period needs to be added; if yes, packing the time period and the tag name into a statistics task package, calculating the statistics task package, and storing the calculated value into a statistics history library.
- 5. The method for rapid data statistics of industrial time series data according to claim 4, wherein after the time period and the tag name are packed into a statistics task packet, the statistics task packet is subjected to statistics task queuing, and the statistics task packet is obtained from the statistics task queuing and sent to an idle calculation thread for calculation, so as to obtain a calculation value.
- 6. A system for rapid data statistics of industrial time series data, comprising: The data analysis module is used for acquiring the data statistics request of the client, analyzing the data statistics request and obtaining the tag name and the statistics task of the data statistics request; the data statistics module is used for dividing a statistics task into a plurality of time periods according to the required time region, and inquiring the statistics values in the history base according to the mark and the time periods to form corresponding statistics values of different time periods; The data packaging module is used for combining the corresponding statistical values of different time periods to obtain a final statistical value, and packaging the final statistical value, the time region and the tag name into a statistical result; and the data forwarding module is used for sending the statistical result to the target client.
- 7. The system for rapid data statistics of industrial time series data according to claim 6 further comprising a statistics value storage module for dividing the statistics task into a plurality of time periods according to the required time region, and performing statistics value inquiry in the historian according to the label and the time periods to form corresponding statistics values of different time periods, wherein if there is no value in the statistics values: The method comprises the steps of packaging a time period and a tag name, in which a statistic value does not exist, into a calculation task group, calculating the calculation task group to obtain the statistic value, packaging the statistic value, the time period and the tag name if the time period of the statistic value meets a storage statistic history base, storing the statistic value, the time period and the tag name into a statistic history base, combining the corresponding statistic values of different time periods to obtain a final statistic value, packaging the final statistic value, the time region and the tag name into a statistic result, packaging the statistic value, the time period and the tag name if the time period of the statistic value does not meet the storage statistic history base, carrying out data statistics, combining the corresponding statistic values of different time periods to obtain the final statistic value, and packaging the final statistic value, the time region and the tag name into the statistic result.
- 8. The system for rapid data statistics of industrial time series data according to claim 6 further comprising a tag signature supplementing module for traversing tag names and interacting with a statistics historian to obtain statistics values of whether the latest time period needs to be added, if so, packaging the time period and the tag names into a statistics task package, calculating the statistics task package, and storing the calculated values into the statistics historian.
- 9. An electronic device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, carries out the steps of a method of fast data statistics of industrial time series data according to any one of claims 1 to 5.
- 10. A storage medium having stored thereon a computer program, which when executed by a processor performs the steps of a method of fast data statistics of industrial time series data according to any of claims 1to 5.
Description
Method and related system for rapid data statistics of industrial time sequence data Technical Field The invention belongs to the field of database maintenance, and particularly relates to a method and a related system for rapid data statistics of industrial time sequence data. Background With the rapid development of industrial internet and intelligent manufacturing, industrial sites generate huge amounts of time series data. The data are derived from various sensors, controllers, PLC equipment, SCADA systems and the like, and have the advantages of high sampling frequency, multiple dimensions and strong timeliness. In order to realize functions such as equipment state monitoring, energy consumption analysis, production optimization, fault early warning and the like, enterprises commonly adopt a time sequence Database (TIME SERIES Database, TSDB) to store and manage the data. There are a variety of industrial time series database products on the market, such as InfluxDB, timescaleDB, openTSDB, TDengine, which are characterized in terms of data storage, compression, retrieval, computation, etc. However, in practical applications, enterprises often need to integrate data from different data sources in the same system and perform unified data statistics and analysis. Because the supporting modes of the data bases on the statistical calculation are different, the calculation method, the calculation speed, the calculation precision and the calculation result are different. For example, some databases use window aggregation functions based on SQL extensions, and some use streaming computing frameworks or built-in computing engines, and different implementations may deviate from the statistics of the same dataset in different databases. Furthermore, the statistical function of part of the database is only used as an auxiliary module, mainly serving the data display or visualization, and is not oriented to the large-scale industrial data statistical task. This makes it difficult to guarantee consistency, repeatability and performance of data statistics in a multi-system, multi-data source industrial scenario. When the enterprise performs cross-system statistics or comparison analysis, a large amount of manpower is required to perform data export, preprocessing and secondary calculation, so that the data processing cost is increased, and the reliability of a statistics result is reduced. Disclosure of Invention The invention aims to eliminate calculation difference among different databases and provides a method and a related system for quick data statistics of industrial time series data. In order to achieve the above purpose, the invention adopts the following technical scheme: in a first aspect, the present invention provides a method for rapid data statistics of industrial time series data, comprising the steps of: Acquiring a data statistics request of a client, and analyzing the data statistics request to obtain a tag name and a statistics task of the data statistics request; Dividing a statistical task into a plurality of time periods according to the required time region, and inquiring statistical values in a historical library according to the mark and the time periods to form corresponding statistical values of different time periods; combining the corresponding statistical values of different time periods to obtain a final statistical value, and packaging the final statistical value, the time region and the tag name into a statistical result; And sending the statistical result to the target client. The invention is further improved in that after the data statistics request of the client is obtained, task statistics queuing is carried out on the data statistics request; when the data statistics request is analyzed, the data statistics request is acquired from the task statistics queue for analysis. The invention is further improved in that the statistical task is divided into a plurality of time periods according to the required time region, the statistical value inquiry is carried out in the history base according to the label and the time periods, when corresponding statistical values of different time periods are formed, if the statistical values have non-existing values: Packing the time period and the tag name with the non-existing statistic value into a calculation task group, and calculating the calculation task group to obtain the statistic value; if the time period of the statistic value meets the requirement of storing the statistic history library, packaging the statistic value, the time period and the tag name, storing the packaged statistic value, the time period and the tag name into the statistic history library, merging the corresponding statistic values of different time periods to obtain a final statistic value, and packaging the final statistic value, the time region and the tag name into a statistic result; If the time period of the statistic value does not meet the requirement of the