CN105512271A - UV counting method and device for real-time analysis system and server - Google Patents

UV counting method and device for real-time analysis system and server Download PDF

Info

Publication number
CN105512271A
CN105512271A CN201510883194.9A CN201510883194A CN105512271A CN 105512271 A CN105512271 A CN 105512271A CN 201510883194 A CN201510883194 A CN 201510883194A CN 105512271 A CN105512271 A CN 105512271A
Authority
CN
China
Prior art keywords
counting number
adaptive base
base counting
number algorithm
algorithm instance
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
CN201510883194.9A
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.)
Beijing Xiaomi Technology Co Ltd
Xiaomi Inc
Original Assignee
Xiaomi Inc
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 Xiaomi Inc filed Critical Xiaomi Inc
Priority to CN201510883194.9A priority Critical patent/CN105512271A/en
Publication of CN105512271A publication Critical patent/CN105512271A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a UV counting method and device for a real-time analysis system and a server. The method includes the steps that user identifiers of all visitors visiting websites through the Internet in preset time frames are added into adaptive cardinal number counting algorithm objects corresponding to the preset time frames, and the adaptive cardinal number counting algorithm objects are serialized and then written into a database; unique visitor (UV) counting is carried out according to an object series obtained after serialization in the database. In this way, due the fact that the size of memory space occupied by the adaptive cardinal number counting algorithm objects can be preset, the size of memory space occupied by UV counting is still the size of the memory space occupied by the adaptive cardinal number counting algorithm objects even the number of user identifiers of visitors needing to be counted is very large, and thus large memory space is saved.

Description

