CN101082935B - Non-only indexes search method for internal memory data - Google Patents
Non-only indexes search method for internal memory data Download PDFInfo
- Publication number
- CN101082935B CN101082935B CN2007101228693A CN200710122869A CN101082935B CN 101082935 B CN101082935 B CN 101082935B CN 2007101228693 A CN2007101228693 A CN 2007101228693A CN 200710122869 A CN200710122869 A CN 200710122869A CN 101082935 B CN101082935 B CN 101082935B
- Authority
- CN
- China
- Prior art keywords
- index
- key
- entry
- type
- internal storage
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a non-unique index searching method of internal memory data, which comprises the following steps: (1) building to generate the non-unique parameter mark of the internal memory data; distributing the index register list according to the parameter mark; (2) building the non-unique index for the internal memory data according to the index register list; (3) utilizing the non-unique index to search the internal memory data. The inveniton simplifies the code of operating mode of database, which reduces the coupling of database operating mode and internal memory database.
Description
Technical field
The invention discloses memory database in the communication field to a kind of search method of the data that it provided, relate in particular to memory database data are set up the implementation method that non-only indexes comes the locator data record.
Background technology
In the NGN network, realized the intercommunication of PSTN net and Packet Based Network.MSG is as the network element that connects PSTN and IP Packet Based Network, and in order to improve the ability of data processing, the real-time of enhanced system has been used memory database.The use of memory database in the network equipment more and more widely.
In the memory database that uses at present, be to finish by the method for setting up index for the record retrieval of memory table.The method of its realization is when record inserts memory table, sets up index according to the key word of setting up memory table.In memory database, under most of situation, its index key is unique, but sometimes for application need, and the key word that is used for setting up the memory table of index can not guarantee uniqueness.Can realize the part coupling by sequential index in this case.
This mode has a significant disadvantages, when setting up sequential index exactly, needs mobile internal memory, and newly-established index value is inserted into suitable position, and is consuming time bigger, influences system real time; In addition, because the part of sequential index coupling, when the needed record in location, the time complexity that can cause retrieving becomes n/2 increase doubly, in the worst case, needs relatively n time, could retrieve and navigate to the internal memory record; Simultaneously, during only being applied in, sequential index under the situation of small data quantity, is not suitable for the memory table of big data quantity.
Summary of the invention
The technical problem to be solved in the present invention provides a kind of non-only indexes search method of internal storage data, be used to manage many situations that record identical key word, the same memory headroom of these queue sharing, make that the retrieval location of internal storage data is quick and convenient, can satisfy the real-time of system, the requirement of big data quantity.
In order to address the above problem, the invention provides a kind of non-only indexes search method of internal storage data, wherein, may further comprise the steps:
(1) sets up the required parameter identification of non-only indexes that generates internal storage data, and according to described parameter identification allocation index registration table, calculate the value of the index queue inlet of non-only indexes,, the recording mechanism of index recorded in the index key go for index field adds key tag;
(2) acquisition is recorded in the index match-type in the index registration table, and the recording mechanism that the current vernier of the metadata Meta information acquisition that writes down from the internal storage data table points to then in conjunction with given index key match index item, and is inserted index entry;
(3) synthetic index key, and utilize synthetic index key match index item, Search and Orientation internal storage data;
Further, method of the present invention, wherein, parameter identification described in the step (1) comprises: index match-type, index type, index key length, index key title and the sequence number of index key in table;
Further, method of the present invention, wherein, allocation index registration table in the step (1), further comprising the steps of:
(1a) from variable parameter one by one obtain the field name that is used for setting up index;
(1b) obtain the log-on message of field by field name, and according to the length and the number of the log-on message computation index key word of field;
(1c) traversal index registry objects is sought a unappropriated registers memory space, the length of internal storage data table handle, index type and the index key of its index handle of initialization, correspondence, and the value of the index queue inlet item of calculating non-only indexes;
(1d) add key tag to index field one by one, the recording mechanism of index is recorded go in the index key;
Further, method of the present invention, wherein, described step (2) comprising: obtain to be recorded in the index match-type in the index registration table, the recording mechanism that the current vernier of the Meta information acquisition that writes down from the internal storage data table points to, then according to given index key match index item, and insert index entry;
Further, method of the present invention, wherein, described in conjunction with given index key match index item, further comprising the steps of:
(21a) host type of judgement index, if sequential index, execution in step 21b; If OTHASH (Hash) is types index, then execution in step 21c;
(21b) obtain last index entry by calculating, utilize two fens binary search, when the key word that writes down in the index entry is identical with synthetic key word, then according to the entry value of index entry, obtain the formation dummy argument of index queue, thereby obtain recording mechanism according to the record in the formation dummy argument;
(21c) with the index key that generates, copy to according to two-octet type in the buffering of index key structure of OTHASH type and go; And, calculate the entry value of index according to index key, by entry value, calculate the address of index entry, thereby according to the queue heads recording mechanism of record in the inlet, and the entry value of index is cached in the registration table;
Further, method of the present invention, wherein, described insertion index entry, further comprising the steps of:
(22a) if sequential index, this index entry also exists, and it is long current index data district need to be moved down an index entry, the current index entry entry value of initialization, promptly index dique dummy argument is copied to index entry with key word, and index number added 1, execution in step 22b then;
If the OTHASH type judges that current index queue for empty, then adds 1 with index number, then execution in step 22b;
(22b) when recording indexes is not created, be self index item No., forerunner, follow-up be all zero and the follow-up of index entry dummy argument be not equal to self, the formation dummy argument is cached in the index queue head, then index entry is linked to index queue, and produce new formation dummy argument, the new dummy argument of buffer memory simultaneously, and the index degree of depth added 1;
If (22c) insertion is unsuccessful, then need the rollback Index Status;
Further, method of the present invention, wherein, described step (3) comprising: at first synthetic index key, and utilize synthetic index key Search and Orientation internal storage data, the mobile data vernier is to the position of the record that navigates to;
Further, method of the present invention, wherein, synthetic index key, further comprising the steps of:
(3a) obtain index at the registration table index information, and further obtain internal storage data table handle by the index handle;
(3b) judge the key word synthetic method, if a hash, then execution in step 3c; If not the OTHASH type, execution in step 3d then;
(3c) a hash key buffer zone is converted to two-octet type, and successively each field type is converted to two-octet type, compose simultaneously and give buffer zone, the flow process of synthetic index key finishes;
(3d) the key word buffer zone is converted to character string type, for each the index key field that need synthesize of definition, execution in step 3e is to step 3g;
(3e) from the index registration table, obtain the index key field number, and judge the validity of recording mechanism;
(3f) from the META information of internal storage data table, obtain the descriptor of key field, obtain the field length of key field, be used as the synthetic side-play amount of index key in the key word buffer zone;
(3g), judge index key length according to the type of index key, if single value, the value of acquisition index key from variable parameter, and with its unloading entry keyword buffer zone; If array, the variable parameter that will import into converts the respective pointer type to, and carries out memory copying according to address of importing into and key length; At last, temporary pointer is pointed to last position of key word;
Further, method of the present invention wherein, is utilized synthetic index key match index item, and the Search and Orientation internal storage data may further comprise the steps:
(31a) according to synthetic index key, the match index list item obtains the internal storage data recording mechanism;
(31b) the mobile data vernier points to current record, with the value buffer memory temporary space of current record;
(31c) visit this record manipulative indexing item, from index entry, obtain next record number, thereby can obtain next bar recording mechanism that the current index queue of non-only indexes is imported recording mechanism according to the input recording mechanism;
(31d) according to recording mechanism mobile data vernier, obtain the value of internal storage data.
Adopt the method for the invention, compared with prior art, the present invention sets up non-only indexes by the internal storage data table to memory database, need not to travel through the internal storage data table, or partly mate, the data manipulation primitive of fast access data recording is provided, simplified the code of database manipulation module, reduced of the coupling of database manipulation module, accelerated the tempo of development and the stabilized speed of the communication system of use memory database with memory database.Data manipulation primitive has encapsulated non-only indexes, has accelerated the access speed of data, has improved the stability of memory database for data manipulation, real-time.
Description of drawings
Fig. 1 be in the embodiment of the invention memory database non-only indexes set up process flow diagram;
Fig. 2 is an allocation index internal memory registration table process flow diagram in the embodiment of the invention;
Fig. 3 is a keyword matching index list item process flow diagram in the embodiment of the invention;
Fig. 4 inserts the index entry process flow diagram in the embodiment of the invention;
Fig. 5 is the process flow diagram of the key word of synthetic index in the embodiment of the invention;
Fig. 6 is a keyword search location internal storage data process flow diagram in the embodiment of the invention.
Embodiment
The present invention is in order to solve the drawback that conventional solution exists, further set forth the non-only indexes search method of a kind of internal storage data of the present invention by following specific embodiment, below embodiment is described in detail, but not as a limitation of the invention.
As shown in Figure 1, be the process flow diagram of setting up of memory database non-only indexes of the present invention, it comprises that step is as follows:
As shown in Figure 2, be allocation index internal memory registration table process flow diagram in the invention process use-case.Its concrete steps are as follows:
As shown in Figure 3, be in conjunction with keyword matching index list item process flow diagram in the invention process use-case.Its concrete steps are as follows:
Step 213 if the OTHASH type, is then obtained the log-on message of field by field name, with the index key that generates, according to double byte DWORD types-copy in the buffering of the keyword structure of OTHASH type; And, calculate the entry value of index according to index key, by entry value, calculate the address of index entry; Thereby, and the entry value of index is cached in the registration table according to the queue heads recording mechanism of record in the inlet.
As shown in Figure 4, be to insert the index entry process flow diagram in the invention process use-case.Its concrete steps are as follows:
If the OTHASH type judges that current index queue for empty, then adds 1 with index number, execution in step 223 then;
Step 223 gets nowhere unusually if insert, and then needs the rollback Index Status.
As shown in Figure 5, be the process flow diagram of the key word of synthetic index in the invention process use-case.Its concrete steps are as follows:
Step 311 obtains index at the registration table index information by the index handle, and further obtains internal storage data table handle;
Step 312 is judged the key word synthetic method; If a hash (hash, i.e. HASH Hash), then execution in step 313; If not the OTHASH type, then execution in step 314;
Step 313 is converted to double byte DWORD type with a hash (HASH Hash) key word buffer zone, and each field type is converted to double byte DWORD type successively, composes simultaneously and gives buffer zone, and the flow process of synthetic index key finishes;
Step 314 is converted to STR (string character string) type with the key word buffer zone, and for each key field that need synthesize of definition, execution in step 315 is to step 317;
Step 315 obtains key field number from the index registration table, and judges the validity of recording mechanism;
Step 316 from the META information of internal storage data table, obtains the descriptor of key field, obtains the field length of key field, is used as the side-play amount of composite key in the key word buffer zone.
Step 317 according to the type of key word, is judged key length, if single value obtains key value from variable parameter, and with its unloading entry keyword buffer zone; If array, the variable parameter that will import into converts the respective pointer type to, and carries out memory copying according to address of importing into and key length; At last, temporary pointer is pointed to last position of key word.
As shown in Figure 6, be keyword search location internal storage data process flow diagram in the invention process use-case.Its concrete steps are as follows:
Step 323 is visited this record manipulative indexing item according to the input recording mechanism, obtains next record number from index entry, thereby can obtain next bar recording mechanism that the current index queue of non-only indexes is imported recording mechanism;
Step 324 according to recording mechanism mobile data vernier, can obtain the value of internal storage data.
Certainly; the present invention also can have other various embodiments; under the situation that does not deviate from spirit of the present invention and essence thereof; those of ordinary skill in the art can make various corresponding changes and distortion according to the present invention, but these corresponding changes and distortion all should belong to the protection domain of the appended claim of the present invention.
Claims (7)
1. the non-only indexes search method of an internal storage data is characterized in that, may further comprise the steps:
(1) sets up the required parameter identification of non-only indexes that generates internal storage data, and according to described parameter identification allocation index registration table, calculate the value of the index queue inlet of non-only indexes,, the recording mechanism of index recorded in the index key go for index field adds key tag;
(2) acquisition is recorded in the index match-type in the index registration table, and the recording mechanism that the current vernier of the metadata Meta information acquisition that writes down from the internal storage data table points to then in conjunction with given index key match index item, and is inserted index entry;
(3) synthetic index key, and utilize synthetic index key match index item, Search and Orientation internal storage data.
2. the method for claim 1 is characterized in that, parameter identification described in the step (1) comprises: index match-type, index type, index key length, index key title and the sequence number of index key in table.
3. the method for claim 1 is characterized in that, allocation index registration table in the step (1) is further comprising the steps of:
(1a) from variable parameter one by one obtain the field name that is used for setting up index;
(1b) obtain the log-on message of field by field name, and according to the length and the number of the log-on message computation index key word of field;
(1c) traversal index registry objects is sought a unappropriated registers memory space, the length of internal storage data table handle, index type and the index key of its index handle of initialization, correspondence, and the value of the index queue inlet item of calculating non-only indexes;
(1d) add key tag to index field one by one, the recording mechanism of index is recorded in the index key go.
4. the method for claim 1 is characterized in that, and is described in conjunction with given index key match index item, further comprising the steps of:
(21a) host type of judgement index, if sequential index, execution in step 21b; If Hash OTHASH types index, then an execution in step 21c;
(21b) obtain last index entry by calculating, utilize two fens binary search, when the key word that writes down in the index entry is identical with synthetic key word, then according to the entry value of index entry, obtain the formation dummy argument of index queue, thereby obtain recording mechanism according to the record in the formation dummy argument;
(21c) with the index key that generates, copy to according to two-octet type in the buffering of index key structure of OTHASH type and go; And, calculate the entry value of index according to index key, by entry value, calculate the address of index entry, thereby according to the queue heads recording mechanism of record in the inlet, and the entry value of index is cached in the registration table.
5. method as claimed in claim 4 is characterized in that, described insertion index entry is further comprising the steps of:
(22a) if sequential index, this index entry also exists, and it is long current index data district need to be moved down an index entry, the current index entry entry value of initialization, promptly index dique dummy argument is copied to index entry with key word, and index number added 1, execution in step 22b then;
If the OTHASH type judges that current index queue for empty, then adds 1 with index number, then execution in step 22b;
(22b) when recording indexes is not created, be self index item No., forerunner, follow-up be all zero and the follow-up of index entry dummy argument be not equal to self, the formation dummy argument is cached in the index queue head, then index entry is linked to index queue, and produce new formation dummy argument, the new dummy argument of buffer memory simultaneously, and the index degree of depth added 1;
If (22c) insertion is unsuccessful, then need the rollback Index Status.
6. the method for claim 1 is characterized in that, synthetic index key is further comprising the steps of:
(3a) obtain index at the registration table index information, and further obtain internal storage data table handle by the index handle;
(3b) judge the key word synthetic method, if a hash, then execution in step 3c; If not the OTHASH type, execution in step 3d then;
(3c) a hash key buffer zone is converted to two-octet type, and successively each field type is converted to two-octet type, compose simultaneously and give buffer zone, the flow process of synthetic index key finishes;
(3d) the key word buffer zone is converted to character string type, for each the index key field that need synthesize of definition, execution in step 3e is to step 3g;
(3e) from the index registration table, obtain the index key field number, and judge the validity of recording mechanism;
(3f) from the META information of internal storage data table, obtain the descriptor of key field, obtain the field length of key field, be used as the synthetic side-play amount of index key in the key word buffer zone;
(3g), judge index key length according to the type of index key, if single value, the value of acquisition index key from variable parameter, and with its unloading entry keyword buffer zone; If array, the variable parameter that will import into converts the respective pointer type to, and carries out memory copying according to address of importing into and key length; At last, temporary pointer is pointed to last position of key word.
7. the method for claim 1 is characterized in that, utilizes synthetic index key match index item, and the Search and Orientation internal storage data may further comprise the steps:
(31a) according to synthetic index key, the match index list item obtains the internal storage data recording mechanism;
(31b) the mobile data vernier points to current record, with the value buffer memory temporary space of current record;
(31c) visit this record manipulative indexing item, from index entry, obtain next record number, thereby can obtain next bar recording mechanism that the current index queue of non-only indexes is imported recording mechanism according to the input recording mechanism;
(31d) according to recording mechanism mobile data vernier, obtain the value of internal storage data.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2007101228693A CN101082935B (en) | 2007-07-06 | 2007-07-06 | Non-only indexes search method for internal memory data |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2007101228693A CN101082935B (en) | 2007-07-06 | 2007-07-06 | Non-only indexes search method for internal memory data |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101082935A CN101082935A (en) | 2007-12-05 |
CN101082935B true CN101082935B (en) | 2010-09-29 |
Family
ID=38912504
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2007101228693A Expired - Fee Related CN101082935B (en) | 2007-07-06 | 2007-07-06 | Non-only indexes search method for internal memory data |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101082935B (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2010087575A2 (en) | 2009-02-01 | 2010-08-05 | Lg Electronics Inc. | Broadcast receiver and 3d video data processing method |
CN101609460B (en) * | 2009-07-22 | 2011-12-14 | 中国科学院地理科学与资源研究所 | Searching method of supporting isomeric geoscientific data resources and searching system |
CN102122285B (en) * | 2010-01-11 | 2012-10-31 | 卓望数码技术(深圳)有限公司 | Data cache system and data inquiry method |
CN101944115B (en) * | 2010-09-14 | 2012-07-25 | 杭州海康威视数字技术股份有限公司 | Method and system for searching logs |
CN107967284B (en) * | 2016-10-20 | 2022-07-05 | 北京京东尚科信息技术有限公司 | Method and device for storing and inquiring order information |
CN107562644B (en) * | 2017-08-11 | 2021-02-09 | 记忆科技(深圳)有限公司 | Compression method of solid state disk mapping table |
CN110019221B (en) * | 2017-12-18 | 2022-07-19 | 本无链科技(深圳)有限公司 | Memory mapping type database system |
CN108509625A (en) * | 2018-04-08 | 2018-09-07 | 中国人民解放军63601部队 | A kind of data inactivity table location positioning method |
-
2007
- 2007-07-06 CN CN2007101228693A patent/CN101082935B/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
CN101082935A (en) | 2007-12-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101082935B (en) | Non-only indexes search method for internal memory data | |
JP7407912B2 (en) | How to index and store blockchain data | |
CN107577427B (en) | data migration method, device and storage medium for blockchain system | |
US11899641B2 (en) | Trie-based indices for databases | |
US11106633B2 (en) | DNA-based data center with deduplication capability | |
CN102016789A (en) | Data processing apparatus and method of processing data | |
CN101183363B (en) | Method for unitedly configuring management EMS memory data-base by system table structure | |
CN101727502A (en) | Data query method, data query device and data query system | |
US20080282355A1 (en) | Document container data structure and methods thereof | |
CN105027115A (en) | Query and index over documents | |
US8386526B2 (en) | Coupled node tree backup/restore apparatus, backup/restore method, and program | |
CN103002061B (en) | Method and device for mutual conversion of long domain names and short domain names | |
JP2012174096A (en) | Computer system and data management method | |
CN102193983B (en) | Relation path-based node data filtering method of graphic database | |
US20080244355A1 (en) | Comparing data sets through identification of matching blocks | |
US7376658B1 (en) | Managing cross-store relationships to data objects | |
US20050149472A1 (en) | Reorganization-free mapping of objects in databases using a mapping chain | |
CN101963993B (en) | Method for fast searching database sheet table record | |
CN111259003B (en) | Database establishment method and device | |
CN102193988A (en) | Method and system for retrieving node data in graphic database | |
US8005844B2 (en) | On-line organization of data sets | |
WO2024022330A1 (en) | Metadata management method based on file system, and related device thereof | |
US20240004832A1 (en) | System and method for providing a container environment in a single file | |
US20060184554A1 (en) | System and method for extensible metadata architecture for digital images using in-place editing | |
US20060184576A1 (en) | System and method for extensible metadata architecture for digital images |
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 | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20100929 Termination date: 20160706 |
|
CF01 | Termination of patent right due to non-payment of annual fee |