CN104579753B - User data statistical method, access stratum server and statistical server - Google Patents

User data statistical method, access stratum server and statistical server Download PDF

Info

Publication number
CN104579753B
CN104579753B CN201410776782.8A CN201410776782A CN104579753B CN 104579753 B CN104579753 B CN 104579753B CN 201410776782 A CN201410776782 A CN 201410776782A CN 104579753 B CN104579753 B CN 104579753B
Authority
CN
China
Prior art keywords
server
statistical
address information
access stratum
user data
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
Application number
CN201410776782.8A
Other languages
Chinese (zh)
Other versions
CN104579753A (en
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.)
Tencent Technology Shenzhen Co Ltd
Tencent Cloud Computing Beijing Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201410776782.8A priority Critical patent/CN104579753B/en
Publication of CN104579753A publication Critical patent/CN104579753A/en
Application granted granted Critical
Publication of CN104579753B publication Critical patent/CN104579753B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Transfer Between Computers (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a kind of user data statistical method, access stratum server and statistical server, belong to communication technical field.Methods described includes:When the user for receiving terminal transmission reaches the standard grade request, mark of reaching the standard grade is distributed for user, the user, which reaches the standard grade, to be asked to carry user data;According to the address information of access stratum server, from multiple statistical servers, statistical server corresponding to the access stratum server is determined, each statistical server is respectively used to the user data that multiple access stratum servers that storage is specified are sent;Storage request is sent to the statistical server, mark of reaching the standard grade is carried in storage request, accesses the address information and user data of stratum server, make statistical server that user data is stored in core buffer, and duration is specified every first by statistical server, the user data of storage is counted.Present invention saves the internal memory of statistical server, improves the concurrency of statistical server, and then improves the processing speed of statistical server.

Description

User data statistical method, access stratum server and statistical server
Technical field
The present invention relates to communication technical field, more particularly to a kind of user data statistical method, access stratum server and system Count server.
Background technology
It is more and more come the user to be communicated by instant messaging application with the fast development of the communication technology.In order to The reliability for ensureing to communicate between user to the user data applied using the instant messaging, it is necessary to count, for example, working as certain , can be by the user data of each Urban Statistical in the country, to determine the state when individual national user data occurs abnormal There is communication failure in which of family city, so as to targetedly being repaired based on communication failure, with ensure user it Between the reliability that communicates.
At present, the statistics Organization Chart of user data is as shown in figure 1, in the system architecture, including multiple Access Layer services Device and multiple statistical servers, it is each to access stratum server with statistical server by network connection, when progress user data During statistics, for each access stratum server in the plurality of access stratum server, if the access stratum server receives end The request of reaching the standard grade sent is held, then any statistics user data that request of reaching the standard grade carries being sent in the plurality of statistical server Server, when the statistical server receives the user data, delay from the internal memory in advance for each Access Layer server-assignment Rush in area, search the access stratum server corresponding to core buffer, the user data is stored in the core buffer of lookup It is interior, and send response message to the access stratum server.Afterwards, use of the plurality of statistical server every a cycle to storage User data is once counted.
Because statistical server internal memory remaining after storage allocation buffering area is less, so, when statistical server is same When receive multiple users reach the standard grade request when, if remaining low memory is reached the standard grade request with handling the plurality of user simultaneously, Need to reach the standard grade a part of user and ask to be stored in the hard disk of statistical server, cause the concurrency of statistical server to reduce, And reduce statistical server to reach the standard grade to user the processing speed of request.
The content of the invention
In order to solve problem of the prior art, the embodiments of the invention provide a kind of user data statistical method, Access Layer Server and statistical server.The technical scheme is as follows:
First aspect, there is provided a kind of user data statistical method, methods described include:
When the user for accessing stratum server and receiving terminal transmission reaches the standard grade request, reached the standard grade mark for user's distribution, it is described User, which reaches the standard grade, to be asked to carry user data;
It is described to access address information of the stratum server according to the access stratum server, from multiple statistical servers, really Statistical server corresponding to the fixed access stratum server, each statistical server in the multiple statistical server are used respectively In the user data that multiple access stratum servers that storage is specified are sent;
The access stratum server sends storage request to the statistical server, is carried in the storage request on described Line mark, the address information of the access stratum server and the user data, make the statistical server be based on described reach the standard grade The address information of mark and the access stratum server, the user data is stored in corresponding to the access stratum server Deposit in buffering area, and duration is specified every first by the statistical server, the user data of storage is counted.
Second aspect, there is provided a kind of user data statistical method, methods described include:
Statistical server receives the storage request that access stratum server is sent, and the storage request carrying is reached the standard grade mark, institute The address information and user data of access stratum server are stated, the statistical server is that the access stratum server connects according to Enter the address information of stratum server, be determined from multiple statistical servers, and it is each in the multiple statistical server Statistical server is respectively used to the user data that multiple access stratum servers that storage is specified are sent, and the mark of reaching the standard grade is described It is user's distribution to access stratum server;
The statistical server reached the standard grade according to mark and it is described access stratum server address information, by the user Data storage is in core buffer corresponding to the access stratum server;
Every in the first specified duration, multiple core buffers that the statistical server includes the statistical server The user data of storage is counted.
The third aspect, there is provided one kind access stratum server, the access stratum server include:
Distribute module, it is described for when the user for receiving terminal transmission reaches the standard grade request, mark of reaching the standard grade to be distributed for user User, which reaches the standard grade, to be asked to carry user data;
First determining module, for the address information according to access stratum server, from multiple statistical servers, determine institute State and access statistical server corresponding to stratum server, each statistical server in the multiple statistical server is respectively used to deposit Store up the user data that the multiple access stratum servers specified are sent;
First sending module, for being asked to statistical server transmission storage, in the storage request described in carrying Reach the standard grade mark, it is described access stratum server address information and the user data, make the statistical server be based on it is described on Line identifies and the address information of the access stratum server, and the user data is stored in corresponding to the access stratum server In core buffer, and duration is specified every first by the statistical server, the user data of storage is counted.
Fourth aspect, there is provided a kind of statistical server, the statistical server include:
Receiving module, for receive access stratum server send storage request, it is described storage request carrying reach the standard grade mark, The address information and user data of the access stratum server, statistical server are the access stratum servers according to the access The address information of stratum server, it is determined from multiple statistical servers, and each system in the multiple statistical server Meter server is respectively used to the user data that multiple access stratum servers that storage is specified are sent, and the mark of reaching the standard grade is described connects Enter stratum server for user's distribution;
First memory module, for the address information of reached the standard grade according to mark and the access stratum server, by described in User data is stored in core buffer corresponding to the access stratum server;
Statistical module, for every in the first specified duration, multiple core buffers that the statistical server is included The user data of storage is counted.
The beneficial effect that technical scheme provided in an embodiment of the present invention is brought is:
In embodiments of the present invention, when access stratum server receive terminal transmission user reach the standard grade request after, according to The address information of the access stratum server, from multiple statistical servers, determine statistical fractals corresponding to the access stratum server Device, each statistical server in the plurality of statistical server are respectively used to what multiple access stratum servers that storage is specified were sent User data, that is to say, each statistical server is only the multiple Access Layer server-assignment core buffers specified, rather than For each Access Layer server-assignment core buffer, so as to save the internal memory of statistical server, and statistical server Remaining internal memory is more after storage allocation buffering area, it is sufficient to while handle multiple users and reach the standard grade request, without by user Line request is stored in the hard disk of statistical server, is improved the concurrency of statistical server, is also improved statistical server pair User reaches the standard grade the processing speed of request.
Brief description of the drawings
Technical scheme in order to illustrate the embodiments of the present invention more clearly, make required in being described below to embodiment Accompanying drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for For those of ordinary skill in the art, on the premise of not paying creative work, other can also be obtained according to these accompanying drawings Accompanying drawing.
Fig. 1 is a kind of system architecture diagram for user data statistics that prior art provides;
Fig. 2 is a kind of system architecture diagram of user data statistics provided in an embodiment of the present invention;
Fig. 3 is a kind of user data statistical method flow chart provided in an embodiment of the present invention;
Fig. 4 is another user data statistical method flow chart provided in an embodiment of the present invention;
Fig. 5 is another user data statistical method flow graph provided in an embodiment of the present invention;
Fig. 6 is a kind of structural representation for accessing stratum server provided in an embodiment of the present invention;
Fig. 7 is a kind of structural representation of statistical server provided in an embodiment of the present invention;
Fig. 8 is the structural representation of another access stratum server provided in an embodiment of the present invention;
Fig. 9 is the structural representation of another statistical server provided in an embodiment of the present invention.
Embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing to embodiment party of the present invention Formula is described in further detail.
Before to the embodiment of the present invention carrying out that explanation is explained in detail, first to the system architecture of the embodiment of the present invention and should Introduced with scene.Fig. 2 is a kind of user data statistical system Organization Chart of the offer of the embodiment of the present invention.Of the invention real Multiple access stratum servers and multiple statistical servers can be included by applying in the system architecture of example, each stratum server that accesses is used for The request that receiving terminal is sent, the request can reach the standard grade including user asks and user offline request;And each statistical server User data for being sent to access stratum server counts, and accesses between stratum server and statistical server and pass through net Network connects.Further, since each access stratum server is connected with each statistical server in Fig. 1, so, statistical server is just Need to divide equally for each access stratum server and match somebody with somebody a core buffer, make statistical server institute after storage allocation buffering area Surplus internal memory is less, is not enough to handle multiple users simultaneously and reaches the standard grade request, it is necessary to which a part of user request of reaching the standard grade is stored in into system In the hard disk for counting server, the concurrency of statistical server is reduced, statistical server is also reduced and user is reached the standard grade request Processing speed.And in fig. 2, by the way that specified multiple access stratum servers are attached with a statistical server, so, Statistical server is only multiple Access Layer server-assignment core buffers that this is specified, rather than is each access stratum server Storage allocation buffering area, so as to save the internal memory of statistical server;And statistical server storage allocation buffering area it Remaining internal memory is more afterwards, it is sufficient to while handles multiple users and reaches the standard grade request, without user's request of reaching the standard grade is stored in into statistics clothes It is engaged in the hard disk of device, improves the concurrency of statistical server, also improves statistical server and user is reached the standard grade the processing of request Speed.
Fig. 3 is a kind of user data statistical method flow chart provided in an embodiment of the present invention.Referring to Fig. 3, this method includes:
Step 301:When the user for accessing stratum server and receiving terminal transmission reaches the standard grade request, reached the standard grade mark for user's distribution Know, the user, which reaches the standard grade, to be asked to carry user data.
Step 302:Address information of the stratum server according to the access stratum server is accessed, from multiple statistical servers, Determine statistical server corresponding to the access stratum server, each statistical server in the plurality of statistical server is respectively used to Store the user data that the multiple access stratum servers specified are sent.
Step 303:Access stratum server and send storage request to the statistical server of determination, carried in storage request The address information and user data of line mark, access stratum server, make statistical server be based on reach the standard grade mark and Access Layer service The address information of device, user data is stored in core buffer corresponding to the access stratum server, and by statistical server Duration is specified every first, the user data of storage is counted.
In embodiments of the present invention, when access stratum server receive terminal transmission user reach the standard grade request after, according to The address information of the access stratum server, from multiple statistical servers, determine statistical fractals corresponding to the access stratum server Device, each statistical server in the plurality of statistical server are respectively used to what multiple access stratum servers that storage is specified were sent User data, that is to say, each statistical server is only the multiple Access Layer server-assignment core buffers specified, rather than For each Access Layer server-assignment core buffer, so as to save the internal memory of statistical server, and statistical server Remaining internal memory is more after storage allocation buffering area, it is sufficient to while handle multiple users and reach the standard grade request, without by user Line request is stored in the hard disk of statistical server, is improved the concurrency of statistical server, is also improved statistical server pair User reaches the standard grade the processing speed of request.
Alternatively, address information of the stratum server according to access stratum server is accessed, from multiple statistical servers, it is determined that Statistical server corresponding to the access stratum server, including:
The address information that access stratum server accesses stratum server with this carries out modulo operation to statistical server quantity, obtains To computing numerical value, computing numerical value is defined as statistical server corresponding to the access stratum server and numbered, the statistics of determination is taken Statistical server corresponding to business device numbering is defined as statistical server corresponding to the access stratum server;Or
Address information of the stratum server according to the access stratum server is accessed, from the address information and statistical server of storage In corresponding relation between numbering, statistical server corresponding to acquisition is numbered, and will be united corresponding to the statistical server numbering of acquisition Meter server is defined as statistical server corresponding to the access stratum server.
Alternatively, after distributing mark of reaching the standard grade for user, in addition to:
Access stratum server obtains terminal address information from the user data;
Access stratum server is by terminal address information and mark of reaching the standard grade, pair for being stored in address information between mark of reaching the standard grade In should being related to.
Alternatively, this method also includes:
When statistical server also stores in core buffer corresponding to access stratum server reaches the standard grade mark, if access Stratum server receives the user offline request of terminal transmission, then the terminal address information carried is asked according to user offline, In corresponding relation between from the address information and mark of reaching the standard grade of storage, mark of being reached the standard grade corresponding to acquisition;
Address information of the stratum server according to the access stratum server is accessed, from multiple statistical servers, it is determined that this connects Enter statistical server corresponding to stratum server;
Access stratum server and send removal request to the statistical server of determination, mark of reaching the standard grade is carried in the removal request, Make statistical server according to the mark of reaching the standard grade, user data corresponding to deletion.
Alternatively, after access stratum server sends removal request to statistical server, in addition to:
Stratum server is accessed according to the terminal address information, in the corresponding relation for deleting address information between mark of reaching the standard grade Corresponding mark of reaching the standard grade.
Alternatively, access stratum server and send data to the statistical server by using user data datagram protocol UDP.
Above-mentioned all optional technical schemes, the alternative embodiment of the embodiment of the present invention can be formed according to any combination, this Inventive embodiments no longer repeat one by one.
Fig. 4 is a kind of user data statistical method flow chart provided in an embodiment of the present invention.Referring to Fig. 4, this method includes:
Step 401:Statistical server receives the storage request that access stratum server is sent, and storage request carrying is reached the standard grade mark Know, the address information and user data of access stratum server, the statistical server is that access stratum server takes according to the Access Layer The address information of business device, is determined from multiple statistical servers, and each statistical fractals in the plurality of statistical server Device is respectively used to the user data that multiple access stratum servers that storage is specified are sent, and mark of reaching the standard grade is that access stratum server is to use Family distribution.
Step 402:Statistical server deposits user data according to the address information of reach the standard grade mark and the access stratum server Storage is in core buffer corresponding to access stratum server.
Step 403:Duration, multiple memory buffers that the statistical server includes the statistical server are specified every first The user data stored in area is counted.
In embodiments of the present invention, when access stratum server receive terminal transmission user reach the standard grade request after, according to The address information of the access stratum server, from multiple statistical servers, determine statistical fractals corresponding to the access stratum server Device, each statistical server in the plurality of statistical server are respectively used to what multiple access stratum servers that storage is specified were sent User data, that is to say, each statistical server is only the multiple Access Layer server-assignment core buffers specified, rather than For each Access Layer server-assignment core buffer, so as to save the internal memory of statistical server, and statistical server Remaining internal memory is more after storage allocation buffering area, it is sufficient to while handle multiple users and reach the standard grade request, without by user Line request is stored in the hard disk of statistical server, is improved the concurrency of statistical server, is also improved statistical server pair User reaches the standard grade the processing speed of request.
Alternatively, statistical server stores user data according to the address information of reach the standard grade mark and access stratum server In core buffer corresponding to the access stratum server, including:
According to the address information of the access stratum server, the multiple internal memories included from the statistical server delay statistical server Rush in area, search core buffer corresponding to the access stratum server;
Statistical server carries out cuckoo Hash operation to the mark of reaching the standard grade, and obtains the user data in the internal memory found Storage location in buffering area;
Statistical server stores user data in the storage location.
Alternatively, duration, multiple core buffers that statistical server includes the statistical server are specified every first The user data of middle storage is counted, including:
Every in the first specified duration, the user data that statistical server stores from the plurality of core buffer, obtaining should The terminal address information that user data includes;
Statistical server is according to the address information storehouse stored in terminal address information and internal memory, to the plurality of core buffer The user data of middle storage is counted, and generates data statistics form, address information storehouse includes the first corresponding relation and second pair At least one in should being related to, corresponding relation of first corresponding relation between address information and area, the second corresponding relation is Corresponding relation between address information and operator.
Alternatively, statistical server is according to the address information storehouse stored in terminal address information and internal memory, to the plurality of interior The user data stored in buffering area is deposited to be counted, before generating data statistics form, in addition to:
For statistical server since the first character of each address information of storage, acquisition specifies number a character, obtains To the first compression address information;
When address information bank includes the first corresponding relation, statistical server compresses the first compression address information and first It is regional corresponding to address information, it is stored in address information storehouse in the first corresponding relation;
When address information bank includes the second corresponding relation, statistical server compresses the first compression address information and first Operator corresponding to address information, it is stored in address information storehouse in the second corresponding relation.
Alternatively, statistical server is according to the address information storehouse stored in terminal address information and internal memory, to the plurality of interior Deposit the user data stored in buffering area to be counted, generate data statistics form, including:
For statistical server since the first character of terminal address information, acquisition specifies number a character, obtains second Compress address information;
When address information bank includes the first corresponding relation, statistical server is according to the second compression address information, from first In corresponding relation, the area belonging to terminal is obtained, statistical server is counted the user data for belonging to areal, is generated First data statistics form;
When address information bank includes the second corresponding relation, statistical server is according to the second compression address information, from second In corresponding relation, the operator belonging to the terminal is obtained, statistical server is united the user data for belonging to same operator Meter, generate the second data statistics form.
Alternatively, statistical server stores user data according to the address information of reach the standard grade mark and access stratum server After in core buffer corresponding to access stratum server, in addition to:
Statistical server obtains the time for storing the user data;
The time of acquisition is defined as the renewal time of the user data by statistical server;
Statistical server stores the renewal time of the user data.
Alternatively, this method also includes:
Duration is specified every second, statistical server obtains the renewal of the user data stored in the plurality of core buffer Time;
Statistical server calculates the time interval between renewal time and current time;
The user data that time interval is spaced greatly by statistical server at fixed time is defined as inactive users data;
Statistical server deletes the inactive users data.
Above-mentioned all optional technical schemes, can form the alternative embodiment of the present invention according to any combination, and the present invention is real Example is applied no longer to repeat one by one.
Fig. 5 is a kind of user data statistical method flow chart provided in an embodiment of the present invention.Referring to Fig. 5, this method includes:
Step 501:When the user for accessing stratum server and receiving terminal transmission reaches the standard grade request, reached the standard grade mark for user's distribution Know, the user, which reaches the standard grade, to be asked to carry user data.
In embodiments of the present invention, the user that terminal is sent to access stratum server request of reaching the standard grade can be divided into two kinds, and one The user that terminal is sent when kind being the application of user's log-in instant communication reaches the standard grade request, and another kind is terminal automated log on instant messaging Using when the user that sends reach the standard grade request.It is in order to ensure the security of user account, when the IMU for second of situation News application in terminal backstage, or user exit the instant messaging application when, the terminal every the 3rd specify duration, to access Stratum server sends a user and reached the standard grade request, for one key of acquisition from access stratum server, when the terminal passes through this When instant messaging is applied to access stratum server transmission instant communication information, the key can be carried in the instant communication information, When the access stratum server receives the instant communication information, the key is verified, when the key authentication by when, really Determine user account safety, when the key authentication is obstructed out-of-date, determine the dangerous property of user account.
Wherein, user account is the instant messaging account that the user registers in stratum server is accessed, and the 3rd specifies duration Set in advance, such as, the 3rd specify when a length of 1 hour, the embodiment of the present invention is not specifically limited to this.
In addition, the mark of reaching the standard grade that access stratum server is user's distribution can be the numerical value such as 0,1,2,3, it is, of course, also possible to For other identifiers, the embodiment of the present invention is not specifically limited to this.
User, which reaches the standard grade, can include user account, terminal address information etc. in the user data that request carries, therefore, when connecing It is that user is distributed after mark of reaching the standard grade to enter stratum server, and the access stratum server can reach the standard grade from the user asks the user of carrying Terminal address information is obtained in data;And by the terminal address information of acquisition and the mark of reaching the standard grade, be stored in address information with it is upper In corresponding relation between line mark.For example access stratum server is that reaching the standard grade for user distribution is identified as ID1, the Access Layer The terminal address information obtained in the user data that server reaches the standard grade request carrying from the user is address information 1, now, access Address information 1 and the mark ID1 that reaches the standard grade can be stored in address information as shown in table 1 below and mark of reaching the standard grade by stratum server Between corresponding relation in.
Table 1
Address information Reach the standard grade mark
Address information 1 ID1
…… ……
Wherein, terminal address information can be the IP (Internet Protocol, network interconnection agreement) of the terminal Location, it is, of course, also possible to be the other information of the terminal, such as, (Media Access Control, media connect the MAC of the terminal Enter control) address, the embodiment of the present invention is not specifically limited to this.
Step 502:The access stratum server is according to the address information of the access stratum server, from multiple statistical servers In, determine statistical server corresponding to the access stratum server, each statistical server difference in the plurality of statistical server The user data sent for storing the multiple access stratum servers specified.
Because terminal can be that is to say with automated log on instant messaging application, terminal specifies duration to Access Layer every the 3rd Server sends a user and reached the standard grade request, so, access stratum server can frequently receive the user that terminal is sent and reach the standard grade Request, cause the load for accessing stratum server larger.Therefore, in embodiments of the present invention, it is each in multiple statistical servers Statistical server is respectively used to the user data that multiple access stratum servers that storage is specified are sent, rather than each Access Layer clothes The user data that business device is sent, so, statistical server need to be only multiple Access Layer server-assignment memory buffers that this is specified Area, save the internal memory of statistical server.And according to the address information of the access stratum server, from the plurality of statistical server In, can be included by determining the mode of statistical server corresponding to the access stratum server by two kinds:
First way, the address information that access stratum server accesses stratum server with this are carried out to statistical server quantity Modulo operation, computing numerical value is obtained, the computing numerical value is defined as into statistical server corresponding to the access stratum server numbers, will Statistical server corresponding to the statistical server numbering of determination is defined as accessing statistical server corresponding to stratum server.
For first way, because the address information for accessing stratum server is changeless, so, whenever Access Layer Server receive user reach the standard grade request when, access the address information of stratum server with this and modulus carried out to statistical server quantity Computing, obtained computing numerical value is also fixed, so as to determine unique statistical fractals for the access stratum server Device.For example the address information that access stratum server accesses stratum server with this obtains to statistical server quantity progress modulo operation The computing numerical value arrived is 2, now, determines that statistical server numbering is 2 corresponding to the access stratum server, and be 2 by numbering Statistical server is defined as statistical server corresponding to the access stratum server.
The second way, address information of the stratum server according to the access stratum server is accessed, from the address information of storage In corresponding relation between being numbered with statistical server, statistical server corresponding to acquisition is numbered, by the statistical server of acquisition Statistical server corresponding to numbering is defined as statistical server corresponding to the access stratum server.
For the second way, it can be numbered in advance for each statistical server, and each statistical server distribution is specified Multiple access stratum servers, then, the address information of the multiple access stratum servers specified and statistical server are numbered, It is stored in the corresponding relation between address information and statistical server numbering, or, above-mentioned first way, thing can be based on First calculate statistical server numbering corresponding to each access stratum server, and by the address information and system of each access stratum server Server numbering is counted, the corresponding relation being stored between address information and statistical server numbering.Afterwards, statistical server can be with According to the address information of the access stratum server, directly from the corresponding pass between the address information and statistical server numbering of storage Statistical server numbering corresponding to being obtained in system, and then statistical server corresponding to determining the access stratum server, reduce really The time of statistical server corresponding to the fixed access stratum server, and then improve user and reach the standard grade the processing speed of request.
It is false for example the corresponding relation between address information and the statistical server numbering being previously stored is as shown in table 2 below Such as, the address information of the access stratum server is address information 1, at this point it is possible to which statistical server corresponding to being obtained from table 2 is compiled Number be 2, and then determine numbering be 2 statistical server be defined as statistical server corresponding to the access stratum server.
Table 2
Address information Statistical server is numbered
Address information 1 2
…… ……
Further, because the mark scope of reaching the standard grade of Access Layer server-assignment is very big, generally 0 to 40 hundred million, it is still, real The online number in border is generally 3,000,000 or so, if the internal memory that statistical server is the multiple Access Layer server-assignments specified delays The all reserved memory headroom that can keep 4,000,000,000 users in area is rushed, then can cause the internal memory wretched insufficiency of statistical server.Therefore, exist In the embodiment of the present invention, statistical server can be the core buffer of each one designated space of Access Layer server-assignment, For example the core buffer of 1500 general-purpose user datas can be accommodated for each Access Layer server-assignment one, and by experiment Prove, when core buffer is 5 times of actual online user number, the performance of the statistical server can reach requirement, and ensure The Statistical Speed of user data is higher.
Step 503:The access stratum server sends storage request to the statistical server of determination, is carried in storage request Reach the standard grade mark, access stratum server address information and user data.
In embodiments of the present invention, access stratum server to statistical server send storage request when, using UDP (User Datagram Protocol, User Datagram Protocol) agreement.Because storage request is sent to statistical fractals by udp protocol by all means Device, no matter whether statistical server receives storage request, it that is to say, access stratum server sends to statistical server and stored After request, statistical server will not return to response message to access stratum server, so save the place of access stratum server Resource is managed, also reduces the influence handled instant messaging business.
Step 504:When the statistical server receives storage request, believed according to the address of the access stratum server Cease, in the multiple core buffers included from the statistical server, search core buffer corresponding to the access stratum server.
, can be in each core buffer after the statistical server is the multiple Access Layer storage allocation buffering areas specified The address information of access stratum server corresponding to middle storage, therefore, when statistical server receives storage request, the statistics In multiple core buffers that server can include the address information of the access stratum server and the plurality of statistical server The address information of the access stratum server of storage is compared, so that it is determined that core buffer corresponding to the access stratum server.
It should be noted that corresponding access clothes can be stored in first storage location of each core buffer The address information of business device, it is, of course, also possible to be stored in other storage locations, the embodiment of the present invention does not do specific limit to this It is fixed.
Step 505:Statistical server carries out cuckoo Hash operation to mark of reaching the standard grade, and obtains the user data in lookup Storage location in core buffer, and in the storage location, store the user data.
Because the algorithm performance of cuckoo Hash operation is inherently higher, therefore, in embodiments of the present invention, statistics clothes Business device to reach the standard grade mark carry out cuckoo Hash operation, obtain the user data core buffer memory storage position speed compared with It hurry up, and can also be that each user data finds corresponding storage location in the core buffer.
In addition, when the size of core buffer is 5 times of actual online user number, cuckoo Hash operation can be set Number be preset times, it is demonstrated experimentally that when preset times be 10 times when, for user data look for storage location when, can reach Preferable effect, and the effect that cuckoo Hash operation counts for discrete user data is better than other Hash operations.Enter One step, after statistical server has carried out preset times time cuckoo Hash operation, again without finding the user data Corresponding storage location, then lose the user data.
It should be noted that user data can be not only stored in the storage location by statistical server, can also incite somebody to action Access stratum server is that the mark of reaching the standard grade of user distribution is stored in the storage location, it is, of course, also possible to store the class of the terminal Type, the embodiment of the present invention are not specifically limited to this.
After statistical server is the multiple Access Layer server-assignment core buffers specified, statistical fractals are saved The internal memory of device, the internal memory for making statistical server remaining is enough to handle multiple users simultaneously and reached the standard grade request, and then improves statistical fractals The concurrency of device.And in the case where concurrency is larger, in order to ensure the process performance of statistical server, the embodiment of the present invention exists When storing user data, design, that is to say using without lock, statistical server after storage location stores user data, The storage location will not be fixed for the statistical server, and other user data can also be stored in the storage location, Therefore, in the case where concurrency is larger, user data be present and write random risk.And user it is improper it is offline in the case of, User data in core buffer will not be deleted, therefore, in order to prevent that being write random user data is continuously increased, statistical fractals Device specifies duration every second, can clear up an inactive users data, is specially:When statistical server stores user data, The statistical server obtains the time for storing the user data;The time of acquisition is defined as to the renewal time of the user data; And store the renewal time of the user data.Afterwards, the statistical server specifies duration every second, obtains the statistical server Including multiple core buffers in renewal time of user data for storing;And calculate renewal time and the current time of acquisition Between time interval;The user data that time interval is spaced greatly at fixed time is defined as inactive users data, and deletes Inactive users data.
In embodiments of the present invention, second duration and specified time interval is specified all to set in advance, second when specifying Length can be 2 hours etc., specified time interval can be 1 day etc., the embodiment of the present invention is not specifically limited to this.
Wherein, after by storing user data the step of above-mentioned steps 501-505, statistical server can be according to as follows The step of the user data of storage is counted.
Step 506:Statistical server specifies duration, the multiple core buffers included from the statistical server every first In the user data of storage, the terminal address information that the user data includes is obtained.
It is remaining after statistical server is each Access Layer server-assignment core buffer due in the prior art Internal memory is less, when counting user data, remaining internal memory carry out user data statistics speed it is slower, cause count granularity compared with Greatly.And in the embodiment of the present invention, statistical server is only the multiple Access Layer server-assignment core buffers specified, remaining Internal memory is more, carries out the speed of user data statistics, reduces statistics granularity.Such as in embodiments of the present invention, first Specified duration can be 45 seconds, so, statistics granularity can be made to reach a minute rank, that is to say, per minute to carry out at least User data statistics.
Step 507:The address information storehouse that the statistical server stores in the terminal address information and internal memory according to acquisition, it is right The user data stored in multiple core buffers that the statistical server includes is counted, and generates data statistics form, ground For location information bank including at least one in the first corresponding relation and the second corresponding relation, the first corresponding relation is address information and ground In corresponding relation between area, corresponding relation of second corresponding relation between address information and operator.
In order to improve the speed of user data statistics, statistical server can be worked as by internal memory in address information library storage After getting terminal address information, if address information storehouse includes the first corresponding relation, the statistical server can be straight The terminal address information according to acquisition is connect, in the first corresponding relation stored from internal memory, obtains the area belonging to terminal.If Address information storehouse includes the second corresponding relation, then the statistical server can directly according to the terminal address information of acquisition, from In the second corresponding relation stored in internal memory, the operator belonging to terminal is obtained.
When the address information stored in the information bank of address is more, address information library storage can be influenceed on the contrary in internal memory The processing speed of statistical server, therefore, in embodiments of the present invention, in order to save the internal memory of statistical server, improve statistics The processing speed of server, the address information stored in the corresponding relation can be compressed, be specially:Statistical server from The first character of each address information of storage starts, and acquisition specifies number a character, obtains the first compression address information;When , will be regional corresponding to the first compression address information and the first compression address information when address information storehouse includes the first corresponding relation, It is stored in the first corresponding relation in address information storehouse;When address information bank includes the second corresponding relation, by the first compression Operator corresponding to address information and the first compression address information, is stored in the second corresponding relation in address information storehouse.It Afterwards, when statistical server is according to the address information storehouse stored in terminal address information and internal memory, what statistical server was included is more The user data stored in individual core buffer is counted, and when generating data statistics form, statistical server can be from the end The first character of end address information starts, and acquisition specifies number a character, obtains the second compression address information;Work as address information When storehouse includes the first corresponding relation, according to the second compression address information, in the first corresponding relation out of address information storehouse, obtain Area belonging to terminal, and the user data for belonging to areal is counted, generate the first data statistics form.Work as address When information bank includes the second corresponding relation, statistical server according to second compression address information, second out of address information storehouse In corresponding relation, the operator belonging to terminal is obtained, statistical server is counted the user data for belonging to same operator, Generate the second data statistics form.
It should be added that it is to be set in advance according to terminal address information to specify number, such as, work as terminal address When information is IP address, 32 characters can be included in IP address, are specified number at this point it is possible to set as 24, so, will be all As an IP address, the scale of the corresponding relation between address information and area is subtracted for preceding 24 characters all identical IP address Lack 256 times, greatly save the internal memory of statistical server.In addition, when the regional minimum granularity of division in the corresponding relation is During city, latter 8 of IP address can only represent 256 terminals, and the probability that 256 terminals are located at same city is especially big, because This, this address information compression method can ensure user data statistical accuracy.
Area belonging to terminal can be country, city etc., and when the area belonging to terminal is national, statistical server leads to Cross above-mentioned steps and get country belonging to each terminal, and same national user data is counted, generation data system Count form.When the area belonging to terminal is city, statistical server gets the city belonging to each terminal by above-mentioned steps City, and the user data in same city is counted, generate data statistics form.
Alternatively, statistical server can be counted with extension set room.When statistical server extension set room counts, Ke Yicong In multiple statistical servers, selection is located at the statistical server of same computer room, and will be stored in the statistical server of same computer room User data counted.
It should be noted that when being counted to user data, can be with the quantity of counting user, the embodiment of the present invention is to this It is not specifically limited.In addition, not only including current statistics in the statistical report form of generation, current time is additionally may included in The statistics counted before, and the statistical report form can be curve map, pie chart etc., the embodiment of the present invention is not done equally to this It is specific to limit.
Alternatively, in embodiments of the present invention, after being counted to user data, statistical server is also based on working as The user data of preceding statistics and user data according to statistics is analyzed before, such as, if the number of users of current statistic is big In the first specified quantity, it is determined that the data of statistics go wrong, and now, statistical server can be with display alarm prompt message. Wherein, judge that the method whether data of statistics go wrong is a lot, such as, number of users is less than the second specified quantity, continuously The difference of the data counted twice is more than the 3rd specified quantity etc., and the embodiment of the present invention is no longer listed one by one.Wherein, first specify Quantity, the second specified quantity and the 3rd specified quantity are all set in advance, and the embodiment of the present invention is not specifically limited to this.
Further, when user is improper offline, statistical server can clear up nothing by the method for above-mentioned steps 505 Effectiveness user data, and when user is normally offline, statistical server can clear up user data by following method, specifically For:Distributed when statistical server also stores the access stratum server in core buffer corresponding to access stratum server for user Reach the standard grade mark when, if access stratum server receive terminal transmission user offline request, according to the user offline please The terminal address information of carrying is sought, from the address information and the corresponding relation between identifying of reaching the standard grade of storage, is obtained on corresponding Line identifies;And according to the address information of access stratum server, from multiple statistical servers, determine that the access stratum server is corresponding Statistical server;Afterwards, access stratum server and send removal request to the statistical server of determination, carried in the removal request The mark of reaching the standard grade obtained, makes the statistical server according to the mark of reaching the standard grade, user data corresponding to deletion.
Wherein, according to the mark of reaching the standard grade, the concrete operations of user data corresponding to deletion can be statistical server:Statistics Server is according to the mark of reaching the standard grade, and in the multiple core buffers included from the statistical server, searches and stores the mark of reaching the standard grade Storage location, and delete the user data stored in the storage location that finds.
Further, after access stratum server sends removal request to statistical server, in addition to:Access stratum server According to terminal address information, corresponding mark of reaching the standard grade in the corresponding relation between address information and mark of reaching the standard grade is deleted.So, connect Enter the stratum server mark that this can also subsequently be reached the standard grade and distribute to other users, improve the utilization rate for mark of reaching the standard grade.
With reference to the description in step 503, in embodiments of the present invention, access stratum server is all to system by udp protocol Count server and send data, the process resource of access stratum server can be saved, also reduce and instant messaging business is handled Influence.
It should be noted that when user data is stored in virtual memory, when statistical server breaks down, such as, Statistical server occurs dodging situation about moving back, and can cause the loss of statistics, and when user data is stored in shared drive, statistics The failure of server will not cause the loss of statistics, and therefore, in embodiments of the present invention, the internal memory in statistical server is equal Use shared drive, rather than virtual memory.
In embodiments of the present invention, when access stratum server receive terminal transmission user reach the standard grade request after, according to The address information of the access stratum server, from multiple statistical servers, determine statistical fractals corresponding to the access stratum server Device, each statistical server in the plurality of statistical server are respectively used to what multiple access stratum servers that storage is specified were sent User data, that is to say, each statistical server is only the multiple Access Layer server-assignment core buffers specified, rather than For each Access Layer server-assignment core buffer, so as to save the internal memory of statistical server, and statistical server Remaining internal memory is more after storage allocation buffering area, it is sufficient to while handle multiple users and reach the standard grade request, without by user Line request is stored in the hard disk of statistical server, is improved the concurrency of statistical server, is also improved statistical server pair User reaches the standard grade the processing speed of request.
Fig. 6 is a kind of structural representation for accessing stratum server provided in an embodiment of the present invention.Referring to Fig. 6, the Access Layer Server includes:
Distribute module 601, for when the user for receiving terminal transmission reaches the standard grade request, mark of reaching the standard grade to be distributed for user, User, which reaches the standard grade, to be asked to carry user data;
First determining module 602, for according to access stratum server address information, from multiple statistical servers, really Statistical server corresponding to the fixed access stratum server, each statistical server in the plurality of statistical server are respectively used to deposit Store up the user data that the multiple access stratum servers specified are sent;
First sending module 603, for sending storage request to the statistical server of determination, carried in storage request Line mark, the address information of the access stratum server and user data, make the statistical server be based on reach the standard grade mark and the access The address information of stratum server, user data is stored in core buffer corresponding to the access stratum server, and by counting Server specifies duration every first, and the user data of storage is counted.
Optional, the first determining module 602 includes:
First determining unit, the address information for accessing stratum server with this carry out modulus fortune to statistical server quantity Calculate, obtain computing numerical value, computing numerical value is defined as into statistical server corresponding to the access stratum server numbers, by the system of determination Statistical server corresponding to meter server numbering is defined as statistical server corresponding to the access stratum server;Or
Second determining unit, for the address information according to the access stratum server, from the address information and statistics of storage In corresponding relation between server numbering, statistical server corresponding to acquisition is numbered, by the statistical server numbering pair of acquisition The statistical server answered is defined as statistical server corresponding to the access stratum server.
Alternatively, the access stratum server also includes:
First acquisition module, for obtaining terminal address information from user data;
Memory module, for by the terminal address information and reaching the standard grade mark, address information is stored between mark of reaching the standard grade Corresponding relation in.
Alternatively, the access stratum server also includes:
Second acquisition module, for also being deposited in core buffer corresponding to the access stratum server when the statistical server Storage reach the standard grade mark when, if receive the terminal transmission user offline request, according to user offline ask carry terminal Address information, from the address information and the corresponding relation between identifying of reaching the standard grade of storage, mark of being reached the standard grade corresponding to acquisition;
Second determining module, for the address information according to the access stratum server, from multiple statistical servers, it is determined that Statistical server corresponding to the access stratum server;
Second sending module, for sending removal request to the statistical server, mark of reaching the standard grade is carried in the removal request, Make the statistical server according to mark of reaching the standard grade, user data corresponding to deletion.
Alternatively, the access stratum server also includes:
Removing module, for according to terminal address information, delete address information between mark of reaching the standard grade corresponding relation in Corresponding mark of reaching the standard grade.
Alternatively, the access stratum server sends data by using user data datagram protocol UDP to statistical server.
In embodiments of the present invention, when access stratum server receive terminal transmission user reach the standard grade request after, according to The address information of the access stratum server, from multiple statistical servers, determine statistical fractals corresponding to the access stratum server Device, each statistical server in the plurality of statistical server are respectively used to what multiple access stratum servers that storage is specified were sent User data, that is to say, each statistical server is only the multiple Access Layer server-assignment core buffers specified, rather than For each Access Layer server-assignment core buffer, so as to save the internal memory of statistical server, and statistical server Remaining internal memory is more after storage allocation buffering area, it is sufficient to while handle multiple users and reach the standard grade request, without by user Line request is stored in the hard disk of statistical server, is improved the concurrency of statistical server, is also improved statistical server pair User reaches the standard grade the processing speed of request.
Fig. 7 is a kind of structural representation of statistical server provided in an embodiment of the present invention.Referring to Fig. 7, the statistical fractals Device includes:
Receiving module 701, the storage request sent for receiving access stratum server, storage request carrying are reached the standard grade mark Know, the address information of the access stratum server and user data, statistical server are the access stratum servers according to the Access Layer The address information of server, it is determined from multiple statistical servers, and each statistical fractals in multiple statistical servers Device is respectively used to the user data that multiple access stratum servers that storage is specified are sent, and mark of reaching the standard grade is that the access stratum server is User's distribution;
First memory module 702, for the address information according to reach the standard grade mark and the access stratum server, by user data It is stored in core buffer corresponding to the access stratum server;
Statistical module 703, for specifying duration every first, it will be deposited in multiple core buffers that statistical server includes The user data of storage is counted.
Alternatively, the first memory module 702 includes:
Searching unit, for the address information according to the access stratum server, from multiple core buffers, search this and connect Enter core buffer corresponding to stratum server;
Arithmetic element, for carrying out cuckoo Hash operation to mark of reaching the standard grade, the user data is obtained in finding Deposit the storage location in buffering area;
First memory cell, in storage location, storing user data.
Alternatively, statistical module 703 includes:
First acquisition unit, for specifying duration every first, from the user data of multiple core buffers storage, obtain The terminal address information for taking the user data to include;
Statistic unit, for according to the address information storehouse stored in terminal address information and internal memory, to multiple memory buffers The user data stored in area is counted, and generates data statistics form, and the address information storehouse includes the first corresponding relation and the It is at least one in two corresponding relations, corresponding relation of first corresponding relation between address information and area, the second corresponding pass It is the corresponding relation between address information and operator.
Alternatively, statistical module 703 also includes:
Second acquisition unit, for since the first character of each address information of storage, acquisition to specify number individual Character, obtain the first compression address information;
Second memory cell, for when address information bank includes the first corresponding relation, by the first compression address information and Area corresponding to first compression address information, is stored in address information storehouse in the first corresponding relation;
3rd memory cell, for when address information bank includes the second corresponding relation, by the first compression address information and Operator corresponding to first compression address information, is stored in address information storehouse in the second corresponding relation.
Alternatively,
Statistic unit, it is specifically used for:
Since the first character of terminal address information, acquisition specifies number a character, obtains the second compression address letter Breath;
When address information bank includes the first corresponding relation, address information is compressed according to second, from the first corresponding relation, The area belonging to terminal is obtained, the statistical server is counted the user data for belonging to areal, generates the first data Statistical report form;
When address information bank includes the second corresponding relation, address information is compressed according to second, from the second corresponding relation, The operator belonging to the terminal is obtained, the statistical server is counted the user data for belonging to same operator, generation the Two data statistics forms.
Alternatively, the statistical server also includes:
First acquisition module, the time of the user data is stored for obtaining;
First determining module, for the time of acquisition to be defined as to the renewal time of the user data;
Second memory module, for storing the renewal time of the user data.
Alternatively, the statistical server also includes:
Second acquisition module, for specifying duration every second, obtain the user data stored in multiple core buffers Renewal time;
Computing module, for calculating the time interval between renewal time and current time;
Second determining module, the user data for time interval to be spaced greatly at fixed time are defined as inactive users number According to;
Removing module, for deleting the inactive users data.
In embodiments of the present invention, when access stratum server receive terminal transmission user reach the standard grade request after, according to The address information of the access stratum server, from multiple statistical servers, determine statistical fractals corresponding to the access stratum server Device, each statistical server in the plurality of statistical server are respectively used to what multiple access stratum servers that storage is specified were sent User data, that is to say, each statistical server is only the multiple Access Layer server-assignment core buffers specified, rather than For each Access Layer server-assignment core buffer, so as to save the internal memory of statistical server, and statistical server Remaining internal memory is more after storage allocation buffering area, it is sufficient to while handle multiple users and reach the standard grade request, without by user Line request is stored in the hard disk of statistical server, is improved the concurrency of statistical server, is also improved statistical server pair User reaches the standard grade the processing speed of request.
It should be noted that:Above-described embodiment provide user data statistic device when user data counts, only more than The division progress of each functional module is stated for example, in practical application, can be as needed and by above-mentioned function distribution by difference Functional module complete, i.e., the internal structure of device is divided into different functional modules, with complete it is described above whole or Person's partial function.In addition, the user data statistic device that above-described embodiment provides belongs to user data statistical method embodiment Same design, its specific implementation process refer to embodiment of the method, repeated no more here.
Fig. 8 is refer to, the structural representation of the access stratum server provided it illustrates one embodiment of the invention.It is described Access stratum server 800 includes CPU (CPU) 801 including random access memory (RAM) 802 and read-only storage The system storage 804 of device (ROM) 803, and connection system storage 804 and the system bus of CPU 801 805.The access stratum server 800 also includes helping the basic input/defeated that information is transmitted between each device in computer Go out system (I/O systems) 806, and the Large Copacity for storage program area 813, application program 810 and other program modules 815 Storage device 807.
The basic input/output 806 includes for the display 808 of display information and inputs letter for user The input equipment 809 of such as mouse, keyboard etc of breath.Wherein described display 808 and input equipment 809 are all by being connected to The IOC 810 of system bus 805 is connected to CPU 801.The basic input/output 806 Can also include IOC 810 for receive and handle from keyboard, mouse or electronic touch pen etc. it is multiple its The input of his equipment.Similarly, IOC 810 also provides output to display screen, printer or other kinds of defeated Go out equipment.
The mass-memory unit 807 is by being connected to the bulk memory controller (not shown) of system bus 805 It is connected to CPU 801.The mass-memory unit 807 and its associated computer-readable medium are Access Layer Server 800 provides non-volatile memories.That is, the mass-memory unit 807 can include such as hard disk or The computer-readable medium (not shown) of CD-ROM drive etc.
Without loss of generality, the computer-readable medium can include computer-readable storage medium and communication media.Computer Storage medium is included for information such as storage computer-readable instruction, data structure, program module or other data The volatibility and non-volatile, removable and irremovable medium that any method or technique is realized.Computer-readable storage medium includes RAM, ROM, EPROM, EEPROM, flash memory or other solid-state storages its technologies, CD-ROM, DVD or other optical storages, tape Box, tape, disk storage or other magnetic storage apparatus.Certainly, skilled person will appreciate that the computer-readable storage medium It is not limited to above-mentioned several.Above-mentioned system storage 804 and mass-memory unit 807 may be collectively referred to as memory.
According to various embodiments of the present invention, the access stratum server 800 can also pass through the networks such as internet The remote computer operation being connected on network.Namely access stratum server 800 can be by being connected to the system bus 805 On NIU 811 be connected to network 812, in other words, other can also be connected to using NIU 811 The network or remote computer system (not shown) of type.
The memory also includes one or more than one program, one or more than one program storage in In memory, one or more than one program bag, which contains, to be used to carry out two-dimensional code generation method provided in an embodiment of the present invention And/or the instruction of mutual authentication method.
Fig. 9 is refer to, the structural representation of the statistical server provided it illustrates one embodiment of the invention.The system Meter server 900 includes CPU (CPU) 901 including random access memory (RAM) 902 and read-only storage (ROM) 903 system storage 904, and connection system storage 904 and the system bus 905 of CPU 901. The access stratum server 900 also includes the basic input/output system of transmission information between each device in help computer (the I/O systems) 906 of system, and the massive store for storage program area 913, application program 910 and other program modules 915 Equipment 907.
The basic input/output 906 includes for the display 908 of display information and inputs letter for user The input equipment 909 of such as mouse, keyboard etc of breath.Wherein described display 908 and input equipment 909 are all by being connected to The IOC 910 of system bus 905 is connected to CPU 901.The basic input/output 906 Can also include IOC 910 for receive and handle from keyboard, mouse or electronic touch pen etc. it is multiple its The input of his equipment.Similarly, IOC 910 also provides output to display screen, printer or other kinds of defeated Go out equipment.
The mass-memory unit 907 is by being connected to the bulk memory controller (not shown) of system bus 905 It is connected to CPU 901.The mass-memory unit 907 and its associated computer-readable medium take for statistics Business device 900 provides non-volatile memories.That is, the mass-memory unit 907 can include such as hard disk or CD- The computer-readable medium (not shown) of ROM drive etc.
Without loss of generality, the computer-readable medium can include computer-readable storage medium and communication media.Computer Storage medium is included for information such as storage computer-readable instruction, data structure, program module or other data The volatibility and non-volatile, removable and irremovable medium that any method or technique is realized.Computer-readable storage medium includes RAM, ROM, EPROM, EEPROM, flash memory or other solid-state storages its technologies, CD-ROM, DVD or other optical storages, tape Box, tape, disk storage or other magnetic storage apparatus.Certainly, skilled person will appreciate that the computer-readable storage medium It is not limited to above-mentioned several.Above-mentioned system storage 904 and mass-memory unit 907 may be collectively referred to as memory.
According to various embodiments of the present invention, the statistical server 900 can also be connected by networks such as internets The remote computer operation being connected on network.Namely statistical server 900 can be by being connected on the system bus 905 NIU 911 is connected to network 912, in other words, can also be connected to other types using NIU 911 Network or remote computer system (not shown).
The memory also includes one or more than one program, one or more than one program storage in In memory, one or more than one program bag, which contains, to be used to carry out two-dimensional code generation method provided in an embodiment of the present invention And/or the instruction of mutual authentication method.
Obviously, the statistical server that access stratum server and Fig. 9 that embodiment illustrated in fig. 8 provides are provided can also form User data statistical system.
One of ordinary skill in the art will appreciate that hardware can be passed through by realizing all or part of step of above-described embodiment To complete, by program the hardware of correlation can also be instructed to complete, described program can be stored in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only storage, disk or CD etc..
The foregoing is only presently preferred embodiments of the present invention, be not intended to limit the invention, it is all the present invention spirit and Within principle, any modification, equivalent substitution and improvements made etc., it should be included in the scope of the protection.

Claims (26)

1. a kind of user data statistical method, it is characterised in that methods described includes:
When the user for accessing stratum server and receiving terminal transmission reaches the standard grade request, reached the standard grade mark for user's distribution, the user Request of reaching the standard grade carries user data;
The access stratum server from multiple statistical servers, determines institute according to the address information of the access stratum server State and access statistical server corresponding to stratum server, each statistical server in the multiple statistical server is respectively used to deposit Store up the user data that the multiple access stratum servers specified are sent;
The access stratum server is to statistical server transmission storage request, mark of being reached the standard grade in the storage request described in carrying Knowledge, the address information of the access stratum server and the user data, make the statistical server be based on the mark of reaching the standard grade With it is described access stratum server address information, by the user data be stored in it is described access stratum server corresponding to internal memory delay Rush in area, and duration is specified every first by the statistical server, the user data of storage is counted.
2. the method as described in claim 1, it is characterised in that the access stratum server is according to the access stratum server Address information, from multiple statistical servers, statistical server corresponding to the access stratum server is determined, including:
The access stratum server carries out modulo operation with the address information of the access stratum server to statistical server quantity, Obtain computing numerical value, by the computing numerical value be defined as it is described access stratum server corresponding to statistical server number, will determine Statistical server numbering corresponding to statistical server be defined as it is described access stratum server corresponding to statistical server;Or
The access stratum server is according to the address information for accessing stratum server, from the address information and statistical fractals of storage In corresponding relation between device numbering, statistical server corresponding to acquisition is numbered, by corresponding to the statistical server numbering of acquisition Statistical server is defined as statistical server corresponding to the access stratum server.
3. the method as described in claim 1, it is characterised in that described is that user is distributed after mark of reaching the standard grade, in addition to:
The access stratum server obtains terminal address information from the user data;
The terminal address information and the mark of reaching the standard grade are stored in address information and mark of reaching the standard grade by the access stratum server Between corresponding relation in.
4. method as claimed in claim 3, it is characterised in that methods described also includes:
When the statistical server is also reaching the standard grade mark in core buffer described in storage corresponding to the access stratum server, If the access stratum server receives the user offline request that the terminal is sent, taken according to user offline request The terminal address information of band, from the address information and the corresponding relation between identifying of reaching the standard grade of storage, mark of being reached the standard grade corresponding to acquisition Know;
It is described to access address information of the stratum server according to the access stratum server, from the multiple statistical server, really Statistical server corresponding to the fixed access stratum server;
The access stratum server sends removal request to the statistical server, carry in the removal request described in reach the standard grade mark Know, the statistical server is reached the standard grade according to mark, user data corresponding to deletion.
5. method as claimed in claim 4, it is characterised in that the access stratum server is sent to the statistical server to be deleted After request, in addition to:
The access stratum server is deleted corresponding between the address information and mark of reaching the standard grade according to the terminal address information Corresponding mark of reaching the standard grade in relation.
6. the method as described in claim 1-5 any claims, it is characterised in that the access stratum server is by using family Data pack protocol UDP sends data to the statistical server.
7. a kind of user data statistical method, it is characterised in that methods described includes:
Statistical server receives the storage request that access stratum server is sent, the storage request carrying reach the standard grade mark, described connect Enter the address information and user data of stratum server, the statistical server is the access stratum server according to the Access Layer The address information of server, it is determined from multiple statistical servers, and each statistics in the multiple statistical server Server is respectively used to the user data that multiple access stratum servers that storage is specified are sent, and the mark of reaching the standard grade is the access Stratum server is user's distribution;
The statistical server reached the standard grade according to mark and it is described access stratum server address information, by the user data It is stored in core buffer corresponding to the access stratum server;
Duration is specified every first, the statistical server will store in multiple core buffers that the statistical server includes User data counted.
8. method as claimed in claim 7, it is characterised in that the statistical server is reached the standard grade to identify according to and connect with described Enter the address information of stratum server, the user data be stored in core buffer corresponding to the access stratum server, Including:
The statistical server from the multiple core buffer, is searched according to the address information of the access stratum server Core buffer corresponding to the access stratum server;
The statistical server carries out cuckoo Hash operation to the mark of reaching the standard grade, and obtains the user data and is finding Storage location in core buffer;
The statistical server stores the user data in the storage location.
9. method as claimed in claim 7, it is characterised in that described to specify duration every first, the statistical server will The user data stored in multiple core buffers that the statistical server includes is counted, including:
Every in the first specified duration, the user data that the statistical server stores from the multiple core buffer, obtain The terminal address information that the user data includes;
The statistical server is according to the address information storehouse stored in the terminal address information and internal memory, to the multiple internal memory The user data stored in buffering area is counted, and generates data statistics form, and the address information storehouse includes the first corresponding pass At least one, corresponding relation of first corresponding relation between address information and area in system and the second corresponding relation, Corresponding relation of second corresponding relation between address information and operator.
10. method as claimed in claim 9, it is characterised in that the statistical server according to the terminal address information and The address information storehouse stored in internal memory, the user data stored in the multiple core buffer is counted, generate data Before statistical report form, in addition to:
For the statistical server since the first character of each terminal address information of storage, acquisition specifies number a word Symbol, obtains the first compression address information;
When the address information storehouse includes the first corresponding relation, the statistical server by described first compression address information and Area corresponding to the first compression address information, is stored in the address information storehouse in first corresponding relation;
When the address information storehouse includes the second corresponding relation, the statistical server by described first compression address information and Operator corresponding to the first compression address information, is stored in the address information storehouse in second corresponding relation.
11. method as claimed in claim 10, it is characterised in that the statistical server according to the terminal address information and The address information storehouse stored in internal memory, the user data stored in the multiple core buffer is counted, generate data Statistical report form, including:
The statistical server specifies number a character since the first character of the terminal address information, described in acquisition, Obtain the second compression address information;
When the address information storehouse includes first corresponding relation, the statistical server is according to the described second compression address Information, from first corresponding relation, the area belonging to terminal is obtained, the statistical server will belong to the use of areal User data is counted, and generates the first data statistics form;
When the address information storehouse includes second corresponding relation, the statistical server is according to the described second compression address Information, from second corresponding relation, the operator belonging to the terminal is obtained, the statistical server will belong to same fortune The user data of battalion business is counted, and generates the second data statistics form.
12. method as claimed in claim 7, it is characterised in that the statistical server reached the standard grade according to mark and it is described The address information of stratum server is accessed, the user data is stored in core buffer corresponding to the access stratum server Afterwards, in addition to:
The statistical server obtains the time for storing the user data;
The time of acquisition is defined as the renewal time of the user data by the statistical server;
The statistical server stores the renewal time of the user data.
13. method as claimed in claim 12, it is characterised in that methods described also includes:
Duration is specified every second, the statistical server obtains the user data stored in the multiple core buffer more The new time;
The statistical server calculates the time interval between the renewal time and current time;
The user data that time interval is spaced greatly by the statistical server at fixed time is defined as inactive users data;
The statistical server deletes the inactive users data.
14. one kind access stratum server, it is characterised in that the access stratum server includes:
Distribute module, for when the user for receiving terminal transmission reaches the standard grade request, mark of reaching the standard grade, the user to be distributed for user Request of reaching the standard grade carries user data;
First determining module, for the address information according to access stratum server, from multiple statistical servers, it is determined that described connect Enter statistical server corresponding to stratum server, each statistical server in the multiple statistical server is respectively used to storage and referred to The user data that fixed multiple access stratum servers are sent;
First sending module, for statistical server transmission storage request, being reached the standard grade in the storage request described in carrying Mark, the address information of the access stratum server and the user data, make the statistical server be based on the mark of reaching the standard grade Know the address information with the access stratum server, the user data is stored in internal memory corresponding to the access stratum server In buffering area, and duration is specified every first by the statistical server, the user data of storage is counted.
15. access stratum server as claimed in claim 14, it is characterised in that first determining module includes:
First determining unit, for carrying out modulus fortune to statistical server quantity with the address information of the access stratum server Calculate, obtain computing numerical value, the computing numerical value is defined as statistical server numbering corresponding to the access stratum server, by really Statistical server corresponding to fixed statistical server numbering is defined as statistical server corresponding to the access stratum server;Or Person,
Second determining unit, for the address information according to the access stratum server, taken from address information and the statistics of storage In corresponding relation between device numbering of being engaged in, statistical server corresponding to acquisition is numbered, and the statistical server of acquisition is numbered corresponding Statistical server be defined as it is described access stratum server corresponding to statistical server.
16. access stratum server as claimed in claim 14, it is characterised in that the access stratum server also includes:
First acquisition module, for obtaining terminal address information from the user data;
Memory module, for by the terminal address information and the mark of reaching the standard grade, being stored in address information and mark of reaching the standard grade Between corresponding relation in.
17. access stratum server as claimed in claim 16, it is characterised in that the access stratum server also includes:
Second acquisition module, for also being deposited in core buffer corresponding to the access stratum server when the statistical server During mark of being reached the standard grade described in storage, if receiving the user offline request that the terminal is sent, asked according to the user offline The terminal address information of carrying, from the address information and the corresponding relation between identifying of reaching the standard grade of storage, reached the standard grade corresponding to acquisition Mark;
Second determining module, for according to it is described access stratum server address information, from the multiple statistical server, really Statistical server corresponding to the fixed access stratum server;
Second sending module, carried for sending removal request to the statistical server, in the removal request described in reach the standard grade Mark, the statistical server is set to be reached the standard grade according to mark, user data corresponding to deletion.
18. access stratum server as claimed in claim 17, it is characterised in that the access stratum server also includes:
Removing module, for according to the terminal address information, deleting the corresponding pass between the address information and mark of reaching the standard grade Corresponding mark of reaching the standard grade in system.
19. the access stratum server as described in claim 14-18 any claims, it is characterised in that the Access Layer clothes Business device sends data by user datagram protocol UDP to the statistical server.
20. a kind of statistical server, it is characterised in that the statistical server includes:
Receiving module, the storage request sent for receiving access stratum server, the storage request carrying are reached the standard grade mark, described The address information and user data of stratum server are accessed, statistical server is that the access stratum server takes according to the Access Layer The address information of business device, is determined from multiple statistical servers, and each statistics clothes in the multiple statistical server Business device is respectively used to the user data that multiple access stratum servers that storage is specified are sent, and the mark of reaching the standard grade is the Access Layer Server is user's distribution;
First memory module, for the address information of reached the standard grade according to mark and the access stratum server, by the user Data storage is in core buffer corresponding to the access stratum server;
Statistical module, for specifying duration every first, it will be stored in multiple core buffers that the statistical server includes User data counted.
21. statistical server as claimed in claim 20, it is characterised in that first memory module includes:
Searching unit, for the address information according to the access stratum server, from the multiple core buffer, search institute State core buffer corresponding to access stratum server;
Arithmetic element, for carrying out cuckoo Hash operation to the mark of reaching the standard grade, obtain the user data and finding Storage location in core buffer;
First memory cell, in the storage location, storing the user data.
22. statistical server as claimed in claim 20, it is characterised in that the statistical module includes:
First acquisition unit, for specifying duration every first, from the user data of the multiple core buffer storage, obtain The terminal address information for taking the user data to include;
Statistic unit, for according to the address information storehouse stored in the terminal address information and internal memory, to the multiple internal memory The user data stored in buffering area is counted, and generates data statistics form, and the address information storehouse includes the first corresponding pass At least one, corresponding relation of first corresponding relation between address information and area in system and the second corresponding relation, Corresponding relation of second corresponding relation between address information and operator.
23. statistical server as claimed in claim 22, it is characterised in that the statistical module also includes:
Second acquisition unit, for since the first character of each terminal address information of storage, acquisition to specify number individual Character, obtain the first compression address information;
Second memory cell, for when the address information storehouse includes the first corresponding relation, the described first compression address to be believed Area corresponding to breath and the described first compression address information, is stored in the address information storehouse in first corresponding relation;
3rd memory cell, for when the address information storehouse includes the second corresponding relation, the described first compression address to be believed Operator corresponding to breath and the described first compression address information, is stored in second corresponding relation in the address information storehouse In.
24. statistical server as claimed in claim 23, it is characterised in that
The statistic unit, is specifically used for:
A character is specified number since the first character of the terminal address information, described in acquisition, obtains second compressively Location information;
When the address information storehouse includes first corresponding relation, according to the described second compression address information, from described the In one corresponding relation, the area belonging to terminal is obtained, the statistical server is united the user data for belonging to areal Meter, generate the first data statistics form;
When the address information storehouse includes second corresponding relation, according to the described second compression address information, from described the In two corresponding relations, the operator belonging to the terminal is obtained, the statistical server will belong to the number of users of same operator According to being counted, the second data statistics form is generated.
25. statistical server as claimed in claim 20, it is characterised in that the statistical server also includes:
First acquisition module, the time of the user data is stored for obtaining;
First determining module, for the time of acquisition to be defined as to the renewal time of the user data;
Second memory module, for storing the renewal time of the user data.
26. statistical server as claimed in claim 25, it is characterised in that the statistical server also includes:
Second acquisition module, for specifying duration every second, obtain the user data stored in the multiple core buffer Renewal time;
Computing module, for calculating the time interval between the renewal time and current time;
Second determining module, the user data for time interval to be spaced greatly at fixed time are defined as inactive users data;
Removing module, for deleting the inactive users data.
CN201410776782.8A 2014-12-15 2014-12-15 User data statistical method, access stratum server and statistical server Active CN104579753B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410776782.8A CN104579753B (en) 2014-12-15 2014-12-15 User data statistical method, access stratum server and statistical server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410776782.8A CN104579753B (en) 2014-12-15 2014-12-15 User data statistical method, access stratum server and statistical server

Publications (2)

Publication Number Publication Date
CN104579753A CN104579753A (en) 2015-04-29
CN104579753B true CN104579753B (en) 2018-03-23

Family

ID=53095018

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410776782.8A Active CN104579753B (en) 2014-12-15 2014-12-15 User data statistical method, access stratum server and statistical server

Country Status (1)

Country Link
CN (1) CN104579753B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106682167B (en) * 2016-12-26 2020-08-14 山东昆仲信息科技有限公司 Statistical device and method for user behavior data
CN107040581B (en) * 2017-01-25 2021-03-02 腾讯科技(深圳)有限公司 Network packet sending method, device, server and system
CN109428924B (en) * 2017-08-29 2021-07-13 阿里巴巴集团控股有限公司 Application online state maintenance method, access layer assembly, application system and equipment
CN110417624B (en) * 2019-08-30 2021-09-28 腾讯科技(深圳)有限公司 Request statistical method, device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101677324A (en) * 2008-09-17 2010-03-24 华为技术有限公司 Business management method, terminal, network system and related equipment
CN102170364A (en) * 2011-05-26 2011-08-31 华为技术有限公司 Multicast communication method and device for broadband remote access server
CN103501297A (en) * 2013-09-27 2014-01-08 杭州华三通信技术有限公司 Portal authentication method and equipment
CN103763149A (en) * 2013-12-27 2014-04-30 北京集奥聚合科技有限公司 Real-time statistical method for network user number
CN104125599A (en) * 2014-08-13 2014-10-29 重庆大学 WLAN (wireless local area network) access point and user terminal information acquisition, correlation and statistical analysis method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101282342B (en) * 2008-05-30 2012-05-23 腾讯科技(深圳)有限公司 Method and system for fetching network contents

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101677324A (en) * 2008-09-17 2010-03-24 华为技术有限公司 Business management method, terminal, network system and related equipment
CN102170364A (en) * 2011-05-26 2011-08-31 华为技术有限公司 Multicast communication method and device for broadband remote access server
CN103501297A (en) * 2013-09-27 2014-01-08 杭州华三通信技术有限公司 Portal authentication method and equipment
CN103763149A (en) * 2013-12-27 2014-04-30 北京集奥聚合科技有限公司 Real-time statistical method for network user number
CN104125599A (en) * 2014-08-13 2014-10-29 重庆大学 WLAN (wireless local area network) access point and user terminal information acquisition, correlation and statistical analysis method

Also Published As

Publication number Publication date
CN104579753A (en) 2015-04-29

Similar Documents

Publication Publication Date Title
EP3297213B1 (en) Method and apparatus for identifying application information in network traffic
CN104579753B (en) User data statistical method, access stratum server and statistical server
CN107395665A (en) A kind of block chain service handling and business common recognition method and device
CN106657327A (en) Message pushing method and message pushing device
CN106997546A (en) A kind of order processing method and device
CN111125118B (en) Associated data query method, device, equipment and medium
CN105869057A (en) Comment storage device, comment reading method and apparatus, and comment writing method and apparatus
CN112468409A (en) Access control method, device, computer equipment and storage medium
CN113361913A (en) Communication service arranging method, device, computer equipment and storage medium
CN114282011B (en) Knowledge graph construction method and device, and graph calculation method and device
CN107547523A (en) Message processing method, device, the network equipment and machinable medium
CN109302300A (en) Data distributing method and device, data processing method and server
CN104967603A (en) Application account security verification method and apparatus
CN108520401B (en) User list management method, device, platform and storage medium
CN106411638A (en) Method and system for processing monitoring data in cloud monitoring system
CN106469166A (en) A kind of information processing method and device
CN110851758A (en) Webpage visitor number statistical method and device
CN114363002B (en) Method and device for generating network attack relation diagram
CN105939218A (en) Statistical method and device for network traffic
CN108021597B (en) Parallel counter, server and counting method
CN115795100A (en) User event processing method and device, electronic equipment and readable storage medium
US9210147B1 (en) Method, apparatus and computer program product for assessing risk associated with authentication requests
CN111221847B (en) Monitoring data storage method, device and computer readable storage medium
CN108471422B (en) Method, device, server and medium for judging remote login
CN107291757A (en) The method and mode matching device of pattern match

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20210918

Address after: 518057 Tencent Building, No. 1 High-tech Zone, Nanshan District, Shenzhen City, Guangdong Province, 35 floors

Patentee after: TENCENT TECHNOLOGY (SHENZHEN) Co.,Ltd.

Patentee after: TENCENT CLOUD COMPUTING (BEIJING) Co.,Ltd.

Address before: 2, 518000, East 403 room, SEG science and Technology Park, Zhenxing Road, Shenzhen, Guangdong, Futian District

Patentee before: TENCENT TECHNOLOGY (SHENZHEN) Co.,Ltd.

TR01 Transfer of patent right