The statistical method of UV, device and server in real-time analyzer
Technical field
The present invention relates to computer technology, particularly relate to the statistical method of UV in a kind of real-time analyzer, device and server.
Background technology
Along with the arrival of large data age, usually by obtaining valuable information to the analysis of data; Because the value of data was successively decreased rapidly, so carry out real-time analysis to data to become extremely important along with the time that data produce.
Independent visitor (UniqueVisitor is called for short UV) statistics is a very important index in real-time analysis technology.Wherein, traditional UV statistical method to need all user ID of statistics to be all stored in internal memory; Further, the number (being the value of UV) of described all user ID is calculated; Visible, when real-time analyzer needs to calculate a large amount of UV, traditional UV statistical method needs a large amount of internal memory, and the internal memory of this real-time analyzer possibly cannot meet.
Summary of the invention
For overcoming Problems existing in correlation technique, the disclosure provides the statistical method of UV in a kind of real-time analyzer, device and server.
According to the first aspect of disclosure embodiment, the statistical method of UV in a kind of real-time analyzer is provided, comprises:
By passing through the user ID of all visitors of internet access website in each preset period of time, add in the adaptive base counting number algorithm instance corresponding with described preset period of time, and by write into Databasce after the serializing of described adaptive base counting number algorithm instance;
Carry out independent visitor UV according to the object sequence after serializing in described database to add up.
The technical scheme that embodiment of the present disclosure provides can comprise following beneficial effect: by the user ID of all visitors by passing through internet access website in each preset period of time, add in the adaptive base counting number algorithm instance corresponding with described preset period of time, shared by adaptive base counting number algorithm instance, internal memory can preset size, even if need the user ID number of the visitor of statistics very many, the shared internal memory of UV statistics remains the memory size shared by adaptive base counting number algorithm instance, therefore, a large amount of internal memory is saved.
Further, described will by the user ID of all visitors of internet access website in each preset period of time, add in the adaptive base counting number algorithm instance corresponding with described preset period of time, and by write into Databasce after the serializing of described adaptive base counting number algorithm instance, comprising:
In each described preset period of time, by calling the interpolation interface of adaptive base counting number algorithm, by passing through the user ID of all visitors of internet access website in described preset period of time, add in the adaptive base counting number algorithm instance corresponding with described preset period of time;
By calling the serializing interface of described adaptive base counting number algorithm, by write into Databasce after the serializing of described adaptive base counting number algorithm instance, and record the time of write into Databasce.
The technical scheme that embodiment of the present disclosure provides can comprise following beneficial effect: by the user ID of all visitors by passing through internet access website in each preset period of time, add in the adaptive base counting number algorithm instance corresponding with described preset period of time, therefore, a large amount of internal memory is saved.
Further, describedly carry out independent visitor UV according to the object sequence after serializing in described database and add up, comprising:
From described database, obtain the first object sequence corresponding in the given period, and described first object sequence is deserialized as at least one objective self-adapting radix numeration algorithm instance;
At least one objective self-adapting radix numeration algorithm instance described is added, obtains general objective adaptive base counting number algorithm instance;
Inquire about the number of the user ID that described general objective adaptive base counting number algorithm instance comprises.
Further, described described first object sequence is deserialized as at least one objective self-adapting radix numeration algorithm instance, comprises:
By calling the unserializing interface of described adaptive base counting number algorithm, described first object sequence is deserialized as at least one objective self-adapting radix numeration algorithm instance.
Further, described by described at least one objective self-adapting radix numeration algorithm instance addition, obtain general objective adaptive base counting number algorithm instance, comprising:
By calling the merging interface of described adaptive base counting number algorithm, at least one objective self-adapting radix numeration algorithm instance described being added, obtaining described general objective adaptive base counting number algorithm instance.
Further, the number of the user ID that described inquiry described general objective adaptive base counting number algorithm instance comprises, comprising:
By calling the counting interface of described adaptive base counting number algorithm, inquire about the number of the user ID that described general objective adaptive base counting number algorithm instance comprises.
The technical scheme that embodiment of the present disclosure provides can comprise following beneficial effect: disclose a kind of concrete mode of carrying out independent visitor UV statistics according to the object sequence after serializing in described database, by the first object sequence corresponding in the given period obtained from database is deserialized as at least one objective self-adapting radix numeration algorithm instance, and at least one objective self-adapting radix numeration algorithm instance described is added, obtain general objective adaptive base counting number algorithm instance, and then inquire about the number (i.e. the value of UV) of the user ID that described general objective adaptive base counting number algorithm instance comprises, visible, not only save a large amount of internal memory, achieve the add operation of UV result simultaneously.
According to the second aspect of disclosure embodiment, the statistic device of UV in a kind of real-time analyzer is provided, comprises:
Processing module, be configured to by each preset period of time by the user ID of all visitors of internet access website, add in the adaptive base counting number algorithm instance corresponding with described preset period of time, and by write into Databasce after the serializing of described adaptive base counting number algorithm instance;
Statistical module, is configured to the object sequence after according to serializing in described database and carries out independent visitor UV and add up.
Further, described processing module comprises:
Add submodule, be configured in each described preset period of time, by calling the interpolation interface of adaptive base counting number algorithm, by passing through the user ID of all visitors of internet access website in described preset period of time, add in the adaptive base counting number algorithm instance corresponding with described preset period of time;
Serializing submodule, is configured to the serializing interface by calling described adaptive base counting number algorithm, by write into Databasce after the serializing of described adaptive base counting number algorithm instance, and records the time of write into Databasce.
Further, described statistical module comprises:
Unserializing submodule, is configured to obtain the first object sequence corresponding in the given period from described database, and described first object sequence is deserialized as at least one objective self-adapting radix numeration algorithm instance;
Be added submodule, be configured at least one objective self-adapting radix numeration algorithm instance described to be added, obtain general objective adaptive base counting number algorithm instance;
Inquiry submodule, is configured to the number of inquiring about the user ID that described general objective adaptive base counting number algorithm instance comprises.
Further, described unserializing submodule is configured to: by calling the unserializing interface of described adaptive base counting number algorithm, described first object sequence is deserialized as at least one objective self-adapting radix numeration algorithm instance.
Further, described addition submodule is configured to: by calling the merging interface of described adaptive base counting number algorithm, is added by least one objective self-adapting radix numeration algorithm instance described, obtains described general objective adaptive base counting number algorithm instance.
Further, described inquiry submodule is configured to: by calling the counting interface of described adaptive base counting number algorithm, inquires about the number of the user ID that described general objective adaptive base counting number algorithm instance comprises.
According to the third aspect of disclosure embodiment, a kind of server is provided, comprises: processor and the storer for storage of processor executable instruction;
Described processor is configured to:
By passing through the user ID of all visitors of internet access website in each preset period of time, add in the adaptive base counting number algorithm instance corresponding with described preset period of time, and by write into Databasce after the serializing of described adaptive base counting number algorithm instance;
Carry out independent visitor UV according to the object sequence after serializing in described database to add up.
The technical scheme that embodiment of the present disclosure provides can comprise following beneficial effect: provide the statistical method of UV in a kind of real-time analyzer, device and server, by the user ID of all visitors by passing through internet access website in each preset period of time, add in the adaptive base counting number algorithm instance corresponding with described preset period of time, and by write into Databasce after the serializing of described adaptive base counting number algorithm instance, and then carry out independent visitor UV according to the object sequence after serializing in described database and add up.Visible, shared by adaptive base counting number algorithm instance, internal memory can preset size, therefore, saves a large amount of internal memory.
Should be understood that, it is only exemplary and explanatory that above general description and details hereinafter describe, and can not limit the disclosure.
Accompanying drawing explanation
Accompanying drawing to be herein merged in instructions and to form the part of this instructions, shows embodiment according to the invention, and is used from instructions one and explains principle of the present invention.
Fig. 1 is the process flow diagram of the statistical method of UV in a kind of real-time analyzer according to an exemplary embodiment;
Fig. 2 is the process flow diagram of the statistical method of UV in a kind of real-time analyzer according to another exemplary embodiment;
Fig. 3 is the process flow diagram of the statistical method of UV in a kind of real-time analyzer according to another exemplary embodiment;
Fig. 4 is the block diagram of the statistic device embodiment one of UV in a kind of real-time analyzer according to an exemplary embodiment;
Fig. 5 is the block diagram of the statistic device embodiment two of UV in a kind of real-time analyzer according to an exemplary embodiment;
Fig. 6 is the block diagram of the statistic device embodiment three of UV in a kind of real-time analyzer according to an exemplary embodiment;
Fig. 7 is the block diagram of the entity of a kind of server according to an exemplary embodiment;
Fig. 8 is the block diagram of a kind of server 1900 according to an exemplary embodiment.
By above-mentioned accompanying drawing, illustrate the embodiment that the disclosure is clear and definite more detailed description will be had hereinafter.These accompanying drawings and text description be not in order to limited by any mode the disclosure design scope, but by reference to specific embodiment for those skilled in the art illustrate concept of the present disclosure.
Embodiment
Here will be described exemplary embodiment in detail, its sample table shows in the accompanying drawings.When description below relates to accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawing represents same or analogous key element.Embodiment described in following exemplary embodiment does not represent all embodiments consistent with the present invention.On the contrary, they only with as in appended claims describe in detail, the example of apparatus and method that aspects more of the present invention are consistent.
Fig. 1 is the process flow diagram of the statistical method of UV in a kind of real-time analyzer according to an exemplary embodiment, and as shown in Figure 1, in this real-time analyzer, the statistical method of UV can be applicable in server.Comprise the following steps:
In step S101, the user ID of all visitors of internet access website will be passed through in each preset period of time, add in the adaptive base counting number algorithm instance corresponding with described preset period of time, and by write into Databasce after the serializing of described adaptive base counting number algorithm instance.
In disclosure embodiment, propose to adopt adaptive base counting number algorithm to carry out the statistics of UV, the core concept of this algorithm is shown in paper " Fastandaccuratetrafficmatrixmeasurementusingadaptivecard inalitycounting ".Adaptive base counting number algorithm mainly provides with lower interface:
1) add interface: for increasing and counting user mark;
2) serializing interface: for the data structure serializing by adaptive base counting number algorithm instance, obtain the object sequence after serializing;
3) unserializing interface: for object sequence being deserialized as adaptive base counting number algorithm instance;
4) interface is merged: for providing the add operation of adaptive base counting number algorithm instance;
5) interface is counted: for adding up and returning the UV number (i.e. the number of user ID) in adaptive base counting number algorithm instance;
6) interface is reset: for resetting the data structure of adaptive base counting number algorithm instance.
In this step, the user ID of all visitors of internet access website will be passed through in each preset period of time, add in the adaptive base counting number algorithm instance corresponding with described preset period of time, and by write into Databasce after the serializing of described adaptive base counting number algorithm instance; Such as add in adaptive base counting number algorithm instance A by 8 points (not comprising for 8 o'clock sharps) to 9 these time periods by the user ID of all visitors of internet access website, object sequence A is obtained by after adaptive base counting number algorithm instance A serializing when 9 o'clock sharp, and by described object sequence A write into Databasce; Similarly, add in adaptive base counting number algorithm instance B by 9 points (not comprising for 9 o'clock sharps) to 11 these time periods by the user ID of all visitors of internet access website, object sequence B is obtained by after adaptive base counting number algorithm instance B serializing when 11 o'clock sharp, and by described object sequence B write into Databasce.Alternatively, each described preset period of time can be identical or different, and disclosure embodiment is not restricted this.
Alternatively, in the user ID of all visitors by passing through internet access website in each preset period of time, before adding in the adaptive base counting number algorithm instance corresponding with described preset period of time, also comprise: construct an adaptive base counting number algorithm instance.Wherein, in different preset period of time, this adaptive base counting number algorithm instance is reset to different adaptive base counting number algorithm instance; Such as, 8 points (not comprising for 8 o'clock sharps) are in 9 these time periods, and this adaptive base counting number algorithm instance is reset as adaptive base counting number algorithm instance A; 9 points (not comprising for 9 o'clock sharps) are in 11 these time periods, adaptive base counting number algorithm instance A is reset as adaptive base counting number algorithm instance B, the like, by after in write into Databasce after the adaptive base counting number algorithm instance serializing corresponding with described preset period of time in each preset period of time, this adaptive base counting number algorithm instance is reset.
In traditional UV statistical method, will all user ID of statistics be needed all to be stored in internal memory, and calculate the number (being the value of UV) of described all user ID; Compared to traditional UV statistical method, in disclosure embodiment, by the user ID of all visitors by passing through internet access website in each preset period of time, add in the adaptive base counting number algorithm instance corresponding with described preset period of time, wherein, shared by adaptive base counting number algorithm instance, internal memory can preset size, even if need the user ID number of the visitor of statistics very many, the shared internal memory of UV statistics remains the memory size shared by adaptive base counting number algorithm instance, therefore, a large amount of internal memory is saved.
In step s 102, carry out independent visitor UV according to the object sequence after serializing in described database to add up.
By step S101, in described database, preserve the object sequence after adaptive base counting number algorithm instance serializing corresponding to different preset period of time; Such as, 8 points (not comprising for 8 o'clock sharps) are to the object sequence A of 9 these time periods, and 9 points (not comprising for 9 o'clock sharps) are to the object sequence B etc. of 11 these time periods.
In S102 step, carry out independent visitor UV according at least one object sequence after serializing in described database and add up; Alternatively, the object sequence (as object sequence A) that in the period to be checked, (as 8 o'clock to 9 o'clock) are corresponding is obtained from database, described object sequence is deserialized as adaptive base counting number algorithm instance (as adaptive base counting number algorithm instance A), and then inquires about the user ID number in this adaptive base counting number algorithm instance A; Alternatively, the object sequence (as object sequence A and object sequence B) that in the period to be checked, (as 8 o'clock to 11 o'clock) are corresponding is obtained from database, described object sequence is deserialized as adaptive base counting number algorithm instance (as adaptive base counting number algorithm instance A and adaptive base counting number algorithm instance B), and adaptive base counting number algorithm instance A and adaptive base counting number algorithm instance B is carried out addition obtain total adaptive base counting number algorithm instance, and then inquire about the user ID number in this total adaptive base counting number algorithm instance.
The statistical method of UV in a kind of real-time analyzer that the present embodiment provides, by the user ID of all visitors by passing through internet access website in each preset period of time, add in the adaptive base counting number algorithm instance corresponding with described preset period of time, and by write into Databasce after the serializing of described adaptive base counting number algorithm instance; Carry out independent visitor UV according to the object sequence after serializing in described database to add up; Visible, in disclosure embodiment, by the user ID of all visitors by passing through internet access website in each preset period of time, add in the adaptive base counting number algorithm instance corresponding with described preset period of time, shared by adaptive base counting number algorithm instance, internal memory can preset size, even if need the user ID number of the visitor of statistics very many, the shared internal memory of UV statistics remains the memory size shared by adaptive base counting number algorithm instance, therefore, a large amount of internal memory is saved.
Fig. 2 is the process flow diagram of the statistical method of UV in a kind of real-time analyzer according to another exemplary embodiment.On the basis of above-described embodiment, as shown in Figure 2, the specific implementation step of above-mentioned steps S101 comprises:
In step s 201, in each described preset period of time, by calling the interpolation interface of adaptive base counting number algorithm, by passing through the user ID of all visitors of internet access website in described preset period of time, add in the adaptive base counting number algorithm instance corresponding with described preset period of time.
In this step, in each described preset period of time, by calling the interpolation interface of adaptive base counting number algorithm, by passing through the user ID of all visitors of internet access website in described preset period of time, add in the adaptive base counting number algorithm instance corresponding with described preset period of time; Such as 8 points (not comprising for 8 o'clock sharps) are adaptive base counting number algorithm instance A to the adaptive base counting number algorithm instance that 9 these time periods are corresponding; Similarly, 9 points (not comprising for 9 o'clock sharps) are adaptive base counting number algorithm instance B to the adaptive base counting number algorithm instance that 11 these time periods are corresponding.
In step S202, by calling the serializing interface of described adaptive base counting number algorithm, by write into Databasce after the serializing of described adaptive base counting number algorithm instance, and record the time of write into Databasce.
In this step, in each described preset period of time, by calling the serializing interface of described adaptive base counting number algorithm, by in write into Databasce after the adaptive base counting number algorithm instance serializing corresponding with described preset period of time, and record the time (for inquiring about object sequence corresponding in the given period) of write into Databasce; Such as obtain object sequence A when 9 o'clock sharp by after adaptive base counting number algorithm instance A serializing, and recorded for 9 o'clock sharps by described object sequence A write into Databasce simultaneously; Similarly, obtain object sequence B when 11 o'clock sharp by after adaptive base counting number algorithm instance B serializing, and recorded for 11 o'clock sharps by described object sequence B write into Databasce simultaneously.
The statistical method of UV in a kind of real-time analyzer that the present embodiment provides, by the user ID of all visitors by passing through internet access website in each preset period of time, add in the adaptive base counting number algorithm instance corresponding with described preset period of time, therefore, save a large amount of internal memory.
Fig. 3 is the process flow diagram of the statistical method of UV in a kind of real-time analyzer according to another exemplary embodiment.As shown in Figure 3, on the basis of the embodiment shown in above-mentioned Fig. 1 and/or Fig. 2, carry out independent visitor UV according to the object sequence after serializing in described database and add up, can specifically comprise:
In step S301, from described database, obtain the first object sequence corresponding in the given period, and described first object sequence is deserialized as at least one objective self-adapting radix numeration algorithm instance.
In this step, the first object sequence corresponding in the given period is obtained from described database, alternatively, described first object sequence may comprise: the object sequence obtained after the adaptive base counting number algorithm instance serializing that preset period of time described in is corresponding, such as: described first object sequence comprises: the object sequence (as object sequence A) that in the given period, (as 8 o'clock to 9 o'clock) are corresponding; Alternatively, described first object sequence also may comprise: the object sequence that adaptive base counting number algorithm instance corresponding to preset period of time described in two or more obtains after serializing respectively, such as: described first object sequence comprises: the object sequence (as object sequence A and object sequence B) that in the given period, (as 8 o'clock to 11 o'clock) are corresponding.
Further, described first object sequence is deserialized as at least one objective self-adapting radix numeration algorithm instance, alternatively, by calling the unserializing interface of described adaptive base counting number algorithm, described first object sequence is deserialized as at least one objective self-adapting radix numeration algorithm instance; Such as, when described first object sequence comprises: time object sequence (as object sequence A) that in the given period, (as 8 o'clock to 9 o'clock) are corresponding, by calling the unserializing interface of described adaptive base counting number algorithm, described object sequence A is deserialized as objective self-adapting radix numeration algorithm instance (as adaptive base counting number algorithm instance A); Alternatively, when described first object sequence comprises: time object sequence (as object sequence A and object sequence B) that in the given period, (as 8 o'clock to 11 o'clock) are corresponding, by calling the unserializing interface of described adaptive base counting number algorithm, described first object sequence is deserialized as two objective self-adapting radix numeration algorithm instance (as adaptive base counting number algorithm instance A and as described in adaptive base counting number algorithm instance B).
In step s 302, at least one objective self-adapting radix numeration algorithm instance described is added, obtains general objective adaptive base counting number algorithm instance.
In this step, alternatively, by calling the merging interface of described adaptive base counting number algorithm, at least one objective self-adapting radix numeration algorithm instance described being added, obtaining described general objective adaptive base counting number algorithm instance, alternatively, by calling the merging interface of described adaptive base counting number algorithm, in the process that at least one objective self-adapting radix numeration algorithm instance described is added, consider the factor of same user ID, such as: objective self-adapting radix numeration algorithm instance 1 comprises user ID A, objective self-adapting radix numeration algorithm instance 2 comprises user ID A, then objective self-adapting radix numeration algorithm instance 1 and objective self-adapting radix numeration algorithm instance 2 are added the general objective adaptive base counting number algorithm instance obtained and (comprise a user ID A, but not two user ID A).
In traditional UV statistical method, all be stored in needing all user ID of statistics in internal memory, because same user ID may be stored in the internal memory of two machines (or multiple stage machine) in section sometime simultaneously, or same user ID within two time periods (or in multiple time period) is stored in the internal memory of a machine respectively, visible, the UV result in two time periods of two machines or same machine cannot directly be added; Compared to traditional UV statistical method, in disclosure embodiment, by at least one objective self-adapting radix numeration algorithm instance is added, obtain general objective adaptive base counting number algorithm instance, and then inquire about the number of the user ID that this general objective adaptive base counting number algorithm instance comprises, thus the add operation achieved the UV result in two time periods of two machines or same machine, certainly also support the add operation of the UV result of other sight.
In step S303, inquire about the number of the user ID that described general objective adaptive base counting number algorithm instance comprises.
In this step, alternatively, by calling the counting interface of described adaptive base counting number algorithm, inquire about the number of the user ID that described general objective adaptive base counting number algorithm instance comprises, i.e. the value of UV.
In the present embodiment, by the user ID of all visitors by passing through internet access website in each preset period of time, add in the adaptive base counting number algorithm instance corresponding with described preset period of time, and by write into Databasce after the serializing of described adaptive base counting number algorithm instance; Further, from described database, obtain the first object sequence corresponding in the given period, and described first object sequence is deserialized as at least one objective self-adapting radix numeration algorithm instance; By at least one objective self-adapting radix numeration algorithm instance described is added, obtain general objective adaptive base counting number algorithm instance, and then inquire about the number (i.e. the value of UV) of the user ID that described general objective adaptive base counting number algorithm instance comprises; Visible, not only save a large amount of internal memory, achieve the add operation of UV result simultaneously.
Fig. 4 is the block diagram of the statistic device embodiment one of UV in a kind of real-time analyzer according to an exemplary embodiment, and as shown in Figure 4, the statistic device 40 of UV in this real-time analyzer, comprising:
Processing module 401, be configured to by each preset period of time by the user ID of all visitors of internet access website, add in the adaptive base counting number algorithm instance corresponding with described preset period of time, and by write into Databasce after the serializing of described adaptive base counting number algorithm instance;
Statistical module 402, is configured to the object sequence after according to serializing in described database and carries out independent visitor UV and add up.
The statistic device of UV in the real-time analyzer that disclosure embodiment provides, the user ID of all visitors of internet access website will be passed through in each preset period of time by processing module, add in the adaptive base counting number algorithm instance corresponding with described preset period of time, and by write into Databasce after the serializing of described adaptive base counting number algorithm instance; Statistical module carries out independent visitor UV according to the object sequence after serializing in described database to be added up; Visible, shared by adaptive base counting number algorithm instance, internal memory can preset size, even if need the user ID number of the visitor of statistics very many, the shared internal memory of UV statistics remains the memory size shared by adaptive base counting number algorithm instance, therefore, a large amount of internal memory is saved.
On the basis of the embodiment shown in above-mentioned Fig. 4, Fig. 5 is the block diagram of the statistic device embodiment two of UV in a kind of real-time analyzer according to an exemplary embodiment, and with reference to Fig. 5, above-mentioned processing module 401 comprises:
Add submodule 401A, be configured in each described preset period of time, by calling the interpolation interface of adaptive base counting number algorithm, by passing through the user ID of all visitors of internet access website in described preset period of time, add in the adaptive base counting number algorithm instance corresponding with described preset period of time;
Serializing submodule 401B, is configured to the serializing interface by calling described adaptive base counting number algorithm, by write into Databasce after the serializing of described adaptive base counting number algorithm instance, and records the time of write into Databasce.
On the basis of the embodiment shown in above-mentioned Fig. 4 or Fig. 5, Fig. 6 is the block diagram of the statistic device embodiment three of UV in a kind of real-time analyzer according to an exemplary embodiment, and with reference to Fig. 6, above-mentioned statistical module 402 comprises:
Unserializing submodule 402A, is configured to obtain the first object sequence corresponding in the given period from described database, and described first object sequence is deserialized as at least one objective self-adapting radix numeration algorithm instance;
Be added submodule 402B, be configured at least one objective self-adapting radix numeration algorithm instance described to be added, obtain general objective adaptive base counting number algorithm instance;
Inquiry submodule 402C, is configured to the number of inquiring about the user ID that described general objective adaptive base counting number algorithm instance comprises.
Further, described unserializing submodule 402A is configured to: by calling the unserializing interface of described adaptive base counting number algorithm, described first object sequence is deserialized as at least one objective self-adapting radix numeration algorithm instance.
Further, described addition submodule 402B is configured to: by calling the merging interface of described adaptive base counting number algorithm, at least one objective self-adapting radix numeration algorithm instance described is added, obtains described general objective adaptive base counting number algorithm instance.
Further, described inquiry submodule 402C is configured to: by calling the counting interface of described adaptive base counting number algorithm, inquires about the number of the user ID that described general objective adaptive base counting number algorithm instance comprises.
The statistic device of UV in the real-time analyzer that any one embodiment above-mentioned provides, for performing the technical scheme of the arbitrary shown embodiment of the method for Fig. 1 to Fig. 3, it realizes principle and technique effect is similar, by the user ID of all visitors by passing through internet access website in each preset period of time, add in the adaptive base counting number algorithm instance corresponding with described preset period of time, and by write into Databasce after the serializing of described adaptive base counting number algorithm instance; Further, by the first object sequence corresponding in the given period obtained from database is deserialized as at least one objective self-adapting radix numeration algorithm instance, and at least one objective self-adapting radix numeration algorithm instance described is added, obtain general objective adaptive base counting number algorithm instance, and then inquire about the number (i.e. the value of UV) of the user ID that described general objective adaptive base counting number algorithm instance comprises; Visible, not only save a large amount of internal memory, achieve the add operation of UV result simultaneously.
The foregoing describe inner function module and the structural representation of the statistic device of UV in real-time analyzer, its substantial executive agent should be server, Fig. 7 is the block diagram of the entity of a kind of server according to an exemplary embodiment, with reference to Fig. 7, this server can be implemented as: processor and the storer for storage of processor executable instruction;
Described processor is configured to:
By passing through the user ID of all visitors of internet access website in each preset period of time, add in the adaptive base counting number algorithm instance corresponding with described preset period of time, and by write into Databasce after the serializing of described adaptive base counting number algorithm instance;
Carry out independent visitor UV according to the object sequence after serializing in described database to add up.
In the embodiment of the server of above-mentioned information, should understand, this processor can be that CPU (central processing unit) is (English: CentralProcessingUnit, be called for short: CPU), can also be other general processors, digital signal processor (English: DigitalSignalProcessor, be called for short: DSP), (English: ApplicationSpecificIntegratedCircuit is called for short: ASIC) etc. special IC.The processor etc. of general processor can be microprocessor or this processor also can be any routine, and aforesaid storer can be ROM (read-only memory) (English: read-onlymemory, abbreviation: ROM), random access memory (English: randomaccessmemory, RAM), flash memory, hard disk or solid state hard disc be called for short:.Step in conjunction with the method disclosed in the embodiment of the present invention can directly be presented as that hardware processor is complete, or hardware in purpose processor and software module combination complete.
Fig. 8 is the block diagram of a kind of server 1900 according to an exemplary embodiment.With reference to Fig. 8, server 1900 comprises processing components 1922, and it comprises one or more processor further, and the memory resource representated by storer 1932, can such as, by the instruction of the execution of processing components 1922, application program for storing.The application program stored in storer 1932 can comprise each module corresponding to one group of instruction one or more.In addition, processing components 1922 is configured to perform instruction, to perform all or part of step of the statistical method of UV in above-mentioned real-time analyzer.
Server 1900 can also comprise the power management that a power supply module 1926 is configured to perform server 1900, a wired or wireless network interface 1950 is configured to server 1900 to be connected to network, and input and output (I/O) interface 1958.Server 1900 can operate the operating system based on being stored in storer 1932, such as WindowsServerTM, MacOSXTM, UnixTM, LinuxTM, FreeBSDTM or similar.
Those skilled in the art, at consideration instructions and after putting into practice invention disclosed herein, will easily expect other embodiment of the present invention.The application is intended to contain any modification of the present invention, purposes or adaptations, and these modification, purposes or adaptations are followed general principle of the present invention and comprised the undocumented common practise in the art of the disclosure or conventional techniques means.Instructions and embodiment are only regarded as exemplary, and true scope of the present invention and spirit are pointed out by claim below.
Should be understood that, the present invention is not limited to precision architecture described above and illustrated in the accompanying drawings, and can carry out various amendment and change not departing from its scope.Scope of the present invention is only limited by appended claim.

Claims (13)

1. a statistical method of UV in real-time analyzer, is characterized in that, comprising:
By passing through the user ID of all visitors of internet access website in each preset period of time, add in the adaptive base counting number algorithm instance corresponding with described preset period of time, and by write into Databasce after the serializing of described adaptive base counting number algorithm instance;
Carry out independent visitor UV according to the object sequence after serializing in described database to add up.
2. method according to claim 1, it is characterized in that, described will by the user ID of all visitors of internet access website in each preset period of time, add in the adaptive base counting number algorithm instance corresponding with described preset period of time, and by write into Databasce after the serializing of described adaptive base counting number algorithm instance, comprising:
In each described preset period of time, by calling the interpolation interface of adaptive base counting number algorithm, by passing through the user ID of all visitors of internet access website in described preset period of time, add in the adaptive base counting number algorithm instance corresponding with described preset period of time;
By calling the serializing interface of described adaptive base counting number algorithm, by write into Databasce after the serializing of described adaptive base counting number algorithm instance, and record the time of write into Databasce.
3. method according to claim 1 and 2, is characterized in that, describedly carries out independent visitor UV according to the object sequence after serializing in described database and adds up, and comprising:
From described database, obtain the first object sequence corresponding in the given period, and described first object sequence is deserialized as at least one objective self-adapting radix numeration algorithm instance;
At least one objective self-adapting radix numeration algorithm instance described is added, obtains general objective adaptive base counting number algorithm instance;
Inquire about the number of the user ID that described general objective adaptive base counting number algorithm instance comprises.
4. method according to claim 3, is characterized in that, described described first object sequence is deserialized as at least one objective self-adapting radix numeration algorithm instance, comprising:
By calling the unserializing interface of described adaptive base counting number algorithm, described first object sequence is deserialized as at least one objective self-adapting radix numeration algorithm instance.
5. method according to claim 3, is characterized in that, described by described at least one objective self-adapting radix numeration algorithm instance addition, obtains general objective adaptive base counting number algorithm instance, comprising:
By calling the merging interface of described adaptive base counting number algorithm, at least one objective self-adapting radix numeration algorithm instance described being added, obtaining described general objective adaptive base counting number algorithm instance.
6. method according to claim 3, is characterized in that, the number of the user ID that described inquiry described general objective adaptive base counting number algorithm instance comprises, comprising:
By calling the counting interface of described adaptive base counting number algorithm, inquire about the number of the user ID that described general objective adaptive base counting number algorithm instance comprises.
7. a statistic device of UV in real-time analyzer, is characterized in that, comprising:
Processing module, be configured to by each preset period of time by the user ID of all visitors of internet access website, add in the adaptive base counting number algorithm instance corresponding with described preset period of time, and by write into Databasce after the serializing of described adaptive base counting number algorithm instance;
Statistical module, is configured to the object sequence after according to serializing in described database and carries out independent visitor UV and add up.
8. device according to claim 7, is characterized in that, described processing module comprises:
Add submodule, be configured in each described preset period of time, by calling the interpolation interface of adaptive base counting number algorithm, by passing through the user ID of all visitors of internet access website in described preset period of time, add in the adaptive base counting number algorithm instance corresponding with described preset period of time;
Serializing submodule, is configured to the serializing interface by calling described adaptive base counting number algorithm, by write into Databasce after the serializing of described adaptive base counting number algorithm instance, and records the time of write into Databasce.
9. the device according to claim 7 or 8, is characterized in that, described statistical module comprises:
Unserializing submodule, is configured to obtain the first object sequence corresponding in the given period from described database, and described first object sequence is deserialized as at least one objective self-adapting radix numeration algorithm instance;
Be added submodule, be configured at least one objective self-adapting radix numeration algorithm instance described to be added, obtain general objective adaptive base counting number algorithm instance;
Inquiry submodule, is configured to the number of inquiring about the user ID that described general objective adaptive base counting number algorithm instance comprises.
10. device according to claim 9, it is characterized in that, described unserializing submodule is configured to: by calling the unserializing interface of described adaptive base counting number algorithm, described first object sequence is deserialized as at least one objective self-adapting radix numeration algorithm instance.
11. devices according to claim 9, it is characterized in that, described addition submodule is configured to: by calling the merging interface of described adaptive base counting number algorithm, at least one objective self-adapting radix numeration algorithm instance described is added, obtains described general objective adaptive base counting number algorithm instance.
12. devices according to claim 9, it is characterized in that, described inquiry submodule is configured to: by calling the counting interface of described adaptive base counting number algorithm, inquires about the number of the user ID that described general objective adaptive base counting number algorithm instance comprises.
13. 1 kinds of servers, is characterized in that, comprising: processor and the storer for storage of processor executable instruction;
Described processor is configured to:
By passing through the user ID of all visitors of internet access website in each preset period of time, add in the adaptive base counting number algorithm instance corresponding with described preset period of time, and by write into Databasce after the serializing of described adaptive base counting number algorithm instance;
Carry out independent visitor UV according to the object sequence after serializing in described database to add up.
CN201510883194.9A 2015-12-03 2015-12-03 UV counting method and device for real-time analysis system and server Pending CN105512271A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510883194.9A CN105512271A (en) 2015-12-03 2015-12-03 UV counting method and device for real-time analysis system and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510883194.9A CN105512271A (en) 2015-12-03 2015-12-03 UV counting method and device for real-time analysis system and server

Publications (1)

Publication Number Publication Date
CN105512271A true CN105512271A (en) 2016-04-20

Family

ID=55720253

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510883194.9A Pending CN105512271A (en) 2015-12-03 2015-12-03 UV counting method and device for real-time analysis system and server

Country Status (1)

Country Link
CN (1) CN105512271A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107346270A (en) * 2016-05-05 2017-11-14 北京京东尚科信息技术有限公司 Method and system based on the sets cardinal calculated in real time
CN107357740A (en) * 2017-07-05 2017-11-17 腾讯科技(深圳)有限公司 One kind serializing device method of automatic configuration, device and distributed cache system
CN108900619A (en) * 2018-07-06 2018-11-27 阿里巴巴集团控股有限公司 A kind of independent Statistics of accessing population method and device
CN110580322A (en) * 2019-09-18 2019-12-17 北京百度网讯科技有限公司 Independent visitor information processing method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2561448A1 (en) * 2010-04-20 2013-02-27 Verisign, Inc. System for and method of identifying closely matching textual identifiers, such as domain names
CN103297469A (en) * 2012-02-25 2013-09-11 阿里巴巴集团控股有限公司 Method and device of collecting website data
CN103853671A (en) * 2012-12-07 2014-06-11 北京百度网讯科技有限公司 Data writing control method and device
CN104660427A (en) * 2013-11-18 2015-05-27 深圳市腾讯计算机系统有限公司 Method and device for real-time statistics of logs

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2561448A1 (en) * 2010-04-20 2013-02-27 Verisign, Inc. System for and method of identifying closely matching textual identifiers, such as domain names
CN103297469A (en) * 2012-02-25 2013-09-11 阿里巴巴集团控股有限公司 Method and device of collecting website data
CN103853671A (en) * 2012-12-07 2014-06-11 北京百度网讯科技有限公司 Data writing control method and device
CN104660427A (en) * 2013-11-18 2015-05-27 深圳市腾讯计算机系统有限公司 Method and device for real-time statistics of logs

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
CHAOSLAWFUL: "adaptive_counting.h", 《HTTPS://GITHUB.COM/CHAOSLAWFUL/CCARD-LIB/BLOB/MASTER/INCLUDE/ADAPTIVE_COUNTING.H》 *
张洋: "解读Cardinality Estimation算法", 《HTTP://BLOG.CODINGLABS.ORG/ARTICLES/ALGORITHMS-FOR-CARDINALITY-ESTIMATION-PART-I.HTML》 *
止静: "数学之美-【算法】 - 用来流方式计算UV的基数算法", 《HTTPS://MY.OSCHINA.NET/INFINITESPACE/BLOG/315457?FROM=GROUPMESSAGE》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107346270A (en) * 2016-05-05 2017-11-14 北京京东尚科信息技术有限公司 Method and system based on the sets cardinal calculated in real time
CN107346270B (en) * 2016-05-05 2020-05-01 北京京东尚科信息技术有限公司 Method and system for real-time computation based radix estimation
CN107357740A (en) * 2017-07-05 2017-11-17 腾讯科技(深圳)有限公司 One kind serializing device method of automatic configuration, device and distributed cache system
CN107357740B (en) * 2017-07-05 2018-08-03 腾讯科技(深圳)有限公司 A kind of serializing device method of automatic configuration, device and distributed cache system
CN108900619A (en) * 2018-07-06 2018-11-27 阿里巴巴集团控股有限公司 A kind of independent Statistics of accessing population method and device
CN108900619B (en) * 2018-07-06 2022-01-11 创新先进技术有限公司 Independent visitor counting method and device
CN110580322A (en) * 2019-09-18 2019-12-17 北京百度网讯科技有限公司 Independent visitor information processing method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN108959279B (en) Data processing method, data processing device, readable medium and electronic equipment
US8370303B1 (en) Generating snapshots of data tables
CN109309596B (en) Pressure testing method and device and server
US10698962B2 (en) Analysis of data utilization
CN104504084A (en) Method and device for determining user retention rate
CN105512271A (en) UV counting method and device for real-time analysis system and server
CN106886535A (en) A kind of data pick-up method and apparatus for being adapted to multiple data sources
CN110635962B (en) Abnormity analysis method and device for distributed system
CN102129425A (en) Method and device for accessing large-object set table in data warehouse
CN105183669A (en) Data storage method and device
CN110825731A (en) Data storage method and device, electronic equipment and storage medium
CN107391528B (en) Front-end component dependent information searching method and equipment
CN113360581A (en) Data processing method, device and storage medium
US9419868B1 (en) Visualization of user behavior
CN108334521B (en) Database capacity prediction method and device
CN112333294A (en) Log merging method, device, medium and equipment
CN111597093B (en) Exception handling method, device and equipment thereof
CN104317820B (en) Statistical method and device for report forms
Calderón et al. Improving performance using computational compression through memoization: A case study using a railway power consumption simulator
US11983178B2 (en) Techniques for building data lineages for queries
CN115328958A (en) Data association method and device, computer storage medium and electronic equipment
US10409704B1 (en) Systems and methods for resource utilization reporting and analysis
CN111723202A (en) Public opinion data processing device, method and system
US10509659B1 (en) Input processing logic to produce outputs for downstream systems using configurations
Schäfer et al. Sampling with incremental mapreduce

Legal Events

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

Application publication date: 20160420

RJ01 Rejection of invention patent application after publication