CN105607987B - A kind of visit capacity statistical method and device - Google Patents
A kind of visit capacity statistical method and device Download PDFInfo
- Publication number
- CN105607987B CN105607987B CN201510956587.8A CN201510956587A CN105607987B CN 105607987 B CN105607987 B CN 105607987B CN 201510956587 A CN201510956587 A CN 201510956587A CN 105607987 B CN105607987 B CN 105607987B
- Authority
- CN
- China
- Prior art keywords
- visit capacity
- memory headroom
- memory
- concurrent
- recordable
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
- G06F11/3452—Performance evaluation by statistical analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
Abstract
The present invention relates to a kind of visit capacity statistical method and devices, wherein method includes:Memory headroom is obtained, and the memory headroom is divided into M row * N rows region according to default memory size, wherein M corresponds to the quantity of process, and each column corresponds to a process, and N corresponds to the recordable access number of each process;Concurrent access request is received by M process, and records concurrent visit capacity in the memory headroom;Memory Data-Statistics currently total visit capacity is used according to the memory headroom;Current total visit capacity is recorded in database.By the technical solution, concurrent access request is received by multiple threads, and records concurrent visit capacity, in this way, receive it is a large amount of concurrently access when, it is ensured that the speed of visit capacity statistics, while ensureing visit capacity statistical accuracy.
Description
Technical field
The present invention relates to data statistics technical field more particularly to a kind of visit capacity statistical method and devices.
Background technology
Website is frequently necessary to count the visit capacity of user, but when largely concurrently accessing, the speed of the counting
The speed of visit capacity rising may not caught up with.The prior art is that a number constantly adds 1, and one number of a number adds, and speed is very
Slowly.
Invention content
A kind of visit capacity statistical method of offer of the embodiment of the present invention and device, including following technical solution:
According to a first aspect of the embodiments of the present invention, a kind of visit capacity statistical method is provided, including:
Memory headroom is obtained, and the memory headroom is divided into M row * N rows region according to default memory size,
In, M corresponds to the quantity of process, and each column corresponds to a process, and N corresponds to the recordable access number of each process;
Concurrent access request is received by M process, and records concurrent visit capacity in the memory headroom;
Memory Data-Statistics currently total visit capacity is used according to the memory headroom;
Current total visit capacity is recorded in database.
In one embodiment, described that concurrent visit capacity is recorded by M process, and recorded simultaneously in the memory headroom
Visit capacity is sent out, including:
Concurrent access request is received simultaneously by M process, it, will be described when each process receives an access request
The flag bit in a region in the corresponding recordable access number of process described in memory headroom is set to 1 by 0.
In one embodiment, described that memory Data-Statistics currently total visit capacity is used according to the memory headroom, packet
It includes:
It counts in the memory headroom, the number in the region that flag bit is 1;
The number is determined as current total visit capacity.
In one embodiment, the method further includes:
Monitor the processing progress of each process;
When the flag bit of all areas in the corresponding recordable access number of any process in M process that monitors is
When 1, current total visit capacity in the database is added into N, and any process is corresponded into institute in recordable access number
There is the mark in region to be set to 0.
According to a second aspect of the embodiments of the present invention, a kind of visit capacity statistic device is provided, including:
Division module is divided into M row * N for obtaining memory headroom, and by the memory headroom according to default memory size
Row region, wherein M corresponds to the quantity of process, and each column corresponds to a process, and N corresponds to the recordable access number of each process;
First logging modle for receiving concurrent access request by M process, and records simultaneously in the memory headroom
Send out visit capacity;
Statistical module, for being used memory Data-Statistics currently total visit capacity according to the memory headroom;
Second logging modle, for current total visit capacity to be recorded in database.
In one embodiment, first logging modle is used for:
Concurrent access request is received simultaneously by M process, it, will be described when each process receives an access request
The flag bit in a region in the corresponding recordable access number of process described in memory headroom is set to 1 by 0.
In one embodiment, the statistical module includes:
Statistic submodule, for counting in the memory headroom, the number in the region that flag bit is 1;
Determination sub-module, for the number to be determined as current total visit capacity.
In one embodiment, described device further includes:
Monitoring module, the processing progress for monitoring each process;
Processing module, for when all areas in the corresponding recordable access number of any process in M process that monitor
When the flag bit in domain is 1, current total visit capacity in the database is added into N, and any process is corresponded to and can record
Access number in the marks of all areas be set to 0.
The technical solution that the embodiment of the present invention provides can include the following benefits:
Above-mentioned technical proposal receives concurrent access request by multiple processes, and records concurrent visit capacity, in this way,
It receives a large amount of when concurrently accessing, it is ensured that the speed of visit capacity statistics, while ensureing visit capacity statistical accuracy.
It should be understood that above general description and following detailed description is only exemplary and explanatory, not
It can the limitation present invention.
Description of the drawings
The drawings herein are incorporated into the specification and forms part of this specification, and shows the implementation for meeting the present invention
Example, and be used to explain the principle of the present invention together with specification.
Fig. 1 is a kind of flow chart of visit capacity statistical method shown according to an exemplary embodiment.
Fig. 2 is the flow chart of another visit capacity statistical method shown according to an exemplary embodiment.
Fig. 3 is the flow chart of step S103 in another visit capacity statistical method shown according to an exemplary embodiment.
Fig. 4 is the flow chart according to another visit capacity statistical method shown in an exemplary embodiment.
Fig. 5 is a kind of block diagram of visit capacity statistic device shown according to an exemplary embodiment.
Fig. 6 is the block diagram of statistical module in a kind of visit capacity statistic device shown according to an exemplary embodiment.
Fig. 7 is the block diagram of another visit capacity statistic device shown according to an exemplary embodiment.
Specific implementation mode
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to
When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment
Described in embodiment do not represent and the consistent all embodiments of the present invention.On the contrary, they be only with it is such as appended
The example of the consistent device and method of some aspects being described in detail in claims, of the invention.
An embodiment of the present invention provides a kind of visit capacity statistical methods, as shown in Figure 1, the method comprising the steps of S101-
S104:
In step S101, memory headroom is obtained, and memory headroom is divided into M row * N rows according to default memory size
Region, wherein M corresponds to the quantity of process, and each column corresponds to a process, and N corresponds to the recordable access number of each process;
In step s 102, concurrent access request is received by M process, and records in memory headroom and concurrently accesses
Amount;
In step s 103, memory Data-Statistics currently total visit capacity is used according to memory headroom;
In step S104, current total visit capacity is recorded in database.
In this embodiment, concurrent access request is received by multiple processes, and records concurrent visit capacity, in this way,
It receives a large amount of when concurrently accessing, it is ensured that the speed of visit capacity statistics, while ensureing visit capacity statistical accuracy.
For example, opening up the memory headroom of a 16*n, 16 processes of distribution count simultaneously.One process corresponds to a row.
It counts when completing, or when concurrent visit capacity is decreased obviously, visit capacity is counted out according to the size of memory headroom, and by the visit
The amount of asking is recorded in database.As soon as general server maximum supports 100,000 concurrent visit capacity, also the memory of 1M is distributed just
It is much of that.
As shown in Fig. 2, in one embodiment, above-mentioned steps S102 includes step S201:
In step s 201, concurrent access request is received by M process simultaneously, when each process receives an access
When request, the flag bit in a region in the corresponding recordable access number of process in memory headroom is set to 1 by 0.
In this embodiment it is possible to indicate that the also non-record access in the region is asked with flag bit 0, when some process receives
When concurrent access request, the flag bit in a region of the process is set to 1 by 0, to indicate to increase a visit capacity.
As shown in figure 3, in one embodiment, above-mentioned steps S103 includes step S301-S302:
It in step S301, counts in memory headroom, the number in the region that flag bit is 1;
In step s 302, number is determined as current total visit capacity.
In this embodiment it is possible to current total to determine for the number in 1 region by counting flag bit in memory headroom
Visit capacity, to facilitate statistics visit capacity.
As shown in figure 4, in one embodiment, the above method further includes step S401-S402:
In step S401, the processing progress of each process is monitored;
In step S402, when all areas in the corresponding recordable access number of any process in M process that monitors
When the flag bit in domain is 1, current total visit capacity in database is added into N, and any process is corresponded into recordable access number
The mark of all areas is set to 0 in amount.
In this embodiment, the processing progress that each process can also be monitored, when the corresponding recordable visit of some process
It asks that the flag bit of all areas in quantity is 1, then illustrates that N number of region has been write all over, at this point it is possible to by current total in database
Visit capacity adds N, and the mark that any process is corresponded to all areas in recordable access number is set to 0, to it is convenient should be into
Cheng Chong New counts.
For example, opening up the memory headroom of a 16*1000,16 processes of distribution count simultaneously.One process corresponds to a row,
Each column has 1000.When adding 1 every time, it is 1 that just there are one processes by a position.
Meanwhile there are one the memory headroom of 16*1, a correspondence one arranges.When a process writes its corresponding 1000
It is 1 by the position in corresponding 16*1 when full 1.17th process check will access in the database to there are at one 1
Amount plus 1000, while corresponding position in two memory headrooms being reset, facilitate process to count again.
Following is embodiment of the present disclosure, can be used for executing embodiments of the present disclosure.
Fig. 5 is a kind of block diagram of visit capacity statistic device shown according to an exemplary embodiment.As shown in figure 5, the visit
The amount of asking statistic device includes:
Division module 51 is divided into M for obtaining memory headroom, and by the memory headroom according to default memory size
Arrange * N rows region, wherein M corresponds to the quantity of process, and each column corresponds to a process, and N corresponds to the recordable access of each process
Quantity;
First logging modle 52 for receiving concurrent access request by M process, and records in the memory headroom
Concurrent visit capacity;
Statistical module 53, for being used memory Data-Statistics currently total visit capacity according to the memory headroom;
Second logging modle 54, for current total visit capacity to be recorded in database.
In this embodiment, concurrent access request is received by multiple processes, and records concurrent visit capacity, in this way,
It receives a large amount of when concurrently accessing, it is ensured that the speed of visit capacity statistics, while ensureing visit capacity statistical accuracy.
For example, opening up the memory headroom of a 16*n, 16 processes of distribution count simultaneously.One process corresponds to a row.
It counts when completing, or when concurrent visit capacity is decreased obviously, visit capacity is counted out according to the size of memory headroom, and by the visit
The amount of asking is recorded in database.As soon as general server maximum supports 100,000 concurrent visit capacity, also the memory of 1M is distributed just
It is much of that.
In one embodiment, first logging modle 52 is used for:
Concurrent access request is received simultaneously by M process, it, will be described when each process receives an access request
The flag bit in a region in the corresponding recordable access number of process described in memory headroom is set to 1 by 0.
In this embodiment it is possible to indicate that the also non-record access in the region is asked with flag bit 0, when some process receives
When concurrent access request, the flag bit in a region of the process is set to 1 by 0, to indicate to increase a visit capacity.
As shown in fig. 6, in one embodiment, the statistical module 53 includes:
Statistic submodule 61, for counting in the memory headroom, the number in the region that flag bit is 1;
Determination sub-module 62, for the number to be determined as current total visit capacity.
In this embodiment it is possible to current total to determine for the number in 1 region by counting flag bit in memory headroom
Visit capacity, to facilitate statistics visit capacity.
As shown in fig. 7, in one embodiment, above-mentioned apparatus further includes:
Monitoring module 71, the processing progress for monitoring each process;
Processing module 72, for when all in the corresponding recordable access number of any process in M process that monitor
When the flag bit in region is 1, current total visit capacity in the database is added into N, and any process correspondence can be remembered
The mark of all areas is set to 0 in the access number of record.
In this embodiment, the processing progress that each process can also be monitored, when the corresponding recordable visit of some process
It asks that the flag bit of all areas in quantity is 1, then illustrates that N number of region has been write all over, at this point it is possible to by current total in database
Visit capacity adds N, and the mark that any process is corresponded to all areas in recordable access number is set to 0, to it is convenient should be into
Cheng Chong New counts.
For example, opening up the memory headroom of a 16*1000,16 processes of distribution count simultaneously.One process corresponds to a row,
Each column has 1000.When adding 1 every time, it is 1 that just there are one processes by a position.
Meanwhile there are one the memory headroom of 16*1, a correspondence one arranges.When a process writes its corresponding 1000
It is 1 by the position in corresponding 16*1 when full 1.17th process check will access in the database to there are at one 1
Amount plus 1000, while corresponding position in two memory headrooms being reset, facilitate process to count again.
About the device in above-described embodiment, wherein modules execute the concrete mode of operation in related this method
Embodiment in be described in detail, explanation will be not set forth in detail herein.
It should be understood by those skilled in the art that, the embodiment of the present invention can be provided as method, system or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the present invention
Apply the form of example.Moreover, the present invention can be used in one or more wherein include computer usable program code computer
The shape for the computer program product implemented in usable storage medium (including but not limited to magnetic disk storage and optical memory etc.)
Formula.
The present invention be with reference to according to the method for the embodiment of the present invention, the flow of equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that can be realized by computer program instructions every first-class in flowchart and/or the block diagram
The combination of flow and/or box in journey and/or box and flowchart and/or the block diagram.These computer programs can be provided
Instruct the processor of all-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine so that the instruction executed by computer or the processor of other programmable data processing devices is generated for real
The device for the function of being specified in present one flow of flow chart or one box of multiple flows and/or block diagram or multiple boxes.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that instruction generation stored in the computer readable memory includes referring to
Enable the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one box of block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device so that count
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, in computer or
The instruction executed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in a box or multiple boxes.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art
God and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies
Within, then the present invention is also intended to include these modifications and variations.
Claims (4)
1. a kind of visit capacity statistical method, which is characterized in that including:
Memory headroom is obtained, and the memory headroom is divided into M row * N rows region according to default memory size, wherein M pairs
The quantity of process, each column is answered to correspond to a process, N corresponds to the recordable access number of each process;
Concurrent access request is received by M process, and records concurrent visit capacity in the memory headroom;
Memory Data-Statistics currently total visit capacity is used according to the memory headroom;
Current total visit capacity is recorded in database;
It is described that concurrent visit capacity is recorded by M process, and concurrent visit capacity is recorded in the memory headroom, including:
Concurrent access request is received simultaneously by M process, when each process receives an access request, by the memory
The flag bit in a region in the corresponding recordable access number of process described in space is set to 1 by 0;
It is described that memory Data-Statistics currently total visit capacity is used according to the memory headroom, including:
It counts in the memory headroom, the number in the region that flag bit is 1;
The number is determined as current total visit capacity.
2. according to the method described in claim 1, it is characterized in that, the method further includes:
Monitor the processing progress of each process;
When the flag bit of all areas in the corresponding recordable access number of any process in M process that monitors is 1,
Current total visit capacity in the database is added into N, and any process is corresponded into all areas in recordable access number
The mark position in domain is 0.
3. a kind of visit capacity statistic device, which is characterized in that including:
Division module is divided into M row * N rows for obtaining memory headroom, and by the memory headroom according to default memory size
Region, wherein M corresponds to the quantity of process, and each column corresponds to a process, and N corresponds to the recordable access number of each process;
First logging modle for receiving concurrent access request by M process, and is recorded in the memory headroom and is concurrently visited
The amount of asking;
Statistical module, for being used memory Data-Statistics currently total visit capacity according to the memory headroom;
Second logging modle, for current total visit capacity to be recorded in database;
First logging modle is used for:
Concurrent access request is received simultaneously by M process, when each process receives an access request, by the memory
The flag bit in a region in the corresponding recordable access number of process described in space is set to 1 by 0;
The statistical module includes:
Statistic submodule, for counting in the memory headroom, the number in the region that flag bit is 1;
Determination sub-module, for the number to be determined as current total visit capacity.
4. device according to claim 3, which is characterized in that described device further includes:
Monitoring module, the processing progress for monitoring each process;
Processing module, for when all areas in the corresponding recordable access number of any process in M process that monitor
When flag bit is 1, current total visit capacity in the database is added into N, and any process is corresponded into recordable visit
Ask that the mark position of all areas in quantity is 0.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510956587.8A CN105607987B (en) | 2015-12-17 | 2015-12-17 | A kind of visit capacity statistical method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510956587.8A CN105607987B (en) | 2015-12-17 | 2015-12-17 | A kind of visit capacity statistical method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105607987A CN105607987A (en) | 2016-05-25 |
CN105607987B true CN105607987B (en) | 2018-07-20 |
Family
ID=55987939
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510956587.8A Expired - Fee Related CN105607987B (en) | 2015-12-17 | 2015-12-17 | A kind of visit capacity statistical method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105607987B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106354812A (en) * | 2016-08-30 | 2017-01-25 | 江苏名通信息科技有限公司 | Game page view data acquiring method |
CN106484819A (en) * | 2016-09-26 | 2017-03-08 | 天脉聚源(北京)科技有限公司 | A kind of method and device of counting user amount |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101145937A (en) * | 2006-09-15 | 2008-03-19 | 腾讯科技(深圳)有限公司 | Method for displaying access traffic data and its transmission device |
CN101631036A (en) * | 2008-07-14 | 2010-01-20 | 中兴通讯股份有限公司 | Method and device for counting website hits |
CN102377583A (en) * | 2010-08-09 | 2012-03-14 | 百度在线网络技术(北京)有限公司 | Method and system for counting website traffic |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080313019A1 (en) * | 2007-06-14 | 2008-12-18 | Jeffers Martin C | System and method for extracting contact information from website traffic statistics |
-
2015
- 2015-12-17 CN CN201510956587.8A patent/CN105607987B/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101145937A (en) * | 2006-09-15 | 2008-03-19 | 腾讯科技(深圳)有限公司 | Method for displaying access traffic data and its transmission device |
CN101631036A (en) * | 2008-07-14 | 2010-01-20 | 中兴通讯股份有限公司 | Method and device for counting website hits |
CN102377583A (en) * | 2010-08-09 | 2012-03-14 | 百度在线网络技术(北京)有限公司 | Method and system for counting website traffic |
Non-Patent Citations (2)
Title |
---|
一种新型统计计数器结构及其性能研究;张勇 等;《计算机工程与应用》;20031231;第39卷(第21期);第4-5页,第2-3节 * |
深入理解并行编程V1.0-并发编程网;zhangwenge111;《豆丁网:http://www.docin.com/p-790720074.html》;20140409;第4章第4.2-4.4节 * |
Also Published As
Publication number | Publication date |
---|---|
CN105607987A (en) | 2016-05-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10310749B2 (en) | System and method for predicting disk failure | |
US20130282354A1 (en) | Generating load scenarios based on real user behavior | |
US9877219B2 (en) | Wireless network site survey systems and methods | |
CN105049290B (en) | Page access monitoring method and device | |
CN103365928B (en) | Information recommendation method and information recommendation device | |
CN105786401A (en) | Data management method and device in server cluster system | |
CN109948074A (en) | Website data interconnection method, device, storage medium, processor and electronic equipment | |
CN105607987B (en) | A kind of visit capacity statistical method and device | |
CN110020339A (en) | Based on without the webpage data acquiring method and device buried a little | |
CN109871312A (en) | A kind of interface test method, device, equipment and readable storage medium storing program for executing | |
EP2778962B1 (en) | Silo-aware databases | |
CN106937173B (en) | Video playing method and device | |
CN107145421A (en) | A kind of abnormal information acquisition methods and device | |
CN105760298A (en) | Third party testing service platform | |
CN105159826B (en) | A kind of method and apparatus of wrong sentence in positioning target program | |
CN103605480B (en) | Web server and disk resource access control method thereof | |
CN106708445A (en) | Link selection method and device | |
CN106202374A (en) | A kind of data processing method and device | |
CN110019196A (en) | Data processing method and device | |
CN104360894A (en) | Method and device for simulating physical equipment | |
CN107766216A (en) | It is a kind of to be used to obtain the method and apparatus using execution information | |
CN109597743A (en) | Page circle choosing method, click volume statistical method and relevant device | |
CN109857655B (en) | Method and system for detecting dynamic performance of art resources | |
WO2013070226A1 (en) | Computer system performance management with control variables, performance metrics and/or desirability functions | |
US8677121B2 (en) | Monitoring encrypted session properties |
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 | ||
PE01 | Entry into force of the registration of the contract for pledge of patent right |
Denomination of invention: A method and device of access statistics Effective date of registration: 20210104 Granted publication date: 20180720 Pledgee: Inner Mongolia Huipu Energy Co.,Ltd. Pledgor: WUXI TVMINING MEDIA SCIENCE & TECHNOLOGY Co.,Ltd. Registration number: Y2020990001517 |
|
PE01 | Entry into force of the registration of the contract for pledge of patent right | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20180720 |
|
CF01 | Termination of patent right due to non-payment of annual fee |