CN108073709A - A kind of operating method of data record, device, equipment and storage medium - Google Patents
A kind of operating method of data record, device, equipment and storage medium Download PDFInfo
- Publication number
- CN108073709A CN108073709A CN201711386517.9A CN201711386517A CN108073709A CN 108073709 A CN108073709 A CN 108073709A CN 201711386517 A CN201711386517 A CN 201711386517A CN 108073709 A CN108073709 A CN 108073709A
- Authority
- CN
- China
- Prior art keywords
- field
- data
- record
- extended
- length
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2282—Tablespace storage structures; Management thereof
Abstract
The embodiment of the invention discloses a kind of operating method of data record, device, equipment and storage mediums.Wherein, this method includes:In record organization and parsing, by the corresponding extended field of row that modification table structure operation is added with building table when the corresponding original field of original row distinguished.Particular content includes:The record organization of table describes where obtaining data record, and record organization description obtains the number that original row and addition arrange in table, and the number arranged according to the number of original row with other additions before addition row, determines the physical label of extended field;The sum of the sum of data length according to original field and data length of other extended fields before extended field determine the data-bias of extended field;According to the physical label and data-bias of extended field, by field data sequential organization into data record.The technical solution of the embodiment of the present invention when table is added and arranged, only operates data dictionary, need not rebuild data, improves the efficiency of table addition row.
Description
Technical field
The present embodiments relate to database processing field more particularly to a kind of operating method of data record, device, set
Standby and storage medium.
Background technology
It is that carry out tissue according to the order of table definition column each that the row of data list, which records most common method for organizing, in database
A field, we term it sequential organization methods, and also method, will according to the order for becoming long type after first fixed length in field in a organized way
The field of fixed length type and the field of change long type concentrate in together respectively, and the tissue order of field in record is adjusted,
We are known as sequencing method for organizing.For example, the definition of table TAB is (C1 VARCHAR (10), C2 INT, C3 VARBINARY
(10),C4 INT);Method for organizing in sequence, the order of field is C1, C2, C3, C4, according to sequencing method for organizing, table TAB
Middle C2, C4 row are fixed length, and C1, C3 row are elongated, and the order of field is C2, C4, C1, C3.
Compared with sequential organization method, in all records using sequencing method for organizing tissue, regardless of elongated data
Value, position is fixed to the field of fixed length type in record, can be which fixed length according to it in data access
Field obtains its data-bias in record, it is not necessary to travel through preamble field from the beginning, can effectively improve number in record
According to the speed of access.
But when table is added and arranged, sequencing method for organizing Shortcomings.It is new plus be listed in record that corresponding data field can
Can not subsequent field can be omitted between other fields according to record length, so for the data being presently in existence, added
It has to rebuild data when adding row, this can cause tables of data addition row operation to generate substantial amounts of IO, and efficiency is very low.
The content of the invention
An embodiment of the present invention provides a kind of operating method of data record, device, equipment and storage mediums so that ensures
On the premise of majority of case data access speed, in table addition row where data record, it is only necessary to which data dictionary is carried out
Operation, it is not necessary to rebuild data, improve the efficiency of table addition row.
In a first aspect, an embodiment of the present invention provides a kind of operating method of data list, this method includes:
The corresponding record organization description of data record is obtained, the record organization description obtains table where the data record
In the number of original row and addition row, and according to the numbers of the original row and of other addition row before the addition row
Number, determines the physical label of extended field in the data record, and the extended field adds in the table where the data record
Add the corresponding field of row;
The data length of original field and extended field in the data record is obtained, according to the data of the original field
The sum of the sum of length and data length of other extended fields before the extended field, determine that the data of the extended field are inclined
It moves, the original field is original in the table where the data record to arrange corresponding field;
According to the physical label and data-bias of each extended field, by the data order tissue of each extended field to institute
It states in data record.
Second aspect, an embodiment of the present invention provides a kind of operating device of data list, which includes:
Tissue description acquisition module, for obtaining the corresponding record organization description of data record, the record organization description
The number of original row and addition row in table where obtaining the data record, and the number according to the original row and the addition
The number of other addition row, determines the physical label of extended field in the data record, the extended field is institute before row
Addition arranges corresponding field in table where stating data record;
Data-bias determining module, for obtaining the data length of original field and extended field in the data record,
The sum of the sum of data length according to the original field and data length of other extended fields before the extended field, really
The data-bias of the fixed extended field, the original field is original in the table where the data record to arrange corresponding field;
Data organisation module, for the physical label and data-bias according to each extended field, by each extended field
Data order tissue into the data record.
The third aspect, an embodiment of the present invention provides a kind of equipment, which includes:
One or more processors;
Storage device, for storing one or more programs;
When one or more of programs are performed by one or more of processors so that one or more of processing
Device realizes the operating method of the data record described in any embodiment of the present invention.
Fourth aspect, an embodiment of the present invention provides a kind of computer readable storage mediums, are stored thereon with computer journey
Sequence realizes the operating method of the data record described in any embodiment of the present invention when the program is executed by processor.
Operating method, device, equipment and the storage medium of a kind of data record provided in an embodiment of the present invention, pass through setting
The physical label of extended field is corresponded in record organization description, and according to the data-bias of extended field in data record, in original
All extended fields of sequential organization after beginning field, original field still using sequencing mode tissue data, ensure that most of feelings
The speed of data access under condition;And after addition row, already existing data record can be by the value solution of its extended field before
It analyses as NULL, so when table adds row operation, only data dictionary is operated, data need not be rebuild, table is improved and add
Add the efficiency of row.
Description of the drawings
Fig. 1 is a kind of flow chart of the operating method for data record that the embodiment of the present invention one provides;
Fig. 2 is the method flow diagram that record organization description is generated in method provided by Embodiment 2 of the present invention;
Fig. 3 is a kind of flow chart of the operating method for data record that the embodiment of the present invention three provides;
Fig. 4 is the method flow diagram that data record is organized in the method that the embodiment of the present invention three provides;
Fig. 5 is the method flow diagram that data record is parsed in the method that the embodiment of the present invention four provides;
Fig. 6 is the method flow diagram that data record is parsed in the method that the embodiment of the present invention four provides;
Fig. 7 is a kind of structure diagram of the operating device for data record that the embodiment of the present invention five provides;
Fig. 8 is a kind of structure diagram for equipment that the embodiment of the present invention six provides.
Specific embodiment
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched
The specific embodiment stated is used only for explaining the present invention rather than limitation of the invention.It also should be noted that in order to just
Part related to the present invention rather than entire infrastructure are illustrated only in description, attached drawing.
Embodiment one
Fig. 1 is a kind of flow chart of the operating method for data record that the embodiment of the present invention one provides, and the present embodiment can fit
The situation of tissue and parsing is carried out for any data record to row storage mode in database technology.The present embodiment provides
The operating method of data record a kind of can be performed by the operating device of data record, the device can by software and/
Or the mode of hardware is realized, and be integrated in the equipment for performing this method, the equipment for performing this method in the present embodiment can
Be tablet computer, desktop computer and notebook etc. any one can be to intelligent terminal that data record is operated.Specifically,
With reference to figure 1, this method specifically comprises the following steps:
S110 obtains the corresponding record organization description of data record.
Specifically, data record is the row record in table structure.In order to add row in the table where data record, and do not have to
Data are rebuild, it is necessary to obtain the number of original row when table defines, and Xin Jialie is added after original row.When table is added and arranged,
It needs to modify to the object in data dictionary, specifically, data dictionary refers to the data item, data structure, number to data
It is defined and describes according to stream, data storage, processing logic, external entity etc., the purpose is to each in table where data record
Logical identifier, row name, storage class and length of row etc. are described in detail.Further, after table addition row, in data word
Each addition row are illustrated in allusion quotation, using the number of original row as the logical identifier of first addition row in data dictionary
It is recorded, and successively increases logical identifier and carry out the remaining addition row of corresponding record, and recorded addition and arrange corresponding row name, storage
The information such as type and length.Preferably, in order to distinguish original row in table and addition row, can in data dictionary to it is each arrange into
A distinguishing identifier is correspondingly arranged during row description, for example, original row are identified by character " 0 ", addition row pass through character
" 1 " is identified.
Further, when needing to carry out the data in the data record in table in tissue or parsing, it is necessary to according to data
Information in dictionary generates the record organization description of the table.Specifically, record organization description according in data dictionary in the table
The description generation of each column information is the internal storage structure of aid in tissue and parsing data record in database.Further, this implementation
Record organization description in example obtains original row in table and adds row according to the description to each column information in table in data dictionary
Number, and according to the number of original row and the number of other addition row before addition row, determine extended field in data record
Physical label.Specifically, physical label represents that field is stored in the actual order in data record, it is preferred that physical label can
Think physics ID of the field in data record, correspondingly, when table defines where data record the field respective column order
For the logical identifier of field, it is preferred that the logical identifier of field can be that the field is corresponding when table defines in data record
The logic ID of row.For example, the logic ID for the corresponding field that C1 is listed in data record is 0 in table TAB above, physics ID is 2.Tool
Body, the column information in record organization description table according to where data record retouches each field information in data record
It states, wherein the field number in data record, each field information array and the logic for recording field in physical format can be included
ID arrays.Further, record organization description in data dictionary according to, to the distinguishing identifier respectively arranged in table where data record, obtaining
Wherein it is original row and addition row number, and pass through sequencing method for organizing generation for it is original be listed in it is corresponding in data record
The description information of original field determines that addition is listed in the physical label of corresponding extended field in data record, wherein, extend word
Addition in section table where data record is listed in corresponding field in data record.It is specifically, each in each field information array
Field is arranged according to corresponding logic ID, can include in the information array of each field the physics ID of field, data type and
The contents such as ciphered compressed information;Each field physics ID and the correspondence of logic ID are registered in record logic ID array.Into
One step, record organization description generates when the data in data record are carried out with tissue or parsing according to data dictionary,
When need not the data in data record be carried out with tissue or parsing, corresponding record organization description, section can be accordingly deleted
About resource.
Further, when tissue or parsing are carried out to the field data in data record, first according to right in data dictionary
The description of each column information in table where data record, the original row distinguished according to distinguishing identifier in table are arranged with addition, and are led to
The physical label that sequencing method for organizing determines original row is crossed, according to the number of original row and of other addition row before addition row
Number determines the physical label of addition row, records each field physics ID and the correspondence of logic ID, and generation record organization is retouched
It states.When carrying out tissue or parsing to the field data in data record, the record organization that the data record corresponds to generation is obtained
Description.
S120 obtains the data length of each original field and extended field in data record, according to the number of original field
According to the sum of the sum of length and data length of other extended fields before extended field, the data-bias of extended field is determined.
Specifically, when carrying out tissue to the data in data record in table, the corresponding record of the data record is obtained first
Tissue description, when getting corresponding record organization and describing, has also determined that the physical label of each field in data record.
During data record tissue data, on the premise of majority of case data access speed is ensured, in order to add row when need not rebuild
Data are, it is necessary to by after the data organization of extended field to original field, in order to determine each extended field in data record
Position, then need to obtain the data length of each original field and each extended field in data record, so that it is determined that extension
Data-bias of the field in data record.
Further, original field can include fixed-length field and variable-length field, correspondingly, original row can include fixed length
Row and change long line, specifically, fixed-length field is long to define the fixed data determined during the table of data record place according to data type
Degree is listed in corresponding field in the data record, can be long with self-defining data when variable-length field is defines data record place table
Degree is listed in corresponding field in the data record, for example, the definition of table TAB is (C1 VARCHAR (10), C2 INT, C3
VARBINARY (10), C4 INT), wherein, the data in C2 row and C4 row are shape data, occupy 4 bytes, are in table TAB
Fixed length row, the corresponding field in data record is fixed-length field, and the data in C1 row are character data, in data record
Corresponding field can store the character string of variable-length, the byte number occupied self-defined can change, and the data in C3 row are
Binary data, the corresponding field in data record can store the binary number of variable-length, and the byte number occupied can be with
Self-defined change, C1 row and C3 row are the change long lines in table TAB, and the corresponding field in data record is variable-length field.Into one
Step, the data length that fixed length arranges in original row when table where record organization description can also obtain data record defines, due to
Original field in data record is by sequencing method for organizing according to order elongated after first fixed length come tissue, it is possible to according to
The sum of data length of fixed length row determines the data-bias of first change long line in table, so that it is determined that first change in data record
The data-bias of long field, wherein, first elongated data that are listed in is remembered in first variable-length field table where data record
Corresponding field in record.Further, record organization description can also include data record in original field number, fixed-length word
The data-bias of section number and first variable-length field, the data that field can also be included in the information array of each field are inclined
It moves.Wherein, since record organization description is generated according to data dictionary, field data, therefore field information number are not related to
Data-bias in group is only effective to the fixed-length field in original field, is position of the field in data record.
Further, when carrying out tissue to the field data in data record, it is corresponding that the data record is obtained first
The data of original field in data record are carried out group by the physical label of field by sequencing method for organizing in record organization description
It knits, in order to determine position of the extended field in data record, obtains each original field and each extension word in data record
The data length of section, and the data length of the sum of data length according to original field and other extended fields before extended field
The sum of, determine data-bias of each extended field in data record.
S130, according to the physical label and data-bias of each extended field, by the data order group of each extended field
It knits in data record.
Specifically, tissue is carried out by sequencing method for organizing to the data of the original field in data record, for extension
Field after the physical label of each extended field and data-bias is determined, obtains the last one non-NULL in extended field
The corresponding field value order of extended field since the physics ID of first extended field, is added to this by the physics ID of data
Extended field is in data record at corresponding data offset locations, to the last until the physics ID of a non-NULL data.
Further, the data order tissue of each extended field is included to data record:Foundation record format will
Extended field area in the data order tissue to data record of each extended field.
Specifically, the present embodiment is defined the record format that data organization is carried out in data record, as shown in table 1,
In the database, data record is generally divided into record head, data portion and record tail three parts.
Table 1
Wherein, length, the control information and other information of each field of record are registered in record head;Data portion
On the basis of the fixed-length field area of sequencing method for organizing and variable-length field area, extended field area is with the addition of;Record tail registration one
A little verifications or additional information.
Record length, control information and the data portion in record head are focused particularly in the embodiment of the present invention, is not related to annotation
Record the other content and record tail in head.
Specifically, the record length in record head is the total length entirely recorded;Whether control information includes each field
For NULL, the information such as whether compress, therefore the control information of field and few, several bits (bit) can represent to finish, institute
The control information for having field, which concentrates in together, can be concentrated in a few byte, reduce the space used.Wherein, remember
Control information in record head only includes the control information of original field in data portion, not including respectively being extended in extended field area
The control information of field.In the present embodiment, whether the field information of concern is is NULL and whether compresses, therefore each field use
2bit is controlled, and illustratively, control information is represented by 00,01,10, wherein, 00 is expressed as NULL, and 01 represents non-
NULL, 10 represent non-NULL compressions.
Further, data portion is the field value of each field data, specifically, fixed-length field area includes fixed-length field
Value;Variable-length field area includes the data length and field value of variable-length field;Control information of the extended field area including extended field,
Data length and field value.Wherein, the control information of original field is registered in record head in the fixed-length field area of data portion
Fixed-length word segment value, the data length of fixed-length field need not register, and the data length and word of variable-length field are registered by variable-length field area
Segment value.Further, there are its value space, the length in space in fixed-length field area no matter whether its value is NULL in data portion
For the length of the data type of the fixed-length field, and if the variable-length word segment value in variable-length field area is NULL, do not have in data portion
There is its value space.Further, in extended field area, if some extended field and its fields all afterwards are all NULL,
These fields need not be write in record, if intermediate extended field is NULL, no matter whether the extended field is fixed length, all
Only control information part, without subsequent value space.
Further, the physics ID of the last one non-NULL data in acquisition extended field is described according to record organization, from
The physics ID of first extended field starts, and the corresponding field value of extended field is arrived according to the record format sequential organization of definition
In the extended field area of data record at corresponding data offset locations, to the last the physics ID of a non-NULL data is
Only.
The technical solution of the present embodiment corresponds to the physical label of extended field, and root by setting in record organization description
According to the data-bias of extended field in data record, all extended fields of sequential organization after original field, original field is still
Using sequencing mode tissue data, the speed of in most cases data access ensure that;And it after addition row, deposits before
Data record the value of its extended field can be resolved to NULL, so table add row operation when, only to data dictionary
It is operated, data need not be rebuild, improve the efficiency of table addition row.
Embodiment two
Fig. 2 is the method flow diagram that record organization description is generated in method provided by Embodiment 2 of the present invention.It is of the invention real
Example is applied second is that on the basis of above-described embodiment, the flow described to the record organization generated according to data dictionary is further shown
Example property explanation.
As shown in Fig. 2, record organization description is automatically generated according to the data dictionary of database, generation step is roughly divided into two
Step.
The first step travels through the field object of all row in the data record place table after addition extended field, fills each word
The information of section.For original field, the sum of the number of fixed-length field and data length in field are counted before the field.Wherein,
If fixed-length field, numbers of its physics ID for fixed-length field before the field, fixed length before data-bias is the field are set
The sum of data length of field;If variable-length field, it is -1 temporarily to set its physics ID, and data-bias does not calculate.For extension
Field registers the field corresponding column information in table where data record, and physics ID is equal to corresponding logic ID, that is,
On the basis of the number of original field according to the field before the number of extended field sequentially increase;Second step remembers data
After all row are all disposed in table where record, then the original field in field information array is traveled through, wherein variable-length word is set
The physics ID of section.
Specifically, generation record organization description in can include data record in field number, original field number,
The logic of field in fixed-length field number, first variable-length field data-bias, each field information array and record physical format
ID arrays.Wherein, first variable-length field data-bias is the sum of data length of fixed-length field in original field;Record logic
The corresponding logic ID of order after each field of ID array representations is arranged according to corresponding physics ID.
For example, table TAB is defined as (C1VARCHAR (10), C2INT, C3VARBINARY (10), C4INT), arranged in addition
After C5INT, C6VARBINARY, when carrying out tissue to the data record in table TAB, the description of the record organization of generation it is interior
Hold as shown in table 2.
Table 2
The technical solution of the present embodiment corresponds to the physical label of extended field, and root by setting in record organization description
According to the data-bias of extended field in data record, all extended fields of sequential organization after original field, original field is still
Using sequencing mode tissue data, the speed of in most cases data access ensure that;And it after addition row, deposits before
Data record the value of its extended field can be resolved to NULL, so table add row operation when, only to data dictionary
It is operated, data need not be rebuild, improve the efficiency of table addition row.
Embodiment three
Fig. 3 is a kind of flow chart of the operating method for data record that the embodiment of the present invention three provides.The present embodiment be
The method for organizing of each field data in data record is optimized on the basis of above-described embodiment.Referring to Fig. 3, the present embodiment
Method specifically includes:
S210 according to the original field of sequencing mode tissue, and determines the data-bias of first extended field.
Specifically, when carrying out tissue to each field data in data record, according to the mode of sequencing tissue registration, first
The data-bias of a variable-length field does not change.Further, according to the data length of each variable-length field in original field
Determine the sum of data length of variable-length field, since the data-bias of first variable-length field, sequential organization variable-length field
Data, and the sum of data length of the data-bias of first variable-length field in being described according to record organization and variable-length field,
Determine the data-bias of first extended field.
S220, it is long according to the data of other extended fields before the data-bias of first extended field and extended field
The sum of degree determines the data-bias of extended field.
Specifically, after the data-bias of definite first extended field, tissue is carried out to the data of all extended fields, it is first
The sum of data length of other extended fields before the extended field is first determined according to the data length of each extended field.Into
One step, according to the data length of other extended fields before the data-bias of first extended field and the extended field it
With determine the data-bias of the extended field, determine all extended fields in data record successively according to same method
Data-bias.
S230, according to the physical label and data-bias of each extended field, according to record format by each extended field
Data order tissue to data record in extended field area.
The technical solution of the present embodiment, it is suitable after original field according to the data-bias of extended field in data record
All extended fields of sequence tissue, original field still using sequencing mode tissue data, ensure that in most cases data access
Speed, and add row after, the value of its extended field can be resolved to NULL by already existing data record before, in table
During addition row operation, only data dictionary is operated, data need not be rebuild, improve the efficiency of table addition row.
Further, the method for organizing of each field data in the data record after increase extended field is further shown
Example property description.Tissue is carried out to each field data in the data record after increase extended field, is exactly to table where data record
Data record after addition row reorganizes.
Specifically, the method for organizing of each field data is according to each field in data record in data record in the present embodiment
Physical sequential, i.e., the physics ID of each field, according to field all in the method tissue data record specified in record format
Data are sequentially written to according to corresponding physics ID in data record.As shown in figure 4, the step of data record tissue, is substantially such as
Under:
The first step organizes original field data according to physics ID, fills in the fixed-length field area of data portion in data record
With the data in variable-length field area, and corresponding control information is set in record head;Second step obtains the last one in extended field
The physics ID of non-NULL fields is set to finally need the physics ID for writing data in record;3rd step, from first expansion
Until the physics ID of exhibition field starts to need the physics ID for writing data to the end, the field information in being described according to record organization
The data-bias of extended field is gradually calculated, data therebetween is organized, corresponding field value is sequentially written in data record.
Illustratively, table TAB is defined as (C1 VARCHAR (10), C2 INT, C3 VARBINARY (10), C4 INT),
When being wherein not added with row, the organized formats of the data record (' c1_value ', 2, ' c3_value ', 4) of table TAB are as shown in table 3.
Table 3
After table TAB adds row C5 INT, C6 VARBINARY, the data record of table TAB (' c1_value ', 2,
' c3_value ', 4, NULL, NULL) organized formats it is still as shown in table 3.Data record (NULL, the NULL, ' c3_ of table TAB
Value ', 4, NULL, 0x1234) organized formats it is as shown in table 4.
Table 4
Example IV
Fig. 5 is the method stream that data record is parsed in a kind of operating method for data record that the embodiment of the present invention four provides
Cheng Tu.On the basis of above-described embodiment, the embodiment of the present invention further includes:Data record to be resolved in being described according to record organization
The physical label of middle field parses the field in data record to be resolved, obtains the field value of field.
Specifically, when user needs to parse data record, described according to the corresponding record organization of data record to be resolved
In each field physical label, that is, physics ID parses the field in data record to be resolved.Wherein the field includes treating
Parse each field or specific field in data record.Specifically, the service condition after being parsed according to data record, will parse
Field in data record to be resolved is divided into each field sequentially parsed in data record to be resolved, obtains the word of each field
Segment value and this is listed in corresponding specific field in data record to be resolved according to the row identification (RNC-ID) analytic of setting, obtains this and specifies
The field value of field.Further, when sequentially parsing each field in data record to be resolved, since start field, obtain
The field value of the field is taken, and data pointer to be resolved is gradually moved to the data length of the field afterwards, obtains the word of next field
Segment value, until having handled all fields in data record to be resolved.
Further, each field in data record to be resolved is sequentially parsed, obtaining the field value of each field includes:
Data pointer to be resolved is arranged to the initial position of data portion in data record to be resolved, present physical ID is arranged to 0;Root
Current logic ID is obtained according to present physical ID, and corresponding field information is obtained in record organization description according to logic ID;Root
According to the field value of field information parsing corresponding field, and data pointer to be resolved is moved after the data length according to present field;Increase
Physical ID values before sovolin if all fields are all disposed at this time, terminate;If data pointer to be resolved is not disposed,
And be not moved to record tail, then the field value for obtaining next field is cycled successively, if data pointer to be resolved has moved
To tail is recorded, then the corresponding fields of subsequent physical ID return after being both configured to NULL, each in data record to be resolved so as to obtain
The field value of a field.Wherein, data record to be resolved can be divided into the data for not including extended field comprising extended field and
Record.
Further, according to the row identification (RNC-ID) analytic of setting, this is listed in corresponding specific field in data record to be resolved, obtains
When taking the field value of the specific field, the physical label for determining the field is identified by arranging, and according to other words before the field
The sum of data length of section determines the data-bias of the field, obtains and obtains the field at the data-bias in data record
Field value.
Further, based on the above technical solutions, to the field value of acquisition field, the word in data record
Segment type is further described.Field in data record can be divided into fixed-length field and variable-length field in original field,
And three kinds of extended field.With specific reference to Fig. 5, obtaining the field value of field can include:
S310 determines the field type of field according to the number of the physical label of field and original field.
Specifically, the physical label of field is preferably physics ID, by data record by extended field tissue to original
After beginning field, the physics ID orders of each field are set.So when the physics ID of field is less than the number of original field, the word
Section is original field;When the physics ID of field is greater than or equal to the number of original field, which is extended field.
S320 judges whether field is original field.If so, perform S330;If it is not, perform S340.
S330, the control information in the data-bias and record head of field obtain the field value of field.
Specifically, when field is original field, the control information of original field is in record head, according to corresponding control
Information determines whether the field is empty, if it is empty then returns, field value is set to NULL;If not empty, the number determined in the field
According to obtaining the corresponding field value of the field at offset.
S340 obtains the field value of field according to the control information of field in the data-bias of field and extended field area.
Specifically, when field is extended field, the control information of extended field is true in the field in extended field area
Obtain corresponding control information in extended field area at fixed data-bias, and according to the control information determine the field whether be
If it is empty sky then returns, field value is set to NULL;If not empty, then at definite data-bias to obtain the field corresponding
Field value.Further, if the data-bias of the field is equal with the record length, set the field value of the field as
NULL。
The technical solution of the present embodiment, by setting the field at record format parsing corresponding data offset, and acquisition pair
The field value of field is answered, the data that table adds original field in the data record after arranging can be parsed correctly, so during addition row
Data need not be rebuild.
Further, exemplary retouch is carried out to the field value method of the acquisition specific field in the operating method of data record
It states.As shown in fig. 6, obtain specific field field value the step of approximately as:
The first step, the row mark in the table according to where the field in data record, the word described from corresponding record organization
The information of the field is obtained in segment information array;Second step is described according to corresponding physics ID in field information and record organization
In original field number, judge whether the field is original field, if so then execute the 3rd step, if otherwise perform the 7th
Step;3rd step if original field, then obtains the control information in record head, judges whether the field is NULL, is NULL
It then returns, if not NULL, then performs the 4th step;4th step compares physics ID and fixed-length field number, whether judges the field
It is fixed-length field, if so then execute the 5th step, if otherwise performing the 6th step;5th step, according to corresponding data in field information
Offset, returns after obtaining the field value at the data-bias;6th step is begun stepping through respectively from the physics ID of first variable-length field
Since the data-bias of first variable-length field, specific field is navigated to according to the data length of variable-length field for variable-length field
Data-bias at, and returned after obtaining the field value at the corresponding data offset;7th step, from the object of first variable-length field
Reason ID begins stepping through each variable-length field, skips all original fields, navigates at the data offset locations of first extended field;
If the 8th step, current data deviation post have arrived record ending, returned after the field value of the field is set to NULL, it is no
Then perform the 9th step;9th step if the current affiliated fields of ID are the physics ID of specific field, perform the tenth step, otherwise obtains
The data length of the field will perform the 8th step after the data length that the field is moved after data offset locations;Tenth step, parsing are worked as
The field value of preceding field and return.
Embodiment five
Fig. 7 is a kind of structure diagram of the operating device for data record that the embodiment of the present invention five provides, such as Fig. 7 institutes
Show, which includes:
Tissue description acquisition module 501, for obtaining the description of the record organization of table, record organization description obtains original in table
The description respectively arranged, while obtain the number of original row and addition row, and according to the numbers of original row with before addition row other add
Add the number of row, determine the physical label of extended field in data record, extended field adds row in the table where data record
Corresponding field.
Data-bias determining module 502, for obtaining the data length of original field and extended field in data record, root
The sum of the sum of data length according to original field and data length of other extended fields before extended field, determine extended field
Data-bias, original field is the corresponding field of original row in table where data record.
Data organisation module 503 for the physical label and data-bias according to each extended field, will each extend word
The data order tissue of section is into data record.
The technical solution of the present embodiment corresponds to the physical label of extended field, and root by setting in record organization description
According to the data-bias of extended field in data record, all extended fields of sequential organization, do not influence data after original field
The data of original field in record ensure that the speed of in most cases data access, and when table adds row operation, only
Data dictionary is operated, data need not be rebuild, improves the efficiency of table addition row.
Further, original field can include fixed-length field and variable-length field.
Further, above-mentioned data-bias determining module 502 can be specifically used for:First in being described according to record organization
The sum of the data-bias of a variable-length field and the data length of variable-length field determine the data-bias of first extended field;Root
According to the sum of data length of other extended fields before the data-bias and extended field of first extended field, extension is determined
The data-bias of field.
Further, above-mentioned data organisation module 503 can be specifically used for:According to record format by each extended field
Extended field area in data order tissue to data record.
Further, above device can also include:Field parsing module 504, for determining the data of extended field
After offset, the physical label of field and data-bias parsing are to be resolved in data record to be resolved in being described according to record organization
Field in data record obtains the field value of field;Field includes each field or designated word in data record to be resolved
Section.
Further, above-mentioned field parsing module 504 can be specifically used for:According to the physical label of field and original field
Number determine the field type of field;When field is original field, according to the control in the data-bias and record head of field
The field value of acquisition of information field processed;When field is extended field, according to word in the data-bias of field and extended field area
The control information of section obtains the field value of field.
The operating device of data record provided in this embodiment is suitable for the data record that above-mentioned any embodiment provides
Operating method possesses corresponding function and advantageous effect.
Embodiment six
Fig. 8 is a kind of structure diagram for equipment that the embodiment of the present invention six provides.As shown in figure 8, the equipment includes place
Manage device 60, storage device 61 and communicator 62;The quantity of processor 60 can be one or more in equipment, with one in Fig. 8
Exemplified by a processor 60;Processor 60, storage device 61 and the communicator 62 of equipment can be connected by bus or other modes
It connects, in Fig. 8 exemplified by being connected by bus.
Storage device 61 is used as a kind of computer readable storage medium, can perform available for storage software program, computer
Program and module, if the corresponding module of the operating method of the data record in the embodiment of the present invention is (for example, for data record
Operating device in tissue acquisition module 501, data-bias determining module 502 and data organisation module 503 are described).Processing
Device 60 is stored in software program, instruction and module in storage device 61 by operation, so as to perform the various functions of equipment
Using and data processing, that is, realize the operating method of above-mentioned data record.
Storage device 61 can mainly include storing program area and storage data field, wherein, storing program area can store operation
Application program needed for system, at least one function;Storage data field can be stored uses created data etc. according to terminal.
In addition, storage device 61 can include high-speed random access memory, can also include nonvolatile memory, for example, at least one
A disk memory, flush memory device or other non-volatile solid state memory parts.In some instances, storage device 61 can
Further comprise compared with the remotely located memory of processor 60, these remote memories can be by network connection to setting
It is standby.The example of above-mentioned network includes but not limited to internet, intranet, LAN, mobile radio communication and combinations thereof.
Communicator 62 can be used for realizing network connection or mobile data cube computation.
A kind of equipment provided in this embodiment can be used for the operation side for performing the data record that above-mentioned any embodiment provides
Method possesses corresponding function and advantageous effect.
Embodiment seven
The embodiment of the present invention seven additionally provides a kind of computer readable storage medium, is stored thereon with computer program, should
Program can realize the operating method of the data record in above-mentioned any embodiment when being executed by processor.This method specifically includes:
The record organization description of table where obtaining data record, the record organization description obtain original row and addition in table
The number of row, and according to the number of original row and the number of other addition row before addition row, determine to extend word in data record
The physical label of section, extended field add in the table where data record and arrange corresponding field;
The data length of each original field and extended field in data record is obtained, according to the data length of original field
The sum of the sum of with the data length of other extended fields before extended field, determine the data-bias of extended field, original field
It is original in the table where data record to arrange corresponding field;
According to the physical label and data-bias of each extended field, by the data order tissue of each extended field to number
According in record.
Certainly, a kind of storage medium for including computer executable instructions that the embodiment of the present invention is provided, computer
The method operation that executable instruction is not limited to the described above, can also carry out the data record that any embodiment of the present invention is provided
Operating method in relevant operation.
By the description above with respect to embodiment, it is apparent to those skilled in the art that, the present invention
It can be realized by software and required common hardware, naturally it is also possible to which by hardware realization, but the former is more in many cases
Good embodiment.Based on such understanding, what technical scheme substantially in other words contributed to the prior art
Part can be embodied in the form of software product, which can be stored in computer readable storage medium
In, floppy disk, read-only memory (Read-Only Memory, ROM), random access memory (Random such as computer
Access Memory, RAM), flash memory (FLASH), hard disk or CD etc., including some instructions with so that a computer is set
Standby (can be personal computer, server or the network equipment etc.) performs the method described in each embodiment of the present invention.
The foregoing is merely the preferred embodiment of the present invention, are not intended to limit the invention, for those skilled in the art
For, the present invention can have various modifications and changes.All any modifications made within spirit and principles of the present invention are equal
Replace, improve etc., it should all be included in the protection scope of the present invention.
Claims (10)
1. a kind of operating method of data record, which is characterized in that including:
The record organization description of table where obtaining data record, the record organization description obtain original row and addition in the table
The number of row, and according to the number of the original row and the number of other addition row before the addition row, determine the data
The physical label of extended field in record, the extended field add in the table where the data record and arrange corresponding field;
The data length of each original field and extended field in the data record is obtained, according to the data of the original field
The sum of the sum of length and data length of other extended fields before the extended field, determine that the data of the extended field are inclined
It moves, the original field is original in the table where the data record to arrange corresponding field;
According to the physical label and data-bias of each extended field, by the data order tissue of each extended field to the number
According in record.
2. according to the method described in claim 1, it is characterized in that, the original field includes fixed-length field and variable-length field;
Correspondingly, the original row include fixed length row and become long line, the record organization description obtains the data of the fixed length row
The sum of length, the data length arranged according to the fixed length determines the data-bias of first variable-length field in the data record,
First becomes the corresponding field of long line in first variable-length field table where the data record.
3. according to the method described in claim 2, it is characterized in that, it is described according to the sum of data length of the original field with
The sum of data length of other extended fields before the extended field, determining the data-bias of the extended field includes:
The data-bias of first variable-length field in being described according to the record organization and the data length of the variable-length field
The sum of, determine the data-bias of first extended field;
It is long according to the data-bias of first extended field and the data of other extended fields before the extended field
The sum of degree determines the data-bias of the extended field.
4. according to the method described in claim 1, it is characterized in that, the data order tissue by each extended field is to institute
Stating data record includes:
It is described according to record format by the data order tissue of each extended field to the extended field area in the data record
Record format includes record head and data portion, and control information, the data that the extended field area includes the extended field are long
Degree and field value.
5. according to the method described in claim 1, it is characterized in that, it is described determine the extended field data-bias after,
It further includes:
It is treated according to the physical label of field in data record to be resolved in record organization description with data-bias parsing
The field in data record is parsed, obtains the field value of the field, the field is included in the data record to be resolved
Each field or specific field.
6. according to the method described in claim 5, it is characterized in that, the field value for obtaining the field includes:
The field type of the field is determined according to the number of the physical label of the field and the original field;
When the field is original field, the control information in the data-bias of the field and the record head obtains
The field value of the field;
When the field is extended field, the field according to the data-bias of the field and the extended field area
Control information obtains the field value of the field.
7. a kind of operating device of data record, which is characterized in that including:
Tissue description acquisition module, for obtaining the corresponding record organization description of data record, the record organization description obtains
The number of original row and addition row in table where the data record, and the number according to the original row and the addition row
The number of other preceding addition row, determines the physical label of extended field in the data record, and the extended field is the number
Corresponding field is arranged according to addition in table where record;
Data-bias determining module, for obtaining the data length of original field and extended field in the data record, according to
The sum of the sum of data length of the original field and data length of other extended fields before the extended field, determine institute
The data-bias of extended field is stated, the original field is original in the table where the data record to arrange corresponding field;
Data organisation module, for the physical label and data-bias according to each extended field, by the number of each extended field
According to sequential organization into the data record.
8. device according to claim 7, which is characterized in that further include:
Data resolution module, for determine the extended field data-bias after, according to the record organization describe in
The physical label of field parses the field in the data record to be resolved with data-bias in data record to be resolved, obtains institute
The field value of field is stated, the field includes each field or specific field in the data record to be resolved.
9. a kind of equipment, which is characterized in that the equipment includes:
One or more processors;
Storage device, for storing one or more programs;
When one or more of programs are performed by one or more of processors so that one or more of processors are real
The now operating method of the data record as described in any in claim 1-6.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is by processor
The operating method of the data record as described in any in claim 1-6 is realized during execution.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711386517.9A CN108073709B (en) | 2017-12-20 | 2017-12-20 | Data recording operation method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711386517.9A CN108073709B (en) | 2017-12-20 | 2017-12-20 | Data recording operation method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108073709A true CN108073709A (en) | 2018-05-25 |
CN108073709B CN108073709B (en) | 2020-07-24 |
Family
ID=62159007
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711386517.9A Active CN108073709B (en) | 2017-12-20 | 2017-12-20 | Data recording operation method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108073709B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107679245A (en) * | 2017-10-30 | 2018-02-09 | 山东浪潮通软信息科技有限公司 | A kind of organizational structure method of adjustment and device |
CN112835886A (en) * | 2019-11-25 | 2021-05-25 | 浙江大搜车软件技术有限公司 | Data table field adding method and device |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH09146816A (en) * | 1995-11-17 | 1997-06-06 | Nec Corp | Table expansion system |
CN101105813A (en) * | 2007-09-11 | 2008-01-16 | 金蝶软件(中国)有限公司 | Data base extension method and device |
CN103617284A (en) * | 2013-12-11 | 2014-03-05 | 北京金和软件股份有限公司 | Data field extension method |
US20140164443A1 (en) * | 2012-12-06 | 2014-06-12 | Microsoft Corporation | Database scale-out |
CN104346466A (en) * | 2014-11-12 | 2015-02-11 | 中国建设银行股份有限公司 | Method and device of adding new attribute data in database |
CN105808540A (en) * | 2014-12-29 | 2016-07-27 | 金蝶软件(中国)有限公司 | Configuration data storage method and system |
CN106469224A (en) * | 2016-09-26 | 2017-03-01 | 武汉工程大学 | A kind of expansible data model for SaaS platform |
-
2017
- 2017-12-20 CN CN201711386517.9A patent/CN108073709B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH09146816A (en) * | 1995-11-17 | 1997-06-06 | Nec Corp | Table expansion system |
CN101105813A (en) * | 2007-09-11 | 2008-01-16 | 金蝶软件(中国)有限公司 | Data base extension method and device |
US20140164443A1 (en) * | 2012-12-06 | 2014-06-12 | Microsoft Corporation | Database scale-out |
CN103617284A (en) * | 2013-12-11 | 2014-03-05 | 北京金和软件股份有限公司 | Data field extension method |
CN104346466A (en) * | 2014-11-12 | 2015-02-11 | 中国建设银行股份有限公司 | Method and device of adding new attribute data in database |
CN105808540A (en) * | 2014-12-29 | 2016-07-27 | 金蝶软件(中国)有限公司 | Configuration data storage method and system |
CN106469224A (en) * | 2016-09-26 | 2017-03-01 | 武汉工程大学 | A kind of expansible data model for SaaS platform |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107679245A (en) * | 2017-10-30 | 2018-02-09 | 山东浪潮通软信息科技有限公司 | A kind of organizational structure method of adjustment and device |
CN112835886A (en) * | 2019-11-25 | 2021-05-25 | 浙江大搜车软件技术有限公司 | Data table field adding method and device |
Also Published As
Publication number | Publication date |
---|---|
CN108073709B (en) | 2020-07-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10606787B2 (en) | Methods and apparatuses for providing data received by a state machine engine | |
US10915450B2 (en) | Methods and systems for padding data received by a state machine engine | |
US9535861B2 (en) | Methods and systems for routing in a state machine | |
US10489062B2 (en) | Methods and systems for using state vector data in a state machine engine | |
CN105659274A (en) | Method and device for decoding data streams in reconfigurable platforms | |
WO1992002877A1 (en) | Active storage means in a reduction processor | |
CN101145157B (en) | XML format embedded type apparatus characteristic information analysis method | |
CN115499312A (en) | Integration configuration method based on FPGA (field programmable Gate array) back-end P4 multi-mode intelligent network card | |
CN108073709A (en) | A kind of operating method of data record, device, equipment and storage medium | |
CN108664546A (en) | Xml data structure conversion method and device | |
CN114328486A (en) | Data quality checking method and device based on model | |
CN101141438B (en) | Analytical method of message data cell | |
CN111788552A (en) | System and method for low latency hardware memory | |
CN116126429B (en) | Method for persistence and recovery of reference of non-data type object | |
CN107547648A (en) | A kind of internal data clone method and device | |
CN107221067A (en) | A kind of serial number access control method and system | |
CN113408245A (en) | Block chain data coding and decoding method, device, equipment and medium based on GEP | |
US20070255911A1 (en) | Method of optimising writing by a master block into a fifo type interfacing device between this master block and a slave block, and the corresponding computer program product | |
JPH09185565A (en) | Network system with program transferring function | |
JPH09146826A (en) | Memory operating method and memory device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |