CN104765774A - Statistical method and device for used resources - Google Patents

Statistical method and device for used resources Download PDF

Info

Publication number
CN104765774A
CN104765774A CN201510114365.1A CN201510114365A CN104765774A CN 104765774 A CN104765774 A CN 104765774A CN 201510114365 A CN201510114365 A CN 201510114365A CN 104765774 A CN104765774 A CN 104765774A
Authority
CN
China
Prior art keywords
data
user
storage space
index
database
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.)
Granted
Application number
CN201510114365.1A
Other languages
Chinese (zh)
Other versions
CN104765774B (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.)
Sina Technology China Co Ltd
Original Assignee
Sina Technology China 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 Sina Technology China Co Ltd filed Critical Sina Technology China Co Ltd
Priority to CN201510114365.1A priority Critical patent/CN104765774B/en
Publication of CN104765774A publication Critical patent/CN104765774A/en
Application granted granted Critical
Publication of CN104765774B publication Critical patent/CN104765774B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a statistical method and device for used resources. The method comprises the steps of determining various data identifications of each user; determining the data identifications included in index built for each data in a database in advance from the various determined data identifications; determining the storage space used by the user according to the data identification included in the index and the size-fixed storage space. According to the method, each data identification included in the index is only corresponding to the size-fixed storage space, so that the data identification included in the index can be determined from the data identifications of the user, and then the storage space used by the user can be determined; the data in the database cannot be completely scanned; therefore, the statistical efficiency of the used resource can be increased; the statistical time can be particularly greatly reduced while performing statistics for a large amount of resources used by the user.

Description

