CN101676906B - Method of managing memory database space by using bitmap - Google Patents

Method of managing memory database space by using bitmap Download PDF

Info

Publication number
CN101676906B
CN101676906B CN 200810216191 CN200810216191A CN101676906B CN 101676906 B CN101676906 B CN 101676906B CN 200810216191 CN200810216191 CN 200810216191 CN 200810216191 A CN200810216191 A CN 200810216191A CN 101676906 B CN101676906 B CN 101676906B
Authority
CN
China
Prior art keywords
bit
page
map area
bit map
data page
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
Application number
CN 200810216191
Other languages
Chinese (zh)
Other versions
CN101676906A (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.)
Dongguan neighboring workers help Agel Ecommerce Ltd
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN 200810216191 priority Critical patent/CN101676906B/en
Publication of CN101676906A publication Critical patent/CN101676906A/en
Application granted granted Critical
Publication of CN101676906B publication Critical patent/CN101676906B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method of managing a memory database space by using a bitmap, comprising the following steps operated in a system memory area: establishing a first-class bitmap area, establishing a first-class bitmap area auxiliary link list, establishing a second-class bitmap area, distributing data pages, distributing records, releasing the records and releasing the data pages. A second-class bitmap structure is combined with the auxiliary link list to control the management of the distribution and the recovery of the data pages and the records. The invention thoroughly overcomes the problem that only one threading operation is available to the same time intervals in the whole structure of the link list, improves the multitasking performance, ensures the high memory database space utilization rate, can manage a large amount of memory, adopts the bit arithmetic, has high efficiency and stable performance, avoids the performance limitation of the page layer and the record layer at the same time and ensures that the database has excellent expansibility, thereby being suitable for wide popularization and application in the filed.

Description

