CN102902727A - Displacement storage method of variable data structure - Google Patents

Displacement storage method of variable data structure Download PDF

Info

Publication number
CN102902727A
CN102902727A CN2012103290844A CN201210329084A CN102902727A CN 102902727 A CN102902727 A CN 102902727A CN 2012103290844 A CN2012103290844 A CN 2012103290844A CN 201210329084 A CN201210329084 A CN 201210329084A CN 102902727 A CN102902727 A CN 102902727A
Authority
CN
China
Prior art keywords
record
index
value
data structure
field
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN2012103290844A
Other languages
Chinese (zh)
Other versions
CN102902727B (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.)
SICHUAN NAXI POWER SUPPLY CO Ltd
SHANGHAI SUNRISE POWER TECHNOLOGY Co Ltd
Original Assignee
SICHUAN NAXI POWER SUPPLY CO Ltd
SHANGHAI SUNRISE POWER TECHNOLOGY 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 SICHUAN NAXI POWER SUPPLY CO Ltd, SHANGHAI SUNRISE POWER TECHNOLOGY Co Ltd filed Critical SICHUAN NAXI POWER SUPPLY CO Ltd
Priority to CN201210329084.4A priority Critical patent/CN102902727B/en
Publication of CN102902727A publication Critical patent/CN102902727A/en
Application granted granted Critical
Publication of CN102902727B publication Critical patent/CN102902727B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a displacement storage method of a variable data structure, which relates to the technical field of data storage and solves the technical problem that the expandability of the data structure is improved, and at the same time the access efficiency of a databank is ensured. The method specifically comprises the steps of: 1) establishing a databank table and establishing six fields in the databank table; 2) establishing the data structure for specific application; 3) storing all structure records of the data structure into the databank table, establishing a databank table record of each table field of each structure record through the databank table, and generating a unique index value for each databank table record. With the adoption of the method provided by the invention, the expandability of the data structure and the access efficiency of the databank are high.

Description

