CN102902727B - The displacement storage means of changeable data structure - Google Patents
The displacement storage means of changeable data structure Download PDFInfo
- Publication number
- CN102902727B CN102902727B CN201210329084.4A CN201210329084A CN102902727B CN 102902727 B CN102902727 B CN 102902727B CN 201210329084 A CN201210329084 A CN 201210329084A CN 102902727 B CN102902727 B CN 102902727B
- Authority
- CN
- China
- Prior art keywords
- record
- index
- field
- value
- data structure
- 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
Abstract
A displacement storage means for changeable data structure, relates to technical field of data storage, and what solve is when improving data structure extensibility, ensures the technical problem of database access efficiency. The concrete steps of the method are as follows: 1) set up a database table, and in database table, set up 6 fields; 2) for data structure is set up in concrete application; 3) the structure record of all data structures is all stored in database table, database table is that each literary name section of every structure record is set up a storehouse table record, and is that every storehouse table record generates a unique index value. Method provided by the invention, data structure extensibility and database access efficiency are high.
Description
Technical field
The present invention relates to data storage technology, particularly relate to a kind of skill of displacement storage means of changeable data structureArt.
Background technology
Large-scale database system application requires and the access efficiency of database is required all higher to database volume, withThe development of system applies, the data structure using in system also can constantly be expanded, therefore large database systemSystem application requires also high to data structure extensibility, but the data structure adopting in Database Systems has a lot,The efficient access and the structure extensibility that how to realize Large Volume Data storehouse are complicated problems.
When existing data structure expansion, be all that each data structure is set up a table data store, then by dataStorage list is associated with corresponding table, and this data structure extended mode can increase the complexity of database design, Er QiesuiIncreasing and the increase of memory data output of table data store quantity, can cause the access efficiency of database obviously to reduce.
Summary of the invention
For the defect existing in above-mentioned prior art, technical problem to be solved by this invention is to provide a kind of dataThe displacement storage means of the changeable data structure that structure extensibility and database access efficiency are high.
In order to solve the problems of the technologies described above, the displacement storage means of a kind of changeable data structure provided by the present invention,It is characterized in that, concrete steps are as follows:
1) set up a database table TabVar, and in database table TabVar, set up 6 fields and be respectively:ID,index,table,fragment,tablerec,varvalue;
2) set up n data structure for concrete application, each data structure all includes at least one literary name section, thisIn n > 0;
For each data structure is distributed a unique table number, for one of each table field distribution is under this literary name sectionUnique literary name segment number in data structure;
3) that establishes database table TabVar is recorded as storehouse table record, data structure be recorded as structure record:
All structure records are all stored in database table TabVar, and every structure record is all assigned one in this noteUnique recording mechanism in data structure under record;
In database table TabVar, for each literary name section of every structure record is set up a storehouse table record, every storehouseIn table record:
For id field is distributed an ID numbering unique in database table TabVar;
For index field generates an index value unique in database table TabVar;
The value of table field is the table number of data structure under structure record;
The value of fragment field is the literary name segment number of literary name section under structure record;
The value of tablerec field is the recording mechanism of structure record;
The value of varvalue field is the value of literary name section under structure record.
Described 3), in, it is as follows that the index field value of every storehouse table record generates step:
3.1) by the field table in this storehouse table record, fragment, tablerec, becomes according to combinations of valuesOne character string newStr, in character string newStr, each field occupies 8 character bits, the benefit of inadequate 8 charactersEnter character " 0 ", the uniqueness of the character string newStr being generated to ensure;
3.2) making the value of index field is 24, i=0;
3.3) adopt displacement mode to generate index field value, its generation formula is:
index=((index<<k0)^(index>>k1))^newStr[i]
In formula, index is index field value, newStr[i] be i character in character string newStr,Index<<k0 refers to the binary value of the index field k0 position that moves to left, index>>k1 refers to indexThe binary value of the field k1 position that moves to right, symbol " ^ " is xor operation symbol, and k0 is left operation constant, and k1 is right behaviourMake constant, k0=5 here, k1=27;
3.4) if i value is less than 24, return to 3.3 steps after making i increase progressively 1, otherwise by index fieldValue deposits the index field of storehouse table record in.
The displacement storage means of changeable data structure provided by the invention, first sets up the database table of 6 fields, then buildsVertical data structure, all data structures do not need to set up separately table data store, any one data structureData can be kept in database table, therefore different data structures are had to extensibility, only need to set upA database table can be processed different data structures, can reduce the complexity of database design, adapts to differentTransformable application demand adopts displacement algorithm to carry out computation index value simultaneously, can carry out fast index, ensuresThe efficient access of Large Volume Data.
Brief description of the drawings
Fig. 1 is the flow chart of the displacement storage means of the changeable data structure of the embodiment of the present invention.
Detailed description of the invention
Below in conjunction with brief description of the drawings, embodiments of the invention are described in further detail, but the present embodiment being not used inRestriction the present invention, every employing analog structure of the present invention and similar variation thereof, all should list protection model of the present invention inEnclose.
As shown in Figure 1, the displacement storage means of a kind of changeable data structure that the embodiment of the present invention provides, its spyLevy and be, concrete steps are as follows:
1) set up a database table TabVar, and in database table TabVar, set up 6 fields and be respectively:ID,index,table,fragment,tablerec,varvalue;
2) set up n data structure for concrete application, each data structure all includes at least one literary name section, thisIn n > 0;
For each data structure is distributed a unique table number, for one of each table field distribution is under this literary name sectionUnique literary name segment number in data structure;
3) that establishes database table TabVar is recorded as storehouse table record, data structure be recorded as structure record:
All structure records are all stored in database table TabVar, and every structure record is all assigned one in this noteUnique recording mechanism in data structure under record;
In database table TabVar, for each literary name section of every structure record is set up a storehouse table record, every storehouseIn table record:
For id field is distributed an ID numbering unique in database table TabVar;
For index field generates an index value unique in database table TabVar;
The value of table field is the table number of data structure under structure record;
The value of fragment field is the literary name segment number of literary name section under structure record;
The value of tablerec field is the recording mechanism of structure record;
The value of varvalue field is the value of literary name section under structure record;
Such as, table number is T0Data structure have 4 literary name sections, be respectively: ID, frag1, frag2, frag3;If T0There is A bar structure record, by T0In structure record all deposit in database table TabVar after,In database table TabVar, can produce 4A bar data structure T0Storehouse table record.
In the described step 3 of the embodiment of the present invention, it is as follows that the index field value of every storehouse table record generates step:
3.1) by the field table in this storehouse table record, fragment, tablerec, becomes according to combinations of valuesOne character string newStr, in character string newStr, each field occupies 8 character bits, the benefit of inadequate 8 charactersEnter character " 0 ", the uniqueness of the character string newStr being generated to ensure;
3.2) making the value of index field is 24, i=0;
3.3) adopt displacement mode to generate index field value, its generation formula is:
index=((index<<k0)^(index>>k1))^newStr[i]
In formula, index is index field value, newStr[i] be i character in character string newStr,Index<<k0 refers to the binary value of the index field k0 position that moves to left, index>>k1 refers to indexThe binary value of the field k1 position that moves to right, symbol " ^ " is xor operation symbol, and k0 is left operation constant, and k1 is right behaviourMake constant, k0=5 here, k1=27;
3.4) if i value is less than 24, return to 3.3 steps after making i increase progressively 1, otherwise by index fieldValue deposits the index field of storehouse table record in.
The embodiment of the present invention can be according to table field, the fragment of each storehouse table record in database table TabVarField, tablerec field are accessed each data structure, read the structure record of each data structure;
The embodiment of the present invention can calculate according to step 4 the index field of each storehouse table record in database table TabVarValue, then according to the index field value calculating, from go out database table TabVar, find fast corresponding storehouse souvenirRecord, realizes the efficient access to data structure.
Claims (1)
1. a displacement storage means for changeable data structure, is characterized in that, concrete steps are as follows:
1) set up a database table TabVar, and in database table TabVar, set up 6 fields and be respectively: ID, index, table, fragment, tablerec, varvalue;
2) set up n data structure for concrete application, each data structure all includes at least one literary name section, here n > 0;
For each data structure is distributed a unique table number, it is one of each table field distribution unique literary name segment number in data structure under this literary name section;
3) that establishes database table TabVar is recorded as storehouse table record, data structure be recorded as structure record:
All structures record is all stored in database table TabVar, and every structure record is all assigned a unique recording mechanism in data structure under this record;
In database table TabVar, for each literary name section of every structure record is set up a storehouse table record, in every storehouse table record:
For id field is distributed an ID numbering unique in database table TabVar;
For index field generates an index value unique in database table TabVar;
The value of table field is the table number of data structure under structure record;
The value of fragment field is the literary name segment number of literary name section under structure record;
The value of tablerec field is the recording mechanism of structure record;
The value of varvalue field is the value of literary name section under structure record;
Described 3), in, it is as follows that the index field value of every storehouse table record generates step:
3.1) by the field table in this storehouse table record, fragment, tablerec, become a character string newStr according to combinations of values, in character string newStr, each field occupies 8 character bits, inadequate 8 characters fill into character " 0 ", the uniqueness of the character string newStr being generated to ensure;
3.2) making the value of index field is 24, i=0;
3.3) adopt displacement mode to generate index field value, its generation formula is:
index=((index<<k0)^(index>>k1))^newStr[i]
In formula, index is index field value, newStr[i] be i character in character string newStr, index<<k0 refers to the binary value of the index field k0 position that moves to left, index>>k1 refers to that symbol " ^ " is xor operation symbol by the binary value of the index field k1 position that moves to right, k0 is left operation constant, k1 is right operation constant, k0=5 here, k1=27;
3.4), if i value is less than 24, returns to 3.3 steps after making i increase progressively 1, otherwise index field value is deposited in to the index field of storehouse table record.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210329084.4A CN102902727B (en) | 2012-09-07 | 2012-09-07 | The displacement storage means of changeable data structure |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210329084.4A CN102902727B (en) | 2012-09-07 | 2012-09-07 | The displacement storage means of changeable data structure |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102902727A CN102902727A (en) | 2013-01-30 |
CN102902727B true CN102902727B (en) | 2016-05-04 |
Family
ID=47574960
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210329084.4A Expired - Fee Related CN102902727B (en) | 2012-09-07 | 2012-09-07 | The displacement storage means of changeable data structure |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102902727B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109299098B (en) * | 2018-09-29 | 2022-04-12 | 北京理工大学 | Method for storing and accessing multiple tables with multilayer headers in database |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102169460A (en) * | 2010-02-26 | 2011-08-31 | 航天信息股份有限公司 | Method and device for managing variable length data |
US8069184B2 (en) * | 2006-12-29 | 2011-11-29 | Sap Ag | Systems and methods to implement extensibility of tenant content in a provider-tenant environment |
-
2012
- 2012-09-07 CN CN201210329084.4A patent/CN102902727B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8069184B2 (en) * | 2006-12-29 | 2011-11-29 | Sap Ag | Systems and methods to implement extensibility of tenant content in a provider-tenant environment |
CN102169460A (en) * | 2010-02-26 | 2011-08-31 | 航天信息股份有限公司 | Method and device for managing variable length data |
Non-Patent Citations (1)
Title |
---|
一种可变数据结构存储处理模型;朱庆生;《计算机应用》;20040831;第24卷(第8期);正文第69页第1栏倒数第2段-70页第2栏第4段,第71页第2栏第6-10段,第75页第1段,图1 * |
Also Published As
Publication number | Publication date |
---|---|
CN102902727A (en) | 2013-01-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104346357B (en) | The file access method and system of a kind of built-in terminal | |
CN103177127B (en) | Based on CD server database storage system and utilize the method for this system | |
CN101799783A (en) | Data storing and processing method, searching method and device thereof | |
CN103793181B (en) | A kind of method of data synchronization and data synchronous system of multilayer associated storage framework | |
CN103473314A (en) | Key value pair storing method and device based on shared memory | |
CN102831072B (en) | Flash memory device and management method, data read-write method and read-write equipment | |
CN103002061B (en) | Method and device for mutual conversion of long domain names and short domain names | |
CN106682077A (en) | Method for storing massive time series data on basis of Hadoop technologies | |
CN104731515B (en) | Control the method and apparatus of storage device group of planes abrasion equilibrium | |
CN103379160A (en) | Difference synchronizing method for oversized file | |
CN104111924A (en) | Database system | |
CN105389376B (en) | Fragmentation-free multimedia data storage method and system based on continuous blocks | |
CN105718218A (en) | Compressed storage method and system applicable for load records of electric energy meter or concentrator | |
CN103049224A (en) | Method, device and system for importing data into physical tape | |
CN104714894A (en) | Layered phase-change memory abrasion equilibrating method and system based on random mapping | |
CN103136244A (en) | Parallel data mining method and system based on cloud computing platform | |
CN102609358B (en) | Method for aggregating static data and solid-state disk thereof | |
CN103678158A (en) | Optimization method and system for data layout | |
CN102097125B (en) | Phase-memory write operation method | |
CN103544124B (en) | The access method of Nand flash storages | |
CN102520885B (en) | Data management system for hybrid hard disk | |
CN103617124B (en) | Flash memory management method and device | |
CN103744744A (en) | Data storage device and data checking method of volatile storage | |
CN104166627B (en) | A kind of SCM Based NAND FLASH write operation methods | |
CN102902727B (en) | The displacement storage means of changeable data structure |
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 | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20160504 Termination date: 20200907 |