CN105791035B - Data statistical approach and device - Google Patents
Data statistical approach and device Download PDFInfo
- Publication number
- CN105791035B CN105791035B CN201410777095.8A CN201410777095A CN105791035B CN 105791035 B CN105791035 B CN 105791035B CN 201410777095 A CN201410777095 A CN 201410777095A CN 105791035 B CN105791035 B CN 105791035B
- Authority
- CN
- China
- Prior art keywords
- data statistics
- index
- data
- message
- index information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The present invention provides a kind of data statistical approach and device, includes index information and data statistics in data statistics message this method comprises: obtaining data statistics message;Judge in index list with the presence or absence of index information identical with the index information in data statistics message;If there is index information identical with the index information in data statistics message in index list, then according to data statistics corresponding with index information in index list, and the data statistics in data statistics message, determine updated data statistics corresponding with index information in index list.The data that data statistical approach can quickly and accurately in statistics network in the embodiment of the present invention.
Description
Technical field
The present invention relates to network communication technology field, in particular to a kind of data statistical approach and device.
Background technique
As network is using more and more extensive, the data traffic in network is also more and more.In order to facilitate network management
Person grasps the feature of network traffic data in time, is urgently desirable to provide a kind of quick data statistical approach.
In the prior art, usually by carrying out that unlock is added to handle come the data in statistics network to data statistics message,
In, index address and data statistics value corresponding with the index address in data statistics message including data.When to data
When statistical message carries out plus unlock handles, data statistics device first locks data statistics message, and is locking successfully
When count the data statistics value under the index address in the data statistics message;After the completion of statistics, to the data statistics
Message unlocks.
But due to the case where being likely to occur locking failure when locking to data statistics message, for index ground
The identical two continuous data statistical messages in location, when being locked to second data statistics message, if locking failure
After needing that first data statistics message is waited to unlock, it can just relock second data statistics message and be counted,
What data statistics Messages-Waiting relocked takes a long time;In addition, data statistics device needs frequently during data statistics
Ground executes plus unlock operation, adds unlock operation itself time-consuming also long, therefore the speed of data statistics is slower.
Summary of the invention
In view of this, the present invention provides a kind of data statistical approach and device, to solve, data statistics is slow to be asked
Topic.
According to a first aspect of the embodiments of the present invention, a kind of data statistical approach is provided, which comprises
Data statistics message is obtained, includes index information and data statistics in the data statistics message;
Judge to believe in the index list with the presence or absence of index identical with the index information in the data statistics message
Breath;
If there is index information identical with the index information in the data statistics message, root in the index list
According to the data in data statistics corresponding with the index information in the index list and the data statistics message
Statistical information determines updated data statistics corresponding with the index information in the index list.
According to a second aspect of the embodiments of the present invention, a kind of data statistics device is provided, described device includes:
Acquiring unit includes that index information and data are united for obtaining data statistics message, in the data statistics message
Count information;
Judging unit is believed in the index list with the presence or absence of with the index in the data statistics message for judging
Cease identical index information;
Updating unit, for identical with the index information in the data statistics message when existing in the index list
When index information, united according to data statistics corresponding with the index information in the index list and the data
The data statistics in message are counted, determine updated data statistics corresponding with the index information in the index list
Information.
In conclusion by adopting the above-described technical solution, the beneficial effects of the present invention are:
In the embodiment of the present invention, data statistics device exists and acquisition by establishing index list, and in index list
Data statistics message in index information identical index information when, according to data corresponding with the index information in index list
Data statistics message in statistical information and data statistics message, come determine in index list it is corresponding with the index information more
Data statistics after new, data that can quickly and accurately in statistics network.
Detailed description of the invention
Fig. 1 is one embodiment flow chart of data statistical approach of the present invention;
Fig. 2 is the data format of data statistics message of the present invention;
Fig. 3 is another embodiment flow chart of data statistical approach of the present invention;
Fig. 4 is a kind of hardware structure diagram of equipment where data statistics device of the present invention;
Fig. 5 is one embodiment block diagram of data statistics device of the present invention.
Specific embodiment
Technical solution in embodiment in order to enable those skilled in the art to better understand the present invention, and make of the invention real
The above objects, features, and advantages for applying example can be more obvious and easy to understand, with reference to the accompanying drawing to technical side in the embodiment of the present invention
Case is described in further detail.
It is one embodiment flow chart of data statistical approach of the present invention, this method may include following step referring to Fig. 1
It is rapid:
Step 101 obtains data statistics message, may include index information and data statistics letter in the data statistics message
Breath.Wherein, which can be index address or the acquisition sequencing according to data statistics message, be the rope of data
Draw the index value that address is distributed;The data statistics can be the data statistics value as unit of word or byte etc..Data
Statistic device can find the data according to the index information of data;The number can be determined according to the data statistics of data
According to quantity, which occupies how many a words or byte etc..
In a preferred embodiment of the invention, after data statistics device obtains data statistics message for the first time, data statistics
Device can establish index list, include that index information and data statistics corresponding with the index information are believed in the index list
Breath.
Data statistics device can obtain the rope of the data when establishing index list according to the data statistics message first
Draw address and data statistics, the data format of the data statistics message is as shown in Figure 2, wherein the data statistics message package
Eight bytes are included, index address accounts for four bytes (i.e. 32), and data statistics account for three bytes (i.e. 24), for example, needle
It is the data statistics message of " 0x1234abcd00605040 " to data format, the index address of data is " 0x1234abcd ",
Data statistics are " 0x060504 ";It is the data statistics message of " 0x1a2b3c4d00010203 " for data format, it should
The index address of data is " 0x1a2b3c4d ", and data statistics are " 0x010203 ".
Data statistics device, can be successively suitable according to the acquisition of data statistics message after the index address for obtaining the data
Sequence is the index address distribution index value of data, to obtain the index information of the data.Wherein, data statistics device can be with
The index value that numerical value is 1 is distributed for the index address of the data statistics message obtained for the first time, and so on.Since data statistics disappears
The index address of each data may be discrete value in breath, and maximum index address is likely to be breached 0xffffffff, index
The memory of the bigger occupancy of the value of address is bigger, therefore data statistics device is by the index for the distribution of each data and the data
The corresponding index value in location, can be improved the utilization rate of memory, reduce the waste of hardware resource.
Data statistics device obtain the data index information after, new list item can be created store index information with
And data statistics corresponding with the index information, to establish index list.
Step 102 judges to believe in index list with the presence or absence of index identical with the index information in data statistics message
Breath, and if it exists, then follow the steps 103;Otherwise, step 104 is executed.
In a preferred embodiment of the invention, when data statistics device obtains data statistics message again, due to index
List is not empty, therefore data statistics device needs to judge to whether there is and the index in data statistics message in index list
The identical index information of information.
Step 103 disappears according to data statistics corresponding with the index information in index list and the data statistics
The data statistics of breath determine updated data statistics corresponding with the index information in index list.
In a preferred embodiment of the invention, when the data statistics that the data statistics are as unit of word or byte etc.
When value, data statistics device can disappear data statistics value corresponding with the index information in index list with the data statistics
The data statistics value of breath is added, and the result that will add up is as updated data corresponding with the index information in index list
Statistical value.
Step 104 creates new list item in index list, comes index information and data in storing data statistical message
Statistical information.
As seen from the above-described embodiment, data statistics device exists and obtains by establishing index list, and in index list
In the data statistics message taken when the identical index information of index information, according to number corresponding with the index information in index list
Data statistics message in information and data statistics message according to statistics, it is corresponding with the index information in index list to determine
Updated data statistics can quickly and accurately count the data in network.
In the above-described embodiments, due to FPGA (Field-Programmable Gate Array, i.e. field programmable gate
Array) have the characteristics that high-speed read-write, therefore data statistics device can realize the statistics of data in network using FPGA, from
And improve data statistics speed.In addition, due in network data volume it is bigger, data statistics device can store index list
In DRAM (Dynamic RandomAccess Memory, dynamic random access memory), to reduce space occupancy rate.
It is the flow chart of another embodiment of data statistical approach of the present invention, data statistics in the embodiment referring to Fig. 3
Device successively obtains three data statistics message A, B1 and B2, and wherein the data statistics value of data statistics message A, B1 and B2 are equal
It is 100, the index information in data statistics message B1 and B2 is identical, in data statistics message A and data statistics message B1 and B2
Index information it is not identical.Index list is not empty, and in index list there is no with data statistics message A, B1 and
The index information of B2 identical index information may include: when using method statistic data in the present invention
Step 301, when obtaining data statistics message A, due in index list there is no in data statistics message A
The identical index information of index information, therefore establish in index list the rope that new list item comes in storing data statistical message A
Fuse breath and data statistics value.
Step 302, when obtaining data statistics message B1, due in index list there is no in data statistics message B1
The identical index information of index information, therefore establish new list item in index list and come in storing data statistical message B1
Index information and data statistics value.
Step 303, when obtaining data statistics message B2, due to the index information phase in data statistics message B1 and B2
Together, therefore in index list there is index information identical with the index information in data statistics message B2, at this point, data statistics
Device can be by the number in the data statistics value 100 of the data statistics message B1 stored in index list and data statistics message B2
Value 100 is added according to statistics, using the result 200 of addition as updated data system corresponding with the index information in index list
Evaluation.
Corresponding with aforementioned data statistical method embodiment, the present invention also provides the embodiments of data statistics device.
Data statistics Installation practice of the present invention can also pass through hardware or software and hardware combining by software realization
Mode is realized.Taking software implementation as an example, as the device on a logical meaning, being will be non-by the processor of equipment where it
Corresponding computer program instructions are read into memory what operation was formed in volatile memory.For hardware view, such as Fig. 4
It is shown, it is a kind of hardware structure diagram of equipment where data statistics device of the present invention, in addition to processor shown in Fig. 4, network connect
Except mouth, memory, the equipment in embodiment where device usually can also include other hardware, such as be responsible for turn of processing message
Send out chip etc.;The equipment is also possible to be distributed equipment from hardware configuration, may include multiple interface cards, so as to
The extension of hardware view progress Message processing.
It is one embodiment block diagram of data statistics device of the present invention referring to Fig. 5, the apparatus may include:
Acquiring unit 510 includes index information and data in the data statistics message for obtaining data statistics message
Statistical information;
Judging unit 520 whether there is and the rope in the data statistics message in the index list for judging
Fuse ceases identical index information;
Updating unit 530, for existing in the index list and the index information phase in the data statistics message
With index information when, according to data statistics corresponding with the index information in the index list and the number
Data statistics in message according to statistics determine updated data corresponding with the index information in the index list
Statistical information.
In an optional implementation, described device can also include:
Unit 540 is established, for establishing index list after obtaining data statistics message, the index list includes rope
Fuse breath and data statistics corresponding with the index information.
In another optional implementation, described device can also include:
Creating unit 550, for being not present in the index list and the index information in the data statistics message
When identical index information, creation is used for new list item in the index list, to store in the data statistics message
Index information and data statistics.
In another optional implementation,
The updating unit 530, specifically for existing in the index list and the rope in the data statistics message
When fuse ceases identical index information, if the data statistics of the index list and the data statistics message are data system
Evaluation, then by data statistics value corresponding with the index information in the index list, in the data statistics message
Data statistics value be added, and using the result of the addition as update corresponding with the index information in the index list after
Data statistics value.
In another optional implementation,
Index information in the index list and the data statistics message may include: data index address or
It is the index value that the index address of each data distributes according to the acquisition sequencing of the data statistics message.
The function of each unit and the realization process of effect are specifically detailed in the above method and correspond to step in above-mentioned apparatus
Realization process, details are not described herein.
For device embodiment, since it corresponds essentially to embodiment of the method, so related place is referring to method reality
Apply the part explanation of example.The apparatus embodiments described above are merely exemplary, wherein described be used as separation unit
The unit of explanation may or may not be physically separated, and component shown as a unit can be or can also be with
It is not physical unit, it can it is in one place, or may be distributed over multiple network units.It can be according to actual
The purpose for needing to select some or all of the modules therein to realize the present invention program.Those of ordinary skill in the art are not paying
Out in the case where creative work, it can understand and implement.
As seen from the above-described embodiment, data statistics device exists and obtains by establishing index list, and in index list
In the data statistics message taken when the identical index information of index information, according to number corresponding with the index information in index list
Data statistics message in information and data statistics message according to statistics, it is corresponding with the index information in index list to determine
Updated data statistics, data that can quickly and accurately in statistics network.
Those skilled in the art after considering the specification and implementing the invention disclosed here, will readily occur to of the invention its
Its embodiment.This application is intended to cover any variations, uses, or adaptations of the invention, these modifications, purposes or
Person's adaptive change follows general principle of the invention and including the undocumented common knowledge in the art of the present invention
Or conventional techniques.
It should be understood that the present invention is not limited to the precise structure already described above and shown in the accompanying drawings, and
And various modifications and changes may be made without departing from the scope thereof.
Claims (10)
1. a kind of data statistical approach, which is characterized in that the described method includes:
Data statistics message is obtained, includes index information and data statistics in the data statistics message, wherein the rope
The index address for drawing information and date is related;
Judge in index list with the presence or absence of index information identical with the index information in the data statistics message;
If there is index information identical with the index information in the data statistics message in the index list, according to institute
State data statistics corresponding with the index information in index list and the data statistics in the data statistics message
Information determines updated data statistics corresponding with the index information in the index list.
2. the method according to claim 1, wherein after the acquisition data statistics message, the method
Further include:
Index list is established, the index list includes index information and data statistics corresponding with index information letter
Breath.
3. the method according to claim 1, wherein the method also includes:
If index information identical with the index information in the data statistics message is not present in the index list, in institute
It states and creates new list item in index list, to store index information and data statistics in the data statistics message.
4. the method according to claim 1, wherein according to corresponding with the index information in the index list
Data statistics and the data statistics message in data statistics, determine in the index list with it is described
The corresponding updated data statistics of index information, specifically:
When the data statistics of the index list and the data statistics message are data statistics value, by the index column
Data statistics value corresponding with the index information in table, is added with the data statistics value in the data statistics message, and will
The result of the addition is as updated data statistics value corresponding with the index information in the index list.
5. method according to claim 1 to 4, which is characterized in that the index list and data system
Index information in meter message includes: the index address of data or the acquisition sequencing according to the data statistics message,
The index value distributed for the index address of each data.
6. a kind of data statistics device, which is characterized in that described device includes:
Acquiring unit includes that index information and data statistics are believed for obtaining data statistics message, in the data statistics message
Breath, wherein the index information is related to the index address of data;
Judging unit, for judging in index list with the presence or absence of identical with the index information in the data statistics message
Index information;
There is index identical with the index information in the data statistics message in the index list for working as in updating unit
When information, disappeared according to data statistics corresponding with the index information in the index list and the data statistics
Data statistics in breath determine updated data statistics letter corresponding with the index information in the index list
Breath.
7. device according to claim 6, which is characterized in that described device further include:
Unit is established, for establishing index list after obtaining data statistics message, the index list includes index information
And data statistics corresponding with the index information.
8. device according to claim 6, which is characterized in that described device further include:
Creating unit, for when there is no ropes identical with the index information in the data statistics message in the index list
When fuse ceases, new list item is created, in the index list to store the index information sum number in the data statistics message
Information according to statistics.
9. device according to claim 6, which is characterized in that the updating unit is specifically used for working as the index list
When middle presence index information identical with the index information in the data statistics message, if the index list and the data
The data statistics of statistical message are data statistics value, then by data corresponding with the index information in the index list
Statistical value is added with the data statistics value in the data statistics message, and using the result of the addition as the index column
Updated data statistics value corresponding with the index information in table.
10. device according to any one of claims 6 to 9, which is characterized in that the index list and data system
Index information in meter message includes: the index address of data or the acquisition sequencing according to the data statistics message,
The index value distributed for the index address of each data.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410777095.8A CN105791035B (en) | 2014-12-15 | 2014-12-15 | Data statistical approach and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410777095.8A CN105791035B (en) | 2014-12-15 | 2014-12-15 | Data statistical approach and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105791035A CN105791035A (en) | 2016-07-20 |
CN105791035B true CN105791035B (en) | 2019-05-07 |
Family
ID=56374660
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410777095.8A Active CN105791035B (en) | 2014-12-15 | 2014-12-15 | Data statistical approach and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105791035B (en) |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101119246B (en) * | 2007-09-20 | 2010-08-18 | 杭州华三通信技术有限公司 | Data packet sampling statistic method and apparatus |
CN101321088A (en) * | 2008-07-18 | 2008-12-10 | 北京星网锐捷网络技术有限公司 | Method and device for IP data flow information statistics |
CN102255754B (en) * | 2011-07-08 | 2013-07-10 | 中国人民解放军国防科学技术大学 | Serial accessing high speed backbone network traffic acquisition and monitoring method |
CN103379039B (en) * | 2012-04-23 | 2016-12-14 | 华为技术有限公司 | A kind of for flowing the method for statistics, Apparatus and system |
CN103647666A (en) * | 2013-12-13 | 2014-03-19 | 北京中创信测科技股份有限公司 | Method and apparatus for counting call detail record (CDR) messages and outputting results in real time |
-
2014
- 2014-12-15 CN CN201410777095.8A patent/CN105791035B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN105791035A (en) | 2016-07-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105224255B (en) | A kind of storage file management method and device | |
CN110502546A (en) | A kind of data processing method and device | |
CN108268372A (en) | Mock test processing methods, device, storage medium and computer equipment | |
CN111628941A (en) | Network traffic classification processing method, device, equipment and medium | |
CN109726004B (en) | Data processing method and device | |
CN111008075A (en) | Load balancing system, method, device, equipment and medium | |
CN105264509A (en) | Adaptive interrupt coalescing in a converged network | |
CN105094981B (en) | A kind of method and device of data processing | |
CN107908521A (en) | A kind of monitoring method of container performance on the server performance and node being applied under cloud environment | |
CN107402956A (en) | Data processing method, equipment and the computer-readable recording medium of big task | |
CN107451853A (en) | Method, apparatus, system and the storage medium that a kind of red packet distributes in real time | |
WO2018157768A1 (en) | Method and device for scheduling running device, and running device | |
CN108667903B (en) | Data transmission method for uplink, device and storage medium | |
DE112014001397T5 (en) | Flux-based low-latency network operation | |
DE102013209934B4 (en) | Start or stop virtual servers in proper order | |
CN109995787A (en) | A kind of data processing method and relevant device | |
CN110019444A (en) | A kind of operation requests processing method, device, equipment and system | |
US9923794B2 (en) | Method, apparatus, and system for identifying abnormal IP data stream | |
CN104881295B (en) | A kind of window display processing method and device | |
CN106888264A (en) | A kind of method for interchanging data and device | |
CN107800556A (en) | Interface generation system, drill through service layer's device, data transmission method for uplink | |
CN106909436A (en) | Produce the method and system of the dependency relation of virtual machine message queue application program | |
CN105791035B (en) | Data statistical approach and device | |
CN105099753B (en) | The method of Network Management System and its processing business | |
CN105162837B (en) | The method and system of I/O throughputs are promoted under mass data storage environment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Address after: Binjiang District and Hangzhou city in Zhejiang Province Road 310051 No. 68 in the 6 storey building Applicant after: Hangzhou Dipu Polytron Technologies Inc Address before: Binjiang District and Hangzhou city in Zhejiang Province Road 310051 No. 68 in the 6 storey building Applicant before: Hangzhou Dipu Technology Co., Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant |