[go: up one dir, main page]

CN107798009A - Data aggregation method, apparatus and system - Google Patents

Data aggregation method, apparatus and system Download PDF

Info

Publication number
CN107798009A
CN107798009A CN201610795892.8A CN201610795892A CN107798009A CN 107798009 A CN107798009 A CN 107798009A CN 201610795892 A CN201610795892 A CN 201610795892A CN 107798009 A CN107798009 A CN 107798009A
Authority
CN
China
Prior art keywords
data
business datum
aggregation
timestamp
aggregate
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
CN201610795892.8A
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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201610795892.8A priority Critical patent/CN107798009A/en
Publication of CN107798009A publication Critical patent/CN107798009A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/21Design, administration or maintenance of databases
    • G06F16/215Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2477Temporal data queries

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Fuzzy Systems (AREA)
  • Quality & Reliability (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

本发明公开了一种数据聚合方法、装置及系统,涉及信息技术领域,可以提高数据聚合的效率,还可以解决数据聚合操作存在延迟的问题,进而保证数据聚合的实时性。本发明的主要技术方案为:当需要对云环境中存储的海量业务数据按照一定周期进行聚合时,首先从数据收集器获取所述数据收集器当前接收到的业务数据,然后判断所述时间戳是否大于当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点,若大于,则将保存的时间戳为所述聚合触发时间点的业务数据进行聚合。本发明主要用于对云环境中的海量业务数据进行聚合。

The invention discloses a data aggregation method, device and system, which relate to the field of information technology, can improve the efficiency of data aggregation, and can also solve the problem of delay in data aggregation operations, thereby ensuring the real-time performance of data aggregation. The main technical solution of the present invention is: when it is necessary to aggregate the massive business data stored in the cloud environment according to a certain period, first obtain the business data currently received by the data collector from the data collector, and then judge the time stamp Whether it is greater than the aggregation trigger time point corresponding to the first preset period when data aggregation is currently required, and if it is greater than, aggregate the business data with the saved timestamp as the aggregation trigger time point. The invention is mainly used for aggregating massive business data in the cloud environment.

Description

数据聚合方法、装置及系统Data aggregation method, device and system

技术领域technical field

本发明涉及信息技术领域,尤其涉及一种数据聚合方法、装置及系统。The present invention relates to the field of information technology, in particular to a data aggregation method, device and system.

背景技术Background technique

随着互联网的不断发展,在云环境下进行业务数据的存储与统计也越来越普遍。例如,对QPS(Query Per Second,每秒查询率)、PV(Page View,页面浏览量)等不同类别的业务数据进行存储与统计,具体过程可以如图11所示,首先将流式的海量数据存入文件或其他存储介质中,然后每隔一段时间读取文件,将文件内容采用MapReduce的方式进行计算。由于在云环境下存储的数据量很大,因此在对云环境中存储的海量业务数据进行统计时,需要对海量的业务数据进行聚合。With the continuous development of the Internet, the storage and statistics of business data in the cloud environment are becoming more and more common. For example, to store and count different types of business data such as QPS (Query Per Second), PV (Page View, page views), the specific process can be shown in Figure 11. The data is stored in files or other storage media, and then the files are read at regular intervals, and the contents of the files are calculated using MapReduce. Since the amount of data stored in the cloud environment is large, it is necessary to aggregate the massive business data when performing statistics on the massive business data stored in the cloud environment.

目前,在对云环境中存储的海量业务数据进行聚合时,首先将不同时间段接收到的业务数据写入到文件中,然后从文件中读取需要聚合的某一类别的全部业务数据,最后将读取的业务数据按照时间进行排序后进行数据聚合。然而,由于在进行数据聚合时,需要对文件进行读写操作,而为了解决进行文件读写操作过程中存在的文件锁冲突的问题,会在数据聚合时进行一次保存有待聚合数据的文件复制过程,从而造成数据计算的延迟较高;并且由于还需要将读取的业务数据按照时间进行一次排序,从而造成数据聚合的过程较为繁琐,数据聚合操作的效率较低,数据聚合操作延迟较高。At present, when aggregating massive business data stored in the cloud environment, first write the business data received in different time periods into files, then read all the business data of a certain category that needs to be aggregated from the files, and finally The read business data is sorted by time and then aggregated. However, since data aggregation requires reading and writing operations on files, in order to solve the problem of file lock conflicts in the process of file reading and writing operations, a file copy process for saving the data to be aggregated will be performed during data aggregation. , resulting in a high delay in data calculation; and because it is necessary to sort the read business data according to time, the process of data aggregation is cumbersome, the efficiency of data aggregation operation is low, and the delay of data aggregation operation is high.

发明内容Contents of the invention

有鉴于此,本发明实施例提供一种数据聚合方法、装置及系统,主要目的是解决在对云环境中存储的海量业务数据进行聚合时存在数据聚合操作延迟较高的问题。In view of this, embodiments of the present invention provide a data aggregation method, device, and system, the main purpose of which is to solve the problem of high delay in data aggregation operations when aggregating massive business data stored in a cloud environment.

为达到上述目的,本发明提供如下技术方案:To achieve the above object, the present invention provides the following technical solutions:

一方面,本发明提供一种数据聚合方法,包括:In one aspect, the present invention provides a data aggregation method, comprising:

当按照第一预置周期进行数据聚合时,从数据收集器获取所述数据收集器当前接收到的业务数据,所述业务数据携带有时间戳,所述时间戳用于标识所述数据收集器接收到所述业务数据的时间;When data aggregation is performed according to the first preset period, the business data currently received by the data collector is obtained from the data collector, the business data carries a time stamp, and the time stamp is used to identify the data collector The time when the business data is received;

判断所述时间戳是否大于当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点,所述第一预置周期对应多个聚合触发时间点,所述多个聚合触发时间点分别对应的时间逐个递增;Judging whether the timestamp is greater than the aggregation trigger time point corresponding to the first preset period when data aggregation is currently required, the first preset period corresponds to multiple aggregation trigger time points, and the multiple aggregation trigger time points The corresponding time increases one by one;

若是,则将保存的时间戳为当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点的业务数据进行聚合。If yes, aggregate the saved time stamp as the service data at the aggregation trigger time point corresponding to the first preset period when data aggregation is currently required.

另一方面,本发明提供一种数据收集方法,包括:In another aspect, the present invention provides a data collection method, comprising:

接收待聚合的业务数据;Receive business data to be aggregated;

为所述业务数据配置时间戳,所述时间戳用于标识所述数据收集器接收到所述业务数据的时间,configuring a time stamp for the business data, where the time stamp is used to identify the time when the data collector receives the business data,

以使得分析聚合服务器获取所述业务数据并根据所述业务数据的时间戳进行数据聚合。so that the analysis and aggregation server acquires the service data and performs data aggregation according to the time stamp of the service data.

再一方面,本发明提供一种聚合数据查询方法,包括:In yet another aspect, the present invention provides a method for querying aggregated data, including:

向分析聚合服务器发送数据上报指令,所述数据上报指令中携带有需要进行数据聚合的业务数据,以使得分析聚合服务器根据数据收集器接收到所述业务数据的时间和预置聚合触发时间点,按照预置周期对需要进行数据聚合的业务数据进行数据聚合;sending a data reporting instruction to the analysis and aggregation server, the data reporting instruction carrying business data that needs to be aggregated, so that the analysis and aggregation server receives the business data according to the time of the data collector and the preset aggregation trigger time point, Carry out data aggregation for the business data that needs to be aggregated according to the preset cycle;

向所述分析聚合服务器发送数据聚合结果查询指令,所述数据查询指令中携带有待查询业务数据的时间信息;Sending a data aggregation result query instruction to the analysis aggregation server, the data query instruction carrying time information of service data to be queried;

接收与所述时间信息对应的数据聚合结果并进行显示。The data aggregation result corresponding to the time information is received and displayed.

又一方面,本发明提供一种数据聚合装置,包括:In another aspect, the present invention provides a data aggregation device, comprising:

获取单元,用于当按照第一预置周期进行数据聚合时,从数据收集器获取所述数据收集器当前接收到的业务数据,所述业务数据携带有时间戳,所述时间戳用于标识所述数据收集器接收到所述业务数据的时间;An acquisition unit, configured to acquire from the data collector the business data currently received by the data collector when the data aggregation is performed according to the first preset period, the business data carries a time stamp, and the time stamp is used to identify The time when the data collector receives the business data;

判断单元,用于判断所述获取单元获取的所述时间戳是否大于当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点,所述第一预置周期对应多个聚合触发时间点,所述多个聚合触发时间点分别对应的时间逐个递增;A judging unit, configured to judge whether the timestamp acquired by the acquiring unit is greater than the aggregation trigger time point corresponding to the first preset period when data aggregation is currently required, and the first preset period corresponds to multiple aggregation triggers Time points, the times corresponding to the plurality of aggregation trigger time points are incremented one by one;

聚合单元,用于若所述判断单元确定大于当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点,则将保存的时间戳为所述聚合触发时间点的业务数据进行聚合。The aggregation unit is configured to aggregate the business data with the saved time stamp as the aggregation trigger time point if the judging unit determines that it is greater than the aggregation trigger time point corresponding to the first preset period when data aggregation is currently required .

又一方面,本发明提供一种数据收集装置,包括:In yet another aspect, the present invention provides a data collection device, comprising:

接收单元,用于接收待聚合的业务数据;a receiving unit, configured to receive service data to be aggregated;

配置单元,用于为所述业务数据配置时间戳,所述时间戳用于标识所述数据收集器接收到所述业务数据的时间,a configuration unit, configured to configure a time stamp for the service data, where the time stamp is used to identify the time when the data collector receives the service data,

以使得分析聚合服务器获取所述业务数据并根据所述业务数据的时间戳进行数据聚合。so that the analysis and aggregation server acquires the service data and performs data aggregation according to the time stamp of the service data.

又一方面,本发明提供一种聚合数据查询装置,包括:In yet another aspect, the present invention provides an aggregated data query device, comprising:

发送单元,用于向分析聚合服务器发送数据上报指令,所述数据上报指令中携带有需要进行数据聚合的业务数据,以使得分析聚合服务器根据数据收集器接收到所述业务数据的时间和预置聚合触发时间点,按照预置周期对需要进行数据聚合的业务数据进行数据聚合;A sending unit, configured to send a data reporting instruction to the analysis and aggregation server, the data reporting instruction carries business data that needs to be aggregated, so that the analysis and aggregation server receives the business data according to the time and preset time of the data collector Aggregation trigger time point, data aggregation is performed on the business data that needs to be aggregated according to the preset cycle;

所述发送单元,还用于向所述分析聚合服务器发送数据聚合结果查询指令,所述数据查询指令中携带有待查询业务数据的时间信息;The sending unit is further configured to send a data aggregation result query instruction to the analysis aggregation server, where the data query instruction carries time information of service data to be queried;

接收单元,用于接收与所述时间信息对应的数据聚合结果并进行显示。The receiving unit is configured to receive and display the data aggregation result corresponding to the time information.

又一方面,本发明提供一种数据聚合系统,包括:数据收集器和分析聚合服务器;In yet another aspect, the present invention provides a data aggregation system, including: a data collector and an analysis aggregation server;

所述数据收集器,用于接收到业务数据时,为所述业务数据配置时间戳,并将所述业务数据和所述业务数据的时间戳进行保存;The data collector is configured to configure a time stamp for the business data when receiving the business data, and save the business data and the time stamp of the business data;

所述分析聚合服务器,用于当按照第一预置周期进行数据聚合时,从数据收集器获取所述数据收集器当前接收到的业务数据,所述业务数据携带有时间戳;The analysis aggregation server is configured to obtain from the data collector the business data currently received by the data collector when the data aggregation is performed according to the first preset period, and the business data carries a time stamp;

所述分析聚合服务器,还用于判断所述时间戳是否大于当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点,所述第一预置周期对应多个聚合触发时间点,所述多个聚合触发时间点分别对应的时间逐个递增;The analysis and aggregation server is further configured to determine whether the timestamp is greater than the aggregation trigger time point corresponding to the first preset period when data aggregation is currently required, and the first preset period corresponds to multiple aggregation trigger time points , the times corresponding to the plurality of aggregation trigger time points are incremented one by one;

若是,则将保存的时间戳为所述聚合触发时间点的业务数据进行聚合。If yes, aggregate the saved timestamp as the service data at the aggregation trigger time point.

借由上述技术方案,本发明实施例提供的技术方案至少具有下列优点:With the above technical solutions, the technical solutions provided by the embodiments of the present invention have at least the following advantages:

本发明实施例提供的一种数据聚合方法、装置及系统,当需要对云环境中存储的海量业务数据按照一定周期进行聚合时,首先从数据收集器获取所述数据收集器当前接收到的业务数据,然后判断所述时间戳是否大于当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点,若大于,则将保存的时间戳为所述聚合触发时间点的业务数据进行聚合。与目前在对云环境中存储的海量业务数据进行聚合时,都需要对用于存储业务数据的文件进行读写操作,并且还需要将读取的业务数据按照时间进行一次排序相比,本发明由于只需要通过检测当前业务数据的时间戳是否大于当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点,即可实现对不同时间段的业务数据进行聚合,提高数据聚合的效率,并且由于检测操作是实时进行的,可以降低数据聚合操作的延迟,同时可以提高数据聚合的实时性。In the data aggregation method, device and system provided by the embodiments of the present invention, when it is necessary to aggregate the massive business data stored in the cloud environment according to a certain period, first obtain the business data currently received by the data collector from the data collector data, and then determine whether the time stamp is greater than the aggregation trigger time point corresponding to the first preset period when data aggregation is currently required, and if it is greater than, then save the time stamp as the business data at the aggregation trigger time point polymerization. Compared with the current aggregation of massive business data stored in the cloud environment, it is necessary to read and write files used to store business data, and also need to sort the read business data according to time, the present invention Since it is only necessary to detect whether the timestamp of the current business data is greater than the aggregation trigger time point corresponding to the first preset period when data aggregation is currently required, the aggregation of business data in different time periods can be realized, and the efficiency of data aggregation can be improved. Efficiency, and since the detection operation is performed in real time, the delay of the data aggregation operation can be reduced, and the real-time performance of the data aggregation can be improved at the same time.

上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention, it can be implemented according to the contents of the description, and in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable , the specific embodiments of the present invention are enumerated below.

附图说明Description of drawings

通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiment. The drawings are only for the purpose of illustrating a preferred embodiment and are not to be considered as limiting the invention. Also throughout the drawings, the same reference numerals are used to designate the same components. In the attached picture:

图1示出了本发明实施例提供的一种数据聚合方法的流程图;FIG. 1 shows a flowchart of a data aggregation method provided by an embodiment of the present invention;

图2示出了本发明实施例提供的另一种数据聚合方法的流程图;FIG. 2 shows a flowchart of another data aggregation method provided by an embodiment of the present invention;

图3示出了本发明实施例提供的一种聚合数据查询方法的流程图;FIG. 3 shows a flow chart of an aggregated data query method provided by an embodiment of the present invention;

图4示出了本发明实施例提供的一种数据收集方法的流程图;FIG. 4 shows a flowchart of a data collection method provided by an embodiment of the present invention;

图5示出了本发明实施例提供的一种数据聚合装置结构示意图;FIG. 5 shows a schematic structural diagram of a data aggregation device provided by an embodiment of the present invention;

图6示出了本发明实施例提供的另一种数据聚合装置结构示意图;FIG. 6 shows a schematic structural diagram of another data aggregation device provided by an embodiment of the present invention;

图7示出了本发明实施例提供的一种聚合数据查询装置结构示意图;Fig. 7 shows a schematic structural diagram of an aggregated data query device provided by an embodiment of the present invention;

图8示出了本发明实施例提供的一种聚合数据统计装置结构示意图;Fig. 8 shows a schematic structural diagram of an aggregation data statistics device provided by an embodiment of the present invention;

图9示出了本发明实施例提供的一种数据聚合系统结构示意图;FIG. 9 shows a schematic structural diagram of a data aggregation system provided by an embodiment of the present invention;

图10示出了本发明实施例提供的业务数据流转示意图;Fig. 10 shows a schematic diagram of business data flow provided by an embodiment of the present invention;

图11示出了现有技术中数据统计方法架构的示意图;Fig. 11 shows a schematic diagram of the architecture of the data statistics method in the prior art;

图12示出了本发明实施例提供的聚合数据查询方法逻辑架构示意图;Fig. 12 shows a schematic diagram of the logical architecture of the aggregated data query method provided by the embodiment of the present invention;

图13示出了本发明实施例提供的入口服务器的逻辑结构示意图。Fig. 13 shows a schematic diagram of the logical structure of the entry server provided by the embodiment of the present invention.

具体实施方式Detailed ways

下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided for more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

本发明实施例提供的一种数据聚合方法,如图1所示,所述方法包括:A data aggregation method provided by an embodiment of the present invention, as shown in FIG. 1, the method includes:

101、当按照第一预置周期进行数据聚合时,从数据收集器获取所述数据收集器当前接收到的业务数据。101. When data aggregation is performed according to a first preset period, acquire service data currently received by the data collector from the data collector.

其中,所述第一预置周期用于反应进行数据聚合的时间粒度,根据不同的数据聚合需求可以配置不同的时间粒度。如当需要进行时间粒度较小的数据聚合时,可以将第一预置周期配置的相对小一些,如每分钟聚合一次、每五分钟聚合一次等,如当需要进行时间粒度较大的数据聚合时,可以将第一预置周期配置的相对大一些,如每小时聚合一次、每半天聚合一次等。对于本发明实施例,根据不同需求来配置不同的聚合时间粒度,可以进一步提高数据聚合的精度。所述业务数据携带有时间戳,所述时间戳用于标识所述数据收集器接收到所述业务数据后该业务数据触发的时间。例如,数据收集器接收到业务数据后该业务数据触发的时间为10:01,则当前从数据收集器获取的业务数据中携带的时间戳为10:01。所述业务数据可以为QPS(Query Per Second,每秒查询率)、PV(Page View,页面浏览量)等不同类别的业务数据,也可以为同一类别不同应用的业务数据,如应用A和应用B的PV数据,本发明实施例不做限定。Wherein, the first preset period is used to reflect the time granularity for data aggregation, and different time granularities can be configured according to different data aggregation requirements. For example, when data aggregation with a small time granularity is required, the first preset period can be configured relatively small, such as once every minute, once every five minutes, etc., for example, when data aggregation with a large time granularity is required , the first preset period can be configured to be relatively larger, such as aggregation once every hour, aggregation once every half day, and so on. For the embodiment of the present invention, configuring different aggregation time granularities according to different requirements can further improve the accuracy of data aggregation. The service data carries a time stamp, and the time stamp is used to identify the time when the service data is triggered after the data collector receives the service data. For example, if the service data is triggered at 10:01 after the data collector receives the service data, the time stamp carried in the service data currently obtained from the data collector is 10:01. The business data can be business data of different categories such as QPS (Query Per Second, query rate per second), PV (Page View, page views), or business data of different applications of the same category, such as application A and application A. The PV data of B is not limited in this embodiment of the present invention.

102、判断所述时间戳是否大于当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点。102. Determine whether the time stamp is greater than the aggregation trigger time point corresponding to the first preset period when data aggregation is currently required.

其中,所述第一预置周期对应多个聚合触发时间点,所述多个聚合触发时间点分别对应的时间逐个递增,每一个聚合触发时间点用于触发对时间戳为上一个聚合触发时间点的全部业务数据进行聚合操作。例如,第一预置周期为每分钟聚合一次,则从10:00开始,第一预置周期对应多个聚合触发时间点分别为10:01、10:02、10:03等以此类推,当时间戳为10:02大于当前进行数据聚合时所述第一预置周期对应的聚合触发时间点10:01时,触发进行时间戳为10:01的全部业务数据的聚合处理。Wherein, the first preset period corresponds to a plurality of aggregation trigger time points, and the times corresponding to the plurality of aggregation trigger time points are incremented one by one, and each aggregation trigger time point is used to trigger the pair timestamp as the last aggregation trigger time All business data of the point is aggregated. For example, if the first preset period is aggregated once every minute, then starting from 10:00, the first preset period corresponds to multiple aggregation trigger time points, respectively 10:01, 10:02, 10:03, etc., and so on. When the time stamp 10:02 is greater than the aggregation trigger time point 10:01 corresponding to the first preset period when the data aggregation is currently performed, the aggregation processing of all business data with the time stamp 10:01 is triggered.

需要说明的是,所述多个聚合触发时间点可以按照时间顺序以列表、时间轴等方式进行展示,本发明实施例不做限定,例如,当多个聚合触发时间点按照时间顺序以时间轴等方式进行展示时,时间轴上的时间会不断向前滚动,以保证时间轴上的时间为当前时间。对于本发明实施例,通过检测所述时间戳是否大于当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点,即检测当前接收到的业务数据的时间与上一次接收到业务数据的时间是否发生变化,从而确定是否触发业务数据聚合操作,从而保证了对业务数据进行聚合操作的实时性。It should be noted that the multiple aggregation trigger time points can be displayed in a list, time axis, etc. in chronological order, which is not limited in this embodiment of the present invention. For example, when multiple aggregation trigger time points are displayed in a time axis in chronological order etc., the time on the time axis will continuously roll forward to ensure that the time on the time axis is the current time. For the embodiment of the present invention, by detecting whether the time stamp is greater than the aggregation trigger time point corresponding to the first preset period when data aggregation is currently required, that is, the time between the time of the currently received business data and the time of the last received business data is detected. Whether the time of the data changes, so as to determine whether to trigger the business data aggregation operation, thereby ensuring the real-time performance of the business data aggregation operation.

例如,第一预置周期为每分钟聚合一次,若从数据收集器获取的当前接收到的业务数据携带的时间戳为10:01,当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点同为10:01,则确定不触发业务数据聚合操作;若从数据收集器获取的当前接收到的业务数据携带的时间戳为10:02,大于当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点10:01,则确定触发业务数据聚合操作。For example, the first preset period is aggregated once per minute. If the currently received service data obtained from the data collector carries a timestamp of 10:01, the time stamp corresponding to the first preset period when data aggregation is currently required If the aggregation trigger time point is also 10:01, it is determined not to trigger the business data aggregation operation; if the time stamp carried by the currently received business data obtained from the data collector is 10:02, which is greater than the time stamp specified when data aggregation is currently required The aggregation trigger time point corresponding to the first preset period is 10:01, and it is determined to trigger the service data aggregation operation.

103、若大于当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点,则将保存的时间戳为所述聚合触发时间点的业务数据进行聚合。103. If it is greater than the aggregation trigger time point corresponding to the first preset period when data aggregation is currently required, aggregate the service data with the saved time stamp as the aggregation trigger time point.

其中,所述时间戳为所述聚合触发时间点的业务数据保存在预置存储位置。所述预置存储位置可以为预置映射关系表、预置队列等,本发明实施例不做限定。对于本发明实施例,若所述时间戳大于当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点,如由10:01变为了10:02、或者由10:01:01变为了10:01:02,说明当前业务数据携带的时间戳向前发生了变化,即实时触发聚合操作,从而保证了业务数据聚合操作的实时性,提高了业务数据的聚合操作效率。Wherein, the time stamp is stored in a preset storage location for the service data at the aggregation trigger time point. The preset storage location may be a preset mapping table, a preset queue, etc., which are not limited in this embodiment of the present invention. For this embodiment of the present invention, if the timestamp is greater than the aggregation trigger time point corresponding to the first preset period when data aggregation is currently required, for example, from 10:01 to 10:02, or from 10:01:01 It has changed to 10:01:02, indicating that the timestamp carried by the current business data has changed forward, that is, the aggregation operation is triggered in real time, thereby ensuring the real-time performance of the business data aggregation operation and improving the efficiency of the business data aggregation operation.

本发明实施例提供的一种数据聚合方法,当需要对云环境中存储的海量业务数据按照一定周期进行聚合时,首先从数据收集器获取所述数据收集器当前接收到的业务数据,然后判断所述时间戳是否大于当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点,若大于,则将保存的时间戳为所述聚合触发时间点的业务数据进行聚合。与目前在对云环境中存储的海量业务数据进行聚合时,都需要对用于存储业务数据的文件进行读写操作,并且还需要将读取的业务数据按照时间进行一次排序相比,本发明实施例由于只需要通过检测当前业务数据的时间戳是否大于当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点,即可实现对不同时间段的业务数据进行聚合,提高数据聚合的效率,并且由于检测操作是实时进行的,可以降低数据聚合操作的延迟,同时可以提高数据聚合的实时性。In the data aggregation method provided by the embodiment of the present invention, when it is necessary to aggregate the massive business data stored in the cloud environment according to a certain period, first obtain the business data currently received by the data collector from the data collector, and then judge Whether the time stamp is greater than the aggregation trigger time point corresponding to the first preset period when data aggregation is currently required, and if so, aggregate the business data with the saved time stamp as the aggregation trigger time point. Compared with the current aggregation of massive business data stored in the cloud environment, it is necessary to read and write files used to store business data, and also need to sort the read business data according to time, the present invention In the embodiment, it is only necessary to detect whether the time stamp of the current business data is greater than the aggregation trigger time point corresponding to the first preset period when data aggregation is currently required, so that the aggregation of business data in different time periods can be realized, and the data can be improved. The efficiency of aggregation, and since the detection operation is performed in real time, the delay of data aggregation operation can be reduced, and the real-time performance of data aggregation can be improved at the same time.

进一步地,本发明实施例提供另一种数据聚合方法,如图2所示,所述方法包括:Further, the embodiment of the present invention provides another data aggregation method, as shown in FIG. 2, the method includes:

201、当按照第一预置周期进行数据聚合时,从数据收集器获取所述数据收集器当前接收到的业务数据。201. When data aggregation is performed according to a first preset period, acquire service data currently received by the data collector from the data collector.

其中,所述业务数据携带有时间戳,所述时间戳用于标识所述业务服务器接收到所述业务数据的时间。所述第一预置周期和所述业务数据的相应描述可以参照图1所述实施例的对应描述,在此不再赘述。Wherein, the service data carries a time stamp, and the time stamp is used to identify the time when the service server receives the service data. For the corresponding description of the first preset period and the service data, reference may be made to the corresponding description of the embodiment shown in FIG. 1 , which will not be repeated here.

对于本发明实施例,步骤201具体可以包括:当按照第一预置周期进行数据聚合时,从与当前聚合任务对应的预置队列中获取所述业务数据,所述数据收集服务器为每一个类别的业务数据分别配置一个预置队列。具体可以如图10所示,数据收集器中可以配置ONS(消息服务)、Metaq(消息中间件)等转发器,该转发器用于进行数据收集器与聚合分析服务器之间的数据流转。具体地,数据收集器可以通过预置路由规则将不同类别的业务数据分别对应到不同虚拟节点0、1、2等,然后通过虚拟节点将每一类的业务数据分别保存到ONS的不同队列Queue1、Queue2等中,再为每一个队列分别配置一个任务,如任务ServerNode1,从而保证按类别进行业务数据流转和后续数据聚合处理,进一步提高数据聚合精度。For the embodiment of the present invention, step 201 may specifically include: when performing data aggregation according to the first preset period, obtaining the business data from the preset queue corresponding to the current aggregation task, and the data collection server provides Configure a preset queue for business data. Specifically, as shown in FIG. 10 , transponders such as ONS (message service) and Metaq (message middleware) can be configured in the data collector, and the transponders are used for data transfer between the data collector and the aggregation analysis server. Specifically, the data collector can map different types of business data to different virtual nodes 0, 1, 2, etc. through preset routing rules, and then save each type of business data to different queues Queue1 of the ONS through the virtual nodes , Queue2, etc., and then configure a task for each queue, such as task ServerNode1, so as to ensure business data flow and subsequent data aggregation processing by category, and further improve the accuracy of data aggregation.

202、判断所述时间戳是否大于当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点。202. Determine whether the time stamp is greater than the aggregation trigger time point corresponding to the first preset period when data aggregation is currently required.

其中,所述第一预置周期对应多个聚合触发时间点,所述多个聚合触发时间点分别对应的时间逐个递增。所述第一预置周期的配置方式的具体描述可以参照图1所述实施例的对应描述,在此不再赘述。Wherein, the first preset period corresponds to multiple aggregation trigger time points, and the times corresponding to the multiple aggregation trigger time points are incremented one by one. For a specific description of the configuration manner of the first preset period, reference may be made to the corresponding description of the embodiment shown in FIG. 1 , and details are not repeated here.

对于本发明实施例,通过检测所述时间戳是否大于当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点,即检测当前接收到的业务数据的时间与上一次接收到业务数据的时间是否向前发生变化,从而确定是否触发业务数据聚合操作,从而保证了对业务数据进行聚合操作的实时性。For the embodiment of the present invention, by detecting whether the time stamp is greater than the aggregation trigger time point corresponding to the first preset period when data aggregation is currently required, that is, the time between the time of the currently received business data and the time of the last received business data is detected. Whether the time of the data changes forward determines whether to trigger the business data aggregation operation, thereby ensuring the real-time performance of the business data aggregation operation.

进一步地,步骤202之后还可以包括:若所述时间戳与所述聚合触发时间点相同,则将当前接收到的所述业务数据保存到所述与当前聚合任务对应的预置队列中。其中,所述预置队列中缓存有时间戳为聚合触发时间点的全部业务数据。不同预置队列分别缓存有聚合触发时间点不同的业务数据,由于对队列进行缓存和读取操作的延迟较低,因此,将业务数据缓存到队列中,可以进一步降低数据聚合操作的延迟,提高数据聚合操作的实时性。若所述时间戳小于所述聚合触发时间点,则将当前接收到的所述业务数据删除。如聚合触发时间点为10:01,时间戳为09:50,则将当前接收到的时间戳为09:50的业务数据删除,从而保证数据聚合的准确性。Further, after step 202, the method may further include: if the time stamp is the same as the aggregation trigger time point, saving the currently received service data into the preset queue corresponding to the current aggregation task. Wherein, all service data whose time stamp is the triggering time point of the aggregation is cached in the preset queue. Different preset queues cache business data with different aggregation triggering time points. Since the delay of caching and reading operations on the queues is low, caching business data in the queues can further reduce the delay of data aggregation operations and improve Real-time performance of data aggregation operations. If the time stamp is less than the aggregation trigger time point, the currently received service data is deleted. If the aggregation trigger time point is 10:01 and the timestamp is 09:50, the currently received service data with the timestamp of 09:50 will be deleted, so as to ensure the accuracy of data aggregation.

203、若大于当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点,判断当前接收到所述业务数据之后的第一预置时间段内,是否接收到时间戳为所述聚合触发时间点的业务数据。203. If it is greater than the aggregation triggering time point corresponding to the first preset period when data aggregation is currently required, determine whether the time stamp is received within the first preset time period after the service data is currently received. Aggregate business data at the trigger time point.

需要说明的是,当某一个时间戳的业务数据进行聚合后,由于传输数据延迟等原因,数据收集器有可能再次接收到该时间戳的业务数据,此时,如果不对延迟接收到的业务数据进行处理,会造成业务数据的丢失,进而使得业务数据聚合的准确性较低,因此,在进行数据聚合之前,通过配置时间容忍期,即第一预置时间段,可以避免延迟接收到的业务数据的丢失,提高业务数据聚合的准确性。It should be noted that when the business data of a certain time stamp is aggregated, due to the delay of transmission data, etc., the data collector may receive the business data of this time stamp again. At this time, if the business data received with delay Processing will result in the loss of business data, which in turn will make the accuracy of business data aggregation lower. Therefore, before data aggregation, by configuring the time tolerance period, that is, the first preset time period, it is possible to avoid delaying the received business Data loss, improve the accuracy of business data aggregation.

其中,所述第一预置时间段可以根据第一预置周期进行配置。例如,若第一预置周期较小,如每秒钟聚合一次,则第一预置时间段可以为1秒、2秒等,若第一预置周期较为适中,如每分钟聚合一次,则第一预置时间段可以为10秒、20秒等,若第一预置周期较大,如每小时聚合一次,则第一预置时间段可以为10分钟、20分钟等。通过根据第一预置周期配置第一预置时间段,可以进一步提高时间容忍期的配置准确性,进而进一步提高业务数据聚合的准确性。Wherein, the first preset time period may be configured according to a first preset period. For example, if the first preset period is relatively small, such as once per second, then the first preset time period can be 1 second, 2 seconds, etc., if the first preset period is relatively moderate, such as once per minute, then The first preset time period may be 10 seconds, 20 seconds, etc. If the first preset period is relatively large, such as once per hour, the first preset time period may be 10 minutes, 20 minutes, etc. By configuring the first preset time period according to the first preset period, the configuration accuracy of the time tolerance period can be further improved, thereby further improving the accuracy of service data aggregation.

204a、若未接收到,则将保存的时间戳为所述聚合触发时间点的业务数据进行聚合。204a. If not received, aggregate the saved time stamp as the service data at the aggregation trigger time point.

与步骤204a并列的步骤204b、若接收到,则将在所述第一预置时间段内接收到的所述业务数据和保存的时间戳为所述聚合触发时间点的业务数据进行聚合。In step 204b parallel to step 204a, if received, aggregate the service data received within the first preset time period and the saved time stamp as the service data at the aggregation trigger time point.

例如,第一预置周期为每分钟聚合一次,则此时将预置缓冲时间段配置为5分钟。若当前从数据收集器获取的业务数据携带的时间戳为10:02,当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点为10:01,则在对时间戳为10:01的业务数据进行聚合前,判断从当前时间开始后的五分钟内是否接收到携带的时间戳为10:01的业务数据,若接收到,则将在五分钟内接收到的时间戳为10:01的业务数据和之前接收到的时间戳为10:01的业务数据进行数据聚合;若未接收到,说明此时不存在延迟的业务数据,将时间戳为10:01的业务数据进行数据聚合,从而保证了数据聚合的准确性。For example, if the first preset period is aggregated every minute, then the preset buffer time period is configured as 5 minutes. If the time stamp carried by the business data currently obtained from the data collector is 10:02, and the aggregation trigger time point corresponding to the first preset period is 10:01 when data aggregation is currently required, then the time stamp is 10:01. Before the business data of :01 is aggregated, it is judged whether the business data with the time stamp of 10:01 is received within five minutes from the current time. If received, the time stamp received within five minutes is The business data at 10:01 is aggregated with the previously received business data with a time stamp of 10:01; if not received, it means that there is no delayed business data at this time, and the business data with a time stamp of 10:01 is aggregated. Data aggregation, thus ensuring the accuracy of data aggregation.

205、将聚合后的业务数据和所述业务数据对应的时间戳保存在第一预置周期聚合表中。205. Save the aggregated service data and the time stamp corresponding to the service data in a first preset period aggregation table.

其中,第一预置周期聚合表用于保存按照第一预置周期进行聚合后的数据。所述第一预置周期聚合表可以保存在OTS(表格存储)、HBase(分布式面向列的数据库)等存储介质中。例如,若第一预置周期为每分钟聚合一次,则第一预置周期聚合表中保存的为每分钟聚合后的数据。所述第一预置周期聚合表可以如下所示:Wherein, the aggregation table of the first preset period is used to save the data aggregated according to the first preset period. The aggregation table for the first preset period may be stored in a storage medium such as OTS (table storage), HBase (distributed column-oriented database). For example, if the first preset period is aggregated once every minute, the data aggregated every minute is stored in the first preset period aggregation table. The aggregation table of the first preset period may be as follows:

对于本发明实施例,为了实现同时进行不同时间粒度的数据聚合,步骤205之后还可以包括:当同时需要按照第二预置周期进行数据聚合时,从所述数据收集器获取所述数据收集器当前接收到的业务数据的时间戳,所述第二预置周期大于所述第一预置周期,并且所述第二预置周期为所述第一预置周期的整数倍;然后判断所述时间戳是否到达所述第二预置周期对应的聚合触发时间点,所述第二预置周期对应多个聚合触发时间点,所述多个聚合触发时间点分别对应的时间逐个递增;若是,则从所述第一预置周期聚合表中获取时间戳位于所述第二预置周期对应的上一个聚合触发时间点到当前聚合触发时间点内的业务数据进行聚合,并将聚合后的业务数据保存在第二预置周期聚合表中。For the embodiment of the present invention, in order to realize data aggregation at different time granularities at the same time, after step 205, it may also include: when data aggregation needs to be performed according to the second preset period at the same time, obtain the data collector from the data collector The time stamp of the currently received service data, the second preset period is greater than the first preset period, and the second preset period is an integer multiple of the first preset period; then judge the Whether the time stamp reaches the aggregation trigger time point corresponding to the second preset period, the second preset period corresponds to a plurality of aggregation trigger time points, and the times corresponding to the plurality of aggregation trigger time points are incremented one by one; if so, Then, from the aggregation table of the first preset period, obtain the service data whose time stamp is between the last aggregation trigger time point corresponding to the second preset period and the current aggregation trigger time point, and aggregate the aggregated business data The data is saved in the aggregation table of the second preset period.

例如,第一预置周期为每分钟进行一次聚合,第二预置周期为每五分钟进行一次聚合,当前接收到的业务数据的时间戳为10:06,大于第二预置周期对应的聚合触发时间点10:05,则从1分钟聚合表中获取时间戳位于10:01到10:05的业务数据进行聚合,并将聚合后的业务数据保存在5分钟聚合表中。For example, the first preset period is aggregation every minute, the second preset period is aggregation every five minutes, and the timestamp of the currently received service data is 10:06, which is greater than the aggregation corresponding to the second preset period When the trigger time point is 10:05, the business data whose time stamp is from 10:01 to 10:05 is obtained from the 1-minute aggregation table for aggregation, and the aggregated business data is saved in the 5-minute aggregation table.

对于本发明实施例,所述将聚合后的业务数据保存在第二预置周期聚合表中的步骤之前还可以包括:根据当前第二预置周期对应的聚合触发时间为所述聚合后的业务数据配置时间戳,基于上述举例,此时为所述聚合后的业务数据配置时间戳为10:05。此时,将聚合后的业务数据和所述业务数据对应的时间戳保存在第二预置周期聚合表中。For the embodiment of the present invention, before the step of saving the aggregated business data in the aggregation table of the second preset period, it may further include: according to the aggregation trigger time corresponding to the current second preset period, the aggregated business data Data configuration time stamp, based on the above example, at this time, configure the time stamp for the aggregated service data as 10:05. At this time, the aggregated service data and the time stamp corresponding to the service data are saved in the second preset period aggregation table.

进一步地,步骤205之后还可以包括:接收数据查询服务器发送的数据查询指令,所述数据查询指令中携带有时间信息;从所述第一预置周期聚合表中获取时间戳与所述时间信息对应的业务数据并发送给所述查询服务器,以使得所述查询服务器进行数据展示。例如,当所述时间信息为10:01-10:05,从所述第一预置周期聚合表中获取时间戳分别为10:01、10:02、10:03、10:04、10:05的聚合数据。Further, after step 205, it may also include: receiving a data query instruction sent by the data query server, the data query instruction carrying time information; obtaining the time stamp and the time information from the first preset period aggregation table The corresponding business data is sent to the query server, so that the query server can display the data. For example, when the time information is 10:01-10:05, the time stamps obtained from the aggregation table of the first preset period are 10:01, 10:02, 10:03, 10:04, and 10: Aggregate data for 05.

其中,所述查询服务器可以为Portal(入口服务器),该Portal可以提供各种类型的查询接口,以便客户端通过调用Portal提供的数据接口进行聚合后的业务数据的查询。同时,Portal还可以提供业务数据的注册接口,以便数据收集器根据Portal中保存的注册信息对业务数据进行注册信息验证。Wherein, the query server may be a Portal (entry server), and the Portal may provide various types of query interfaces, so that the client may query the aggregated service data by invoking the data interface provided by the Portal. At the same time, the Portal can also provide a registration interface for business data, so that the data collector can verify the registration information of the business data according to the registration information stored in the Portal.

对于本发明实施例,还可以将所述第一预置周期和当前第一预置周期对应的聚合触发时间点保存在预置存储位置。通过将所述第一预置周期和当前第一预置周期对应的聚合触发时间点保存在预置存储位置,可以保证在系统重启或者系统出现故障恢复时,还原到重启或者故障前的时间状态,从而防止数据丢失和对数据的重复计算,进一步提高数据聚合的精度。For the embodiment of the present invention, the aggregation trigger time point corresponding to the first preset period and the current first preset period may also be saved in a preset storage location. By storing the first preset period and the aggregation trigger time point corresponding to the current first preset period in the preset storage location, it can be guaranteed that when the system is restarted or the system recovers from a failure, the time state before the restart or failure can be restored , so as to prevent data loss and double calculation of data, and further improve the accuracy of data aggregation.

本发明实施例提供的另一种数据聚合方法,当需要对云环境中存储的海量业务数据按照一定周期进行聚合时,首先从数据收集器获取所述数据收集器当前接收到的业务数据,然后判断所述时间戳是否大于当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点,若大于,则将保存的时间戳为所述聚合触发时间点的业务数据进行聚合。与目前在对云环境中存储的海量业务数据进行聚合时,都需要对用于存储业务数据的文件进行读写操作,并且还需要将读取的业务数据按照时间进行一次排序相比,本发明实施例由于只需要通过检测当前业务数据的时间戳是否大于当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点,即可实现对不同时间段的业务数据进行聚合,提高数据聚合的效率,并且由于检测操作是实时进行的,可以降低数据聚合操作的延迟,同时可以提高数据聚合的实时性。Another data aggregation method provided by the embodiment of the present invention, when it is necessary to aggregate the massive business data stored in the cloud environment according to a certain period, first obtain the business data currently received by the data collector from the data collector, and then Judging whether the time stamp is greater than the aggregation trigger time point corresponding to the first preset period when data aggregation is currently required, and if so, aggregate the business data with the saved time stamp as the aggregation trigger time point. Compared with the current aggregation of massive business data stored in the cloud environment, it is necessary to read and write files used to store business data, and also need to sort the read business data according to time, the present invention In the embodiment, it is only necessary to detect whether the time stamp of the current business data is greater than the aggregation trigger time point corresponding to the first preset period when data aggregation is currently required, so that the aggregation of business data in different time periods can be realized, and the data can be improved. The efficiency of aggregation, and since the detection operation is performed in real time, the delay of data aggregation operation can be reduced, and the real-time performance of data aggregation can be improved at the same time.

进一步地,本发明实施例提供一种聚合数据查询方法,如图3所示,所述方法包括:Further, an embodiment of the present invention provides an aggregated data query method, as shown in FIG. 3, the method includes:

301、向分析聚合服务器发送数据上报指令。301. Send a data reporting instruction to the analysis aggregation server.

其中,所述数据上报指令中携带有需要进行数据聚合的业务数据,以使得分析聚合服务器根据数据收集器接收到所述业务数据的时间和预置聚合触发时间点,按照预置周期对需要进行数据聚合的业务数据进行数据聚合。对于本发明实施例,步骤301具体可以包括:通过调用Portal接口向数据聚合服务器发送数据上报指令。Wherein, the data reporting instruction carries the business data that needs to be aggregated, so that the analysis and aggregation server performs the required aggregation according to the preset cycle according to the time when the data collector receives the business data and the preset aggregation trigger time point. Data aggregation is performed on the business data of the data aggregation. For the embodiment of the present invention, step 301 may specifically include: sending a data reporting instruction to the data aggregation server by calling the Portal interface.

对于本发明实施例,Portal的逻辑结构图可以如图13所示,在本发明实施例中Portal有两部分作用,第一是用于进行聚合数据的查询,为用户提供了各种类型业务数据查询接口,从而通过查询接口从聚合系统中的存储服务器OTS中查询聚合结果,并返回给客户端进行聚合数据展示。第二是进行上报数据元信息的注册,然后将注册信息写入RDS中,用于在收集器接收数据时进行数据校验。For the embodiment of the present invention, the logical structure diagram of the Portal can be shown in Figure 13. In the embodiment of the present invention, the Portal has two functions. The first is to query aggregated data and provide users with various types of business data. Query interface, so as to query the aggregation result from the storage server OTS in the aggregation system through the query interface, and return it to the client for aggregated data display. The second is to register the reported data metadata, and then write the registration information into RDS for data verification when the collector receives the data.

302、向所述分析聚合服务器发送数据聚合结果查询指令。302. Send a data aggregation result query instruction to the analysis aggregation server.

其中,所述数据查询指令中携带有待查询业务数据的时间信息。对于本发明实施例,步骤302具体可以包括:通过入口服务器Portal配置的数据查询接口向所述分析聚合服务器发送数据聚合结果查询指令。Wherein, the data query instruction carries time information of the service data to be queried. For the embodiment of the present invention, step 302 may specifically include: sending a data aggregation result query instruction to the analysis aggregation server through a data query interface configured on the portal server Portal.

303、接收与所述时间信息对应的数据聚合结果并进行显示。303. Receive and display a data aggregation result corresponding to the time information.

对于本发明实施例,具体应用场景可以如图12所示,包括:理流程如下:首先调用Portal接口向聚合系统注册需要上报数据的监控项,然后调用收集器上报接口,向系统上报指定监控项的数据,此时收集器将接收到的数据发送给中间件ONS,然后分析器将从ONS中拉取数据进行数据分析和聚合,并将数据进行聚合计算后存入OTS(存储服务器)中。当需要进行聚合数据查询时,用户可以通过Portal提供的查询接口查询聚合数据的结果,并通过数据展示页面显示数据的统计结果。For the embodiment of the present invention, the specific application scenario can be shown in Figure 12, including: the process is as follows: first call the Portal interface to register the monitoring items that need to report data to the aggregation system, and then call the collector reporting interface to report the specified monitoring items to the system At this time, the collector will send the received data to the middleware ONS, and then the analyzer will pull the data from ONS for data analysis and aggregation, and store the data in the OTS (storage server) after aggregation calculation. When aggregated data query is required, users can query the aggregated data results through the query interface provided by Portal, and display the statistical results of the data through the data display page.

对于本发明实施例,通过入口服务器Portal为用户提供上报及查询聚合数据的接口,即用户可以方便快捷的进行待聚合数据的上报与聚合结果的查询,进而可以提高待聚合数据的上报效率以及对聚合结果的查询效率。For the embodiment of the present invention, the portal server Portal provides users with an interface for reporting and querying aggregated data, that is, users can conveniently and quickly report the data to be aggregated and query the aggregation results, thereby improving the reporting efficiency of the data to be aggregated and improving the efficiency of the aggregated data. Query efficiency of aggregated results.

进一步地,本发明实施例提供一种数据收集方法,如图4所示,所述方法包括:Further, an embodiment of the present invention provides a data collection method, as shown in FIG. 4, the method includes:

401、接收待聚合的业务数据。402、为所述业务数据配置时间戳。401. Receive service data to be aggregated. 402. Configure a time stamp for the service data.

其中,所述时间戳用于标识所述数据收集器接收到所述业务数据的时间,以使得分析聚合服务器获取所述业务数据并根据所述业务数据的时间戳进行数据聚合。Wherein, the timestamp is used to identify the time when the data collector receives the service data, so that the analysis and aggregation server acquires the service data and performs data aggregation according to the timestamp of the service data.

对于本发明实施例,通过对为接收到的业务数据配置时间戳,可以保证及时触发业务数据的聚合,从而实现对业务数据的实时聚合。For the embodiment of the present invention, by configuring the time stamp for the received service data, it can be ensured that the aggregation of the service data is triggered in time, so as to realize the real-time aggregation of the service data.

进一步地,作为图1所示方法的具体实现,本发明实施例提供一种数据聚合装置,如图5所示,所述装置可以包括:获取单元51、判断单元52、聚合单元53。Further, as a specific implementation of the method shown in FIG. 1 , an embodiment of the present invention provides a data aggregation device. As shown in FIG. 5 , the device may include: an acquisition unit 51 , a judging unit 52 , and an aggregation unit 53 .

获取单元51,用于当按照第一预置周期进行数据聚合时,从数据收集器获取所述数据收集器当前接收到的业务数据,所述业务数据携带有时间戳,所述时间戳用于标识所述数据收集器接收到所述业务数据的时间;The obtaining unit 51 is configured to obtain from the data collector the service data currently received by the data collector when the data aggregation is performed according to the first preset period, the service data carries a time stamp, and the time stamp is used for Identify the time when the data collector receives the service data;

判断单元52,用于判断所述获取单元51获取的所述时间戳是否大于当需要进行数据聚合时所述第一预置周期对应的聚合触发时间点,所述第一预置周期对应多个聚合触发时间点,所述多个聚合触发时间点分别对应的时间逐个递增;A judging unit 52, configured to judge whether the timestamp acquired by the acquiring unit 51 is greater than the aggregation trigger time point corresponding to the first preset period when data aggregation is required, and the first preset period corresponds to a plurality of Aggregation triggering time points, the times corresponding to the plurality of aggregation triggering time points are incremented one by one;

聚合单元53,用于若所述判断单元52确定大于当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点,则将保存的时间戳为所述聚合触发时间点的业务数据进行聚合。The aggregation unit 53 is configured to store the saved timestamp as the service data at the aggregation trigger time point if the judging unit 52 determines that it is greater than the aggregation trigger time point corresponding to the first preset period when data aggregation is currently required to aggregate.

需要说明的是,该装置实施例与前述方法实施例对应,为便于阅读,本装置实施例不再对前述方法实施例中的细节内容进行逐一赘述,但应当明确,本实施例中的装置能够对应实现前述方法实施例中的全部内容。It should be noted that this device embodiment corresponds to the foregoing method embodiment. For the convenience of reading, this device embodiment will not repeat the details of the foregoing method embodiment one by one, but it should be clear that the device in this embodiment can Correspondingly implement all the contents in the foregoing method embodiments.

本发明实施例提供的一种数据聚合装置,当需要对云环境中存储的海量业务数据按照一定周期进行聚合时,首先从数据收集器获取所述数据收集器当前接收到的业务数据,然后判断所述时间戳是否大于当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点,若大于,则将保存的时间戳为所述聚合触发时间点的业务数据进行聚合。与目前在对云环境中存储的海量业务数据进行聚合时,都需要对用于存储业务数据的文件进行读写操作,并且还需要将读取的业务数据按照时间进行一次排序相比,本发明实施例由于只需要通过检测当前业务数据的时间戳是否大于当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点,即可实现对不同时间段的业务数据进行聚合,提高数据聚合的效率,并且由于检测操作是实时进行的,可以降低数据聚合操作的延迟,同时可以提高数据聚合的实时性。A data aggregation device provided by an embodiment of the present invention, when it is necessary to aggregate massive business data stored in a cloud environment according to a certain period, first obtains the business data currently received by the data collector from the data collector, and then judges Whether the time stamp is greater than the aggregation trigger time point corresponding to the first preset period when data aggregation is currently required, and if so, aggregate the business data with the saved time stamp as the aggregation trigger time point. Compared with the current aggregation of massive business data stored in the cloud environment, it is necessary to read and write files used to store business data, and also need to sort the read business data according to time, the present invention In the embodiment, it is only necessary to detect whether the time stamp of the current business data is greater than the aggregation trigger time point corresponding to the first preset period when data aggregation is currently required, so that the aggregation of business data in different time periods can be realized, and the data can be improved. The efficiency of aggregation, and since the detection operation is performed in real time, the delay of data aggregation operation can be reduced, and the real-time performance of data aggregation can be improved at the same time.

进一步地,作为图2所示方法的具体实现,本发明实施例提供一种数据聚合装置,如图6所示,所述装置可以包括:获取单元61、判断单元62、聚合单元63。Further, as a specific implementation of the method shown in FIG. 2 , an embodiment of the present invention provides a data aggregation device. As shown in FIG. 6 , the device may include: an acquisition unit 61 , a judging unit 62 , and an aggregation unit 63 .

获取单元61,用于当按照第一预置周期进行数据聚合时,从数据收集器获取所述数据收集器当前接收到的业务数据,所述业务数据携带有时间戳,所述时间戳用于标识所述数据收集器接收到所述业务数据的时间;The obtaining unit 61 is configured to obtain from the data collector the business data currently received by the data collector when the data aggregation is performed according to the first preset period, the business data carries a time stamp, and the time stamp is used for Identify the time when the data collector receives the service data;

判断单元62,用于判断所述获取单元61获取的所述时间戳是否大于当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点,所述第一预置周期对应多个聚合触发时间点,所述多个聚合触发时间点分别对应的时间逐个递增;A judging unit 62, configured to judge whether the timestamp acquired by the acquiring unit 61 is greater than the aggregation trigger time point corresponding to the first preset period when data aggregation is currently required, and the first preset period corresponds to a plurality of Aggregation triggering time points, the times corresponding to the plurality of aggregation triggering time points are incremented one by one;

聚合单元63,用于若所述判断单元62确定大于当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点,则将保存的时间戳为所述聚合触发时间点的业务数据进行聚合。The aggregation unit 63 is configured to store the saved timestamp as the service data at the aggregation trigger time point if the judging unit 62 determines that it is greater than the aggregation trigger time point corresponding to the first preset period when data aggregation is currently required to aggregate.

进一步地,所述装置还包括:保存单元64。Further, the device further includes: a saving unit 64 .

保存单元64,用于将所述聚合单元63聚合后的业务数据和所述业务数据对应的时间戳保存在第一预置周期聚合表中。The saving unit 64 is configured to save the business data aggregated by the aggregation unit 63 and the time stamp corresponding to the business data in a first preset period aggregation table.

进一步地,所述获取单元61,还用于当同时需要按照第二预置周期进行数据聚合时,从所述数据收集器获取所述数据收集器当前接收到的业务数据的时间戳,所述第二预置周期大于所述第一预置周期;Further, the obtaining unit 61 is also configured to obtain from the data collector the time stamp of the service data currently received by the data collector when data aggregation needs to be performed according to the second preset period at the same time, the The second preset period is greater than the first preset period;

所述判断单元62,还用于判断所述时间戳是否到达所述第二预置周期对应的聚合触发时间点,所述第二预置周期对应多个聚合触发时间点,所述多个聚合触发时间点分别对应的时间逐个递增;The judging unit 62 is further configured to judge whether the time stamp reaches the aggregation trigger time point corresponding to the second preset period, the second preset period corresponds to a plurality of aggregation trigger time points, and the plurality of aggregation trigger time points The times corresponding to the trigger time points are incremented one by one;

所述聚合单元63,还用于若到达所述第二预置周期对应的聚合触发时间点,则从所述第一预置周期聚合表中获取时间戳位于所述第二预置周期对应的上一个聚合触发时间点到当前聚合触发时间点内的业务数据进行聚合;The aggregation unit 63 is further configured to, if the aggregation trigger time point corresponding to the second preset period is reached, obtain the time stamp from the aggregation table of the first preset period at the time point corresponding to the second preset period. Aggregate business data from the previous aggregation trigger time point to the current aggregation trigger time point;

所述保存单元64,还用于将聚合后的业务数据保存在第二预置周期聚合表中。The saving unit 64 is further configured to save the aggregated service data in a second preset period aggregation table.

进一步地,所述装置还包括:配置单元65。Further, the device further includes: a configuration unit 65 .

所述配置单元65,用于根据当前第二预置周期对应的聚合触发时间为所述聚合后的业务数据配置时间戳;The configuration unit 65 is configured to configure a time stamp for the aggregated service data according to the aggregation trigger time corresponding to the current second preset period;

所述保存单元64,具体用于将聚合后的业务数据和所述业务数据对应的时间戳保存在第二预置周期聚合表中。The saving unit 64 is specifically configured to save the aggregated business data and the time stamp corresponding to the business data in the second preset period aggregation table.

进一步地,所述获取单元61,具体用于当按照第一预置周期进行数据聚合时,从与当前聚合任务对应的预置队列中获取所述业务数据,所述数据收集服务器为每一个类别的业务数据分别配置一个预置队列。Further, the acquisition unit 61 is specifically configured to acquire the business data from the preset queue corresponding to the current aggregation task when data aggregation is performed according to the first preset period, and the data collection server provides a Configure a preset queue for business data.

进一步地,所述装置还包括:接收单元66。Further, the device further includes: a receiving unit 66 .

所述接收单元66,用于接收数据查询服务器发送的数据查询指令,所述数据查询指令中携带有时间信息;The receiving unit 66 is configured to receive a data query instruction sent by a data query server, and the data query instruction carries time information;

所述获取单元61,还用于从所述第一预置周期聚合表中获取时间戳与所述时间信息对应的业务数据并发送给所述查询服务器,以使得所述查询服务器进行数据展示。The obtaining unit 61 is further configured to obtain service data with a time stamp corresponding to the time information from the first preset period aggregation table and send it to the query server, so that the query server performs data presentation.

进一步地,所述保存单元64,还用于将所述第一预置周期和当前第一预置周期对应的聚合触发时间点保存在预置存储位置。Further, the saving unit 64 is further configured to save the first preset period and the aggregation trigger time point corresponding to the current first preset period in a preset storage location.

进一步地,所述判断单元62,还用于判断当前接收到所述业务数据之后的第一预置时间段内,是否接收到时间戳为所述聚合触发时间点的业务数据;Further, the judging unit 62 is also used to judge whether the business data whose timestamp is the aggregation trigger time point is received within the first preset time period after the business data is currently received;

所述聚合单元63,具体用于若未接收到,则将保存的时间戳为所述聚合触发时间点的业务数据进行聚合;或者The aggregation unit 63 is specifically configured to aggregate the stored timestamp as the service data at the aggregation trigger time point if not received; or

若接收到,则将在所述第一预置时间段内接收到的所述业务数据和保存的时间戳为所述聚合触发时间点的业务数据进行聚合。If received, aggregate the service data received within the first preset time period and the saved timestamp as the service data at the aggregation trigger time point.

进一步地,所述装置还包括:删除单元67。Further, the device further includes: a deletion unit 67 .

所述保存单元64,还用于若所述时间戳与所述聚合触发时间点相同,则将当前接收到的所述业务数据保存到所述与当前聚合任务对应的预置队列中;The saving unit 64 is further configured to save the currently received service data in the preset queue corresponding to the current aggregation task if the time stamp is the same as the aggregation trigger time point;

所述删除单元67,用于若所述时间戳小于所述聚合触发时间点,则将当前接收到的所述业务数据删除。The deleting unit 67 is configured to delete the currently received service data if the time stamp is smaller than the aggregation trigger time point.

需要说明的是,该装置实施例与前述方法实施例对应,为便于阅读,本装置实施例不再对前述方法实施例中的细节内容进行逐一赘述,但应当明确,本实施例中的装置能够对应实现前述方法实施例中的全部内容。It should be noted that this device embodiment corresponds to the foregoing method embodiment. For the convenience of reading, this device embodiment will not repeat the details of the foregoing method embodiment one by one, but it should be clear that the device in this embodiment can Correspondingly implement all the contents in the foregoing method embodiments.

本发明实施例提供的另一种数据聚合装置,当需要对云环境中存储的海量业务数据按照一定周期进行聚合时,首先从数据收集器获取所述数据收集器当前接收到的业务数据,然后判断所述时间戳是否大于当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点,若大于,则将保存的时间戳为所述聚合触发时间点的业务数据进行聚合。与目前在对云环境中存储的海量业务数据进行聚合时,都需要对用于存储业务数据的文件进行读写操作,并且还需要将读取的业务数据按照时间进行一次排序相比,本发明实施例由于只需要通过检测当前业务数据的时间戳是否大于当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点,即可实现对不同时间段的业务数据进行聚合,提高数据聚合的效率,并且由于检测操作是实时进行的,可以降低数据聚合操作的延迟,同时可以提高数据聚合的实时性。Another data aggregation device provided by the embodiment of the present invention, when it is necessary to aggregate the massive business data stored in the cloud environment according to a certain period, first obtain the business data currently received by the data collector from the data collector, and then Judging whether the time stamp is greater than the aggregation trigger time point corresponding to the first preset period when data aggregation is currently required, and if so, aggregate the business data with the saved time stamp as the aggregation trigger time point. Compared with the current aggregation of massive business data stored in the cloud environment, it is necessary to read and write files used to store business data, and also need to sort the read business data according to time, the present invention In the embodiment, it is only necessary to detect whether the time stamp of the current business data is greater than the aggregation trigger time point corresponding to the first preset period when data aggregation is currently required, so that the aggregation of business data in different time periods can be realized, and the data can be improved. The efficiency of aggregation, and since the detection operation is performed in real time, the delay of data aggregation operation can be reduced, and the real-time performance of data aggregation can be improved at the same time.

再进一步地,作为图3所示方法的具体实现,本发明实施例提供一种聚合数据查询装置,如图7所示,所述装置可以包括:发送单元71、接收单元72。Still further, as a specific implementation of the method shown in FIG. 3 , an embodiment of the present invention provides an aggregated data query device. As shown in FIG. 7 , the device may include: a sending unit 71 and a receiving unit 72 .

发送单元71,用于向分析聚合服务器发送数据上报指令,所述数据上报指令中携带有需要进行数据聚合的业务数据,以使得所述分析聚合服务器根据数据收集器接收到所述业务数据的时间和预置聚合触发时间点,按照第一预置周期对需要进行数据聚合的业务数据进行数据聚合;The sending unit 71 is configured to send a data reporting instruction to the analysis and aggregation server, where the data reporting instruction carries business data that needs to be aggregated, so that the analysis and aggregation server receives the business data according to the time when the data collector receives the data. and the preset aggregation trigger time point, perform data aggregation on the business data requiring data aggregation according to the first preset cycle;

所述发送单元71,还用于向所述分析聚合服务器发送数据聚合结果查询指令,所述数据查询指令中携带有待查询业务数据的时间信息;The sending unit 71 is further configured to send a data aggregation result query instruction to the analysis aggregation server, and the data query instruction carries time information of service data to be queried;

接收单元72,用于接收与所述时间信息对应的数据聚合结果并进行显示。The receiving unit 72 is configured to receive and display the data aggregation result corresponding to the time information.

所述发送单元71,具体用于通过入口服务器Portal配置的数据查询接口向所述分析聚合服务器发送数据聚合结果查询指令。The sending unit 71 is specifically configured to send a data aggregation result query instruction to the analysis aggregation server through a data query interface configured on the portal server Portal.

需要说明的是,该装置实施例与前述方法实施例对应,为便于阅读,本装置实施例不再对前述方法实施例中的细节内容进行逐一赘述,但应当明确,本实施例中的装置能够对应实现前述方法实施例中的全部内容。It should be noted that this device embodiment corresponds to the foregoing method embodiment. For the convenience of reading, this device embodiment will not repeat the details of the foregoing method embodiment one by one, but it should be clear that the device in this embodiment can Correspondingly implement all the contents in the foregoing method embodiments.

本发明实施例提供的一种聚合数据查询装置,通过入口服务器Portal为用户提供上报及查询聚合数据的接口,即用户可以方便快捷的进行待聚合数据的上报与聚合结果的查询,进而可以提高待聚合数据的上报效率以及对聚合结果的查询效率。An aggregated data query device provided by an embodiment of the present invention provides users with an interface for reporting and querying aggregated data through the portal server Portal, that is, users can conveniently and quickly report the aggregated data and query the aggregated results, thereby improving the number of aggregated data to be aggregated. The reporting efficiency of aggregated data and the query efficiency of aggregated results.

再进一步地,作为图4所示方法的具体实现,本发明实施例提供一种数据收集装置,如图8所示,所述装置可以包括:接收单元81、配置单元82。Still further, as a specific implementation of the method shown in FIG. 4 , an embodiment of the present invention provides a data collection device. As shown in FIG. 8 , the device may include: a receiving unit 81 and a configuration unit 82 .

接收单元81,用于接收待聚合的业务数据;a receiving unit 81, configured to receive service data to be aggregated;

配置单元82,用于为所述业务数据配置时间戳,所述时间戳用于标识所述数据收集器接收到所述业务数据的时间,以使得分析聚合服务器获取所述业务数据并根据所述业务数据的时间戳进行数据聚合。The configuration unit 82 is configured to configure a time stamp for the business data, the time stamp is used to identify the time when the data collector receives the business data, so that the analysis aggregation server acquires the business data and The timestamp of business data is used for data aggregation.

本发明实施例提供的一种数据收集装置,通过对为接收到的业务数据配置时间戳,可以保证及时触发业务数据的聚合,从而实现对业务数据的实时聚合。The data collection device provided by the embodiment of the present invention can ensure that the aggregation of the business data is triggered in time by configuring a time stamp for the received business data, thereby realizing the real-time aggregation of the business data.

再进一步地,作为图1或者图2所示方法的具体实现,本发明实施例提供一种数据聚合系统,如图9所示,所述系统可以包括:数据收集器91、分析聚合服务器92。Furthermore, as a specific implementation of the method shown in FIG. 1 or FIG. 2 , an embodiment of the present invention provides a data aggregation system. As shown in FIG. 9 , the system may include: a data collector 91 and an analysis aggregation server 92 .

所述数据收集器91,用于接收到业务数据时,为所述业务数据配置时间戳;The data collector 91 is configured to configure a time stamp for the business data when receiving the business data;

所述分析聚合服务器92,用于当按照第一预置周期进行数据聚合时,从数据收集器获取所述数据收集器91当前接收到的业务数据,所述业务数据携带有时间戳;The analysis aggregation server 92 is configured to obtain from the data collector the service data currently received by the data collector 91 when the data aggregation is performed according to the first preset period, and the service data carries a time stamp;

所述分析聚合服务器92,还用于判断所述时间戳是否大于当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点,所述第一预置周期对应多个聚合触发时间点,所述多个聚合触发时间点分别对应的时间逐个递增;The analysis and aggregation server 92 is also used to determine whether the timestamp is greater than the aggregation trigger time point corresponding to the first preset period when data aggregation is currently required, and the first preset period corresponds to multiple aggregation trigger times point, the times corresponding to the plurality of aggregation trigger time points are incremented one by one;

若是,则将分析聚合服务器92中保存的时间戳为所述聚合触发时间点的业务数据进行聚合。If yes, the time stamp stored in the aggregation server 92 is analyzed and aggregated as the service data at the aggregation trigger time point.

进一步地,所述系统还包括:查询服务器93。Further, the system further includes: a query server 93 .

所述查询服务器93,用于向所述分析聚合服务器92发送数据查询指令,所述数据查询指令中携带有时间信息;The query server 93 is configured to send a data query instruction to the analysis and aggregation server 92, and the data query instruction carries time information;

所述分析聚合服务器92,还用于从所述第一预置周期聚合表中获取时间戳与所述时间信息对应的业务数据并发送给所述查询服务器;The analysis and aggregation server 92 is further configured to acquire the business data with a time stamp corresponding to the time information from the first preset period aggregation table and send it to the query server;

所述查询服务器93,还用于输出所述业务数据。The query server 93 is also used to output the business data.

需要说明的是,该系统实施例与前述方法实施例对应,为便于阅读,本系统实施例不再对前述方法实施例中的细节内容进行逐一赘述,但应当明确,本实施例中的系统能够对应实现前述方法实施例中的全部内容。It should be noted that this system embodiment corresponds to the foregoing method embodiment. For the convenience of reading, this system embodiment does not repeat the details of the foregoing method embodiment one by one, but it should be clear that the system in this embodiment can Correspondingly implement all the contents in the foregoing method embodiments.

本发明实施例提供的一种数据聚合系统,当需要对云环境中存储的海量业务数据按照一定周期进行聚合时,首先分析聚合服务器从数据收集器获取所述数据收集器当前接收到的业务数据,然后分析聚合服务器判断所述时间戳是否大于当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点,若大于,则将保存的时间戳为所述聚合触发时间点的业务数据进行聚合。与目前在对云环境中存储的海量业务数据进行聚合时,都需要对用于存储业务数据的文件进行读写操作,并且还需要将读取的业务数据按照时间进行一次排序相比,本发明实施例由于只需要通过检测当前业务数据的时间戳是否大于当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点,即可实现对不同时间段的业务数据进行聚合,提高数据聚合的效率,并且由于检测操作是实时进行的,可以降低数据聚合操作的延迟,同时可以提高数据聚合的实时性。In the data aggregation system provided by the embodiment of the present invention, when it is necessary to aggregate the massive business data stored in the cloud environment according to a certain period, the analysis aggregation server first obtains the business data currently received by the data collector from the data collector , and then analyze and aggregate the server to determine whether the time stamp is greater than the aggregation trigger time point corresponding to the first preset period when data aggregation is currently required, and if it is greater, the saved time stamp is the service at the aggregation trigger time point The data is aggregated. Compared with the current aggregation of massive business data stored in the cloud environment, it is necessary to read and write files used to store business data, and also need to sort the read business data according to time, the present invention In the embodiment, it is only necessary to detect whether the time stamp of the current business data is greater than the aggregation trigger time point corresponding to the first preset period when data aggregation is currently required, so that the aggregation of business data in different time periods can be realized, and the data can be improved. The efficiency of aggregation, and since the detection operation is performed in real time, the delay of data aggregation operation can be reduced, and the real-time performance of data aggregation can be improved at the same time.

所述图表中数据聚合装置包括处理器和存储器,上述获取单元、判断单元、聚合单元等均作为程序单元存储在存储器中,由处理器执行存储在存储器中的上述程序单元来实现相应的功能。The data aggregation device in the graph includes a processor and a memory. The acquisition unit, judgment unit, and aggregation unit are all stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.

处理器中包含内核,由内核去存储器中调取相应的程序单元。内核可以设置一个或以上,通过调整内核参数来解决在对图表中被选中的图形进行显示时存在显示卡顿的问题。The processor includes a kernel, and the kernel fetches corresponding program units from the memory. One or more kernels can be set, and by adjusting the kernel parameters to solve the problem of display lag when displaying the selected graphics in the chart.

存储器可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM),存储器包括至少一个存储芯片。Memory may include non-permanent memory in computer-readable media, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM), memory includes at least one memory chip.

