CN100410949C - Data bank system and method for controlling data bank data - Google Patents

Data bank system and method for controlling data bank data Download PDF

Info

Publication number
CN100410949C
CN100410949C CNB2006101278170A CN200610127817A CN100410949C CN 100410949 C CN100410949 C CN 100410949C CN B2006101278170 A CNB2006101278170 A CN B2006101278170A CN 200610127817 A CN200610127817 A CN 200610127817A CN 100410949 C CN100410949 C CN 100410949C
Authority
CN
China
Prior art keywords
list item
hash function
random access
access memory
function conversion
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
CNB2006101278170A
Other languages
Chinese (zh)
Other versions
CN1932818A (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CNB2006101278170A priority Critical patent/CN100410949C/en
Publication of CN1932818A publication Critical patent/CN1932818A/en
Application granted granted Critical
Publication of CN100410949C publication Critical patent/CN100410949C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

One method for managing data of data bank relates to storage item. Get corresponding Hash value by Hash function conversion with prescriptive time for key value of storage item and judge whether the key value is collision after Hash function conversion. Storage the item key value of collision into TCAM and the first RAM associated with TCAM. In the prescriptive time, the item after Hash function conversion without collision and its Hash value storage into the second RAM. There is a kind of system relates to storage unit, TCAM, first RAM and second RAM. The first RAM connects with the said TCAM. The item after Hash function conversion without collision storages into the second RAM and storages the conversion item into TCAM and first RAM. Through this system, it can carry in low cost and wastage.

Description

The method of Database Systems and management data database data
Technical field
The present invention relates to technical field of data processing, relate in particular to the method for a kind of Database Systems and management data database data.
Background technology
Along with rapid development of network, the list item item number and the length that are in a lot of equipment requirements supports in the network are also increasing, so the storage space that various list items take also becomes increasing.
Using now commonplace list item storage means comprises and utilizes three value content address storeies (TernaryContentAddress Memory TCAM) stores and utilizes Hash (HASH) function to store two kinds.
Full coupling (Full Match, FM) table is a kind of modal list item type, medium access control (Media Access Control, MAC) table is again relatively more typical in the FM table, will be that example explanation is utilized the TCAM storage and utilized two kinds of different storage meanss of hash function storage with store M AC table hereinafter.
1, utilize the method for TCAM storage:
TCAM is a kind of ternary hardware chip of tabling look-up that is exclusively used in of high speed, key (KEY) value and the mask (MASK) of MAC table are stored among the TCAM, the content of MAC address entries is deposited in the static RAM relevant with this TCAM (Static Random Access Memory, SRAM) in, concrete memory state is referring to Fig. 1, the KEY value that is stored among the TCAM is corresponding one by one with the content of MAC address entries in being stored in SRAM, when tabling look-up because the high zoom table characteristic of TCAM, by searching the contents in table that the KEY value can obtain being stored in unique correspondence among the SRAM soon, easy and simple to handle quick.
But TCAM wants expensive many than other storage medium, power consumption is also very big, Cun Chu contents in table seldom if desired, use a small amount of low capacity TCAM can not bring clearly influence, when the jumbo MAC of storage shows, the remarkable rising of using TCAM will bring cost, the Database Systems that the storage data are used and the power consumption of overall network system all can obviously rise, and list item item number that requirement is supported in present network and length are all in past increasing direction develop rapidly.
2, utilize the method for hash function storage:
Hash function also is known as hash function, and its characteristics just are, the character string of random length can be converted to the numerical value or the index value of regular length.With the MAC table is example, when store M AC list item, KEY value very long and that may comprise any character is converted merely to the cryptographic hash of the regular length of forming by numeral, numerical value such as 4, because only comprise simple numeral just represent each have only at most 10 kinds may, and it is many that length also will be lacked, the numerical value speed of therefore searching one 4 figure place can be than searching very long and may to comprise the KEY value of any character faster, utilizing this cryptographic hash to search data also can be a lot of soon compared with directly utilizing the KEY value to search data speed, use common random access memory stores list item in this case, such as dynamic RAM (Dynamic Random Access Memory, DRAM), speed when SRAM searches is similar substantially with the seek rate of TCAM storage item that utilizes mentioned above, and DRAM, common storage such as SRAM are very cheap compared with TCAM, also low many of power consumption, even the list item of corresponding storage is very big, the method cost that utilizes hash function to store also can be lower, and system power dissipation also can descend.
But because the characteristic of hash function itself, determined the identical situation of cryptographic hash that a plurality of different K EY values are changed out to occur, this situation is called as conflict, when searching, the a plurality of KEY values that conflict occurs will be pointed to same cryptographic hash, adopt this time the chained list method to solve collision problem usually.
The chained list method is exactly to set up a chained list for the cryptographic hash that conflict occurs, all are placed in the same chained list through the KEY value that obtains identical cryptographic hash behind the Hash, when searching, at first find chained list by cryptographic hash, and then in chained list, search with Hash before the KEY value that equates of KEY value, to obtain corresponding contents in table.
Along with the number of times that conflict occurs increases, chained list also can be more and more longer like this, and searching speed also can be more and more slower, and the data base administration work meeting that storage item is used becomes and becomes increasingly complex, and the performance of total system all can be affected.
Summary of the invention
The technical problem to be solved in the present invention provides the method for a kind of Database Systems and management data database data.
For solving the problems of the technologies described above, the invention provides a kind of method of management data database data, this method comprises the method for storage item:
The key assignments of list item to be stored is carried out hash function conversion in the stipulated number, obtain corresponding cryptographic hash;
Whether the key assignments of judging described list item conflicts after through the hash function conversion; Will be through after the conversion of stipulated number hash function, still Chong Tu item key value is stored in three value content address storeies, and contents in table is stored in and the first related random access memory of three value content address storeies; Will be in stipulated number, the list item and the cryptographic hash thereof of once carrying out not conflicting after the hash function conversion are stored in second random access memory.
Wherein, described stipulated number is at least twice, and described method comprises:
The key assignments of list item to be stored is carried out hash function conversion in the stipulated number, obtain corresponding cryptographic hash;
Judge after each key assignments is through the hash function conversion whether conflict, whether the number of times that carries out the hash function conversion reaches stipulated number;
If conflict, and the number of times that carries out hash function conversion do not reach stipulated number, then continues the key assignments of list item to be stored is carried out hash function conversion next time; If conflict, and the number of times that carries out hash function conversion reached stipulated number, then item key value is stored in three value content address storeies, and contents in table is stored in and the first related random access memory of three value content address storeies;
If do not conflict, then list item and cryptographic hash thereof are stored in second random access memory.
Wherein, described method also comprises the method for searching list item:
The key assignments of list item to be found is carried out hash function conversion in the stipulated number, obtain corresponding cryptographic hash;
Judge whether there is list item to be found on second random access memory by described cryptographic hash;
If exist, then obtain list item to be found, search successfully;
If do not exist, then on three value content address storeies, seek the key assignments of list item to be found, search out key assignments after, first random access memory acquisition contents in table that visit is related with three value content address storeies is searched successfully.
Wherein, described stipulated number is at least twice, and described method comprises:
The key assignments of list item to be found is carried out hash function conversion in the stipulated number, obtain corresponding cryptographic hash;
After carrying out the hash function conversion, judge whether there is list item to be found on second random access memory by described cryptographic hash, whether the number of times that carries out the hash function conversion reaches stipulated number at every turn;
If exist, then obtain list item to be found, search successfully;
If do not exist, and the number of times that carries out the hash function conversion do not reach stipulated number, then continues the key assignments of list item to be found is carried out hash function conversion next time; If do not exist, and the number of times that carries out hash function conversion has reached stipulated number, then seeks the key assignments of list item to be found on three value content address storeies, search out key assignments after, visit first random access memory related with three value content address storeies obtains contents in table, searches successfully.
Wherein, described stipulated number is for once.
Wherein, describedly judge whether exist list item to be found to be on second random access memory by described cryptographic hash:
Judge and whether have the cryptographic hash identical on second random access memory with described cryptographic hash;
If do not exist, then there is not list item to be found on second random access memory;
If exist, judge then whether the key assignments of storing under the cryptographic hash on this second random access memory is equal with the key assignments of list item to be found;
If unequal, then there is not list item to be found on second random access memory;
If equate, then have list item to be found on second random access memory, the list item of storing under the cryptographic hash on this second random access memory is list item to be found.
Wherein, described method also comprises the method for remove entries:
, find and treat remove entries according to the key assignments for the treatment of remove entries by described method of searching list item, remove entries is treated in deletion.
Wherein, described method also comprises the method for aging list item:
Definition comprises the aging table of the aging flag of list item, the definition refresh cycle; The list item corresponding aging flag of tense marker that is called;
Each refresh cycle is refreshed once aging table, and by aging flag, the method for using described remove entries is with the list item deletion that was not called in the one-period.
Wherein, described aging flag initial value is " 0 " or " 1 ".
Wherein, described first random access memory is a static RAM.
Wherein, described second random access memory is a dynamic RAM.
The present invention also provides a kind of Database Systems, comprising: processing unit, three value content address storeies, first random access memory and second random access memory; Described first random access memory is associated with described three value content address storeies;
Described processing unit is used for key assignments with list item to be stored and carries out hash function conversion in the stipulated number, obtains corresponding cryptographic hash; Judge after key assignments is through the hash function conversion whether conflict; Will be through after the conversion of stipulated number hash function, still Chong Tu item key value is stored in described three value content address storeies, and contents in table is stored in described first random access memory; Will be in stipulated number, the list item and the cryptographic hash thereof of once carrying out not conflicting after the hash function conversion are stored in described second random access memory.
Wherein, described processing unit is used for key assignments with list item to be stored and carries out hash function conversion in the stipulated number, obtains corresponding cryptographic hash; And judge after each key assignments is through the hash function conversion and whether conflict, whether the number of times that carries out the hash function conversion reaches stipulated number; If conflict, and the number of times that carries out hash function conversion do not reach stipulated number, then continues the key assignments of list item to be stored is carried out hash function conversion next time; If conflict, and the number of times that carries out hash function conversion reached stipulated number, then item key value is stored in described three value content address storeies, and contents in table is stored in described first random access memory; If do not conflict, then list item and cryptographic hash thereof are stored in described second random access memory.
Wherein, described system also comprises:
Search the unit, be used for key assignments with list item to be found and carry out hash function conversion in the stipulated number, obtain corresponding cryptographic hash; Judge on described second random access memory whether have list item to be found by described cryptographic hash; If exist, then obtain list item to be found; If do not exist, then on described three value content address storeies, seek the key assignments of list item to be found, search out key assignments after, visit described first random access memory and obtain contents in table.
Wherein, the described unit of searching is used for key assignments with list item to be found and carries out hash function conversion in the stipulated number, obtains corresponding cryptographic hash; After carrying out the hash function conversion, judge on described second random access memory whether have list item to be found by described cryptographic hash, whether the number of times that carries out the hash function conversion reaches stipulated number at every turn; If exist, then obtain list item to be found; If do not exist, and the number of times that carries out the hash function conversion do not reach stipulated number, then continues the key assignments of list item to be found is carried out hash function conversion next time; If do not exist, and the number of times that carries out the hash function conversion reached stipulated number, then seeks the key assignments of list item to be found on described three value content address storeies, search out key assignments after, visit described first random access memory and obtain contents in table.
Wherein, described stipulated number is for once.
Wherein, described system also comprises:
Delete cells is used for by the described unit of searching finding and treating remove entries according to treating the key assignments of remove entries, and remove entries is treated in deletion.
Wherein, described system also comprises:
Aging unit is used to define the aging table that comprises the aging flag of list item, the definition refresh cycle; In the list item corresponding aging flag of tense marker that is called; Each refresh cycle is refreshed once aging table, by aging flag, uses described delete cells with the list item deletion that was not called in the one-period.
Wherein, described first random access memory is a static RAM.
Wherein, described second random access memory is a dynamic RAM.
As from the foregoing, the present invention is by the advantage in conjunction with TCAM and hash function, to be stored among the RAM that TCAM reaches with TCAM is associated through the list item of hash function conversion back conflict, the list item that does not conflict is stored among other RAM, make the list item that only needs storage not conflict among the common RAM, do not need to adopt the chained list method to solve collision problem, seek rate can remain on the higher level always, can not be affected, can not influence the performance of Database Systems yet; And only need deposit the list item of conflict among the RAM that TCAM reaches with TCAM is associated, it is very little that these list items occupy ratio with respect to whole list item, so even the list item capacity of storage is very big, also seldom low capacity TCAM just can finish, and the cost of system and power consumption can not be subjected to obvious influence like this; So just taken into account the power consumption cost and the performance of system, made system under all lower situation of cost and power consumption, can keep high-speed operation.
Further, the present invention has provided the scheme that can carry out the conversion of one or many hash function again: only carry out a hash function conversion, all are stored among TCAM and the SRAM through the list item that conflict appears in a hash function conversion, be the simple proposal of a kind of flow process, can improve system effectiveness; Carry out repeatedly the hash function conversion, can effectively reduce the probability that conflict occurs, the consumption of TCAM also can reduce like this, when list item is very big, also do not need very jumbo TCAM to store the list item that conflict occurs, the user can be according to self needs decision can carrying out at most how many times hash function conversion.
Further, the present invention is faster several times than DRAM according to SRAM, but the inferior slightly price of DRAM speed is very cheap, and the characteristics that capacity is bigger, provided the RAM related and adopted SRAM with TCAM, the better speed advantage of performance TCAM, the RAM that stores the list item that do not conflict adopts DRAM, the scheme of performance DRAM price and capacity advantage.Because the list item of storing among the TCAM is seldom, related RAM consumption also seldom, so use SRAM very little to the influence of system cost; Using hash function to search list item speed on DRAM and SRAM does not have difference substantially, and the RAM of list item does not adopt DRAM can not have influence on speed so storage does not conflict, and because the RAM large usage quantity here uses DRAM to reduce cost.
Description of drawings
Fig. 1, the use TCAM and the SRAM storage item synoptic diagram that is associated;
Fig. 2, system implementation illustration of the present invention;
The method embodiment process flow diagram of the storage item of the method for Fig. 3, management data database data of the present invention;
The method embodiment process flow diagram of searching list item of the method for Fig. 4, management data database data of the present invention;
The method embodiment process flow diagram of the remove entries of the method for Fig. 5, management data database data of the present invention;
The method embodiment process flow diagram of the aging list item of the method for Fig. 6, management data database data of the present invention.
Embodiment
The invention provides the method for a kind of Database Systems and management data database data, by list item being stored in TCAM and random access memory (Random Access Memory respectively, RAM), combine the advantage of TCAM and hash function, taken into account cost power consumption and speed.
Database system structure provided by the invention comprises processing unit 201, searches unit 202, delete cells 203, aging unit 204, random access memory A205, TCAM206, random access memory B207 as shown in Figure 2, and each Elementary Function is as follows:
Processing unit 201: and random access memory A205, TCAM206, random access memory B207 are interconnected, send operation information, intrasystem data are managed the storing process of control table entry.
Search unit 202: and random access memory A205, TCAM206, random access memory B207 are interconnected, send operation information, intrasystem data are managed the search procedure of control table entry.
Delete cells 203: and random access memory A205, TCAM206, random access memory B207 are interconnected, send operation information, intrasystem data are managed the delete procedure of control table entry.
Aging unit 204: and random access memory 205, TCAM206, random access memory B207 are interconnected, send operation information, intrasystem data are managed the ageing process of control table entry.
Random access memory B207: the list item that storage does not conflict after changing through the one or many hash function, the control that accept processing unit 201, search unit 202, delete cells 203 reaches aging unit 204 is stored, searches, is deleted and wear out list item.
Because DRAM commonly used is than cheap many of SRAM, it is very big that capacity also can be done, and both speed does not have difference substantially when using cryptographic hash to search, so the general more options DRAM of random access memory B207 in actual applications.
TCAM206: and random access memory A205 is associated, list item KEY value and MASK that conflict is arranged after storage is changed through the one or many hash function, the control that accept processing unit 201, search unit 202, delete cells 203 reaches aging unit 204 is stored, searches, is deleted list item.
In system provided by the invention, because TCAM just is used for storing list item KEY value and the MASK that conflict is arranged after the hash function conversion, it is very little that the list item that conflict arranged occupies ratio with respect to whole list item, so even the list item capacity of storage is very big, also seldom low capacity TCAM just can finish, and the cost of system and power consumption can not be subjected to obvious influence like this.
Random access memory A205: and TCAM206 is associated, the contents in table that conflict is arranged after storage is changed through the one or many hash function, these contents in table are corresponding one by one with the list item KEY value that is stored in TCAM206, and the control that accept processing unit 201, search unit 202, delete cells 203 reaches aging unit 204 is stored, searches, deleted and wear out list item.
Because from access speed, SRAM commonly used than DRAM more near the speed of TCAM, for the better speed advantage of performance TCAM, common random access memory A204 can select for use SRAM to cooperate with TCAM in the practical application, according to above describing as can be known in system provided by the invention, the consumption of TCAM seldom, the respective stored content SRAM consumption related with TCAM also is considerably less, and be very trickle to the influence of system cost.
Above mention and to carry out the conversion of one or many hash function, be to stipulate according to the needs of self by the user, once also can be repeatedly, if the number of times of regulation is once, then can only carry out a hash function conversion at most,, then can only carry out twice hash function conversion at most if the number of times of regulation is twice, by that analogy, the concrete disposal route description of method that sees below.
Also need to prove, mentioned in this article interconnected or connect the connection refer on the signaling, rather than direct connection physically, the connecting line that marks among Fig. 2 equally also only refers to the connection on the signaling, for example when actual connection hardware, random access memory A205 might directly insert processing unit 201, also might insert processing unit 201 by TCAM206; If what random access memory A205 and random access memory B207 adopted is the random access memory of same type, then can use the different sections of same random access memory to realize the present invention.
Database Systems operating process provided by the invention will be specifically addressed in the description to method hereinafter.
When carrying out the specific descriptions of method hereinafter, will be SRAM with random access memory A205, random access memory B207 be that DRAM is that example is described.
The method of management data database data provided by the invention comprises the method for the method of storage item, the method for searching list item, remove entries and the method for aging list item, wherein the method for storage item is the basis of all management database data methods, so the following description of at first carrying out the method for storage item.
The method of storage item in the method for management data database data provided by the invention, at first will prepare the KEY value of storage item and carry out the conversion of one or many hash function, the list item that then the KEY value is occurred conflict after changing through hash function is stored in the DRAM, deposit the KEY value in TCAM in the list item KEY value that occurs conflict through hash function conversion back, contents in table deposits in the SRAM related with TCAM.
Now be converted to example, the method for storage item in the method for management data database data be described in detail in detail so that the KEY value is carried out twice hash function at most, idiographic flow as shown in Figure 3:
Step 301, the definite list item KEY value and contents in table that will increase.
Step 302, input KEY value calculate the cryptographic hash 1 " h1 " that KEY obtains after the hash function conversion in hash function 1 " H1 (k) ".
Step 303, search and whether exist among the DRAM and cryptographic hash that h1 equates,, then enter step 304 if exist and cryptographic hash that h1 is equal; If there is no equal with h1 cryptographic hash illustrates conflict to occur, then enters step 307.
Step 304, with among the DRAM with cryptographic hash that h1 equates under the KEY value of storing compare with the list item KEY value that will increase, judge whether to equate, if equate, illustrate that this is a list item of having stored, and then enters step 309; If unequal, illustrate conflict to have occurred, then enter step 305.
The above step 303 to 304 is the judgement that whether occurs conflicting after the hash function conversion for the first time to carrying out, if conflict then enters step 305, if conflict occurs, and direct execution in step 307 just.
Step 305, input KEY value calculate the cryptographic hash 2 " h2 " that KEY obtains after the hash function conversion in hash function 2 " H2 (k) ".
Because conflict has appearred in the hash function conversion first time to the list item KEY value that will increase, in order to reduce conflict, in step 305, use hash function " H2 (k) " that the list item KEY value that will increase is carried out the hash function conversion second time, can be little a lot of through the obvious probability that conflict occurs of the KEY value of hash function conversion for the second time, can effectively reduce the list item number that need be stored among TCAM and the SRAM like this.
In actual applications,, can only carry out a hash function conversion, all are stored among TCAM and the SRAM through the list item that conflict appears in a hash function conversion, reduce flow process and improve system effectiveness according to the situation of system; Also can carry out hash function conversion, reduce the list item that conflict occurs as far as possible, reduce the consumption of TCAM, reduce cost and power consumption more than twice.
Step 306, search and whether exist among the DRAM and cryptographic hash that h2 equates,, then enter step 308 if exist and cryptographic hash that h2 is equal; If there is no equal with h2 cryptographic hash illustrates conflict to occur, then enters step 307.
The cryptographic hash that step 307, the list item that directly will increase and the last hash function of process thereof are converted to is stored among the DRAM.
Can execution in step 307 illustrate that the KEY value of the list item that will increase has obtained a cryptographic hash of not conflicting after through hash function conversion once or twice, then can directly be added on this list item among the DRAM.
Step 308, with among the DRAM with cryptographic hash that h2 equates under the KEY value of storing compare with the list item KEY value that will increase, judge whether to equate, if equate, illustrate that this is a list item of having stored, and then enters step 309; If unequal, illustrate conflict to have occurred, then enter step 310.
Step 309, updated stored be the contents in table through judging that the KEY value equates in DRAM.
Step 310, the KEY value of this list item that will increase is stored among the TCAM, contents in table is stored among the SRAM relevant with TCAM.
So far flow process finishes.
Search the method for list item in the method for management data database data provided by the invention, be on the method basis of storage item, to propose, the list item KEY value that at first will search is carried out the hash function conversion, in DRAM, on DRAM, search by the cryptographic hash after the hash function conversion, if search less than, the hash function conversion times that can carry out at most in the time of then will be according to storage item, carry out repeatedly the hash function conversion, continuation is searched on DRAM, if still can't find, on TCAM, search again, certainly, if in the method for storage item, only allow to carry out a hash function conversion, carry out repeatedly the hash function conversion again with regard to not needing, directly on TCAM, search just passable.
Now be converted to example, the method for searching list item in the method for management data database data be described in detail in detail in the method for storage item, the KEY value is carried out twice hash function at most, idiographic flow as shown in Figure 4:
Step 401, the definite list item KEY value that will search.
Step 402, input KEY value calculate the cryptographic hash 1 " h1 " that KEY obtains after the hash function conversion in hash function 1 " H1 (k) ".
Step 403, search and whether exist among the DRAM and cryptographic hash that h1 equates,, then enter step 404 if exist and cryptographic hash that h1 is equal; If there is no equal with h1 cryptographic hash then enters step 405.
Step 404, with among the DRAM with cryptographic hash that h1 equates under the KEY value of storing compare with the list item KEY value that will search, judge whether to equate, if equate, illustrate that then this is the list item that will search, enters step 409; If unequal, then enter step 405.
After the above step 403 to 404 is the KEY value is carried out the hash function conversion first time, searching on DRAM, if find equal cryptographic hash, and the KEY value of storing under this cryptographic hash also equates, then explanation has found required data, and the person will not carry out next step and search.
Step 405, input KEY value calculate the cryptographic hash 2 " h2 " that KEY obtains after the hash function conversion in hash function 2 " H2 (k) ".
Because use the cryptographic hash after the hash function conversion for the first time of KEY value is not found desired data, and the method regulation of storage item can be carried out twice hash function conversion at most to the KEY value in the present embodiment, so will carry out the hash function conversion second time to the KEY value here, use h2 to continue on DRAM, to search then.
In actual applications,, do not need to carry out the hash function conversion second time so here yet, directly search TCAM and get final product if regulation is at most only carried out a hash function conversion to the KEY value in the method for storage item.
Step 406, search and whether exist among the DRAM and cryptographic hash that h2 equates,, then enter step 407 if exist and cryptographic hash that h2 is equal; If there is no equal with h2 cryptographic hash then enters step 408.
Step 407, with among the DRAM with cryptographic hash that h2 equates under the KEY value of storing compare with the list item KEY value that will search, judge whether to equate, if equate, illustrate that then this is the list item that will search and enters step 409; If unequal, then enter step 408.
The list item KEY value that step 408, use will be searched is searched in TCAM, searches whether there is equal KEY value, if exist, then obtains to be stored in related SRAM according to this equal KEY value and goes up corresponding contents in table, enters step 409; If there is no, then enter step 410.
Because the method for storage item regulation can only be carried out twice hash function conversion at most to the KEY value in the present embodiment, so all do not have after finding on the DRAM after the conversion of twice hash function in that the KEY value is carried out, then bring into use the KEY value on TCAM, to search, if regulation can be carried out the hash function conversion more than twice in the method for storage item, so here, will proceed hash function conversion next time, continuation is searched on DRAM, reach set upper limit in the method for storage item up to the number of times that carries out hash function conversion, when also not finding, just can use the KEY value on TCAM, to search.
Step 409, search successfully the contents in table that acquisition will be searched.
Step 410, search failure, illustrate that this waits to table look-up do not stored by in the Database Systems of searching.
So far flow process finishes.
The method of remove entries in the method for management data database data provided by the invention is in the method for storage item and search on the method basis of list item and propose, idiographic flow as shown in Figure 5:
Step 501, the definite list item KEY value that will delete.
Step 502, call and search module, search list item according to the KEY value.
This step is used searches module, promptly above searches the method for mentioning in the method for list item of searching in the method for management data database data, and the method that is to say the process that deletion is searched and search list item is on all four.
Whether step 503, judgement search successful, successfully enter step 504; Otherwise, enter step 505.
Step 504, search successfully the list item that deletion finds.
Step 505, deletion failure.
The method of aging list item in the method for management data database data provided by the invention is the list item that does not re-use for a long time for cleaning in time, and the storage space of saving system proposes.
Owing to being divided into several parts, whole list items in the method for management data database data provided by the invention are stored in respectively in the different storeies, the list item that can store is also bigger, probably exist some to can not get the list item that calls for a long time, these list items are more and more, occupation space is increasing, insufficient memory might cause some new list items owing to can't add.
In order effectively to use storage space, the highest list item of frequency is called in storage as far as possible, the not invoked list item that will leave unused is for a long time cleared up away, the present invention has defined an aging table in the method for aging list item, each list item all has an aging flag in aging table, the aging flag of each list item is initially " 0 ", system refreshes aging table at set intervals, with flag is the set of " 0 ", with flag is the corresponding tables entry deletion of " 1 ", list item is called at every turn all can carry out the action of reset in aging flag, like this after a list item is by set, in next specified period, all there are not invoked words, will be eliminated, only be called in next specified period, the flag reset just can be retained, the time of refresh cycle can be gone according to the actual needs to determine by the user here.
Aging flag initial value mentioned above also can be " 1 ", reset when refreshing, and set when calling, removing aging flag is the list item of " 0 ".
Be that " 0 " is the application of method in practical operation of the aging list item of example explanation with aging flag initial value now, flow process is referring to Fig. 6, and particular content is as follows:
Step 601, aging table of definition, each is stored in list item in the system all has a correspondence in this aging table aging flag, and corresponding list item information, and the aging flag original state of each list item all is " 0 ".
Step 602, according to the predefined refresh cycle, refreshing aging table at set intervals, judge promptly whether each aging flag is " 0 ", if " 0 " execution in step 603 then; If be not " 0 " then execution in step 604.
Step 603, with the whole sets of aging flag of promising " 0 ".
Step 604, take out all aging flag and be the corresponding list item information of " 1 ", carry out deletion action.
Step 605, judging whether list item is called, is execution in step 606 then; Otherwise execution in step 607.
Step 606, with the aging flag reset of all invoked list items.
Step 607, there is not invoked list item not change the state value of its aging flag.
Step 605 to step 607 is promptly represented, each list item all will be in its aging flag reset when being called, its aging flag state of the list item that was not called just can not obtain changing, if list item is through after refresh activity, do not have deleted, its aging flag inevitable in step 604 by set, if it all be not called before refresh cycle next time arrives, its aging flag will keep the state of " 1 " to arrive up to the new refresh cycle, and will be deleted then.
Step 608, next refresh cycle of wait.
More than the method for a kind of Database Systems provided by the present invention and management data database data is described in detail, used specific case herein principle of the present invention and embodiment are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.

Claims (20)

1. the method for a management data database data is characterized in that, this method comprises the method for storage item:
The key assignments of list item to be stored is carried out hash function conversion in the stipulated number, obtain corresponding cryptographic hash;
Whether the key assignments of judging described list item conflicts after through the hash function conversion; Will be through after the conversion of stipulated number hash function, still Chong Tu item key value is stored in three value content address storeies, and contents in table is stored in and the first related random access memory of three value content address storeies; Will be in stipulated number, the list item and the cryptographic hash thereof of once carrying out not conflicting after the hash function conversion are stored in second random access memory.
2. the method for management data database data as claimed in claim 1 is characterized in that, described stipulated number is at least twice, and described method comprises:
The key assignments of list item to be stored is carried out hash function conversion in the stipulated number, obtain corresponding cryptographic hash;
Judge after each key assignments is through the hash function conversion whether conflict, whether the number of times that carries out the hash function conversion reaches stipulated number;
If conflict, and the number of times that carries out hash function conversion do not reach stipulated number, then continues the key assignments of list item to be stored is carried out hash function conversion next time; If conflict, and the number of times that carries out hash function conversion reached stipulated number, then item key value is stored in three value content address storeies, and contents in table is stored in and the first related random access memory of three value content address storeies;
If do not conflict, then list item and cryptographic hash thereof are stored in second random access memory.
3. the method for management data database data as claimed in claim 1 is characterized in that, described method also comprises the method for searching list item:
The key assignments of list item to be found is carried out hash function conversion in the stipulated number, obtain corresponding cryptographic hash;
Judge whether there is list item to be found on second random access memory by described cryptographic hash;
If exist, then obtain list item to be found, search successfully;
If do not exist, then on three value content address storeies, seek the key assignments of list item to be found, search out key assignments after, first random access memory acquisition contents in table that visit is related with three value content address storeies is searched successfully.
4. the method for management data database data as claimed in claim 3 is characterized in that, described stipulated number is at least twice, and described method comprises:
The key assignments of list item to be found is carried out hash function conversion in the stipulated number, obtain corresponding cryptographic hash;
After carrying out the hash function conversion, judge whether there is list item to be found on second random access memory by described cryptographic hash, whether the number of times that carries out the hash function conversion reaches stipulated number at every turn;
If exist, then obtain list item to be found, search successfully;
If do not exist, and the number of times that carries out the hash function conversion do not reach stipulated number, then continues the key assignments of list item to be found is carried out hash function conversion next time; If do not exist, and the number of times that carries out hash function conversion has reached stipulated number, then seeks the key assignments of list item to be found on three value content address storeies, search out key assignments after, visit first random access memory related with three value content address storeies obtains contents in table, searches successfully.
5. as the method for claim 1 or 3 described management data database datas, it is characterized in that described stipulated number is for once.
6. as the method for claim 3 or 4 described management data database datas, it is characterized in that describedly judge whether exist list item to be found to be on second random access memory by described cryptographic hash:
Judge and whether have the cryptographic hash identical on second random access memory with described cryptographic hash;
If do not exist, then there is not list item to be found on second random access memory;
If exist, judge then whether the key assignments of storing under the cryptographic hash on this second random access memory is equal with the key assignments of list item to be found;
If unequal, then there is not list item to be found on second random access memory;
If equate, then have list item to be found on second random access memory, the list item of storing under the cryptographic hash on this second random access memory is list item to be found.
7. the method for management data database data as claimed in claim 3 is characterized in that, described method also comprises the method for remove entries:
, find and treat remove entries according to the key assignments for the treatment of remove entries by described method of searching list item, remove entries is treated in deletion.
8. the method for management data database data as claimed in claim 7 is characterized in that, described method also comprises the method for aging list item:
Definition comprises the aging table of the aging flag of list item, the definition refresh cycle; The list item corresponding aging flag of tense marker that is called;
Each refresh cycle is refreshed once aging table, and by aging flag, the method for using described remove entries is with the list item deletion that was not called in the one-period.
9. the method for management data database data as claimed in claim 8 is characterized in that, described aging flag initial value is " 0 " or " 1 ".
10. as the method for each described management data database data of claim 1 to 4, it is characterized in that described first random access memory is a static RAM.
11. the method as each described management data database data of claim 1 to 4 is characterized in that, described second random access memory is a dynamic RAM.
12. Database Systems is characterized in that, comprising: processing unit, three value content address storeies, first random access memory and second random access memory; Described first random access memory is associated with described three value content address storeies;
Described processing unit is used for key assignments with list item to be stored and carries out hash function conversion in the stipulated number, obtains corresponding cryptographic hash; Judge after key assignments is through the hash function conversion whether conflict; Will be through after the conversion of stipulated number hash function, still Chong Tu item key value is stored in described three value content address storeies, and contents in table is stored in described first random access memory; Will be in stipulated number, the list item and the cryptographic hash thereof of once carrying out not conflicting after the hash function conversion are stored in described second random access memory.
13. Database Systems as claimed in claim 12 is characterized in that, described processing unit is used for key assignments with list item to be stored and carries out hash function conversion in the stipulated number, obtains corresponding cryptographic hash; And judge after each key assignments is through the hash function conversion and whether conflict, whether the number of times that carries out the hash function conversion reaches stipulated number; If conflict, and the number of times that carries out hash function conversion do not reach stipulated number, then continues the key assignments of list item to be stored is carried out hash function conversion next time; If conflict, and the number of times that carries out hash function conversion reached stipulated number, then item key value is stored in described three value content address storeies, and contents in table is stored in described first random access memory; If do not conflict, then list item and cryptographic hash thereof are stored in described second random access memory.
14. Database Systems as claimed in claim 12 is characterized in that, described system also comprises:
Search the unit, be used for key assignments with list item to be found and carry out hash function conversion in the stipulated number, obtain corresponding cryptographic hash; Judge on described second random access memory whether have list item to be found by described cryptographic hash; If exist, then obtain list item to be found; If do not exist, then on described three value content address storeies, seek the key assignments of list item to be found, search out key assignments after, visit described first random access memory and obtain contents in table.
15. Database Systems as claimed in claim 14 is characterized in that, the described unit of searching is used for key assignments with list item to be found and carries out hash function conversion in the stipulated number, obtains corresponding cryptographic hash; After carrying out the hash function conversion, judge on described second random access memory whether have list item to be found by described cryptographic hash, whether the number of times that carries out the hash function conversion reaches stipulated number at every turn; If exist, then obtain list item to be found; If do not exist, and the number of times that carries out the hash function conversion do not reach stipulated number, then continues the key assignments of list item to be found is carried out hash function conversion next time; If do not exist, and the number of times that carries out the hash function conversion reached stipulated number, then seeks the key assignments of list item to be found on described three value content address storeies, search out key assignments after, visit described first random access memory and obtain contents in table.
16., it is characterized in that described stipulated number is for once as claim 12 or 14 described Database Systems.
17. Database Systems as claimed in claim 14 is characterized in that, described system also comprises:
Delete cells is used for by the described unit of searching finding and treating remove entries according to treating the key assignments of remove entries, and remove entries is treated in deletion.
18. Database Systems as claimed in claim 17 is characterized in that, described system also comprises:
Aging unit is used to define the aging table that comprises the aging flag of list item, the definition refresh cycle; In the list item corresponding aging flag of tense marker that is called; Each refresh cycle is refreshed once aging table, by aging flag, uses described delete cells with the list item deletion that was not called in the one-period.
19., it is characterized in that described first random access memory is a static RAM as each described Database Systems of claim 12 to 15.
20., it is characterized in that described second random access memory is a dynamic RAM as each described Database Systems of claim 12 to 15.
CNB2006101278170A 2006-09-20 2006-09-20 Data bank system and method for controlling data bank data Expired - Fee Related CN100410949C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2006101278170A CN100410949C (en) 2006-09-20 2006-09-20 Data bank system and method for controlling data bank data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2006101278170A CN100410949C (en) 2006-09-20 2006-09-20 Data bank system and method for controlling data bank data

Publications (2)

Publication Number Publication Date
CN1932818A CN1932818A (en) 2007-03-21
CN100410949C true CN100410949C (en) 2008-08-13

Family

ID=37878653

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2006101278170A Expired - Fee Related CN100410949C (en) 2006-09-20 2006-09-20 Data bank system and method for controlling data bank data

Country Status (1)

Country Link
CN (1) CN100410949C (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101770485A (en) * 2008-12-31 2010-07-07 华为技术有限公司 Method and device for adding table items, and method, device and system for processing table items
CN101741737B (en) * 2009-12-08 2013-01-16 中兴通讯股份有限公司 Maintenance method and device of route table
WO2011091581A1 (en) * 2010-01-26 2011-08-04 华为技术有限公司 Method and device for storing and searching keyword
CN102147798A (en) * 2010-02-10 2011-08-10 华为技术有限公司 Method and device for handling Hashed search conflicts
CN101826107B (en) * 2010-04-02 2015-08-05 华为技术有限公司 Hash data processing method and device
CN102012873B (en) * 2010-11-24 2012-09-05 清华大学 Cache system of Not AND (NAND) flash memory and cache method
CN102045170B (en) * 2010-12-28 2013-02-20 北京深思洛克软件技术股份有限公司 Method and system for protecting safety of password
CN103001878B (en) * 2012-11-26 2018-02-16 中兴通讯股份有限公司 The determination method and device of MAC Address hash-collision
US9336855B2 (en) * 2013-05-14 2016-05-10 Qualcomm Incorporated Methods and systems for smart refresh of dynamic random access memory
CN104036054A (en) * 2014-07-08 2014-09-10 携程计算机技术(上海)有限公司 Method and system for searching for destination
CN105516001A (en) * 2014-09-22 2016-04-20 中兴通讯股份有限公司 Method and device for controlling data recovery after soft reset, and packet transport network equipment
CN104484281B (en) * 2014-12-26 2018-09-04 新华三技术有限公司 Date storage method, lookup method and device
CN106033420A (en) * 2015-03-11 2016-10-19 杭州华三通信技术有限公司 A Hash table processing method and device
CN105224620A (en) * 2015-09-21 2016-01-06 盛科网络(苏州)有限公司 The method and device that reduce HASH collision probability is moved by software
WO2018165961A1 (en) * 2017-03-17 2018-09-20 深圳市秀趣品牌文化传播有限公司 E-commerce data processing system and method for increasing speed of accessing e-commerce platform

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6871262B1 (en) * 2002-02-14 2005-03-22 Cisco Technology, Inc. Method and apparatus for matching a string with multiple lookups using a single associative memory
US6870812B1 (en) * 1998-12-18 2005-03-22 Cisco Technology, Inc. Method and apparatus for implementing a quality of service policy in a data communications network
US7002965B1 (en) * 2001-05-21 2006-02-21 Cisco Technology, Inc. Method and apparatus for using ternary and binary content-addressable memory stages to classify packets

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6870812B1 (en) * 1998-12-18 2005-03-22 Cisco Technology, Inc. Method and apparatus for implementing a quality of service policy in a data communications network
US7002965B1 (en) * 2001-05-21 2006-02-21 Cisco Technology, Inc. Method and apparatus for using ternary and binary content-addressable memory stages to classify packets
US6871262B1 (en) * 2002-02-14 2005-03-22 Cisco Technology, Inc. Method and apparatus for matching a string with multiple lookups using a single associative memory

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
基于TCAM的快速更新算法. 付歌等.计算机工程,第29卷第9期. 2003
基于TCAM的快速更新算法. 付歌等.计算机工程,第29卷第9期. 2003 *
数据结构. 蹇强等,244-247,北京邮电大学出版社. 2004
数据结构. 蹇强等,244-247,北京邮电大学出版社. 2004 *

Also Published As

Publication number Publication date
CN1932818A (en) 2007-03-21

Similar Documents

Publication Publication Date Title
CN100410949C (en) Data bank system and method for controlling data bank data
CN100578469C (en) Storage and polling method and storage controller and polling system
CN101604337B (en) Apparatus and method for hash table storage, searching
CN102880724A (en) Method and system for processing Hash collision
CN101159619B (en) Fast adding method, device and switching arrangement of ARP table
CN101692651A (en) Method and device for Hash lookup table
CN101350788B (en) Method for mixed loop-up table of network processor inside and outside
CN102521334A (en) Data storage and query method based on classification characteristics and balanced binary tree
CN102622434B (en) Data storage method, data searching method and device
CN102682108B (en) Row and line mixed database storage method
CN101388842A (en) Storage method and apparatus
CN100479436C (en) Management and maintenance method for static multi-interface range matching table
CN106599091B (en) RDF graph structure storage and index method based on key value storage
CN102508872A (en) Data processing method and system of online processing system based on memory
CN104158744A (en) Method for building table and searching for network processor
Öztürkoğlu A bi‐objective mathematical model for product allocation in block stacking warehouses
CN104468361A (en) Storing and searching method and device for TCAM with priorities
CN110109948A (en) Data query method, computer equipment and computer readable storage medium
CN102129473A (en) Method for searching static data
CN104038423A (en) Open flow flow table refreshing method and router device
CN110191135B (en) ACL configuration method, device and electronic equipment
CN101534477A (en) List item management method and device
CN112148738A (en) Hash collision processing method and system
CN101692653B (en) Management method and management device for routing table
CN103530130A (en) Method and equipment for implementing multiple-input and multiple-output queues

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
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20080813

Termination date: 20120920