The displacement storage means of changeable data structure
Technical field
The present invention relates to data storage technology, particularly relate to a kind of technology of displacement storage means of changeable data structure.
Background technology
Large-scale database system is used the access efficiency that the data storage capacity is required to reach database and is required all higher, development along with system applies, employed data structure also can constantly be expanded in the system, therefore large-scale database system is used and is required also high to data structure extensibility, but the data structure that adopts in the Database Systems has a lot, how to realize that the efficient access in Large Volume Data storehouse and structure extensibility are the problems of a complexity.
During existing data structure expansion, all be that each data structure is set up a data storage list, again that table data store is related with corresponding table, this data structure extended mode can increase the complicacy of database design, and along with the increasing 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 defective that exists in the above-mentioned prior art, technical matters to be solved by this invention provides the displacement storage means of the high changeable data structure of a kind of data structure extensibility and database access efficient.
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 is characterized in that concrete steps are as follows:
1) sets 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 the application, each data structure all includes at least one literary name section, here n〉0;
Be that each data structure distributes a unique table number, for each literary name section is distributed a unique literary name segment number in the data structure under this literary name section;
That 3) establishes database table TabVar is recorded as the storehouse table record, data structure be recorded as the structure record, then:
All structure records all are stored among the database table TabVar, and every structure record all is assigned a unique recording mechanism in the affiliated data structure of this record;
Among the 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 the index field generates an index value unique in database table TabVar;
The value of table field is the table number of data structure under the structure record;
The value of fragment field is the literary name segment number of literary name section under the 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 the structure record.
Further, in the described step 3, it is as follows that the index field value of every storehouse table record generates step:
3.1) with the field table in this storehouse table record, fragment, tablerec, become a character string newStr according to combinations of values, each field occupies 8 character bits among the character string newStr, inadequate 8 characters fill into character " 0 ", with the uniqueness of the character string newStr that guarantees to be generated;
3.2) to make the value of index field be 24, i=0;
3.3) adopt displacement mode to generate the index field value, its generation formula is:
index = ((index << k0) ^(index >> k1)) ^newStr[i]
In the formula, index is the index field value, newStr[i] be i character among the character string newStr, index<<k0 refers to binary value with the index field k0 position that moves to left, index〉k1 refers to binary value with the index field k1 position that moves to right, symbol " ^ " is the xor operation symbol, k0 is left operation constant, k1 is right operation constant, k0=5 here, k1=27;
3.4) if the i value is returned 4.3 steps after less than 24, then making i increase progressively 1, on the contrary then the index field value is deposited in the index field of storehouse table record.
The displacement storage means of changeable data structure provided by the invention, set up first the database table of 6 fields, set up again data structure, all data structures do not need to set up separately table data store, the data of any one data structure can both be kept in the database table, therefore different data structures had extensibility, only need to set up a database table and can process different data structures, can reduce the complicacy of database design, adapt to different transformable application demands, adopt simultaneously displacement algorithm to come the computation index value, can carry out fast index, guarantee the efficient access of Large Volume Data.
Description of drawings
Fig. 1 is the process flow diagram of displacement storage means of the changeable data structure of the embodiment of the invention.
Embodiment
Below in conjunction with description of drawings embodiments of the invention are described in further detail, but present embodiment is not limited to the present invention, every employing analog structure of the present invention and similar variation thereof all should be listed protection scope of the present invention in.
As shown in Figure 1, the displacement storage means of a kind of changeable data structure that the embodiment of the invention provides is characterized in that concrete steps are as follows:
1) sets 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 the application, each data structure all includes at least one literary name section, here n〉0;
Be that each data structure distributes a unique table number, for each literary name section is distributed a unique literary name segment number in the data structure under this literary name section;
That 3) establishes database table TabVar is recorded as the storehouse table record, data structure be recorded as the structure record, then:
All structure records all are stored among the database table TabVar, and every structure record all is assigned a unique recording mechanism in the affiliated data structure of this record;
Among the 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 the index field generates an index value unique in database table TabVar;
The value of table field is the table number of data structure under the structure record;
The value of fragment field is the literary name segment number of literary name section under the 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 the structure record;
Such as, table number is T 0Data structure 4 literary name sections are arranged, be respectively: ID, frag1, frag2, frag3; If T 0A bar structure record is arranged, then with T 0In structure record all deposit among the database table TabVar after, in database table TabVar, can produce 4A bar data structure T 0The storehouse table record.
In the described step 3 of the embodiment of the invention, it is as follows that the index field value of every storehouse table record generates step:
3.1) with the field table in this storehouse table record, fragment, tablerec, become a character string newStr according to combinations of values, each field occupies 8 character bits among the character string newStr, inadequate 8 characters fill into character " 0 ", with the uniqueness of the character string newStr that guarantees to be generated;
3.2) to make the value of index field be 24, i=0;
3.3) adopt displacement mode to generate the index field value, its generation formula is:
index = ((index << k0) ^(index >> k1)) ^newStr[i]
In the formula, index is the index field value, newStr[i] be i character among the character string newStr, index<<k0 refers to binary value with the index field k0 position that moves to left, index〉k1 refers to binary value with the index field k1 position that moves to right, symbol " ^ " is the xor operation symbol, k0 is left operation constant, k1 is right operation constant, k0=5 here, k1=27;
3.4) if the i value is returned 4.3 steps after less than 24, then making i increase progressively 1, on the contrary then the index field value is deposited in the index field of storehouse table record.
The embodiment of the invention can be accessed each data structure according to table field, fragment field, the tablerec field of each storehouse table record among the database table TabVar, reads the structure record of each data structure;
The embodiment of the invention can calculate according to step 4 the index field value of each storehouse table record among the database table TabVar, again according to the index field value that calculates, from go out database table TabVar, find fast corresponding storehouse table record, realize the efficient access to the data structure.

Claims (2)