本申请还提供了一种计算机程序产品,当在数据处理设备上执行时,适于执行初始化有如下方法步骤的程序代码:当按照第一预置周期进行数据聚合时,从数据收集器获取所述数据收集器当前接收到的业务数据,所述业务数据携带有时间戳,所述时间戳用于标识所述数据收集器接收到所述业务数据的时间;然后判断所述时间戳是否大于当前需要进行数据聚合时所述第一预置周期对应的聚合触发时间点,所述第一预置周期对应多个聚合触发时间点,所述多个聚合触发时间点分别对应的时间逐个递增;若是,则将所述数据收集器中保存的时间戳为所述聚合触发时间点的业务数据进行聚合。The present application also provides a computer program product, which, when executed on a data processing device, is adapted to execute a program code initialized with the following method steps: when data aggregation is performed according to a first preset cycle, all The business data currently received by the data collector, the business data carries a time stamp, and the time stamp is used to identify the time when the data collector receives the business data; then judge whether the time stamp is greater than the current The aggregation trigger time point corresponding to the first preset period when data aggregation is required, the first preset period corresponds to a plurality of aggregation trigger time points, and the times corresponding to the plurality of aggregation trigger time points are incremented one by one; if , the time stamp saved in the data collector is aggregated as the service data at the aggregation trigger time point.