A kind of statistical method of resource occupation and device
Technical field
The present invention relates to field of computer technology, particularly relate to a kind of statistical method and device of resource occupation.
Background technology
Along with the development of network, for user provides the method for service namely to serve (softwareas a service by software, saas) namely mode changes platform into serves (platform as a service, paas) mode, hbase database is set up on paas, is mainly used in as user provides storage space.
In actual applications, service provider often needs the size knowing the storage space that each user is shared in hbase database, so that leading subscriber and server.In the prior art, the method of the storage space that counting user takies is generally: statistics equipment is for a user, according to the user ID of this user, determine user-defined identification that this user uses (Data Identification specifically can by user's self-defining), again according to user ID and user-defined identification, determine the Data Identification that this user uses, last according to each Data Identification determined, corresponding each data in scan database, obtain the storage space shared by each data, so just obtain the storage space shared by this user.
Such as, the user ID that tentation data storehouse is distributed for certain user is in advance ABC, and the user-defined identification of this user's self-defining is respectively aaa, bbb and ccc, equipment of then adding up determines that the Data Identification that this user uses is ABC_aaa, ABC_bbb, ABC_ccc, all corresponding data of each Data Identification.Statistics equipment can adopt this three Data Identifications, data corresponding with this three Data Identifications in scan database.Suppose that the space shared by each data obtained is 1M, then can determine that the storage space that this user takies altogether is 3M.
But if will determine the storage space shared by a large amount of users, equipment of so adding up almost is equivalent to the total data wanting to deposit in scan full hard disk database, this will time of at substantial, and statistical efficiency is lower.
Summary of the invention
The embodiment of the present invention provides a kind of statistical method and device of resource occupation, during in order to solve in prior art the storage space determined shared by the user that statistics is a large amount of, and the problem that statistical efficiency is lower.
The statistical method of a kind of resource occupation that the embodiment of the present invention provides, comprising:
Determine each Data Identification of user;
According to being the index that each data in database are set up in advance, in the described each Data Identification determined, determine to be included in the Data Identification in described index; Wherein, the storage space of the corresponding fixed size of each Data Identification comprised in described index;
According to the storage space of the Data Identification be included in described index and described fixed size, determine the storage space of described CU.
The statistic device of a kind of resource occupation that the embodiment of the present invention provides, comprising:
Determination module, for determining each Data Identification of user;
Scan module, for according to being the index that each data in database are set up in advance, in the described each Data Identification determined, determines to be included in the Data Identification in described index; Wherein, the storage space of the corresponding fixed size of each Data Identification comprised in described index;
Statistical module, for the storage space according to the Data Identification be included in described index and described fixed size, determines the storage space of described CU.
The embodiment of the present invention provides a kind of statistical method and device of resource occupation, the method is for the user wanting resource consumption statistic, determine each Data Identification of this user, according to being the index that each data in database are set up in advance, in each Data Identification of this user, determine the Data Identification comprised in the index, according to the Data Identification comprised in the index, determine the storage space of this CU.In the above-mentioned methods, due to the storage space of the equal corresponding fixed size of each Data Identification comprised in index, therefore, as long as in the Data Identification of user, determine the Data Identification comprised in the index, just can determine the storage space of CU, and without the need to the data in scan full hard disk database, thus the efficiency of resource consumption statistic can be improved, especially when adding up the resource shared by a large number of users, timing statistics can be shortened greatly.
Accompanying drawing explanation
Accompanying drawing described herein is used to provide a further understanding of the present invention, forms a part of the present invention, and schematic description and description of the present invention, for explaining the present invention, does not form inappropriate limitation of the present invention.In the accompanying drawings:
The process schematic of the statistical method of the resource occupation that Fig. 1 provides for the embodiment of the present invention;
The schematic diagram data in the first storage area and the second storage area being set up to index that Fig. 2 provides for the embodiment of the present invention;
Fig. 3 for the embodiment of the present invention provide user data is divided into data block time random combine set up the schematic diagram of index;
What Fig. 4 provided for the embodiment of the present invention arranges to data the first schematic diagram setting up index;
What Fig. 5 provided for the embodiment of the present invention arranges to data the second schematic diagram setting up index
The structural representation of the statistic device of the resource occupation that Fig. 6 provides for the embodiment of the present invention.
Embodiment
For making the object, technical solutions and advantages of the present invention clearly, below in conjunction with the specific embodiment of the invention and corresponding accompanying drawing, technical solution of the present invention is clearly and completely described.Obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
The statistic processes of the resource occupation that Fig. 1 provides for the embodiment of the present invention, specifically comprises the following steps:
S101: each Data Identification determining user.
In embodiments of the present invention, statistics equipment, for the user wanting resource consumption statistic, first will determine the Data Identification of this user.
User is in database during store data, and for the ease of management data (inquiry, change), database all gives data a Data Identification, and this Data Identification is unique in a database.In general database, Data Identification=user ID+user-defined identification, user ID is the character string that database is fixed to the length of each user's Random assignment, as: database to the character string of user one Random assignment is: ABCDEFGHIJ, aa, bb etc.The mark of user-defined identification to be user when store data be data self-defining.
Such as, suppose in a certain database, this database is the user ID that a certain user distributes: DC, this user defines Data Identification AA, then the Data Identification of described user is DC_AA, the user ID EF of another user, he defines Data Identification is also AA, then the Data Identification of described user is EF_AA.
In a database, the user-defined identification of different user may be the same, user-defined identification as user one is AA, the user-defined identification of user two is also AA, but the user ID of different user is well-determined, therefore the Data Identification of user is also unique in a database, and the Data Identification as user one is DC_AA, and the Data Identification of user two is EF_AA.
S102: according to being the index that each data in database are set up in advance, in the described each Data Identification determined, determine to be included in the Data Identification in described index.
Wherein, the storage space of the corresponding fixed size of each Data Identification comprised in described index.
In embodiments of the present invention, described database, include but not limited to: db2, oracle, sql, the databases such as access, hbase, index is the equal of the catalogue of each data in database, a large amount of user data is housed in database, database, when storing these user data, stores, in prior art with different storage areas, database is to the inquiry of data or statistical, storage areas different in this database must be traveled through, like this will time of at substantial, statistical efficiency is lower.
So, in embodiments of the present invention, the index of this database directly can be scanned when the resource occupation storage space of counting user.Such as: in fig. 2, the data of user one are stored in the first storage area and the second storage area respectively, wherein, here the first storage area and the second storage area, be assumed to be the sector in certain memory device, particularly, the Data Identification of the data stored in first storage area is: aa_A, aa_B, aa_C.The Data Identification of the data stored in second storage area is: aa_D, aa_E, aa_F.Thus, aa_A can be extracted the Data Identification as first storage area, aa_D can be extracted the Data Identification as second storage area.
Visible by upper example, when scanning the data of user one, can be two Data Identifications connect in scanning index, and need not scan storage area one and two, obviously, such mode improves the efficiency to data scanning effectively.
S103: according to the storage space of the Data Identification be included in described index and described fixed size, determine the storage space of described CU.
Due to each Data Identification comprised in index, correspond to different storage areas respectively, and the storage space of storage area (also can be called memory capacity) is normally fixed, and, containing user ID in Data Identification, so, the storage area corresponding to Data Identification, the storage area that namely corresponding user data is corresponding.So, by the Data Identification in index, and the storage space of storage area corresponding to this Data Identification, just can determine the storage space shared by user data.
Along using example, suppose, the size of the storage space of the first storage area and the second storage area is 1MB, so, by the index in Fig. 2, corresponding first storage area of Data Identification aa_A wherein, corresponding second storage area of Data Identification aa_D, so, the storage space shared by data of user one is 2MB.
Pass through said method, the index set up in the direct scan database of statistics equipment, determine the Data Identification be included in described index, again according to the storage space being included in Data Identification in described index and described fixed size, determine the resource of CU, data volume due to index is far smaller than the data volume of the total data deposited in database, and therefore, the method being carried out the resource that counting user takies by scanning index effectively can improve statistical efficiency.
Just because of in prior art, when database is added up the data wherein stored or is retrieved, can only by the mode of scan full hard disk, cause statistics or effectiveness of retrieval lower.
Therefore, for above-mentioned steps S102, in advance for each data in database set up index, be specially: be some data blocks by each Data Placement in database in advance, the storage space of each data block is equal, extract the Data Identification of data in each data block, as the index of this data block.
As a kind of optimal way of the present invention, described data block, its storage space is 64K usually, certainly, the storage space of this data block adjusts according to needs during practical application, as: by as described in the storage space of data block be adjusted to 1MB etc., do not make concrete restriction at this.
In embodiments of the present invention, usually using the index of the Data Identification of the data of first in data block as this data block.
Such as, in a certain database, the data of two users (comprising: user one and user two) are only stored in database, and, in this database, the data of user one and user two correspondence are divided into two equal data blocks of storage space, comprising: the first data block and the second data block.Particularly, store the data of user one correspondence in the first data block, the Data Identification of these data is respectively: aa_AA, aa_AB, aa_AC; Store the data of user two correspondence in second data block, the Data Identification of these data is respectively: bb_11, bb_22, bb_33.
Suppose, for the first data block, using the index of Data Identification " aa_AA " wherein as this first data block; Accordingly, for the second data block, using the Data Identification " bb_22 " that wherein the stores index as this second data block.
From in upper example, the mode of a certain Data Identification as index in this data block is extracted from the data block divided in advance, can directly scan the index of different pieces of information block, and need not the mass data stored in data block be scanned, thus effectively reduce when scanning data, the data volume scanned, improves the efficiency to data scanning.
But, set up in the mode of index due to above-mentioned, when being data block by the Data Placement of each user, be generally random combine, if only adopt the above-mentioned mode setting up index, still there is more serious defect, specifically:
As shown in Figure 3, suppose user one, the data of user two and user three are all stored in a certain database, wherein, the Data Identification of the data of user one is: aa_A and aa_D, the Data Identification of the data of user two is: bb_B and bb_D, the Data Identification of the data of user three is cc_C and cc_F, and the data of above-mentioned three users are divided in two data blocks as shown in Figure 3 by this database respectively.The Data Identification of first data in two data blocks extracts by tentation data storehouse respectively, respectively as the index of the first data block and the second data block, also, using Data Identification aa_A and aa_D as the index of the first data block and the second data block.
So, when adding up the storage space of CU, then this first data block and the second data block all can be can be regarded as the storage space of user one, and user two or the storage space shared by user three can not be can be regarded as.But obviously, in two data blocks, the storage space shared by the data of user one only has 1/3rd of the storage space of whole data block.Thus cause the error to the storage space shared by each user.
Therefore, in embodiments of the present invention, for above-mentioned steps, be some data blocks by each Data Placement in database, be specially: each data in database are sorted, making the data of same user in described database adjacent, is some data blocks by each Data Placement after sequence.
Each data are sorted, namely the Data Identification corresponding to each data is sorted, again because include user ID in Data Identification, so, just a certain user can be uniquely determined by Data Identification, thus, can by each data of different user, according to the user belonging to these data, arranged together.
Specifically, such as: as shown in Figure 4, suppose, the Data Identification of the data of user one is: aa_AA, aa_BB, aa_CC, aa_DD; The Data Identification of the data of user two is: bb_11, bb_22.
So, after arranging according to Data Identification above-mentioned six data, the data sequence of formation is as follows:
aa_AA,aa_BB,aa_CC,aa_DD,bb_11,bb_22。
Visible, four data of user one are adjacent, and two data of user two are adjacent.Thus, can by user one a two data aa_AA, aa_BB is divided into a data block (the first data block), aa_CC, aa_DD is divided into another data block (the second data block), user two two data bb_11, bb_22 are divided into a data block (the 3rd data block).Certainly, the storage space that the first to the 3rd data block is corresponding is identical.
As shown in Figure 4, from the first data block, extract Data Identification aa_AA, and, from the second data block, extract Data Identification aa_CC, as the index of this user one correspondence.Data Identification bb_11 is extracted, as the index of this user two correspondence from the 3rd data block.
Visible, set up index by the way, just can directly scan this index, find all data of user one and user two.Also just ensure that the homogeneity of the data scanned, thus promote efficiency that the data of a certain user are scanned, also effectively reduce error when counting user takies storage space.
It should be noted that, in example as shown in Figure 4, to the storage space shared by counting user one and user two, so, only need determine the quantity of the Data Identification in the index that each user is corresponding, the storage space of the data block corresponding to Data Identification, just can determine user one and the storage space shared by user two.Also be, suppose that the storage space shared by the first to the 3rd data block is 64K, statistics equipment is in the process scanned the index in database, scanning index retrieves aa_AA and aa_CC two indexes for the moment, bb_11 index is retrieved during scanning index two, aa_AA and aa_CC two indexes belong to the Data Identification of user one, also be, the user comprised in index once the quantity of Data Identification be 2, therefore the storage space shared by user one that statistics device statistics goes out is the product of the storage space 64IK of this quantity 2 and fixed size, i.e. 128K.This index of bb_11 belongs to the Data Identification of user two, and the quantity of the Data Identification of the user two comprised in index is just 1, similar, and the storage space shared by user two that statistics device statistics goes out is 64K.
What here need to further illustrate is, in example as shown in Figure 5, to the storage space shared by counting user one and user two, directly pass through scanning index, determine the quantity of the Data Identification of each user comprised in index, the storage space of the data block corresponding to Data Identification, just can determine user one and the storage space shared by user two.But, as shown in Figure 5, index one is the index of Data Identification aa_AA and aa_CC as two data blocks being extracted user one respectively from the first data block and the second data block obviously, and in the second data block, obviously contain the data bb_11 of user two, suppose that the storage space shared by the first to the 3rd data block is 64K, statistics equipment is in the process scanned the index in database, scanning index retrieves aa_AA and aa_CC two indexes for the moment, bb_22 index is retrieved during scanning index two, aa_AA and aa_CC two indexes belong to the Data Identification of user one, the user comprised in index once the quantity of Data Identification be 2, therefore the storage space shared by user one that statistics device statistics goes out is 128K, this index of bb_22 belongs to the Data Identification of user two, the quantity of the Data Identification of the user two comprised in index is just 1, therefore the storage space shared by user two that statistics device statistics goes out is 64K, but significantly can find out that the second data block contains the data bb_11 user two from figure, but the storage space that data bb_11 has calculated user one has suffered, the storage space of the user one therefore counted can more than the physical memory space of user one, count the storage space of user two and the storage space of the user two counted can be less than the physical memory space of user two.Can find out, the storage space of the user counted is compared with the physical memory space of user, error can between 0K to 64K, but in actual applications, the data not only having comprised a certain user simultaneously but also the quantity of the data block comprising other user data except this user mostly be two most, minimum is one, and the storage space of the user therefore counted is compared with the physical memory space of this user, and error can between 0K to 128K.
By finding out in above-mentioned example that statistics equipment is when the mode by scanning index carrys out the storage space shared by counting user, some errors can be produced compared with the physical memory space of user, its error range is between 0K to 128K, even if in reality test, the maximum error produced also is no more than 7%-8%, but the data capacity that user stores is all in the data magnitude of MB and more than GB, these errors are compared with the memory capacity of user data, the error produced is negligible, does not affect the use in actual applications of this technology.
Therefore, according to the storage space of the Data Identification be included in described index and described fixed size, determine the storage space of described CU, be specially: the quantity determining the Data Identification be included in described index, determine the product of the storage space of described quantity and described fixed size, as the storage space of described CU.
Consider in practical application, the limited storage space of database, and the user for 1,000,000 grades or even millions is operationally provided data storage service by database, user constantly writes data in database, if do not limit the storage space that user uses, so, the storage space of database, within a certain period of time by saturated, has a strong impact on the stores service to data.
Therefore, in embodiments of the present invention, database is when depositing the data of user, just limit for the storage space of user in this database in advance, also be, for above-mentioned steps S101, described method specifically also comprises: according to the designated memory space being described user distribution in advance, judge whether the storage space of the described CU determined is greater than described designated memory space, if, forbid that described user is to described database write data, otherwise, allow described user to described database write data.
Such as: database is the storage space that each user distributes is 100MB, if the current storage space in a database of user is not more than 100MB, then this user can continue store data in a database, if the current storage space in a database of user is greater than 100MB, then database just needs to forbid that this user writes any data again in database.In order to not affect the stores service to data, the carrying out that therefore database will be real-time, to the scanning of user data, carries out judging whether this user can also continue to put data to databases.
And in reality test, as when testing hbase database, the size choosing user data is 20GB, storage space shared by the user come out by the mode of final test discovery scanning index is compared with the physical memory space of user, the maximum error produced is in about 7%-8% (its error is specifically about 1.4GB-1.6GB), on database, its error produced can judge whether this user can also continue to put data to databases and produce certain impact.
Therefore, as a kind of optimal way during practical application, specifically can for user improves the storage space of 10% on the basis that database is the physical memory space size that user distributes, as: for the size of the storage space of user's distribution is 100GB, also be, after the writing of user reaches 100GB, just forbid that this user writes data again in database, but reality consistency operation time, by forbidding that the storage size that this user writes data again in database brings up to 110GB, so just can avoid this error.
The statistical method of the resource occupation provided for the embodiment of the present invention above, based on same thinking, the embodiment of the present invention also provides a kind of statistic device of resource occupation.
As shown in Figure 6, a kind of statistic device of resource occupation that the embodiment of the present invention provides comprises:
Determination module 601, for determining each Data Identification of user;
Scan module 602, for according to being the index that each data in database are set up in advance, in the described each Data Identification determined, determines to be included in the Data Identification in described index; Wherein, the storage space of the corresponding fixed size of each Data Identification comprised in described index;
Statistical module 603, for the storage space according to the Data Identification be included in described index and described fixed size, determines the storage space of described CU.
In embodiments of the present invention, determination module 601, specifically for, according to the user ID of described user, determine the user-defined identification that described user uses, according to described user ID and the user-defined identification determined, determine the Data Identification of described user.
Described device also comprises:
Module 604 set up in index, and for being some data blocks by each Data Placement in database in advance, the storage space of each data block is equal, extracts the Data Identification of data in each data block, as the index of this data block.
Particularly, module 604 set up in this index, for sorting to each data in database, makes the data of same user in described database adjacent, is some data blocks by each Data Placement after sequence.
Described statistical module 603, specifically for, determine the quantity of the Data Identification be included in described index, determine the product of the storage space of described quantity and described fixed size, as the storage space of described CU.
Described device also comprises:
Disabled module 605, according to being the designated memory space that described user distributes in advance, judge whether the storage space of the described CU determined is greater than described designated memory space, if, forbid that described user is to described database write data, otherwise, allow described user to described database write data.
In one typically configuration, computing equipment comprises one or more processor (CPU), input/output interface, network interface and internal memory.
Internal memory may comprise the volatile memory in computer-readable medium, and the forms such as random access memory (RAM) and/or Nonvolatile memory, as ROM (read-only memory) (ROM) or flash memory (flash RAM).Internal memory is the example of computer-readable medium.
Computer-readable medium comprises permanent and impermanency, removable and non-removable media can be stored to realize information by any method or technology.Information can be computer-readable instruction, data structure, the module of program or other data.The example of the storage medium of computing machine comprises, but be not limited to phase transition internal memory (PRAM), static RAM (SRAM), dynamic RAM (DRAM), the random access memory (RAM) of other types, ROM (read-only memory) (ROM), Electrically Erasable Read Only Memory (EEPROM), fast flash memory bank or other memory techniques, read-only optical disc ROM (read-only memory) (CD-ROM), digital versatile disc (DVD) or other optical memory, magnetic magnetic tape cassette, tape magnetic rigid disk stores or other magnetic storage apparatus or any other non-transmitting medium, can be used for storing the information can accessed by computing equipment.According to defining herein, computer-readable medium does not comprise temporary computer readable media (transitory media), as data-signal and the carrier wave of modulation.
Also it should be noted that, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thus make to comprise the process of a series of key element, method, commodity or equipment and not only comprise those key elements, but also comprise other key elements clearly do not listed, or also comprise by the intrinsic key element of this process, method, commodity or equipment.When not more restrictions, the key element limited by statement " comprising ... ", and be not precluded within process, method, commodity or the equipment comprising described key element and also there is other identical element.
It will be understood by those skilled in the art that embodiments of the invention can be provided as method, system or computer program.Therefore, the present invention can adopt the form of complete hardware embodiment, completely software implementation or the embodiment in conjunction with software and hardware aspect.And the present invention can adopt in one or more form wherein including the upper computer program implemented of computer-usable storage medium (including but not limited to magnetic disk memory, CD-ROM, optical memory etc.) of computer usable program code.
The foregoing is only embodiments of the invention, be not limited to the present invention.To those skilled in the art, the present invention can have various modifications and variations.All do within spirit of the present invention and principle any amendment, equivalent replacement, improvement etc., all should be included within right of the present invention.

Claims (10)

1. a statistical method for resource occupation, is characterized in that, comprising:
Determine each Data Identification of user;
According to being the index that each data in database are set up in advance, in the described each Data Identification determined, determine to be included in the Data Identification in described index; Wherein, the storage space of the corresponding fixed size of each Data Identification comprised in described index;
According to the storage space of the Data Identification be included in described index and described fixed size, determine the storage space of described CU.
2. the method for claim 1, is characterized in that, determines each Data Identification of user, specifically comprises:
According to the user ID of described user, determine the user-defined identification that described user uses;
According to described user ID and the user-defined identification determined, determine the Data Identification of described user.
3. the method for claim 1, is characterized in that, in advance for each data in database set up index, specifically comprises:
Be some data blocks by each Data Placement in database in advance, the storage space of each data block is equal;
Extract the Data Identification of data in each data block, as the index of this data block;
Wherein, be some data blocks by each Data Placement in database, specifically comprise:
Each data in database are sorted, makes the data of same user in described database adjacent;
By sequence after each Data Placement be some data blocks.
4. the method for claim 1, is characterized in that, according to the storage space of the Data Identification be included in described index and described fixed size, determines the storage space of described CU, specifically comprises:
Determine the quantity of the Data Identification be included in described index;
Determine the product of the storage space of described quantity and described fixed size, as the storage space of described CU.
5. the method for claim 1, is characterized in that, described method also comprises:
According to being the designated memory space that described user distributes in advance, judge whether the storage space of the described CU determined is greater than described designated memory space;
If so, forbid that described user is to described database write data;
Otherwise, allow described user to described database write data.
6. a statistic device for resource occupation, is characterized in that, comprising:
Determination module, for determining each Data Identification of user;
Scan module, for according to being the index that each data in database are set up in advance, in the described each Data Identification determined, determines to be included in the Data Identification in described index; Wherein, the storage space of the corresponding fixed size of each Data Identification comprised in described index;
Statistical module, for the storage space according to the Data Identification be included in described index and described fixed size, determines the storage space of described CU.
7. device as claimed in claim 6, is characterized in that, described determination module specifically for, according to the user ID of described user, determine the user-defined identification that described user uses, according to described user ID and the user-defined identification determined, determine the Data Identification of described user;
And/or,
Described statistical module specifically for, determine the quantity of the Data Identification be included in described index, determine the product of the storage space of described quantity and described fixed size, as the storage space of described CU.
8. device as claimed in claim 6, it is characterized in that, described device also comprises:
Module set up in index, and for being some data blocks by each Data Placement in database in advance, the storage space of each data block is equal, extracts the Data Identification of data in each data block, as the index of this data block.
9. device as claimed in claim 8, is characterized in that, described index set up module specifically for, sorting to each data in database, make the data of same user in described database adjacent, is some data blocks by each Data Placement after sequence.
10. device as claimed in claim 6, it is characterized in that, described device also comprises:
Disabled module, according to being the designated memory space that described user distributes in advance, judge whether the storage space of the described CU determined is greater than described designated memory space, if, forbid that described user is to described database write data, otherwise, allow described user to described database write data.
CN201510114365.1A 2015-03-16 2015-03-16 A kind of statistical method and device of resource occupation Active CN104765774B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510114365.1A CN104765774B (en) 2015-03-16 2015-03-16 A kind of statistical method and device of resource occupation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510114365.1A CN104765774B (en) 2015-03-16 2015-03-16 A kind of statistical method and device of resource occupation

Publications (2)

Publication Number Publication Date
CN104765774A true CN104765774A (en) 2015-07-08
CN104765774B CN104765774B (en) 2018-07-31

Family

ID=53647605

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510114365.1A Active CN104765774B (en) 2015-03-16 2015-03-16 A kind of statistical method and device of resource occupation

Country Status (1)

Country Link
CN (1) CN104765774B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107180042A (en) * 2016-03-09 2017-09-19 阿里巴巴集团控股有限公司 Flow statistical method, the apparatus and system of search engine
CN109508318A (en) * 2018-11-15 2019-03-22 北京金山云网络技术有限公司 A kind of amount of storage statistical method, device, electronic equipment and readable storage medium storing program for executing

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060184720A1 (en) * 2005-02-16 2006-08-17 Sinclair Alan W Direct data file storage in flash memories
CN103795811A (en) * 2014-03-06 2014-05-14 焦点科技股份有限公司 Information storage and data statistical management method based on meta data storage

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060184720A1 (en) * 2005-02-16 2006-08-17 Sinclair Alan W Direct data file storage in flash memories
CN103795811A (en) * 2014-03-06 2014-05-14 焦点科技股份有限公司 Information storage and data statistical management method based on meta data storage

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107180042A (en) * 2016-03-09 2017-09-19 阿里巴巴集团控股有限公司 Flow statistical method, the apparatus and system of search engine
CN107180042B (en) * 2016-03-09 2020-12-15 创新先进技术有限公司 Search engine flow statistical method, device and system
CN109508318A (en) * 2018-11-15 2019-03-22 北京金山云网络技术有限公司 A kind of amount of storage statistical method, device, electronic equipment and readable storage medium storing program for executing

Also Published As

Publication number Publication date
CN104765774B (en) 2018-07-31

Similar Documents

Publication Publication Date Title
CN103577440B (en) A kind of data processing method and device in non-relational database
CN104281701B (en) Multiscale Distributed Spatial data query method and system
CN106407207B (en) Real-time newly-added data updating method and device
CN105631003A (en) Intelligent index establishing, inquiring and maintaining method supporting mass data classification and counting
CN103473239A (en) Method and device for updating data of non relational database
CN107807932B (en) Hierarchical data management method and system based on path enumeration
CN101763415B (en) Method and device for generating B tree index of database
TW201800967A (en) Method and device for processing distributed streaming data
CN104750826A (en) Structural data resource metadata automatically-identifying and dynamically-registering method
CN102890714A (en) Method and device for indexing data
CN104486777A (en) Method and device for processing data
CN103198150A (en) Big data indexing method and system
CN104834650A (en) Method and system for generating effective query tasks
CN111104457A (en) Massive space-time data management method based on distributed database
CN102253985B (en) File system data management method and system
CN109213445A (en) A kind of management method, management system and the relevant apparatus of storage system metadata
CN104714957A (en) List structure changing method and device
JP2023543004A (en) Merge update method, device, and medium for R-tree index based on Hilbert curve
Li et al. Efficient implementation of a multi-dimensional index structure over flash memory storage systems
CN106503054A (en) A kind of data query method and server
WO2021016050A1 (en) Multi-record index structure for key-value stores
Xanthakis et al. Parallax: Hybrid key-value placement in lsm-based key-value stores
CN101963993B (en) Method for fast searching database sheet table record
CN104765774A (en) Statistical method and device for used resources
CN107609011A (en) The maintaining method and device of a kind of data-base recording

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230308

Address after: Room 501-502, 5/F, Sina Headquarters Scientific Research Building, Block N-1 and N-2, Zhongguancun Software Park, Dongbei Wangxi Road, Haidian District, Beijing, 100193

Patentee after: Sina Technology (China) Co.,Ltd.

Address before: 100080, International Building, No. 58 West Fourth Ring Road, Haidian District, Beijing, 20 floor

Patentee before: Sina.com Technology (China) Co.,Ltd.