The content of the invention
In order to solve problem of the prior art, the embodiments of the invention provide a kind of method and device for inserting data.Institute
State technical scheme as follows:
First aspect includes there is provided a kind of method for inserting data, methods described:
The entity class set up according to the corresponding data table metadata of at least one tables of data is obtained, the entity class includes
Check value, one entity class of each tables of data correspondence;
Determine to be inserted into the tables of data of data, and the school included according to the corresponding entity class of the tables of data in database
Value is tested to verify the data being inserted into the tables of data;
If verifying successfully, the data being inserted into are inserted by the data according to the corresponding entity class of the tables of data
Table.
With reference in a first aspect, in the first possible implementation of first aspect, the acquisition is according at least one
The entity class that the corresponding data table metadata of tables of data is set up, including:
Obtain the corresponding data table metadata of at least one tables of data;
Create the corresponding entity class metadata of each data table metadata;
The corresponding check value of each entity class is set, and according to the corresponding check value of each entity class and each entity class member
The corresponding entity class of each tables of data of data creation, each entity class includes the check value set and creates the entity class
Entity class metadata.
With reference to the first possible implementation of first aspect, in second of possible implementation of first aspect
In, the data table metadata includes data sheet field type;It is described to create the corresponding entity class of each data table metadata
Before metadata, in addition to:
Mapping table is set up, the mapping table includes the data type pass corresponding with the data type of entity class of database
System;
It is described to create the corresponding entity class metadata of each data table metadata, including:
The corresponding entity class field type of each data sheet field type is created according to the mapping table, and by the entity
Class field type as establishment entity class metadata.
With reference to the first possible implementation of first aspect, in the third possible implementation of first aspect
In, the data table metadata includes the default value of data sheet field;It is described to create the corresponding reality of each data table metadata
Body class metadata, including:
The default value that each entity class field is created in constructed fuction is the default value of corresponding each data sheet field,
And using the default value of the entity class field as establishment entity class metadata.
With reference to second of first aspect or the third possible implementation, in the 4th kind of possible reality of first aspect
In existing mode, the corresponding check value of each entity class of basis and each tables of data of each entity class metadata establishment are corresponding
After entity class, in addition to:
The entity class metadata generation database insertion sentence included according to the entity class, by the database parenthesis
Sentence as the entity class basic function;
It is described that the data being inserted into are inserted by the tables of data according to the corresponding entity class of the tables of data, including:
The data being inserted into are inserted by the tables of data according to the basic function of the corresponding entity class of the tables of data.
With reference to second of first aspect or the third possible implementation, in the 5th kind of possible reality of first aspect
It is described that the data being inserted into are inserted by the tables of data according to the corresponding entity class of the tables of data in existing mode, including:
The entity class metadata that entity class corresponding to the tables of data includes carries out assembled;
Database insertion sentence is generated according to the assembled result of the entity class metadata;
The data being inserted into are inserted by the tables of data according to the insertion sentence.
Second aspect includes there is provided a kind of device for inserting data, described device:
Acquisition module, for obtaining the entity class set up according to the corresponding data table metadata of at least one tables of data, institute
Stating entity class includes check value, one entity class of each tables of data correspondence;
Determining module, the tables of data for determining to be inserted into data in database;
Correction verification module, for the check value that is included according to the corresponding entity class of the tables of data to being treated in the tables of data
The data of insertion are verified;
Module is inserted, for when verifying successfully, according to the corresponding entity class of the tables of data by the number being inserted into
According to the insertion tables of data.
With reference to second aspect, in the first possible implementation of second aspect, the acquisition module, including:
Acquiring unit, for obtaining the corresponding data table metadata of at least one tables of data;
First creating unit, for creating the corresponding entity class metadata of each data table metadata;
Setting unit, for setting the corresponding check value of each entity class;
Second creating unit, for creating each according to the corresponding check value of each entity class and each entity class metadata
The corresponding entity class of tables of data, each entity class includes the check value set and the entity class member number for creating the entity class
According to.
With reference to the first possible implementation of second aspect, in second of possible implementation of second aspect
In, the data table metadata that the acquiring unit is got includes data sheet field type;
The acquisition module, in addition to:
Unit is set up, for setting up mapping table, the mapping table includes the data type of database and the data of entity class
The corresponding relation of type;
First creating unit, for creating the corresponding entity class of each data sheet field type according to the mapping table
Field type, and using the entity class field type as establishment entity class metadata.
With reference to the first possible implementation of second aspect, in the third possible implementation of second aspect
In, the data table metadata that the acquiring unit is got includes the default value of data sheet field;
First creating unit, the default value for creating each entity class field in constructed fuction is corresponding every
The default value of individual data sheet field, and using the default value of the entity class field as establishment entity class metadata.
With reference to second of second aspect or the third possible implementation, in the 4th kind of possible reality of second aspect
In existing mode, the acquisition module, in addition to:
Generation unit, for the entity class metadata generation database insertion sentence included according to the entity class, by institute
Database insertion sentence is stated as the basic function of the entity class;
The insertion module, for the basic function according to the corresponding entity class of the tables of data by the number being inserted into
According to the insertion tables of data.
With reference to second of second aspect or the third possible implementation, in the 5th kind of possible reality of second aspect
In existing mode, the insertion module, for being spelled to the entity class metadata that the corresponding entity class of the tables of data includes
Dress;Database insertion sentence is generated according to the assembled result of the entity class metadata;Treated according to the insertion sentence by described
The data of insertion insert the tables of data.
The beneficial effect that technical scheme provided in an embodiment of the present invention is brought is:
Include the entity class of check value according to what the corresponding data table metadata of at least one tables of data was set up by obtaining,
And the check value included according to the corresponding entity class of the tables of data for being inserted into data is to the data check that is inserted into tables of data
During success, according to the corresponding entity class of tables of data by the insertion of data into data table being inserted into, it is achieved thereby that the automatic of data inserts
Enter;Further, since entity class includes check value so that data can be verified before by insertion of data into data table, no
The insertion efficiency of data is improve only, the insertion effect of data is also optimized.
Embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing to embodiment party of the present invention
Formula is described in further detail.
For at present when by insertion of data into data storehouse, it is necessary to which manual creation database inserts sentence so as to database
Insert data it is less efficient the problem of, the embodiments of the invention provide it is a kind of insert data method, referring to Fig. 1, method stream
Journey includes:
101:The entity class set up according to the corresponding data table metadata of at least one tables of data is obtained, entity class includes
Check value, one entity class of each tables of data correspondence;
As a kind of alternative embodiment, the entity set up according to the corresponding data table metadata of at least one tables of data is obtained
Class, including:
Obtain the corresponding data table metadata of at least one tables of data;
Create the corresponding entity class metadata of each data table metadata;
The corresponding check value of each entity class is set, and according to the corresponding check value of each entity class and each entity class member
The corresponding entity class of each tables of data of data creation, each entity class includes the check value set and the entity for creating entity class
Class metadata.
As a kind of alternative embodiment, data table metadata includes data sheet field type;Create each data list cell
Before the corresponding entity class metadata of data, in addition to:
Mapping table is set up, mapping table includes the corresponding relation of the data type of database and the data type of entity class;
The corresponding entity class metadata of each data table metadata is created, including:
The corresponding entity class field type of each data sheet field type is created according to mapping table, and by entity class field class
Type as establishment entity class metadata.
As a kind of alternative embodiment, data table metadata includes the default value of data sheet field;Create each data
The corresponding entity class metadata of table metadata, including:
The default value that each entity class field is created in constructed fuction is the default value of corresponding each data sheet field,
And using the default value of entity class field as establishment entity class metadata.
As a kind of alternative embodiment, create every according to the corresponding check value of each entity class and each entity class metadata
After the corresponding entity class of individual tables of data, in addition to:
The entity class metadata generation database insertion sentence included according to entity class, regard database insertion sentence as reality
The basic function of body class.
102:Determine to be inserted into the tables of data of data, and the school included according to the corresponding entity class of tables of data in database
Value is tested to verify the data being inserted into tables of data;
103:If verifying successfully, according to the corresponding entity class of tables of data by the insertion of data into data table being inserted into.
As a kind of alternative embodiment, according to the corresponding entity class of tables of data by the insertion of data into data table being inserted into, wrap
Include:
According to the basic function of the corresponding entity class of tables of data by the insertion of data into data table being inserted into.
As a kind of alternative embodiment, according to the corresponding entity class of tables of data by the insertion of data into data table being inserted into, wrap
Include:
The entity class metadata that entity class corresponding to tables of data includes carries out assembled;
Database insertion sentence is generated according to the assembled result of entity class metadata;
According to insertion sentence by the insertion of data into data table being inserted into.
Method provided in an embodiment of the present invention, is built by obtaining according to the corresponding data table metadata of at least one tables of data
Vertical includes the entity class of check value, and the check value logarithm included according to the corresponding entity class of the tables of data for being inserted into data
During according to the data check success being inserted into table, according to the corresponding entity class of tables of data by the insertion of data into data table being inserted into,
It is achieved thereby that data are automatically inserted into;Further, since entity class includes check value so that before by insertion of data into data table
Data can be verified, not only increase the insertion efficiency of data, also optimize the insertion effect of data.
The embodiments of the invention provide it is a kind of insert data method, the content of the embodiment with reference to shown in above-mentioned Fig. 1, with
This method is applied to exemplified by C Plus Plus environment, method provided in an embodiment of the present invention is carried out explanation is explained in detail.Referring to figure
2, method flow includes:
201:Obtain the corresponding data table metadata of at least one tables of data;
Due to multiple tables of data may be included in a database, for the insertion of data into data storehouse that will be inserted into, this reality
The method for applying example offer obtains the corresponding data table metadata of at least one tables of data.On obtaining at least one tables of data correspondence
Data table metadata mode, the present embodiment is not especially limited.Looked into when it is implemented, can be performed by the API of database
Table structure command is ask, so as to obtain the corresponding data table metadata of at least one tables of data;Wherein, data table metadata include but
Be not limited to data sheet field name, data sheet field type, data sheet field length, the default value of data sheet field, whether based on
Key and whether be from adding.
202:Create the corresponding entity class metadata of each data table metadata;
Wherein, entity class be Object-Oriented Systems in class, entity class metadata be Object-Oriented Systems in class member
Data.
Mode on creating the corresponding entity class metadata of each data table metadata, the present embodiment does not make specific limit
It is fixed.When it is implemented, different establishment modes can be used according to different entity class metadata.For being wrapped in data table metadata
Including data sheet field type and data table metadata includes the situation of data sheet field type, present embodiments provide including
But it is not limited to the mode that the following two kinds creates entity class metadata:
First way:Data table metadata includes data sheet field type, creates each data table metadata correspondence
Entity class metadata before, in addition to:
Mapping table is set up, mapping table includes the corresponding relation of the data type of database and the data type of entity class;
The corresponding entity class metadata of each data table metadata is created, including:
The corresponding entity class field type of each data sheet field type is created according to mapping table, and by entity class field class
Type as establishment entity class metadata.
Due to mapping table including database data type and entity class data type corresponding relation, then can be according to reflecting
The corresponding relation of the data type for the database that firing table includes and the data type of entity class creates each data sheet field class
The corresponding entity class field type of type.
To insert data instance into database by C++, then entity class metadata corresponds to C++ metadata, entity class word
Segment type correspondence C++ field types, mapping table includes the data type of database and C++ data type corresponding relation, root
The C++ field types corresponding to data sheet field type are created according to the corresponding relation.
The second way:Data table metadata includes the default value of data sheet field, creates each data table metadata
Corresponding entity class metadata, including:
The default value that each entity class field is created in constructed fuction is the default value of corresponding each data sheet field,
And using the default value of entity class field as establishment entity class metadata.
Wherein, constructed fuction is used to, in the object in creating entity class, initialize object, and as object assigns initial value;
Entity class field is used for the attribute for identifying object in entity class;The default value of data sheet field is set when being the data table definitions field
The default value put.
It is the silent of corresponding each data sheet field on creating the default value of each entity class field in constructed fuction
Recognize the mode of value, the present embodiment is not especially limited.When it is implemented, can be in the corresponding number of at least one tables of data got
According to the default value of searching data literary name section in table metadata, the default value of the corresponding data sheet field found is regard as establishment
Each entity class field default value.
203:The corresponding check value of each entity class is set, and according to the corresponding check value of each entity class and each entity
Class metadata creates the corresponding entity class of each tables of data, and each entity class includes the check value set and creates entity class
Entity class metadata;
Wherein, check value includes but is not limited to length check value and type checking value, and the present embodiment is not in check value
Hold and size is defined.Mode on setting check value, the present embodiment is equally not especially limited.Using check value as length
Exemplified by check value, due to potentially including multiple fields in an entity class, when it is implemented, can be passed through according to data table metadata
Set Value interfaces are that each field in entity class sets corresponding length check value.Further, since each tables of data is set
Possible difference is put, and the different entity class of different tables of data correspondences, therefore, the method that the present embodiment is provided can be for each real
Body class sets corresponding check value.
Further, each tables of data is being created according to the corresponding check value of each entity class and each entity class metadata
During corresponding entity class, because tables of data is corresponding with data table metadata, data table metadata correspondent entity class metadata is then counted
It is corresponding with entity class metadata according to table, therefore, it can be created according to the corresponding check value of each entity class and each entity class metadata
The corresponding entity class of each tables of data is built, each entity class includes the check value set and the entity class member number for creating entity class
According to so that tables of data one entity class of correspondence.
It is corresponding on creating each tables of data according to the corresponding check value of each entity class and each entity class metadata
The mode of entity class, the present embodiment is not especially limited.When it is implemented, can be corresponding at least one tables of data got
The corresponding data table metadata of each tables of data is searched in data table metadata, further according to each data table metadata pair of establishment
The entity class metadata answered obtains the corresponding entity class metadata of each tables of data, by the check value of setting and each data list cell
The corresponding entity class metadata write-in tables of data entity class file of data, obtains the corresponding entity class of each tables of data.
As a kind of alternative embodiment, create every according to the corresponding check value of each entity class and each entity class metadata
After the corresponding entity class of individual tables of data, also include but is not limited to:
The entity class metadata generation database insertion sentence included according to entity class, regard database insertion sentence as reality
The basic function of body class.
As shown in the above, the method that the present embodiment is provided also includes generation database parenthesis when creating entity class
The step of sentence.The mode of sentence is inserted on generation database, the present embodiment is not especially limited.When it is implemented, available
The entity class metadata that code generator is included by entity class generates database and inserts sentence, and then database is inserted into sentence
It is used as the basic function of entity class.Wherein, entity class metadata includes but is not limited to entity class field type, entity class field name
And the constraint of entity class field etc., the constraint of entity class field includes but is not limited to entity class data length, entity class data value model
Enclose, the basic function of entity class includes but is not limited to GetInsert ().
It should be noted that in addition to the entity class metadata generation database insertion sentence included according to entity class, also
The sentences such as entity class metadata generation data base querying, renewal and the deletion that can be included according to entity class;Correspondingly, entity class
Basic function also includes GetSelect (), GetUpdate () and GetDelete () etc..
As a kind of alternative embodiment, the method that the present embodiment is provided also includes but is not limited to each entity according to setting
The corresponding check value of class generates corresponding verification expression formula;Wherein, the verification expression formula of generation can be integrated in Set Value and connect
In mouthful, when an entity class includes multiple fields, correspondence is generated also directed to the check value that each field is set in entity class
Verification value expression.
Further, if the corresponding verification expression formula of each entity class is generated, according to the corresponding school of each entity class
Test value and when each entity class metadata creates each tables of data corresponding entity class, can be according to the corresponding verification of each entity class
Expression formula and each entity class metadata create the corresponding entity class of each tables of data, and each entity class includes the verification of generation
Expression formula and the entity class metadata for creating entity class.
Further, completed by above-mentioned steps 201 to step 203 and obtain corresponding according at least one tables of data
The entity class that data table metadata is set up, in order to complete the side for providing the tables of data in insertion of data into data storehouse, the present embodiment
Method also includes subsequent step.
204:Determine to be inserted into the tables of data of data, and the school included according to the corresponding entity class of tables of data in database
Value is tested to verify the data being inserted into tables of data;
Because database includes at least one tables of data, the corresponding check value of different tables of data is different, accordingly, it would be desirable to really
Determine to be inserted into the tables of data of data in database.On the mode for the tables of data for determining to be inserted into data in database, this implementation
Example is not especially limited.When it is implemented, the tables of data mark of input can be obtained, determined according to tables of data mark in database
It is inserted into the tables of data of data.Certainly, in addition to aforesaid way, it can also be determined according to the attribute for the data being inserted into database
It is inserted into the tables of data of data.
Further, on the check value that is included according to the corresponding entity class of tables of data to the number that is inserted into tables of data
According to the mode verified, the present embodiment is not especially limited.So that check value is length check value as an example, when it is implemented, can
By the incoming length value of Get Value interfaces, length check is carried out in Set Value interfaces;When incoming length value exceeds
During the length check value of setting, throw exception.
As a kind of alternative embodiment, if according to the corresponding verification expression formula of each entity class and each entity class member number
According to the corresponding entity class of each tables of data of establishment, then the verification expression formula pair that can be also included according to the corresponding entity class of tables of data
The data being inserted into are verified.On the mode verified according to verification expression formula to the data being inserted into, the present embodiment
It is not especially limited.By taking verification expression formula as follows as an example, the verification expression formula shows that field age span is 0
To 150;If verification expression formula is integrated in SetValue interfaces, the data being inserted into are judged in Set Value interfaces
Whether in the range of 0 to 150;If not in the range of 0 to 150, throw exception.
If(!(0<=ageValue&&ageValue<=150))
{
Throw Exception;
}
School is carried out to the data being inserted into tables of data by the check value included according to the corresponding entity class of tables of data
Test, the data check of data Layer is advanceed into application layer completes, and improves the efficiency of insertion data.
205:If verifying successfully, according to the corresponding entity class of tables of data by the insertion of data into data table being inserted into.
When verifying successfully, show the setting for the tables of data that the data fit being inserted into is determined, therefore, can be according to tables of data
Corresponding entity class is by the insertion of data into data table being inserted into.Including but not limited to the following two kinds is present embodiments provided according to number
According to the corresponding entity class of table by the mode for the insertion of data into data table being inserted into:
First way:According to the basic function of the corresponding entity class of tables of data by the insertion of data into data table being inserted into;
Wherein, because the database of the entity class metadata generation included according to entity class inserts sentence as entity class
Basic function, therefore, can be according to the basic function of the corresponding entity class of the tables of data by the insertion of data into data table being inserted into.
The second way:The entity class metadata that entity class corresponding to tables of data includes carries out assembled;According to entity
The assembled result generation database insertion sentence of class metadata;According to insertion sentence by the insertion of data into data table being inserted into.
Wherein, the entity class metadata on including to the corresponding entity class of tables of data carries out assembled mode, this reality
Example is applied to be not especially limited.When it is implemented, SQL (Structured Query Language, structuralized query language can be passed through
Speech) the entity class metadata that includes to entity class of assembled device carries out assembled, generated according to the assembled result of entity class metadata
SQL statement is inserted, the insertion SQL statement is database insertion sentence.In addition, the entity class member that can also include to entity class
Data progress is assembled, according to SQL statements such as the assembled result of entity class metadata generation inquiry, renewal and deletions.
If it should be noted that generating database insertion sentence when creating entity class, using first way will
The insertion of data into data table being inserted into;If database insertion sentence is not generated when creating entity class, using the second way
By the insertion of data into data table being inserted into.On the specific implementation of both inserted modes, the present embodiment does not make specific limit
It is fixed.When it is implemented, the api interface that can be provided by database manufacturer, basic function or the database insertion of incoming entity class
Sentence, sentence is inserted by the insertion of data into data table being inserted into according to the basic function of entity class or database;Wherein, entity class
Basic function can be SQL function, database insertion sentence can be SQL statement.
Further, after according to the corresponding entity class of tables of data by the insertion of data into data table being inserted into, acquisition insert
Enter result for return value, return value includes success or failure.
Method provided in an embodiment of the present invention, is built by obtaining according to the corresponding data table metadata of at least one tables of data
Vertical includes the entity class of check value, and the check value logarithm included according to the corresponding entity class of the tables of data for being inserted into data
During according to the data check success being inserted into table, according to the corresponding entity class of tables of data by the insertion of data into data table being inserted into,
It is achieved thereby that data are automatically inserted into;Further, since entity class includes check value so that before by insertion of data into data table
Data can be verified, not only increase the insertion efficiency of data, also optimize the insertion effect of data.
Referring to Fig. 3, the embodiments of the invention provide a kind of device for inserting data, the device be used to performing above-mentioned Fig. 1 or
The method that embodiment shown in Fig. 2 is provided.The device includes:
Acquisition module 301, for obtaining the entity class set up according to the corresponding data table metadata of at least one tables of data,
Entity class includes check value, one entity class of each tables of data correspondence;
Determining module 302, the tables of data for determining to be inserted into data in database;
Correction verification module 303, for the check value that is included according to the corresponding entity class of tables of data to being inserted into tables of data
Data verified;
Module 304 is inserted, for when verifying successfully, the data being inserted into being inserted according to the corresponding entity class of tables of data
Tables of data.
As a kind of alternative embodiment, referring to Fig. 4, acquisition module 301, including:
Acquiring unit 3011, for obtaining the corresponding data table metadata of at least one tables of data;
First creating unit 3012, for creating the corresponding entity class metadata of each data table metadata;
Setting unit 3013, for setting the corresponding check value of each entity class;
Second creating unit 3014, for according to the corresponding check value of each entity class and the establishment of each entity class metadata
The corresponding entity class of each tables of data, each entity class includes the check value set and the entity class member number for creating entity class
According to.
As a kind of alternative embodiment, the data table metadata that acquiring unit 3011 is got includes data sheet field class
Type;
Referring to Fig. 5, acquisition module 301, in addition to:
Unit 3015 is set up, for setting up mapping table, mapping table includes the data type of database and the data of entity class
The corresponding relation of type;
First creating unit 3012, for creating the corresponding entity class field of each data sheet field type according to mapping table
Type, and using entity class field type as establishment entity class metadata.
As a kind of alternative embodiment, the data table metadata that acquiring unit 3011 is got includes data sheet field
Default value;
First creating unit 3012, the default value for creating each entity class field in constructed fuction is corresponding every
The default value of individual data sheet field, and using the default value of entity class field as establishment entity class metadata.
As a kind of alternative embodiment, referring to Fig. 6, acquisition module 301, in addition to:
Generation unit 3016, for the entity class metadata generation database insertion sentence included according to entity class, by number
Sentence is inserted as the basic function of entity class according to storehouse;
Module 304 is inserted, the data being inserted into are inserted into number for the basic function according to the corresponding entity class of tables of data
According to table.
As a kind of alternative embodiment, module 304 is inserted, for the entity class included to the corresponding entity class of tables of data
Metadata carries out assembled;Database insertion sentence is generated according to the assembled result of entity class metadata;It will be treated according to insertion sentence
The insertion of data into data table of insertion.
Device provided in an embodiment of the present invention, is built by obtaining according to the corresponding data table metadata of at least one tables of data
Vertical includes the entity class of check value, and the check value logarithm included according to the corresponding entity class of the tables of data for being inserted into data
During according to the data check success being inserted into table, according to the corresponding entity class of tables of data by the insertion of data into data table being inserted into,
It is achieved thereby that data are automatically inserted into;Further, since entity class includes check value so that before by insertion of data into data table
Data can be verified, not only increase the insertion efficiency of data, also optimize the insertion effect of data.
Fig. 7 is a kind of block diagram of the device 1000 of insertion data according to an exemplary embodiment.For example, device
1000 can be computer, messaging devices, tablet device, personal digital assistant, server etc..
Reference picture 7, device 1000 can include following one or more assemblies:Processing assembly 1002, memory 1004, electricity
Source component 1006, multimedia groupware 1008, audio-frequency assembly 1010, I/O (Input/Output, input/output) interface 1012,
Sensor cluster 1014, and communication component 1016.
The integrated operation of the usual control device 1000 of processing assembly 1002, such as with display, call, data communication,
The camera operation operation associated with record operation.Processing assembly 1002 can include one or more processors 1020 to perform
Instruction, to complete all or part of step of above-mentioned method.In addition, processing assembly 1002 can include one or more moulds
Block, is easy to the interaction between processing assembly 1002 and other assemblies.For example, processing assembly 1002 can include multi-media module,
To facilitate the interaction between multimedia groupware 1008 and processing assembly 1002.
Memory 1004 is configured as storing various types of data supporting the operation in device 1000.These data
Example includes the instruction of any application program or method for being used to operate on device 1000, contact data, telephone book data,
Message, picture, video etc..Memory 1004 can by any kind of volatibility or non-volatile memory device or they
Combination realization, such as SRAM (Static Random Access Memory, static RAM), EEPROM
(Electrically-Erasable Programmable Read-Only Memory, the read-only storage of electrically erasable
Device), EPROM (Erasable Programmable Read Only Memory, Erasable Programmable Read Only Memory EPROM), PROM
(Programmable Read-Only Memory, programmable read only memory), and ROM (Read-Only Memory, it is read-only to deposit
Reservoir), magnetic memory, flash memory, disk or CD.
Power supply module 1006 provides electric power for the various assemblies of device 1000.Power supply module 1006 can include power management
System, one or more power supplys, and other components associated with generating, managing and distributing electric power for device 1000.
Multimedia groupware 1008 is included in the screen of one output interface of offer between described device 1000 and user.
In some embodiments, screen can include LCD (Liquid Crystal Display, liquid crystal display) and TP (Touch
Panel, touch panel).If screen includes touch panel, screen may be implemented as touch-screen, to receive from user's
Input signal.Touch panel includes one or more touch sensors with the gesture on sensing touch, slip and touch panel.Institute
State touch sensor can not only sensing touch or sliding action border, but also detection touches or slide phase with described
The duration of pass and pressure.In certain embodiments, multimedia groupware 1008 includes a front camera and/or rearmounted taken the photograph
As head.When device 1000 is in operator scheme, such as screening-mode or during video mode, front camera and/or rear camera
The multi-medium data of outside can be received.Each front camera and rear camera can be a fixed optical lens systems
Unite or with focusing and optical zoom capabilities.
Audio-frequency assembly 1010 is configured as output and/or input audio signal.For example, audio-frequency assembly 1010 includes one
MIC (Microphone, microphone), when device 1000 is in operator scheme, such as call model, logging mode and speech recognition mould
During formula, microphone is configured as receiving external audio signal.The audio signal received can be further stored in memory
1004 or sent via communication component 1016.In certain embodiments, audio-frequency assembly 1010 also includes a loudspeaker, for defeated
Go out audio signal.
I/O interfaces 1012 are that interface, above-mentioned peripheral interface module are provided between processing assembly 1002 and peripheral interface module
Can be keyboard, click wheel, button etc..These buttons may include but be not limited to:Home button, volume button, start button and
Locking press button.
Sensor cluster 1014 includes one or more sensors, and the state for providing various aspects for device 1000 is commented
Estimate.For example, sensor cluster 1014 can detect opening/closed mode of device 1000, the relative positioning of component, such as group
Part is the display and keypad of device 1000, and sensor cluster 1014 can be with 1,000 1 groups of detection means 1000 or device
The position of part changes, the existence or non-existence that user contacts with device 1000, the orientation of device 1000 or acceleration/deceleration and device
1000 temperature change.Sensor cluster 1014 can include proximity transducer, be configured to connect in not any physics
The presence of object nearby is detected when touching.Sensor cluster 1014 can also include optical sensor, such as CMOS (Complementary
Metal Oxide Semiconductor, CMOS) or CCD (Charge-coupled Device, Charged Couple
Element) imaging sensor, for being used in imaging applications.In certain embodiments, the sensor cluster 1014 can also be wrapped
Include acceleration transducer, gyro sensor, Magnetic Sensor, pressure sensor or temperature sensor.
Communication component 1016 is configured to facilitate the communication of wired or wireless way between device 1000 and other equipment.Dress
The wireless network based on communication standard, such as WiFi, 2G or 3G, or combinations thereof can be accessed by putting 1000.It is exemplary at one
In embodiment, communication component 1016 receives broadcast singal or broadcast correlation from external broadcasting management system via broadcast channel
Information.In one exemplary embodiment, the communication component 1016 also include NFC (Near Field Communication,
Near-field communication) module, to promote junction service.For example, RFID (Radio Frequency can be based in NFC module
Identification, radio frequency identification) technology, IrDA (Infra-red Data Association, Infrared Data Association) skill
Art, UWB (Ultra Wideband, ultra wide band) technology, BT (Bluetooth, bluetooth) technologies and other technologies are realized.
In the exemplary embodiment, device 1000 can be by one or more ASIC (Application Specific
Integrated Circuit, application specific integrated circuit), DSP is (at Digital signal Processor, data signal
Manage device), DSPD (Digital signal Processor Device, digital signal processing appts), PLD (Programmable
Logic Device, PLD), FPGA) (Field Programmable Gate Array, field programmable gate
Array), controller, microcontroller, microprocessor or other electronic components realize, for performing the above method.
In the exemplary embodiment, a kind of non-transitorycomputer readable storage medium including instructing, example are additionally provided
Such as include the memory 1004 of instruction, above-mentioned instruction can be performed to complete the above method by the processor 1020 of device 1000.Example
Such as, the non-transitorycomputer readable storage medium can be ROM, RAM (Random Access Memory, arbitrary access
Memory), CD-ROM (Compact Disc Read-Only Memory, compact disc read-only memory), tape, floppy disk and light number
According to storage device etc..
Device 1000 includes memory, and one or more than one program, one of them or more than one
Program storage is configured to by one or more than one computing device in memory.It is one or one with
Upper program bag contains the instruction for the operation for being used to perform the insertion data described in above-described embodiment.
Device provided in an embodiment of the present invention, is built by obtaining according to the corresponding data table metadata of at least one tables of data
Vertical includes the entity class of check value, and the check value logarithm included according to the corresponding entity class of the tables of data for being inserted into data
During according to the data check success being inserted into table, according to the corresponding entity class of tables of data by the insertion of data into data table being inserted into,
It is achieved thereby that data are automatically inserted into;Further, since entity class includes check value so that before by insertion of data into data table
Data can be verified, not only increase the insertion efficiency of data, also optimize the insertion effect of data.
It should be noted that:The device for the insertion data that above-described embodiment is provided is when inserting data, only with above-mentioned each work(
The division progress of energy module is for example, in practical application, as needed can distribute above-mentioned functions by different functions
Module is completed, i.e., the internal structure of device is divided into different functional modules, described above all or part of to complete
Function.In addition, the device for the insertion data that above-described embodiment is provided and the embodiment of the method for insertion data belong to same design, its
The process of implementing refers to embodiment of the method, repeats no more here.
The embodiments of the present invention are for illustration only, and the quality of embodiment is not represented.
One of ordinary skill in the art will appreciate that realizing that all or part of step of above-described embodiment can be by hardware
To complete, the hardware of correlation can also be instructed to complete by program, described program can be stored in a kind of computer-readable
In storage medium, storage medium mentioned above can be read-only storage, disk or CD etc..
The foregoing is only presently preferred embodiments of the present invention, be not intended to limit the invention, it is all the present invention spirit and
Within principle, any modification, equivalent substitution and improvements made etc. should be included in the scope of the protection.