本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.

本申请是参照根据本申请实施例的数据聚合方法、装置、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowcharts and/or block diagrams of data aggregation methods, apparatuses, and computer program products according to embodiments of the present application. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a general purpose computer, special purpose computer, embedded processor, or processor of other programmable data processing equipment to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing equipment produce a An apparatus for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions The device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby The instructions provide steps for implementing the functions specified in the flow chart or blocks of the flowchart and/or the block or blocks of the block diagrams.

在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.

存储器可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。存储器是计算机可读介质的示例。Memory may include non-permanent storage in computer readable media, in the form of random access memory (RAM) and/or nonvolatile memory such as read only memory (ROM) or flash RAM. The memory is an example of a computer readable medium.

计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can be implemented by any method or technology for storage of information. Information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Flash memory or other memory technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic tape cartridge, tape magnetic disk storage or other magnetic storage device or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media excludes transitory computer-readable media, such as modulated data signals and carrier waves.

以上仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。The above are only examples of the present application, and are not intended to limit the present application. For those skilled in the art, various modifications and changes may occur in this application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.

Claims (17)

  1. A kind of 1. data aggregate system, it is characterised in that including:Data collector and analysis aggregate server;
    The data collector, during for receiving business datum, stabbed for the business datum setup time;
    The analysis aggregate server, for when carrying out data aggregate according to the first during cycle, being obtained from data collector The business datum that the data collector is currently received, the business datum carry timestamp;
    The analysis aggregate server, it is additionally operable to judge whether the timestamp is more than described in when being currently needed for carrying out data aggregate Polymerization triggered time point corresponding to first during cycle, first during cycle corresponds to multiple polymerization triggered time points, described Time corresponding to multiple polymerization triggered time points difference is incremented by one by one;
    If so, then business datum of the timestamp of preservation for the polymerization triggered time point is polymerize.
  2. 2. data aggregate system according to claim 1, it is characterised in that the system also includes:Inquire about server;
    The inquiry server, for sending data query instruction, the data query instruction to the analysis aggregate server In carry temporal information;
    The analysis aggregate server, it is additionally operable to obtain timestamp and time letter from the first during cycle Aggregation Table Business datum corresponding to breath is simultaneously sent to the inquiry server;
    The inquiry server, it is additionally operable to export the business datum.
  3. A kind of 3. data aggregation method, it is characterised in that including:
    When carrying out data aggregate according to the first during cycle, obtain the data collector from data collector and be currently received Business datum, the business datum carries timestamp, and the timestamp, which is used to identifying the data collector, receives institute State the time of business datum;
    Judge whether the timestamp is more than polymerization corresponding to the first during cycle described in when being currently needed for carrying out data aggregate and touches Time point is sent out, first during cycle corresponds to multiple polymerization triggered time points, and the multiple polymerization triggered time point is right respectively The time answered is incremented by one by one;
    If so, polymerization corresponding to the first during cycle described in during then by the timestamp of preservation to be currently needed for carrying out data aggregate is touched The business datum at hair time point is polymerize.
  4. 4. data aggregation method according to claim 3, it is characterised in that described to preserve in the data collector After timestamp is polymerize for the business datum of the polymerization triggered time point, methods described also includes:
    Timestamp corresponding to business datum after polymerization and the business datum is stored in the first during cycle Aggregation Table.
  5. 5. data aggregation method according to claim 4, it is characterised in that the business datum by after polymerization and described Timestamp corresponding to business datum is stored in after the step in the first during cycle Aggregation Table, and methods described also includes:
    When needing to carry out data aggregate according to the second during cycle simultaneously, the Data Collection is obtained from the data collector The timestamp for the business datum that device is currently received, second during cycle are more than first during cycle, and described Second during cycle is the integral multiple of first during cycle;
    Judge whether the timestamp reaches polymerization triggered time point, the second preset week corresponding to second during cycle Phase corresponds to multiple polymerization triggered time points, and the time corresponding to the multiple polymerization triggered time point difference is incremented by one by one;
    It is located at if so, then obtaining timestamp from the first during cycle Aggregation Table upper one corresponding to second during cycle Individual polymerization triggered time point is polymerize to the business datum worked as in pre-polymerization triggered time point, and by the business datum after polymerization It is stored in the second during cycle Aggregation Table.
  6. 6. data aggregation method according to claim 5, it is characterised in that the business datum by after polymerization is stored in Before step in second during cycle Aggregation Table, methods described also includes:
    It is the business datum setup time stamp after the polymerization to polymerize the triggered time according to corresponding to current second during cycle;
    The business datum by after polymerization, which is stored in the second during cycle Aggregation Table, to be included:
    Timestamp corresponding to business datum after polymerization and the business datum is stored in the second during cycle Aggregation Table.
  7. 7. data aggregation method according to claim 3, it is characterised in that described to enter line number according to the first during cycle During according to polymerization, the business datum being currently received from the data collector acquisition data collector includes:
    When carrying out data aggregate according to the first during cycle, from described in obtained in the corresponding preset queue of pre-polymerization task A preset queue is respectively configured for the business datum of each classification in business datum, the data collection server.
  8. 8. data aggregation method according to claim 4, it is characterised in that methods described also includes:
    The data query instruction that data query server is sent is received, temporal information is carried in the data query instruction;
    Timestamp business datum corresponding with the temporal information is obtained from the first during cycle Aggregation Table and is sent to The inquiry server, to cause the inquiry server to carry out data display.
  9. 9. data aggregation method according to claim 3, it is characterised in that methods described also includes:
    Preset storage position is stored in by triggered time point is polymerize corresponding to first during cycle and current first during cycle Put.
  10. 10. data aggregation method according to claim 3, it is characterised in that the timestamp by preservation is described poly- Before the business datum of conjunction triggered time point is polymerize, methods described also includes:
    Judge to be currently received in the preset buffer time section after the business datum, if receive timestamp to be described poly- Close the business datum of triggered time point;
    The timestamp by preservation carries out polymerization for the business datum of the polymerization triggered time point to be included:
    If not receiving, business datum of the timestamp of preservation for the polymerization triggered time point is polymerize;
    It is institute by the business datum received in the preset buffer time section and the timestamp preserved if receiving The business datum for stating polymerization triggered time point is polymerize.
  11. 11. data aggregation method according to claim 7, it is characterised in that described to judge whether the timestamp is more than It polymerize corresponding to first during cycle described in when being currently needed for carrying out data aggregate after triggered time point, methods described is also wrapped Include:
    If the timestamp is identical with the polymerization triggered time point, the business datum being currently received is saved in institute State in preset queue corresponding with working as pre-polymerization task;
    If the timestamp is less than the polymerization triggered time point, the business datum being currently received is deleted.
  12. A kind of 12. method of data capture, it is characterised in that including:
    Receive business datum to be polymerized;
    Stabbed for the business datum setup time, the timestamp receives the business number for identifying the data collector According to time,
    Gather so as to which aggregate server must be analyzed and obtain the business datum and carry out data according to the timestamp of the business datum Close.
  13. A kind of 13. aggregated data querying method, it is characterised in that including:
    Data are sent to analysis aggregate server and report instruction, and the data report in instruction and carry carry out data aggregate in need Business datum so that must analyze aggregate server receives time of the business datum and preset poly- according to data collector Triggered time point is closed, according to during cycle to needing the business datum for carrying out data aggregate to carry out data aggregate;
    The instruction of data aggregate result queries is sent to the analysis aggregate server, is carried in the data query instruction to be checked Ask the temporal information of business datum;
    Receive data aggregate result corresponding with the temporal information and shown.
  14. 14. aggregated data querying method according to claim 13, it is characterised in that described to the analysis aggregated service Device, which sends the instruction of data aggregate result queries, to be included:
    By the data-query interfaces that portal server Portal is configured data aggregate knot is sent to the analysis aggregate server Fruit query statement.
  15. A kind of 15. data aggregate device, it is characterised in that including:
    Acquiring unit, for when carrying out data aggregate according to the first during cycle, obtaining the data from data collector and receiving The business datum that storage is currently received, the business datum carry timestamp, and the timestamp is used to identify the data Collector receives the time of the business datum;
    Judging unit, whether the timestamp for judging the acquiring unit acquisition, which is more than, is currently needed for carrying out data aggregate Polymerization triggered time point, first during cycle correspond to multiple polymerization triggered times corresponding to the during cycles of Shi Suoshu first Point, time corresponding to the multiple polymerization triggered time point difference are incremented by one by one;
    Polymerized unit, if determining to be more than the first during cycle described in when being currently needed for carrying out data aggregate for the judging unit Corresponding polymerization triggered time point, then business datum of the timestamp of preservation for the polymerization triggered time point is polymerize.
  16. A kind of 16. transacter, it is characterised in that including:
    Receiving unit, for receiving business datum to be polymerized;
    Dispensing unit, for being stabbed for the business datum setup time, the timestamp connects for identifying the data collector The time of the business datum is received,
    Gather so as to which aggregate server must be analyzed and obtain the business datum and carry out data according to the timestamp of the business datum Close.
  17. A kind of 17. aggregated data inquiry unit, it is characterised in that including:
    Transmitting element, instruction is reported for sending data to analysis aggregate server, the data are reported to carry in instruction and needed The business datum of data aggregate is carried out, so that must analyze aggregate server receives the business datum according to data collector Time and it is preset polymerization triggered time point, according to during cycle to need carry out data aggregate business datum carry out data gather Close;
    The transmitting element, it is additionally operable to send the instruction of data aggregate result queries, the data to the analysis aggregate server The temporal information of business datum to be checked is carried in query statement;
    Receiving unit, for receiving data aggregate result corresponding with the temporal information and being shown.