A kind of method of utilizing bitmap that the memory database space is managed
Technical field
The present invention relates to the management method of memory database system, relate in particular to a kind of bitmap that utilizes and the memory database space is carried out the method for efficient management.
Background technology
Traditional data base management system (DBMS) all is placed on all data on disk and manages, so be called disk database.Disk database need to be accessed the operation that disk carries out data continually, due to the operation of disk read-write data will be carried out the Mechanical Moving of magnetic head on the one hand, be subject on the other hand the impact of system call time, when data volume very large, when frequent operation and complexity, will expose a lot of problems.
In recent years, memory size improves constantly, price constantly drops, after computing machine has entered 64 epoch, operating system can be supported larger address space, industry improves day by day to Database Systems real-time response Capability Requirement simultaneously, and taking full advantage of memory techniques lifting database performance becomes important developing direction of database field.
In database technology, mainly contain at present two kinds of methods and use a large amount of internal memories.A kind of is in traditional database, increase Buffer Pool, the data that an office is related to all are placed in Buffer Pool, are organized into corresponding data structure and inquire about and upgrade processing, the share memory technology of namely often saying, the main target of this method optimization is to minimize disk access.Another kind is exactly the memory database technology, redesign exactly a kind of new data base management system (DBMS), algorithm and data structure to query processing, concurrent control and recovery redesign, more effectively to use CPU and internal memory, this technology is put whole database in internal memory into, thereby can produce the variation of some essence.
The superior function that memory database system brings not only be fast to memory read-write comparison disk read-write on, the more important thing is, many traditional approachs of data in magnetic disk management have fundamentally been abandoned, all manage in internal memory based on total data and carried out the design of new architecture, and also carried out corresponding improvement aspect data buffer storage, Index Algorithm, parallel work-flow, thereby made data processing speed than the fast some orders of magnitude of the data processing speed of traditional database.
Can recognize by above introduction, memory database works in internal memory fully, and how fully and efficiently managing huge memory headroom just becomes extremely important problem in the memory database design.
In well behaved Database Systems, internal memory must be that paging (is page; Some system is referred to as piece, block) uses, and the size of page can be 4k, 8k, 16k, 32k...... etc.Using the benefit of paging management is to obtain a more moderate linear module, satisfies simultaneously the memory requirements of minute quantity or magnanimity under the prerequisite of taking into account dirigibility and ease of manageability, and neither wasting space does not increase again managerial burden.
Traditional page management pattern is fully based on chained list, is divided into some chained lists according to the current state of page (idle, take etc.).Similarly, the different conditions according to record also is divided into some chained lists in page.The allocate and recycle of page and record all relies on the chain table handling.
The way to manage of this chained list that places one's entire reliance upon has very large defective:
1, the character of chained list itself has determined the read-write operation of chained list is all needed to lock, and a plurality of threads can not read while write chained list, and this will cause thread waits.In the system of Multitask Data storehouse, the contention of chained list lock will become the important bottleneck of system.And the space of management is larger, and chained list is just longer, and contention is more serious, and the overall space efficiency of management is just lower.
2, a large amount of list structures has expended very large memory headroom, reduced the utilization factor of memory headroom, and the space is larger, wastes more.
3, the logic that a large amount of chained lists is managed is very complicated, greatly reduces the Reliability ﹠ Maintainability of whole system.
Thereby prior art awaits to improve and improve.
Summary of the invention
The object of the invention is to solve the problem that exists in above full linked list type management, proposes a kind of new method that the memory database space is managed, realize distribution and the recovery of control data page and record.
Technical scheme of the present invention comprises:
A kind of method of utilizing bitmap that the memory database space is managed, memory headroom is divided into a plurality of data pages according to page, wherein, is included in the following operation steps in the Installed System Memory district:
A, set up the one-level bit map area, wherein, described one-level bit map area is positioned at the certain bits map-area in described Installed System Memory district, and described one-level bit map area is that each data page in described a plurality of data page distributes some bit, is used for recording the state of this data page;
B, set up the auxiliary chained list of one-level bit map area, at least one described some bit of the corresponding described one-level bit map area of each node of wherein said auxiliary chained list;
C, set up the secondary bit map area, wherein, described secondary bit map area is arranged in the certain bits map-area of each data page of described a plurality of data pages, and described secondary bit map area is that each record in this page distributes certain bit, is used for preserving the state of this record;
A data page in D, the described a plurality of data pages of distribution;
E, distribute a record in this page;
F, the described record of release;
G, the described data page of release.
Described method, wherein, described steps A comprises:
Open up described one-level bit map area and all be initialized as unallocated state according to total memory field size that system need to manage.
Described method, wherein, described steps A is further comprising the steps of:
A1, set the internal memory that will use m MB in Database Systems configurations, wherein, m is positive integer; And distributed the internal memory of this capacity by the main frame support; The size of setting simultaneously every page is p KB, and wherein, p is positive integer;
A2, Database Systems distribute the m mb of memory by opening up shared drive after starting; Suppose that this internal memory first address is g, wherein, g is natural number;
A3, the needed one-level bit map area size of calculating are b1=(m*1024)/(p*8) byte;
A4, keep the space of b1 byte in the beginning of total application heap, as the one-level bit map area, the one-level bit map area is initialized as full 0.
Described method, wherein, described step B comprises:
Set up the auxiliary chained list of described one-level bitmap and initialization, the available free bit of institute in described one-level bit map area is recorded in the territory.
Described method, wherein, described step C comprises:
C1, according to the data page offset address, this page is carried out initialization, record the top margin control information, and the needed secondary bit map area of the data-evaluations such as the length length of the record of depositing according to this page needs;
The secondary bit map area of C2, this page of initialization is use with all the bit field marks in the secondary bit map area.
Described method, wherein, described step D comprises the following steps:
The first node of D1, the auxiliary chained list of the described one-level bitmap of access therefrom obtains first idle bit territory, and is labeled as and distributes;
The node of the auxiliary chained list at the place, bit territory of finding in D2, detecting step D1 if all bit territory corresponding to this node all is distribution state, shifts out chained list with this node;
D3, according to the position in the idle bit territory of finding in step D1, calculate the position offset address of corresponding data page in whole data field.
Described method, wherein, described step D1 comprises the following steps:
D11, upper-layer service are sent request, the request for data page, and indicate every record length≤r byte in this page; Wherein, r is positive integer;
D12: navigate to auxiliary chain heading node, if find that chained list is empty, returns without the idle data page fault to caller, otherwise turns next step;
D13: first idle bit of the first node of search, searching and establishing this bit is 1, expression takies; Suppose that this bit is n the bit that g begins, n is the counting natural number since 1; Check that one-level bit map area corresponding to this node whether for complete 1, is to extract this node from chained list.
Described method, wherein, described step D3 comprises the following steps:
D31: navigate to n the data page first address h that bit is corresponding in the data field, the * p byte offset of h=g+b1 byte offset+(n-1), wherein b1 is described one-level bit map area size, and unit is byte, and p is the size of each data page, and unit is KB;
D32: the page to h skew place carries out the top margin initialization, records necessary management information; And calculating secondary bit map area length b2; The length of supposing top margin is the q byte, b2=(p*1024-q)/(r*8) byte; Wherein, q is positive integer;
D33: navigate to h+q byte offset place, the zone of b2 byte after this is initialized as full 0;
D34: return to successful result and page skew h+q to caller.
Described method, wherein, described step e comprises:
E1, navigate to secondary bit map area in the data page that needs assignment record, use certain algorithm search to arrive this bit map area first idle bit territory, with this bit territory status modifier for distributing;
E2, navigate to by certain algorithm the corresponding recording address in bit territory that step e 1 is distributed, this record is carried out initialization.
Described method, wherein, described step e 1 comprises:
E11, upper-layer service are sent request, require record space of application in n data page;
E12, navigate to the secondary bit map area first address of this data page according to the algorithm of D31 and D32 step; Seek first available bit of this zone, namely be set as 1 if find, expression distributes, and returns successfully; Do not forward next step to if do not find;
E13, return to this page without the error message of remaining space to caller.
Described method, wherein, described step F comprises:
Navigating to secondary bit map area in this data page that records the place, search bit territory corresponding to this record, is the free time with this bit territory status modifier.
Described method, wherein, described step F also comprises the steps:
F1, upper-layer service are sent request, require to discharge the n bar record space in m data page;
Wherein, m is natural number;
F2, navigate to the secondary bit map area first address of this data page, navigate to n bit, and be set as 0, expression is reclaimed, and returns successfully; Do not forward next step to if do not find;
F3, return to page number or the illegal error message of recording mechanism to caller.
Described method, wherein, described step G comprises:
G1, according to the offset address of waiting to discharge page, navigate to the corresponding bit territory of this page in the one-level bit map area by certain algorithm, this territory is set to the free time;
G2, check the auxiliary chained list node of one-level bitmap at place, bit territory, if this node not in chained list, adds chained list.
Described method, wherein, described step G1 comprises the following steps:
G11, upper-layer service are sent request, require to discharge m data page; Wherein, m is natural number;
G12, begin to calculate wherein from one-level bitmap first address g, g is natural number, navigates to m bit place, if do not find, returns to the illegal error message of page number to caller; Otherwise this bit is set as 0, and expression is reclaimed.
A kind of method of utilizing bitmap that the memory database space is managed provided by the present invention, owing to utilizing the secondary bitmap structure, control simultaneously the management method of distribution and the recovery of data page and record in conjunction with an auxiliary chained list, overcome the complex structure of full list structure management, the problem such as chained list lock bottleneck, memory headroom utilization factor are low; Improved the multitask performance, travelling speed is fast, and the memory headroom utilization factor is high, and the managing internal memory amount is large, adopts bit arithmetic efficient high, properties constant, and make database possess good extendability.
Description of drawings
Fig. 1 is one-level bitmap of the present invention and auxiliary chain list structure schematic diagram thereof;
Fig. 2 is secondary bitmap structure schematic diagram of the present invention;
Fig. 3 is initialization of the present invention and data page allocation flow schematic diagram;
Fig. 4 is recording areas allocation flow schematic diagram of the present invention;
Fig. 5 is recording areas recovery process schematic diagram of the present invention;
Fig. 6 is data page recovery process schematic diagram of the present invention.
Embodiment
Introduce some embodiment of the present invention below in conjunction with accompanying drawing.
The present invention proposes a kind of secondary bitmap structure that utilizes utilizes the secondary bitmap structure to the method that the memory database space manages, and realizes controlling distribution and the recovery of data page and record in conjunction with an auxiliary chained list.
At first, delimit the use that a specific bitmap region is controlled all data pages, this bit map area keeps some bit for each data page, is used for recording the state of this page.The distribution of data page and the recovery only value of the needs corresponding bit of modification position get final product.Such bit map area is referred to as " one-level bitmap ", sees Fig. 1 for details.
Then, delimit the use that a specific bitmap region is controlled all records of this page in each data page, this bit map area is that every record keeps some bit, is used for preserving the state of this record.Article one, the distribution of record and the reclaim value that only needs to revise corresponding bit position gets final product.Such bit map area is referred to as " secondary bitmap ", sees Fig. 2 for details.
For the one-level bit map area is set up an auxiliary chained list, each node of chained list, shifts out chained list with respective nodes, otherwise just adds chained list if these some bit are occupied corresponding to some bit of one-level bit map area.When needs distribute idle bit in the one-level bit map area, as long as first node of this chained list of access.Embody the concept of " time is changed in the space ", seen Fig. 1 for details.
This method concrete steps are as follows:
1, system initialization
(a) the total memory field size that need to manage according to system is opened up the one-level bit map area and all is initialized as " unallocated " state;
(b) set up the auxiliary chained list of one-level bitmap and initialization, the available free bit of institute in the one-level bit map area is recorded in the territory.
2, distribute data page
(c) the first node of the auxiliary chained list of access one-level bitmap, therefrom obtain first idle bit territory by certain algorithm, and be labeled as " distributing ".
(d) detect the node of the auxiliary chained list at the place, bit territory of finding in (c), if all bit territory corresponding to this node is all " distributing " state, this node is shifted out chained list.
(e) according to the position in the idle bit territory of finding in (c), calculate the position offset address of corresponding data page in whole data field by certain algorithm.
(f) according to the data page offset address that obtains in (e), this page is carried out initialization, record the top margin control information, and the needed secondary bit map area of the data-evaluations such as the length length of the record of depositing according to this page needs.
(g) the secondary bit map area of this page of initialization is " not using " with all bit field marks
3, assignment record
(h) navigating to secondary bit map area in the data page that needs assignment record, uses certain algorithm search to arrive this bit map area first idle bit territory, is " distributing " with this bit territory status modifier
(i) navigate to by certain algorithm the corresponding recording address in bit territory that (h) step is distributed, this record is carried out initialization.
4, RR release record
(j) navigating to secondary bit map area in this data page that records the place, uses certain algorithm search to the bit territory of this record correspondence, is " free time " with this bit territory status modifier
5, discharge data page
(k) according to the offset address of waiting to discharge page, navigate to the corresponding bit territory of this page in the one-level bit map area by certain algorithm, this territory is set to " free time "
(l) check the auxiliary chained list node of one-level bitmap at place, bit territory, if this node not in chained list, adds chained list.
Please note: above (a) is not must be sequentially to carry out continuously to (l) step, and should in the light of actual conditions need to carry out.
Like this, by the combination operation to above two kinds of bit map area and a chained list, just realized the high speed of recording areas in all data pages and page is distributed and reclaimed.
Embodiment 1, and as shown in Figure 3, in a typical application scenarios, initialization also distributes the complete procedure of a data page to comprise the following steps:
Steps A 1: set the internal memory that will use m MB in the Database Systems configuration, wherein, m is positive integer; And the main frame support distributes the internal memory of this capacity.The size of setting simultaneously every page is p KB; Wherein, p is positive integer.
Step B1: after Database Systems start by opening up shared drive or similar fashion distributes m
Mb of memory.Suppose that this application heap first address is g, wherein, g is natural number.
Step C1: calculate needed one-level bit map area size b1=(m*1024)/(p*8), the unit byte.
Step D1: keep the space of b1 byte in the beginning of total application heap, as the one-level bit map area, bit map area is initialized as full 0.
Step e 1: be the auxiliary chained list allocation space of one-level bitmap, chained list contains b1 node, initialization from beginning to end.
Step F 1: upper-layer service is sent request, the request for data page, and indicate every record length≤r byte in this page.Wherein, r is positive integer.
Step G1: navigate to auxiliary chain heading node, if find that chained list is empty, returns to " without the idle data page " mistake to caller, otherwise turns the H1 step.
Step H1: first idle bit of the first node of search, searching and establishing this bit is 1, expression takies.Suppose that this bit is n the bit that g begins, n is the counting natural number since 1.Check that one-level bit map area corresponding to this node whether for complete 1, is to extract this node from chained list.
Step I1: navigate to n the data page first address h that bit is corresponding in the data field, the * p byte offset of h=g+b1 byte offset+(n-1).
Step J1: the page to h skew place carries out the top margin initialization, records necessary management information.And calculating secondary bit map area length b2, the byte of unit.The length of supposing top margin is the q byte, b2=(p*1024-q)/(r*8), and wherein, q is positive integer.
Step K 1: navigate to h+q byte offset place, the zone of b2 byte after this is initialized as full 0.
Step L1: return to successful result and page skew n to caller.
Embodiment 2, and as shown in Figure 4, in a typical application scenarios, the complete procedure of a record space of application comprises the following steps:
Steps A 2: upper-layer service is sent request, requires record space of application in n data page.
Step B2: navigate to the secondary bit map area first address of this data page according to the algorithm of I1 and J1 step, seek first available bit of this zone according to certain algorithm, namely be set as 1 if find, expression distributes, and returns successfully; Do not forward the C2 step to if do not find.
Step C2: return to the error message of " this page is without remaining space " to caller
Embodiment 3, and as shown in Figure 5, in a typical application scenarios, the complete procedure that discharges a record space comprises the following steps:
Steps A 3: upper-layer service is sent request, requires to discharge the n bar record space in m data page.Wherein, m, n are natural number.
Step B3: navigate to the secondary bit map area first address of this data page according to the algorithm of I1 and J1 step, navigate to n bit, and be set as 0, expression is reclaimed, and returns successfully; Do not forward the C3 step to if do not find.
Step C3: return to the error message of " page number or recording mechanism are illegal " to caller.
Embodiment 4, and as shown in Figure 6, in a typical application scenarios, the complete procedure that discharges a data page comprises the following steps:
Steps A 4: upper-layer service is sent request, requires to discharge m data page.Wherein, m is natural number.
Step B4: begin to calculate from one-level bitmap first address g, wherein, g is natural number, navigates to m bit place, if do not find, returns to the error message of " page number is illegal " to caller; Otherwise this bit is set as 0, and expression is reclaimed.
Step C4: check the auxiliary chained list node of one-level bitmap at m bit place, if this node not in chained list, adds chained list.
Above drawings and Examples describe the method that the present invention utilizes the secondary bitmap structure that the memory database space is managed in detail, illustrated and utilized the secondary bitmap structure, controlled process and the step of distribution and the recovery of data page and record in conjunction with an auxiliary chained list.
The present invention utilizes the secondary bitmap structure, controls simultaneously the management method of distribution and the recovery of data page and record in conjunction with an auxiliary chained list, and its important feature is:
1, bit map area is the zone that a physics exists, there is no association between this zone each several part, a plurality of byte can be modified simultaneously, therefore this mechanism can be supported the multi-thread concurrent operation well, arbitrary moment all can have a plurality of data pages and recording areas are distributed concomitantly and discharge, so just thoroughly avoided to have simultaneously in full chained list framework the problem of a threading operation, greatly improved the multitask performance, this point is vital for the internal memory type database take very-high performance as main target.
2, bitmap mechanism can be controlled pages or a record with some bit, so the spent memory headroom of administrative section is minimum, almost can ignore.In a typical application scenarios, the total internal memory of management 20GB only need expend the 12.66MB space, and namely the real space that is used for the storage data accounts for more than 99.938% of gross space, and the memory headroom utilization factor is high.
3, the memory headroom that can manage of this method only is limited by the memory size of main frame, and main frame is supported great internal memory, and this method just can be managed much internal memories, and reduces along with the increase of total internal memory for the ratio that the internal memory of control section accounts for total internal memory.
4, bit arithmetic is all computing extremely efficiently for the cpu of any framework, and the bitmap management mode mainly relies on bit arithmetic, only has the chain table handling of minute quantity, so the efficient of bitmap management mode is considerably beyond full chained list mode.
5, this method has been used the two-stage bitmap, includes simultaneously record in data page and page in bitmap management, has avoided simultaneously performance bottleneck in page layer and recording layer.
6, the performance of this method is constant, and is much no matter the space of management has, and distributes and the operation times that reclaims a page or record is fixed.This means that database will possess good extendability.
The above is only preferred embodiment of the present invention, and is in order to limit the present invention, within the spirit and principles in the present invention not all, and any modification of doing is equal to replacement, improves etc., within all should being included in protection scope of the present invention.Scope of patent protection of the present invention should be as the criterion with claims.

