CN102447589B - Method and device for aggregating records - Google Patents
Method and device for aggregating records Download PDFInfo
- Publication number
- CN102447589B CN102447589B CN201010502543.5A CN201010502543A CN102447589B CN 102447589 B CN102447589 B CN 102447589B CN 201010502543 A CN201010502543 A CN 201010502543A CN 102447589 B CN102447589 B CN 102447589B
- Authority
- CN
- China
- Prior art keywords
- polymerization
- time
- peak
- records
- aggregating
- 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.)
- Expired - Fee Related
Links
Abstract
The invention discloses a method and device for aggregating records. The method comprises the following steps of: when an aggregating time arrives, obtaining aggregating cycles corresponding to each record according the records generated in a current aggregating cycle; searching and obtaining records with information recording time belonging to the aggregating cycles for the obtained aggregating cycles; and respectively aggregating the records in the aggregating cycles. According to the technical scheme disclosed by the invention, the records which should be actually aggregated in the aggregating cycles are determined through the information recording time, and the aggregation is carried out on a prior aggregating cycle again when the condition that records belonging to the prior aggregating cycle appear in the current aggregating cycle is discovered, so that the accuracy for aggregating the records is ensured.
Description
Technical field
The present invention relates to data aggregation technique, espespecially a kind of method of aggregating records and device.
Background technology
For the ruuning situation of monitor network equipment, background server conventionally can record according to certain detailed data precision the ruuning situation of the network equipment, network traffic information for example, and generate and preserve one by one.Along with data volume is increasingly huge, it is almost current unique selection that detail record is periodically carried out to polymerization by certain precision.Polymerization is mainly added up according to the record in polymerization cycle, for example, total flow, the maximum minimum of flow etc.For example the registration accuracy of detailed data is 1 minute, and polymerization precision is 10 minutes, with regard to a detailed data of every 1 minute of expression system record, within every 10 minutes, again the detail record in these 10 minutes is carried out to polymerization.
Because data processing exists a process, from record data to real generation record, be actually and have time delay.Only, after record generates, this record just can be aggregated function and read, and carries out converging operationJu Hecaozuo.For example, information recording time corresponding to the information content of record is 9:58, but the time that generates this record is likely 10:02.At polymerization cycle, be that 10 minutes, polymerization time are be 10:00 in the situation that, it is the polymerization cycle that 10:00 is corresponding that this minute book should belong to polymerization time, from 9:50~10:00, but because being recorded in 10:02, this divides generation, thereby it drops on next polymerization cycle 10:00~10:10 exactly, and carry out record at 10:10, thereby cause the inaccurate of aggregating records.
Summary of the invention
In view of this, main purpose of the present invention is to provide a kind of method and device of aggregating records, applies method provided by the present invention and device and can to record, carry out polymerization accurately.
For achieving the above object, technical scheme of the present invention is achieved in that
A method for aggregating records, the method comprises:
While arriving polymerization time, obtain the record generating in current polymerization cycle;
According to each, record the corresponding information recording time and obtain respectively recording corresponding polymerization cycle;
To the polymerization cycle respectively obtaining, in the current all records that generated, search and obtain the record that the information recording time belongs to this polymerization cycle;
Record in described each polymerization cycle is carried out respectively to polymerization.
A device for aggregating records, this device comprises memory cell, processing unit and polymerized unit;
Described memory cell, for preserving the record of generation and the aggregating records that polymerization obtains;
Described processing unit for when arriving polymerization time, obtains the record generating in current polymerization cycle from described memory cell; And according to each, record the corresponding information recording time and obtain respectively recording corresponding polymerization cycle;
Described polymerized unit for each polymerization cycle that described processing unit is obtained, is searched and is obtained the record that the information recording time belongs to this polymerization cycle in the current all records that generated; And the record in described each polymerization cycle is carried out respectively to polymerization, the aggregating records that polymerization is obtained is saved to memory cell.
The method of a kind of aggregating records provided by the present invention and device, when arriving polymerization time, obtain respectively recording corresponding polymerization cycle according to the record generating in current polymerization cycle; To the polymerization cycle respectively obtaining, search and obtain the record that the information recording time belongs to this polymerization cycle; And the record in each polymerization cycle is carried out respectively to polymerization.Technical scheme of the present invention has been determined the actual record that should carry out polymerization in polymerization cycle by the information recording time; And before having occurred belonging to during the recording of polymerization cycle, again polymerization cycle is before carried out to polymerization in finding this polymerization cycle, guaranteed the accuracy of aggregating records.
Accompanying drawing explanation
Fig. 1 is the flow chart of the inventive method;
Fig. 2 is the flow chart of the embodiment of the present invention;
Fig. 3 is the structure chart of apparatus of the present invention.
Embodiment
In the detailed description of this part, only, by implementing the example of the desired best mode of inventor of the present invention, illustrate and described preferred embodiment of the present invention.It will be appreciated that and can not deviate under prerequisite of the present invention, with regard to each apparent aspect, it is modified.Correspondingly, it is exemplary in itself that drawing and description should be regarded as, rather than restrictive.
Referring to Fig. 1, the flow chart that Fig. 1 is the inventive method.Specifically comprise: in step 101, while arriving polymerization time, obtain the record generating in current polymerization cycle; In step 102, according to each, record the corresponding information recording time and obtain respectively recording corresponding polymerization cycle; In step 103, to the polymerization cycle respectively obtaining, in the current all records that generated, search and obtain the record that the information recording time belongs to this polymerization cycle; And the record in described each polymerization cycle is carried out respectively to polymerization.
The time that the above-mentioned mentioned information recording time is recorded information, namely the information in record is when to put record.The time that this information recording asynchronism(-nization) generates in record, the time that record generates refers to information is stored in to the time on storage medium as a record.Time delay described in the invention is exactly the information recording time of record and records the time delay of rise time.The information recording time generally can be carried in corresponding record, needs to obtain to record corresponding information recording during the time, only need from corresponding record, read.
By a concrete example, technical scheme of the present invention is described in detail below.
The registration accuracy of supposing current detailed data is 1 minute, and polymerization precision is 10 minutes.When arriving current polymerization time 10:00, the present invention processes according to the flow process shown in Fig. 2.
In step 201, when arriving polymerization time 10:00, obtain all records that generate in polymerization cycle 9:50~10:00 that this polymerization time 10:00 is corresponding.
The sign (ID) of supposing the record of acquisition is 101~158.Record ID is used for record of unique identification, normally, when generation is recorded, by order, is added up and is obtained.
In step 202, according in Record ID 101~158, respectively information recording time of record obtains respectively recording corresponding polymerization cycle.
Because record data exist time delay to real generation between record, thus the record of some in fact record be before the information of polymerization cycle, but because time delay just generates at this polymerization cycle.So just cause, the in fact corresponding polymerization cycle of this class is not this polymerization cycle, but polymerization cycle before corresponding.The object of this step is just to find the actual corresponding polymerization cycle of each record, namely according to the time of information recording, finds the polymerization cycle of actual correspondence.
Here, the information recording time of supposing ID102 is 9:25, and corresponding polymerization cycle is 9:21~9:30; The information recording time of ID105 is 9:36, and corresponding polymerization cycle is 9:31~9:40; The information recording time of ID108 is 9:47, and corresponding polymerization cycle is 9:41~9:50; The information recording time of other records all between 9:51~10:00, corresponding current polymerization cycle 9:51~10:00.
In step 203, to polymerization cycle 9:21~9:30, the 9:31~9:40,9:41~9 that obtain: 50 and 9:51~10:00, in the current all records that generated, search and obtain the record that the information recording time belongs to this polymerization cycle; And the record in each polymerization cycle is carried out respectively to polymerization.
Here, to the polymerization cycle respectively obtaining, the record that belongs to this polymerization cycle in the current all records that generated, and carry out polymerization, in fact be exactly when new record appears in corresponding polymerization cycle, according to current new record and the old record that polymerization cycle generated in the past re-start again polymerization and calculate.Like this, through this step, when current polymerization time 10:00, not only can obtain the aggregating records of 10:00, also can obtain the aggregating records that polymerization time is 9:50,9:40 and 9:30.
As can be seen here, technical scheme of the present invention has been determined the actual record that should carry out polymerization in polymerization cycle by the information recording time; And before having occurred belonging to during the recording of polymerization cycle, again polymerization cycle is before carried out to polymerization in finding this polymerization cycle, guaranteed the accuracy of aggregating records.
Because technical scheme of the present invention can be before occurring during the recording of polymerization cycle, again this polymerization cycle is carried out to polymerization computing, may there are a plurality of aggregating records that calculate in a therefore corresponding polymerization cycle.
In this case, can, when polymerization cycle exists corresponding aggregating records, with the current aggregating records obtaining of this polymerization cycle, upgrade already present aggregating records.Like this, only there is an aggregating records in a polymerization cycle.Can certainly preserve all aggregating records that calculate, like this, likely can there are a plurality of aggregating records in a polymerization cycle.Now, in inquiry aggregating records, can inquire about according to many aggregating records.
For example, the in the situation that of recording flow peak-peak and minimum peak in aggregating records, in the time need to inquiring about peak-peak corresponding to given polymerization time, obtain all aggregating records of the corresponding polymerization cycle of this polymerization time, get the peak-peak that the maximum in aggregating records obtains as inquiry; In the time need to inquiring about minimum peak corresponding to given polymerization time, obtain all aggregating records of the corresponding polymerization cycle of this polymerization time, get the minimum peak that the minimum value in aggregating records obtains as inquiry.
When certain time point of polymerization cycle does not record, system can be 0 by the minimum peak assignment of this polymerization cycle.The unwritten reason of certain time point occurs and mainly contain two, one of them is: on this time point, really there is no flow, flow is 0; Another is: due to time delay, being recorded in follow-up polymerization cycle of this time point generates, and be reflected in current polymerization cycle, just there is no record.Under latter event, while generating in the follow-up polymerization cycle of being recorded in of this time point, according to the solution of the present invention, when aggregating records corresponding to calculated for subsequent polymerization cycle, due to the record in polymerization cycle before having occurred, can recalculate this aggregating records of polymerization cycle before.Like this, in the situation that the physical record of this time point is not 0, according to the inquiry mode of above-mentioned minimum peak, even at the record that has obtained disappearance, the minimum peak of polymerization cycle is always 0 before, can not reflect really actual situation.
For this reason, when technical scheme of the present invention exists unwritten time point in polymerization cycle, the minimum peak of this polymerization cycle is set to system maximum; When minimum peak corresponding to the given polymerization time of inquiry, further comprise: whether the minimum value that judgement is got for given polymerization time is system maximum, system maximum if, using 0 minimum peak obtaining as inquiry; Otherwise, the minimum peak that the minimum value of getting is obtained as inquiry.
In addition, referring to Fig. 3, the device that Fig. 3 is a kind of aggregating records provided by the invention, this device comprises memory cell, processing unit and polymerized unit.Wherein, described memory cell, for preserving the record of generation and the aggregating records that polymerization obtains; Described processing unit for when arriving polymerization time, obtains the record generating in current polymerization cycle from described memory cell; And according to each, record the corresponding information recording time and obtain respectively recording corresponding polymerization cycle; Described polymerized unit for each polymerization cycle that described processing unit is obtained, is searched and is obtained the record that the information recording time belongs to this polymerization cycle in the current all records that generated; And the record in described each polymerization cycle is carried out respectively to polymerization, the aggregating records that polymerization is obtained is saved to memory cell.
In addition, described memory cell, is further used for the aggregating records that polymerization obtains according to polymerized unit, when polymerization cycle exists corresponding aggregating records, with the current aggregating records obtaining, upgrades the already present aggregating records of corresponding polymerization cycle.
In addition, this device further comprises query unit; Described query unit, for in the situation that record records flow peak-peak and minimum peak, in the time need to inquiring about peak-peak corresponding to given polymerization time, from described memory cell, obtain all aggregating records of the corresponding polymerization cycle of this polymerization time, get the peak-peak that the maximum in aggregating records obtains as inquiry; In the time need to inquiring about minimum peak corresponding to given polymerization time, from described memory cell, obtain all aggregating records of the corresponding polymerization cycle of this polymerization time, get the minimum peak that the minimum value in aggregating records obtains as inquiry.
In addition, this device further comprises operating unit; Described operating unit, for when current polymerization cycle exists unwritten time point, the minimum peak of this polymerization cycle is set to system maximum, is saved to described memory cell; Described query unit, when minimum peak corresponding to the given polymerization time of inquiry, further comprises: whether the minimum value that judgement is got for this given polymerization time is system maximum, and system maximum if, using 0 minimum peak obtaining as inquiry; Otherwise, the minimum peak that the minimum value of getting is obtained as inquiry.
The foregoing is only preferred embodiment of the present invention, in order to limit the present invention, within the spirit and principles in the present invention not all, any modification of making, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.
Claims (8)
1. a method for aggregating records, is characterized in that, the method comprises:
While arriving polymerization time, obtain the record generating in current polymerization cycle;
According to each, record the corresponding information recording time and obtain respectively recording corresponding polymerization cycle;
To the polymerization cycle respectively obtaining, in the current all records that generated, search and obtain the record that the information recording time belongs to this polymerization cycle;
The record that is belonged to this polymerization cycle the information recording time in described each polymerization cycle carries out respectively polymerization.
2. method according to claim 1, is characterized in that, the method further comprises:
When polymerization cycle exists corresponding aggregating records, with the current aggregating records obtaining of this polymerization cycle, upgrade already present aggregating records.
3. method according to claim 1, is characterized in that, the method further comprises: the in the situation that of recording flow peak-peak and minimum peak in record,
In the time need to inquiring about peak-peak corresponding to given polymerization time, obtain all aggregating records of the corresponding polymerization cycle of this polymerization time, get the peak-peak that the maximum in aggregating records obtains as inquiry;
In the time need to inquiring about minimum peak corresponding to given polymerization time, obtain all aggregating records of the corresponding polymerization cycle of this polymerization time, get the minimum peak that the minimum value in aggregating records obtains as inquiry.
4. method according to claim 3, is characterized in that,
The method further comprises: while there is unwritten time point in polymerization cycle, the minimum peak of this polymerization cycle is set to system maximum;
When minimum peak corresponding to the given polymerization time of inquiry, further comprise: whether the minimum value that judgement is got for given polymerization time is system maximum, system maximum if, using 0 minimum peak obtaining as inquiry; Otherwise, the minimum peak that the minimum value of getting is obtained as inquiry.
5. a device for aggregating records, is characterized in that, this device comprises memory cell, processing unit and polymerized unit;
Described memory cell, for preserving the record of generation and the aggregating records that polymerization obtains;
Described processing unit for when arriving polymerization time, obtains the record generating in current polymerization cycle from described memory cell; And according to each, record the corresponding information recording time and obtain respectively recording corresponding polymerization cycle;
Described polymerized unit for each polymerization cycle that described processing unit is obtained, is searched and is obtained the record that the information recording time belongs to this polymerization cycle in the current all records that generated; And the record that the information recording time in described each polymerization cycle belongs to this polymerization cycle is carried out respectively to polymerization, the aggregating records that polymerization is obtained is saved to memory cell.
6. device according to claim 5, is characterized in that,
Described memory cell, is further used for the aggregating records that polymerization obtains according to polymerized unit, when polymerization cycle exists corresponding aggregating records, with the current aggregating records obtaining, upgrades the already present aggregating records of corresponding polymerization cycle.
7. device according to claim 5, is characterized in that, this device further comprises query unit;
Described query unit, for in the situation that record records flow peak-peak and minimum peak, in the time need to inquiring about peak-peak corresponding to given polymerization time, from described memory cell, obtain all aggregating records of the corresponding polymerization cycle of this polymerization time, get the peak-peak that the maximum in aggregating records obtains as inquiry; In the time need to inquiring about minimum peak corresponding to given polymerization time, from described memory cell, obtain all aggregating records of the corresponding polymerization cycle of this polymerization time, get the minimum peak that the minimum value in aggregating records obtains as inquiry.
8. device according to claim 7, is characterized in that, this device further comprises operating unit;
Described operating unit, for when current polymerization cycle exists unwritten time point, the minimum peak of this polymerization cycle is set to system maximum, is saved to described memory cell;
Described query unit, when minimum peak corresponding to the given polymerization time of inquiry, further comprises: whether the minimum value that judgement is got for this given polymerization time is system maximum, and system maximum if, using 0 minimum peak obtaining as inquiry; Otherwise, the minimum peak that the minimum value of getting is obtained as inquiry.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201010502543.5A CN102447589B (en) | 2010-09-30 | 2010-09-30 | Method and device for aggregating records |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201010502543.5A CN102447589B (en) | 2010-09-30 | 2010-09-30 | Method and device for aggregating records |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102447589A CN102447589A (en) | 2012-05-09 |
CN102447589B true CN102447589B (en) | 2014-07-30 |
Family
ID=46009696
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201010502543.5A Expired - Fee Related CN102447589B (en) | 2010-09-30 | 2010-09-30 | Method and device for aggregating records |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102447589B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107798009A (en) * | 2016-08-31 | 2018-03-13 | 阿里巴巴集团控股有限公司 | Data aggregation method, apparatus and system |
CN106506234B (en) * | 2016-12-05 | 2019-09-10 | 深圳市彬讯科技有限公司 | A kind of SOA service real time monitoring reports and service performance metrics method |
CN106998436B (en) * | 2017-03-24 | 2020-09-01 | 浙江宇视科技有限公司 | Video backup method and device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101018121A (en) * | 2007-03-15 | 2007-08-15 | 杭州华为三康技术有限公司 | Log convergence processing method and convergence processing device |
CN101132375A (en) * | 2007-09-28 | 2008-02-27 | 杭州华三通信技术有限公司 | Network flux statistical method and device |
CN101267349A (en) * | 2008-04-29 | 2008-09-17 | 杭州华三通信技术有限公司 | Network traffic analysis method and device |
-
2010
- 2010-09-30 CN CN201010502543.5A patent/CN102447589B/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101018121A (en) * | 2007-03-15 | 2007-08-15 | 杭州华为三康技术有限公司 | Log convergence processing method and convergence processing device |
CN101132375A (en) * | 2007-09-28 | 2008-02-27 | 杭州华三通信技术有限公司 | Network flux statistical method and device |
CN101267349A (en) * | 2008-04-29 | 2008-09-17 | 杭州华三通信技术有限公司 | Network traffic analysis method and device |
Non-Patent Citations (2)
Title |
---|
郭剑云,曹庆华.NetFlow流量采集与聚合的研究实现.《现代电子技术》.2009,第32卷(第7期), * |
陈宁,徐同阁.一种高速流量聚合方法的设计与实现.《微计算机信息》.2008,第24卷(第3期), * |
Also Published As
Publication number | Publication date |
---|---|
CN102447589A (en) | 2012-05-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107219997B (en) | Method and device for verifying data consistency | |
CN107911249B (en) | Method, device and equipment for sending command line of network equipment | |
CN112131099B (en) | Version upgrading test method and device | |
CN107766575B (en) | Read-write separation database access method and device | |
CN109669622B (en) | File management method, file management device, electronic equipment and storage medium | |
CN107026881B (en) | Method, device and system for processing service data | |
CN105224546A (en) | Data storage and query method and apparatus | |
CN102354292A (en) | Method and system for checking consistency of records in master and backup databases | |
CN105512283A (en) | Data quality management and control method and device | |
CN104104717A (en) | Inputting channel data statistical method and device | |
CN102244758A (en) | Video-recording-file-based data acquisition method and equipment | |
CN102282544A (en) | Storage system | |
CN104731816A (en) | Method and device for processing abnormal business data | |
CN110879687B (en) | Data reading method, device and equipment based on disk storage | |
CN104834648A (en) | Log query method and device | |
CN111475105A (en) | Monitoring data storage method, device, server and storage medium | |
CN102447589B (en) | Method and device for aggregating records | |
CN101882135A (en) | Data processing method and device | |
CN106354587A (en) | Mirror image server and method for exporting mirror image files of virtual machine | |
CN109165175A (en) | Device identification generation method and device | |
CN106201772A (en) | The backup of a kind of operating system based on data center, restoration methods and device | |
CN107491458B (en) | Method, device and system for storing time series data | |
CN104754555A (en) | Number-backfilling method and device | |
CN106708445A (en) | Link selection method and device | |
CN106998436B (en) | Video backup method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address | ||
CP03 | Change of name, title or address |
Address after: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No. Patentee after: Xinhua three Technology Co., Ltd. Address before: 310053 Hangzhou hi tech Industrial Development Zone, Zhejiang province science and Technology Industrial Park, No. 310 and No. six road, HUAWEI, Hangzhou production base Patentee before: Huasan Communication Technology Co., Ltd. |
|
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20140730 Termination date: 20200930 |