CN201610795892.8A 2016-08-31 2016-08-31 Data aggregation method, apparatus and system Pending CN107798009A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610795892.8A CN107798009A (en) 2016-08-31 2016-08-31 Data aggregation method, apparatus and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610795892.8A CN107798009A (en) 2016-08-31 2016-08-31 Data aggregation method, apparatus and system

Publications (1)

Publication Number Publication Date
CN107798009A true CN107798009A (en) 2018-03-13

Family

ID=61529581

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610795892.8A Pending CN107798009A (en) 2016-08-31 2016-08-31 Data aggregation method, apparatus and system

Country Status (1)

Country Link
CN (1) CN107798009A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109408544A (en) * 2018-09-27 2019-03-01 平安科技(深圳)有限公司 Data aggregation method, device and storage medium, server based on engine
CN110502543A (en) * 2019-08-07 2019-11-26 京信通信系统(中国)有限公司 Device performance data storage method, device, device and storage medium
WO2021179122A1 (en) * 2020-03-09 2021-09-16 深圳市欢太科技有限公司 Data processing method and related products
CN115687407A (en) * 2022-11-07 2023-02-03 中盈优创资讯科技有限公司 A method and device for optimizing aggregation query of large amount of data based on data source
CN118916241A (en) * 2024-10-08 2024-11-08 深圳开鸿数字产业发展有限公司 Data aggregation method, device, terminal and medium
CN119311756A (en) * 2024-12-18 2025-01-14 临工重机股份有限公司 A method, device, equipment and medium for aggregate storage of data backhaul

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101063973A (en) * 2006-04-27 2007-10-31 国际商业机器公司 Method and system for the aggregation of data in multiple processing environments
CN102447589A (en) * 2010-09-30 2012-05-09 杭州华三通信技术有限公司 Method and device for aggregating records
US20130132681A1 (en) * 2011-11-22 2013-05-23 Microsoft Corporation Temporal standby list
CN105005274A (en) * 2014-01-31 2015-10-28 费希尔-罗斯蒙特系统公司 Managing big data in process control systems

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101063973A (en) * 2006-04-27 2007-10-31 国际商业机器公司 Method and system for the aggregation of data in multiple processing environments
CN102447589A (en) * 2010-09-30 2012-05-09 杭州华三通信技术有限公司 Method and device for aggregating records
US20130132681A1 (en) * 2011-11-22 2013-05-23 Microsoft Corporation Temporal standby list
CN105005274A (en) * 2014-01-31 2015-10-28 费希尔-罗斯蒙特系统公司 Managing big data in process control systems

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
翁溪 等: "openflow网络测量分析系统的设计实现", 《通信学报》 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109408544A (en) * 2018-09-27 2019-03-01 平安科技(深圳)有限公司 Data aggregation method, device and storage medium, server based on engine
CN109408544B (en) * 2018-09-27 2023-11-03 平安科技(深圳)有限公司 Data aggregation method and device based on engine, storage medium and server
CN110502543A (en) * 2019-08-07 2019-11-26 京信通信系统(中国)有限公司 Device performance data storage method, device, device and storage medium
WO2021179122A1 (en) * 2020-03-09 2021-09-16 深圳市欢太科技有限公司 Data processing method and related products
CN115687407A (en) * 2022-11-07 2023-02-03 中盈优创资讯科技有限公司 A method and device for optimizing aggregation query of large amount of data based on data source
CN118916241A (en) * 2024-10-08 2024-11-08 深圳开鸿数字产业发展有限公司 Data aggregation method, device, terminal and medium
CN118916241B (en) * 2024-10-08 2025-01-28 深圳开鸿数字产业发展有限公司 A method, device, terminal and medium for data aggregation
CN119311756A (en) * 2024-12-18 2025-01-14 临工重机股份有限公司 A method, device, equipment and medium for aggregate storage of data backhaul
CN119311756B (en) * 2024-12-18 2025-04-08 临工重机股份有限公司 Aggregation storage method, device, equipment and medium for data return