1. the displacement storage means of a changeable data structure is characterized in that concrete steps are as follows:
1) sets 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 the application, each data structure all includes at least one literary name section, here n〉0;
Be that each data structure distributes a unique table number, for each literary name section is distributed a unique literary name segment number in the data structure under this literary name section;
That 3) establishes database table TabVar is recorded as the storehouse table record, data structure be recorded as the structure record, then:
All structure records all are stored among the database table TabVar, and every structure record all is assigned a unique recording mechanism in the affiliated data structure of this record;
Among the 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 the index field generates an index value unique in database table TabVar;
The value of table field is the table number of data structure under the structure record;
The value of fragment field is the literary name segment number of literary name section under the 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 the structure record.
2. the displacement storage means of changeable data structure according to claim 1 is characterized in that: in the described step 3, it is as follows that the index field value of every storehouse table record generates step:
3.1) with the field table in this storehouse table record, fragment, tablerec, become a character string newStr according to combinations of values, each field occupies 8 character bits among the character string newStr, inadequate 8 characters fill into character " 0 ", with the uniqueness of the character string newStr that guarantees to be generated;
3.2) to make the value of index field be 24, i=0;
3.3) adopt displacement mode to generate the index field value, its generation formula is:
index = ((index << k0) ^(index >> k1)) ^newStr[i]
In the formula, index is the index field value, newStr[i] be i character among the character string newStr, index<<k0 refers to binary value with the index field k0 position that moves to left, index〉k1 refers to binary value with the index field k1 position that moves to right, symbol " ^ " is the xor operation symbol, k0 is left operation constant, k1 is right operation constant, k0=5 here, k1=27;
3.4) if the i value is returned 4.3 steps after less than 24, then making i increase progressively 1, on the contrary then the index field value is deposited in the index field of storehouse table record.
CN201210329084.4A 2012-09-07 2012-09-07 The displacement storage means of changeable data structure Expired - Fee Related CN102902727B (en)

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 true CN102902727A (en) 2013-01-30
CN102902727B 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)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109299098A (en) * 2018-09-29 2019-02-01 北京理工大学 The storage and its access method of a kind of table of multiple multilayer gauge outfits in the database

Citations (2)

* Cited by examiner, † Cited by third party
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

Patent Citations (2)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
Title
朱庆生: "一种可变数据结构存储处理模型", 《计算机应用》, vol. 24, no. 8, 31 August 2004 (2004-08-31) *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109299098A (en) * 2018-09-29 2019-02-01 北京理工大学 The storage and its access method of a kind of table of multiple multilayer gauge outfits in the database
CN109299098B (en) * 2018-09-29 2022-04-12 北京理工大学 Method for storing and accessing multiple tables with multilayer headers in database

Also Published As

Publication number Publication date
CN102902727B (en) 2016-05-04

Similar Documents

Publication Publication Date Title
CN104346357B (en) The file access method and system of a kind of built-in terminal
CN102096685B (en) Method and device for synchronizing distributive data into data warehouse
CN108984744B (en) Non-main chain block self-growing method
CN102799679B (en) Hadoop-based massive spatial data indexing updating system and method
CN104021123B (en) method and system for data migration
CN106682077A (en) Method for storing massive time series data on basis of Hadoop technologies
CN103793181B (en) A kind of method of data synchronization and data synchronous system of multilayer associated storage framework
CN104615594A (en) Data updating method and device
CN105515997B (en) The higher efficiency range matching process of zero scope expansion is realized based on BF_TCAM
CN105389376B (en) Fragmentation-free multimedia data storage method and system based on continuous blocks
CN103379160A (en) Difference synchronizing method for oversized file
CN104111924A (en) Database system
CN102521312A (en) Storage method of file index, and file system
CN106844288A (en) A kind of random string generation method and device
CN102890719A (en) Method and device for fuzzy research of license plate numbers
CN102567419B (en) Mass data storage device and method based on tree structure
CN103823641B (en) The virtual volume system of a kind of on-line rapid estimation and its implementation
CN106342316B (en) Aeronautical satellite platform high-fidelity satellite simulation general framework system
CN105408893B (en) A kind of data processing and wiring method and relevant apparatus
CN102902727A (en) Displacement storage method of variable data structure
CN102043591B (en) Write operation method for phase-change random access memory (PRAM)
CN105446666A (en) Full digital sequence storage method and system based on mobile terminal
CN104268225A (en) File system architecture for addressing in multidimensional degree of freedom, as well as generating and accessing mode thereof
CN105117169B (en) A kind of method and device of the disk space management of optimization
CN103281383A (en) Timing sequence recording method for distributed-type data source

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: 20160504

Termination date: 20200907

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