Claims (14)

1. one kind is utilized bitmap to the method that the memory database space manages, and it is characterized in that, memory headroom is divided into a plurality of data pages according to page, is included in the following operation steps in the Installed System Memory district:
A, set up the one-level bit map area, wherein, described one-level bit map area is positioned at the certain bits map-area in described Installed System Memory district, and described one-level bit map area is that each data page in described a plurality of data page distributes some bit, is used for recording the state of this data page;
B, set up the auxiliary chained list of one-level bit map area, at least one described some bit of the corresponding described one-level bit map area of each node of wherein said auxiliary chained list;
C, set up the secondary bit map area, wherein, described secondary bit map area is arranged in the certain bits map-area of each data page of described a plurality of data pages, and described secondary bit map area is that each record in this page distributes certain bit, is used for preserving the state of this record;
A data page in D, the described a plurality of data pages of distribution;
E, distribute a record in this page;
F, the described record of release;
G, the described data page of release.
2. the method for claim 1, is characterized in that, described steps A comprises:
Open up described one-level bit map area and all be initialized as unallocated state according to total memory field size that system need to manage.
3. method as claimed in claim 2, is characterized in that, described steps A is further comprising the steps of:
A1, set the internal memory that will use m MB in Database Systems configurations, wherein, m is positive integer; And distributed the internal memory of this capacity by the main frame support; The size of setting simultaneously every page is p KB, and wherein, p is positive integer;
A2, Database Systems distribute the m mb of memory by opening up shared drive after starting; Suppose that this internal memory first address is g, wherein, g is natural number;
A3, the needed one-level bit map area size of calculating are b1=(m*1024)/(p*8) byte;
A4, keep the space of b1 byte in the beginning of total application heap, as the one-level bit map area, the one-level bit map area is initialized as full 0.
4. method as claimed in claim 1, is characterized in that, described step B comprises:
Set up the auxiliary chained list of described one-level bitmap and initialization, the available free bit of institute in described one-level bit map area is recorded in the territory.
5. the method for claim 1, is characterized in that, described step C comprises:
C1, according to the data page offset address, this page is carried out initialization, record the top margin control information, and the needed secondary bit map area length of length information estimation of the record of depositing according to this page needs;
The secondary bit map area of C2, this page of initialization is use with all the bit field marks in the secondary bit map area.
6. the method for claim 1, is characterized in that, described step D comprises the following steps:
The first node of D1, the auxiliary chained list of the described one-level bitmap of access therefrom obtains first idle bit territory, and is labeled as and distributes;
The node of the auxiliary chained list at the place, bit territory of finding in D2, detecting step D1 if all bit territory corresponding to this node all is distribution state, shifts out chained list with this node;
D3, according to the position in the idle bit territory of finding in step D1, calculate the position offset address of corresponding data page in whole data field.
7. method as claimed in claim 6, is characterized in that, described step D1 comprises the following steps:
D11, upper-layer service are sent request, the request for data page, and indicate every record length≤r byte in this page; Wherein, r is positive integer;
D12: navigate to auxiliary chain heading node, if find that chained list is empty, returns without the idle data page fault to caller, otherwise turns next step;
D13: first idle bit of the first node of search, searching and establishing this bit is 1, expression takies; Suppose that this bit is n the bit that g begins, n is the counting natural number since 1; Check that one-level bit map area corresponding to this node whether for complete 1, is to extract this node from chained list.
8. method as claimed in claim 6, is characterized in that, described step D3 comprises the following steps:
D31: navigate to n the data page first address h that bit is corresponding in the data field, the * p byte offset of h=g+b1 byte offset+(n-1), wherein b1 is described one-level bit map area size, and unit is byte, and p is the size of each data page, and unit is KB;
D32: the page to h skew place carries out the top margin initialization, records necessary management information; And calculating secondary bit map area length b2; The length of supposing top margin is the q byte, b2=(p*1024-q)/(r*8) byte; Wherein, q is positive integer;
D33: navigate to h+q byte offset place, the zone of b2 byte after this is initialized as full 0;
D34: return to successful result and page skew h+q to caller.
9. the method for claim 1, is characterized in that, described step e comprises:
E1, navigate to secondary bit map area in the data page that needs assignment record, use certain algorithm search to arrive this bit map area first idle bit territory, with this bit territory status modifier for distributing;
E2, navigate to by certain algorithm the corresponding recording address in bit territory that step e 1 is distributed, this record is carried out initialization.
10. method as claimed in claim 8, is characterized in that, described step e 1 comprises:
E11, upper-layer service are sent request, require record space of application in n data page;
E12, navigate to the secondary bit map area first address of this data page according to the algorithm of D31 and D32 step; Seek first available bit of this zone, namely be set as 1 if find, expression distributes, and returns successfully; Do not forward next step to if do not find;
E13, return to this page without the error message of remaining space to caller.
11. the method for claim 1 is characterized in that, described step F comprises:
Navigating to secondary bit map area in this data page that records the place, search bit territory corresponding to this record, is the free time with this bit territory status modifier.
12. method as claimed in claim 11 is characterized in that, described step F also comprises the steps:
F1, upper-layer service are sent request, require to discharge the n bar record space in m data page; Wherein, m is natural number;
F2, navigate to the secondary bit map area first address of this data page, navigate to n bit, and be set as 0, expression is reclaimed, and returns successfully; Do not forward next step to if do not find;
F3, return to page number or the illegal error message of recording mechanism to caller.
13. the method for claim 1 is characterized in that, described step G comprises:
G1, according to the offset address of waiting to discharge page, navigate to the corresponding bit territory of this page in the one-level bit map area by certain algorithm, this territory is set to the free time;
G2, check the auxiliary chained list node of one-level bitmap at place, bit territory, if this node not in chained list, adds chained list.
14. method as claimed in claim 13 is characterized in that, described step G1 comprises the following steps:
G11, upper-layer service are sent request, require to discharge m data page; Wherein, m is natural number;
G12, begin to calculate wherein from one-level bitmap first address g, g is natural number, navigates to m bit place, if do not find, returns to the illegal error message of page number to caller; Otherwise this bit is set as 0, and expression is reclaimed.
CN 200810216191 2008-09-18 2008-09-18 Method of managing memory database space by using bitmap Expired - Fee Related CN101676906B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200810216191 CN101676906B (en) 2008-09-18 2008-09-18 Method of managing memory database space by using bitmap

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200810216191 CN101676906B (en) 2008-09-18 2008-09-18 Method of managing memory database space by using bitmap