Similar Documents

Publication Publication Date Title
CN107145489B (en) Information statistics method and device for client application based on cloud platform
CN107798009A (en) Data aggregation method, apparatus and system
US11575579B2 (en) Systems and methods for networked microservice modeling
US8527458B2 (en) Logging framework for a data stream processing server
US8386466B2 (en) Log visualization tool for a data stream processing server
CN105379183B (en) Variable duration windows on continuous data streams
WO2020233212A1 (en) Log record processing method, server, and storage medium
WO2020147480A1 (en) Stream processing-based monitoring index abnormality detection method, device and equipment
CN104281684B (en) Massive logs are stored and querying method and system
WO2020087082A1 (en) Trace and span sampling and analysis for instrumented software
WO2017071134A1 (en) Distributed tracking system
US10657099B1 (en) Systems and methods for transformation and analysis of logfile data
JP2019523952A (en) Streaming data distributed processing method and apparatus
TWI748989B (en) Data aggregation method and device
EP3282643A1 (en) Method and apparatus of estimating conversation in a distributed netflow environment
CN110262951A (en) A business second-level monitoring method and system, storage medium and client
Cao et al. Timon: A timestamped event database for efficient telemetry data processing and analytics
CN113297245A (en) Method and device for acquiring execution information
CN111339052A (en) Method and device for processing unstructured log data
US11741096B1 (en) Granular performance analysis for database queries
CN106557483B (en) A data processing, data query method and device
CN113271234B (en) Adaptive event aggregation
US20220269732A1 (en) Generation of a recommendation for automatic transformation of times series data at ingestion
HK1252392A1 (en) Data aggregation method, device and system
US11055267B2 (en) Handling time series index updates at ingestion

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 1252392

Country of ref document: HK

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20180313

REG Reference to a national code

Ref country code: HK

Ref legal event code: WD

Ref document number: 1252392

Country of ref document: HK