Publications (2)

Publication Number Publication Date
CN101676906A CN101676906A (en) 2010-03-24
CN101676906B true CN101676906B (en) 2013-06-05

Family

ID=42029475

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200810216191 Expired - Fee Related CN101676906B (en) 2008-09-18 2008-09-18 Method of managing memory database space by using bitmap

Country Status (1)

Country Link
CN (1) CN101676906B (en)

Families Citing this family (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101901261A (en) * 2010-07-23 2010-12-01 南京国电南自轨道交通工程有限公司 Method for storing real-time database by using similar cluster
CN101916290B (en) * 2010-08-18 2014-12-10 中兴通讯股份有限公司 Managing method of internal memory database and device
CN102063378B (en) * 2010-12-17 2013-02-13 曙光信息产业股份有限公司 Method for allocating contiguous memory in kernel at high speed
CN102184140A (en) * 2011-04-01 2011-09-14 航天恒星科技有限公司 Real-time database-orientated table file space distribution method
CN102541758A (en) * 2011-12-22 2012-07-04 深圳市融创天下科技股份有限公司 Method, system as well as terminal equipment for allocating and releasing memory
CN103678553A (en) * 2013-12-06 2014-03-26 上海寰创通信科技股份有限公司 Wireless terminal database establishing method based on shared memory design
CN104572810A (en) * 2014-11-17 2015-04-29 深圳市光息谷科技发展有限公司 Method for carrying out operation processing on massive files by utilizing bitmaps
CN105930280B (en) * 2016-05-27 2019-07-05 诸葛晴凤 A kind of efficient page organization and management method towards Nonvolatile memory
CN106445502A (en) * 2016-08-30 2017-02-22 北京小米移动软件有限公司 Image display method and apparatus
CN108021442A (en) * 2016-11-03 2018-05-11 阿里巴巴集团控股有限公司 The system of release physical memory, device and method
CN109246036B (en) * 2017-07-10 2021-02-09 深圳市中兴微电子技术有限公司 Method and device for processing fragment message
CN107590199B (en) * 2017-08-18 2019-12-24 西安理工大学 Memory-oriented multithreading database design method
CN108121813B (en) * 2017-12-27 2020-09-18 东软集团股份有限公司 Data management method, device, system, storage medium and electronic equipment
CN109284234B (en) * 2018-09-05 2020-12-04 珠海昇生微电子有限责任公司 Storage address allocation method and system
CN110618883B (en) * 2019-09-26 2022-09-13 迈普通信技术股份有限公司 Method, device, equipment and storage medium for sharing memory linked list
CN112100022B (en) * 2020-08-14 2022-02-15 北京航空航天大学 Method for instantly recording object distribution points when monitoring Java object memory leakage on android system
CN113535392B (en) * 2021-07-08 2023-07-11 中国人民解放军国防科技大学 Memory management method and system for realizing support of large memory continuous allocation based on CMA
CN113284039B (en) * 2021-07-16 2021-10-08 杭州安恒信息技术股份有限公司 Bitmap management method, device and equipment and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1661568A (en) * 2004-02-24 2005-08-31 中国科学院声学研究所 File system in device of recording and playing back sounds and images under embedded type environment
CN101030165A (en) * 2006-03-02 2007-09-05 腾讯科技(深圳)有限公司 Magnetic disk space management and managing system
CN101169791A (en) * 2007-12-03 2008-04-30 福建星网锐捷网络有限公司 Sharing chained list error detection method and system
CN101221535A (en) * 2008-01-25 2008-07-16 中兴通讯股份有限公司 Garbage recovery mobile communication terminal of Java virtual machine and recovery method thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1661568A (en) * 2004-02-24 2005-08-31 中国科学院声学研究所 File system in device of recording and playing back sounds and images under embedded type environment
CN101030165A (en) * 2006-03-02 2007-09-05 腾讯科技(深圳)有限公司 Magnetic disk space management and managing system
CN101169791A (en) * 2007-12-03 2008-04-30 福建星网锐捷网络有限公司 Sharing chained list error detection method and system
CN101221535A (en) * 2008-01-25 2008-07-16 中兴通讯股份有限公司 Garbage recovery mobile communication terminal of Java virtual machine and recovery method thereof

Also Published As

Publication number Publication date
CN101676906A (en) 2010-03-24

Similar Documents

Publication Publication Date Title
CN101676906B (en) Method of managing memory database space by using bitmap
CN101458613B (en) Method for implementing mixed hierarchical array, the hierarchical array and storage system
CN102460400B (en) Hypervisor-based management of local and remote virtual memory pages
JP4738038B2 (en) Memory card
CN104731717B (en) Storage arrangement and storage management method
CN110119425A (en) Solid state drive, distributed data-storage system and the method using key assignments storage
CN100383792C (en) Buffer data base data organization method
CN101510176B (en) Control method of general-purpose operating system for accessing CPU two stage caching
CN105335098A (en) Storage-class memory based method for improving performance of log file system
CN104395904A (en) Efficient data object storage and retrieval
CN101183383A (en) Snapshot system and method of use thereof
CN102184229B (en) Memory data storage method of huge RFID (Radio Frequency Identification Device) label information
CN102262512A (en) System, device and method for realizing disk array cache partition management
CN103597455A (en) Efficient tag storage for large data caches
CN107256196A (en) The caching system and method for support zero-copy based on flash array
CN102411632B (en) Chain table-based memory database page type storage method
CN101446976A (en) File storage method in distributed file system
CN101256535B (en) Apparatus and method for reading-writing and rapidly fetching hard disk data
CN102819494A (en) Optimization method for writing in flash memory in sequence
CN102184140A (en) Real-time database-orientated table file space distribution method
CN102763070B (en) The management method of disk buffering and device
CN101610197A (en) A kind of buffer management method and system thereof
CN101303667B (en) Method and device for establishing magnetic disk null cluster table and seeking magnetic disk null cluster
CN101833514B (en) Method for realizing virtual internal memory in nand type flash memory medium based on micromemory system
CN111078143A (en) Hybrid storage method and system for data layout and scheduling based on segment mapping

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20151231

Address after: 523080, A1, 706-02, 704-01, 706-01, 704-02,, Tian An Digital City, 1 Golden Road, Nancheng District, Guangdong, China

Patentee after: Dongguan neighboring workers help Agel Ecommerce Ltd

Address before: 518057 Nanshan District Guangdong high tech Industrial Park, South Road, science and technology, ZTE building, Ministry of Justice

Patentee before: ZTE Corporation

CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20130605

Termination date: 20190918

CF01 Termination of patent right due to non-payment of annual fee