CN110019226A - A kind of introduction method and device of database file - Google Patents

A kind of introduction method and device of database file Download PDF

Info

Publication number
CN110019226A
CN110019226A CN201711403376.7A CN201711403376A CN110019226A CN 110019226 A CN110019226 A CN 110019226A CN 201711403376 A CN201711403376 A CN 201711403376A CN 110019226 A CN110019226 A CN 110019226A
Authority
CN
China
Prior art keywords
data
database
label
database file
entry
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.)
Pending
Application number
CN201711403376.7A
Other languages
Chinese (zh)
Inventor
蔡余广
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN201711403376.7A priority Critical patent/CN110019226A/en
Publication of CN110019226A publication Critical patent/CN110019226A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the present application provides the introduction method and device of a kind of database file.This method comprises: obtaining database file to be imported, every data in database file includes data label, data length and data content, and data length is used to indicate the length of data content;The data in database file are stored to database according to the data label, data length of data in database file and the storage format of data content according to the corresponding relationship of the data label in the data label and database in database file.Using scheme provided by the embodiments of the present application, it can be realized and database file is introduced directly into database, improve the abundant degree of database data.

Description

A kind of introduction method and device of database file
Technical field
This application involves technical field of data storage, more particularly to the introduction method and device of a kind of database file.
Background technique
Network cameras (IP Camera, IPC) and network video recorder (Network Video Recorder, NVR) group At system in, IPC can capture facial image, and facial image is sent to NVR.NVR receives the face figure of IPC transmission As after, which can be matched with the human face data in database.NVR can provide phase according to matching result The alarm answered.Therefore, the abundant degree of data will have a direct impact on matching result in database.
In the related art, the data source of the database in NVR includes that the NVR equipment is extracted from facial image in advance Data and manual entry data.There are version informations for database in NVR, for example, the number of the database purchase in NVR1 It is name, age and phone according to sequence, the data sequence of the database purchase in NVR2 is name, phone and age, then this The version information of two databases is different.It, can not will be from other NVR since the database version in each NVR is different Derived database file is introduced directly into the database of the NVR, and the abundant degree of database data is lower.
Summary of the invention
The introduction method and device for being designed to provide a kind of database file of the embodiment of the present application will be counted with realizing It is introduced directly into database according to library file, improves the abundant degree of database data.Specific technical solution is as follows.
In a first aspect, the embodiment of the present application provides a kind of introduction method of database file.This method comprises:
Database file to be imported is obtained, every data in the database file includes that data label, data are long Degree and data content, the data length are used to indicate the length of the data content;
According to the corresponding relationship of the data label in the data label and database in database file, according to the data The data label, data length of data and the storage format of data content in library file, by the data in the database file It stores to the database.
Optionally, the database file includes multiple entry datas, includes a plurality of data in every entry data;Described According to the corresponding relationship of the data label in the data label and database in database file, according to number in the database file According to data label, data length and data content storage format, the data in the database file are stored to described The step of database, comprising:
For each entry data in the database file, determine from the database each in the entry data The storage location of data;
According to the corresponding relationship of the data label in the data label and database in database file, by the database Each data label of entry data described in each data label and the database of entry data described in file carries out Matching;
For every data where the data label of successful match in the entry data, according to the data of the data Length obtains corresponding data content from the database file, and the data content is stored to described in the database The storage location of data described in entry data.
Optionally, this method further include:
For the data where the data label that it fails to match in the database file, refusal stores the data to institute State database;
For the data where the data label that it fails to match in the database, the data content of the data is emptied or It is set to the first preset value.
Optionally, in the storage that the data content is stored to data described in the entry data to the database Before position, this method further include:
Obtain the version information of the data content;
Judge that whether corresponding with the preset database version information version information be compatible;
The data content is stored into data described in the entry data to the database if it is, executing Storage location the step of.
Optionally, in the entry data of the database file further include: image corresponding with the data content of acquisition obtains The data content taken is to carry out the data that feature extraction obtains to corresponding image in advance;
When version information version information corresponding with the preset database is incompatible, this method further include:
The data content is replaced with into the second preset value, second preset value is stored to described in the database The storage location of data described in entry data;
When image corresponding with the data content has been stored to the database, feature is carried out to described image and is mentioned It takes, second preset value in the database is replaced using the data content that extraction obtains.
Optionally, the corresponding relationship of the data label in the data label and database according in database file, According to the storage format of the data label, data length and data content of data in the database file, by the database The step of data in file are stored to the database, comprising:
The key of the database file is obtained, is decrypted with database file described in the key pair, according to data The corresponding relationship of the data label in data label and database in library file, according to the number of data in the database file According to the storage format of label, data length and data content, the data in the database file after decryption are stored to the number According to library.
Optionally, the database file includes multiple entry datas, includes a plurality of data in every entry data;
The key for obtaining the database file, is decrypted with database file described in the key pair, according to The corresponding relationship of the data label in data label and database in database file, according to data in the database file Data label, data length and data content storage format, the data in the database file after decryption are stored to institute The step of stating database, comprising:
The corresponding key of each entry data of the database file is obtained, with database file described in the key pair In corresponding entry data be decrypted, it is corresponding with the data label in database according to the data label in database file Relationship, according to the storage format of the data label, data length and data content of data in the database file, after decryption Database file in the entry data pieces of data that includes store to the database.
Optionally, it after being decrypted with the corresponding entry data in database file described in the key pair, also wraps It includes:
The check bit data for including according to the entry data in the database file after decryption, to the data library text after decryption Entry data in part is verified;
When verifying successfully, the data label in the data label and database according in database file is executed Corresponding relationship will be solved according to the storage format of the data label, data length and data content of data in the database file The step of pieces of data that the entry data in database file after close includes is stored to the database.
Optionally, it stores by the data in the database file to the database, further includes:
Obtain the corresponding ExportRange information of data to be exported;
According to the ExportRange information, the data to be exported is exported from the database;
Storage format and the data to be exported according to the data label of the data, data length and data content, Generate export database file.
Second aspect, the embodiment of the present application provide a kind of gatherer of database file.The device includes:
First obtains module, every data packet for obtaining database file to be imported, in the database file Data label, data length and data content are included, the data length is used to indicate the length of the data content;
Memory module, for being closed according to the data label in database file is corresponding with the data label in database System, according to the storage format of the data label, data length and data content of data in the database file, by the data Data in library file are stored to the database.
Optionally, the database file includes multiple entry datas, includes a plurality of data in every entry data;It is described to deposit Store up module, comprising:
Submodule is determined, for being determined from the database for each entry data in the database file The storage location of pieces of data in the entry data;
Matched sub-block, for being closed according to the data label in database file is corresponding with the data label in database System, by each of each data label of entry data described in the database file and entry data described in the database A data label is matched;
Sub-module stored, for every data where the data label for successful match in the entry data, root Corresponding data content is obtained from the database file according to the data length of the data, by the data content store to The storage location of data described in the entry data of the database.
Optionally, device further include: processing module;
The processing module, for refusing for the data where the data label that it fails to match in the database file The data are stored to the database absolutely;For the data where the data label that it fails to match in the database, by this The data content of data empties or is set to the first preset value.
Optionally, the sub-module stored, is also used to:
The storage location that the data content is stored to data described in the entry data to the database it Before, obtain the version information of the data content;
Judge that whether corresponding with the preset database version information version information be compatible;
If it is, the data content is stored depositing for data described in the entry data to the database Storage space is set.
Optionally, in the entry data of the database file further include: image corresponding with the data content of acquisition obtains The data content taken is to carry out the data that feature extraction obtains to corresponding image in advance;The sub-module stored, is also used to:
When version information version information corresponding with the preset database is incompatible, by the data content The second preset value is replaced with, second preset value is stored into depositing for data described in the entry data to the database Storage space is set;
When image corresponding with the data content has been stored to the database, feature is carried out to described image and is mentioned It takes, second preset value in the database is replaced using the data content that extraction obtains.
Optionally, the memory module, is specifically used for:
The key of the database file is obtained, is decrypted with database file described in the key pair, according to data The corresponding relationship of the data label in data label and database in library file, according to the number of data in the database file According to the storage format of label, data length and data content, the data in the database file after decryption are stored to the number According to library.
Optionally, the database file includes multiple entry datas, includes a plurality of data in every entry data;It is described to deposit Module is stored up, is specifically used for:
The corresponding key of each entry data of the database file is obtained, with database file described in the key pair In corresponding entry data be decrypted, it is corresponding with the data label in database according to the data label in database file Relationship, according to the storage format of the data label, data length and data content of data in the database file, after decryption Database file in the entry data pieces of data that includes store to the database.
Optionally, the memory module, is also used to:
After being decrypted with the corresponding entry data in database file described in the key pair, after decryption The check bit data that entry data in database file includes carry out school to the entry data in the database file after decryption It tests;
When verifying successfully, closed according to the data label in database file is corresponding with the data label in database System, according to the storage format of the data label, data length and data content of data in the database file, after decryption The pieces of data that entry data in database file includes is stored to the database.
Optionally, the device further include:
Second obtains module, for storing by the data in the database file to the database, obtains The corresponding ExportRange information of data to be exported;
Export module, for exporting the data to be exported from the database according to the ExportRange information;
Generation module, for according to the data label of the data, data length and data content storage format and institute Data to be exported is stated, export database file is generated.
The third aspect, the embodiment of the present application provide a kind of electronic equipment.The electronic equipment include processor, communication connect Mouth, memory and communication bus, wherein processor, communication interface, memory complete mutual communication by communication bus;
Memory, for storing computer program;
Processor when for executing the program stored on memory, realizes data library text provided by the embodiments of the present application The introduction method of part.This method comprises:
Database file to be imported is obtained, every data in the database file includes that data label, data are long Degree and data content, the data length are used to indicate the length of the data content;
According to the corresponding relationship of the data label in the data label and database in database file, according to the data The data label, data length of data and the storage format of data content in library file, by the data in the database file It stores to the database.
Fourth aspect, the embodiment of the present application provide a kind of computer readable storage medium.The computer-readable storage medium Computer program is stored in matter, the computer program realizes database provided by the embodiments of the present application when being executed by processor The introduction method of file.This method comprises:
Database file to be imported is obtained, every data in the database file includes that data label, data are long Degree and data content, the data length are used to indicate the length of the data content;
According to the corresponding relationship of the data label in the data label and database in database file, according to the data The data label, data length of data and the storage format of data content in library file, by the data in the database file It stores to the database.
The introduction method and device of database file provided by the embodiments of the present application, can be according to the number in database file According to the corresponding relationship of the data label in label and database, according to the storage lattice of data label, data length and data content Formula stores the data in database file to database.Since every data in database file is all with data label, number It is stored in database file according to the format of length and data content, regardless of in database file, what position is pieces of data be located at Set, can according between data label corresponding relationship and above-mentioned storage format pieces of data stored to pair of database It answers in position, therefore can be realized and database file is introduced directly into database, improve the abundant degree of database data.When So, any product or method for implementing the application do not necessarily require achieving all the advantages described above at the same time.
Detailed description of the invention
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below There is attached drawing needed in technical description to be briefly described.It should be evident that the accompanying drawings in the following description is only this Some embodiments of application for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Fig. 1 is a kind of flow diagram of the introduction method of database file provided by the embodiments of the present application;
Fig. 2 a is a kind of structural reference figure of the binary form of database file provided by the embodiments of the present application;
Fig. 2 b is that the data in database file are stored the process to database with reference to figure;
Fig. 3 is a kind of flow diagram of step S102 in Fig. 1;
Fig. 4 a is a kind of with reference to figure of the storage location of pieces of data from entry data determining in database;
Fig. 4 b is a kind of with reference to figure after the entry data in Fig. 4 a to be imported to database;
Fig. 5 is provided by the embodiments of the present application by a kind of flow diagram derived from database file;
Fig. 6 a is a kind of interaction flow schematic diagram that face library file is exported from NVR;
Fig. 6 b is a kind of derived structural schematic diagram of face library file;
Fig. 6 c is that face library file is imported to one of NVR interaction flow schematic diagram;
Fig. 7 is a kind of structural schematic diagram of the gatherer of database file provided by the embodiments of the present application;
Fig. 8 is a kind of structural schematic diagram of electronic equipment provided by the embodiments of the present application.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete Whole description.Obviously, described embodiment is only a part of the embodiment of the application, instead of all the embodiments.Base Embodiment in the application, those of ordinary skill in the art are obtained all without making creative work Other embodiments shall fall in the protection scope of this application.
Database file is introduced directly into database in order to realize, improves the abundant degree of database data, the application Embodiment provides the introduction method and device of a kind of database file.Below by specific embodiment, the application is carried out detailed It describes in detail bright.
Fig. 1 is a kind of flow diagram of the introduction method of database file provided by the embodiments of the present application.The present embodiment Applied to electronic equipment.The electronic equipment may include common computer, Intelligent mobile equipment, tablet computer, laptop, The equipment such as server, or the equipment such as network video recorder (Network Video Recorder, NVR).Electronics is set It is stored with database in standby, which can be the types such as face database, information of vehicles library, personal information library.
The method of the present embodiment includes the following steps S101~step S102:
Step S101: database file to be imported is obtained.
Wherein, every data in the database file includes data label, data length and data content, i.e. every number Accordingly data label, data length, data content format be stored in database file.Data label is for indicating data Attribute type, data label can be with textual representations, can also be numerically.Data length is used to indicate the length of data content Degree.Data label and data length all can be regular length data, the length of data content can be not fixed.Data content Length by this parameter definition of data length, that is, indicate the length of the data content after data length.Above-mentioned data library text Part can be the file of binary system (Bin) format.
For example, table 1 is a kind of content example of database file.The first row tables of data in table 1 shows data label, X and Y is two kinds of representations of data label in " X/Y ", and X is the textual representation mode of data label, and Y is the number of data label Word representation.Second row data indicate data length.The third line tables of data shows data content.Wherein, " Zhang San ", " male ", " 22 ", " 12345678910 ", " Chinese " are the data content of the pieces of data in database file.
Table 1
Data label Name/11 Gender/12 Age/13 Phone/14 National/15
Data length 2 bytes 1 byte 2 bytes 11 bytes 1 byte
Data content Zhang San Male 22 12345678910 The Chinese
The corresponding binary form of partial content in database file shown in table 1 may refer to shown in Fig. 2 a.Scheming In binary file shown in 2a, every data all in accordance with data label, data length and data content storage format sequence Arrangement.Wherein, data label is fixed occupies 2 bytes, and data length is fixed to occupy 1 byte.
The database file can be the derived file from other electronic equipments, be also possible to electronic equipment according to storage Information generate file, or according to the information of user's typing generate file.For example, working as the executing subject of the present embodiment When for NVR, database file can be the derived file from other NVR.
Step S102: it according to the corresponding relationship of the data label in the data label and database in database file, presses It, will be in database file according to the storage format of the data label, data length and data content of data in above-mentioned database file Data store to database.
Wherein, there are each data labels and corresponding data content in database.Data in database file are led Enter the database, is to store the data content of the pieces of data in database file to each data label pair of database The storage location answered.
This step is specifically as follows, according to the data label in the data label and database in preset database file Corresponding relationship will according to the storage format of the data label, data length and data content of data in above-mentioned database file Data in database file are stored to database.
Wherein, the corresponding relationship of the data label in the data label and database in database file can be deposits in advance Storage.Data label in database file may be the same or different with data label corresponding in database.For example, The data label " name " in data label " 11 " correspondence database in database file, the data label in database file Data label " age " in " 12 " correspondence database;Alternatively, data label " name " correspondence database in database file In data label " name ", the data label " 12 " etc. in data label " 12 " correspondence database in database file.Phase Mutual corresponding data label is meant that identical.For example, data label " 11 " with data label " name " be it is mutual corresponding, Namely data label " 11 " has with data signature " name " identical meaning.
In this step, the corresponding relationship of the data label in data label and database in database file can also be with It is interpreted as, the data when the data label in database file is identical as the data label in database, in database file It is corresponded to each other between label and the data label in database.
It, can be according to the data label and number in database file when data in database file are stored to database According to the corresponding relationship of the data label in library, by the data label progress in the data label and database in database file Match, according to matching result, according to the data label, data length of data in above-mentioned database file and the storage lattice of data content Formula corresponding will deposit in database file according to the data label that the data content that data length determines is stored in database matching Storage space is set.
For example, in conjunction with table 1 and Fig. 2 b it is found that the data label " name " in database file and " name " in database Match, and according to " data length " 2 byte in table 1, the corresponding data of " name " label can be somebody's turn to do from database file The data content that 2 bytes are determined after length, that is, determine " Zhang San " this data content, " Zhang San " stored into database " surname Name " the corresponding storage location of label.The storage mode of other data is similar, repeats no more.It can be seen that database from Fig. 2 b The sequence of " gender " " age " two labels is inconsistent in file and database, but sequence is inconsistent to be had no effect on number It stores according to the data in library file into database, because data when storing are stored according to the corresponding relationship of data label.
Database in the present embodiment can be SQLite database, MySQL database or other databases.
As shown in the above, the present embodiment can be according to the data in the data label and database in database file The corresponding relationship of label, according to the storage format of data label, data length and data content, by the data in database file It stores to database.Since every data in database file is all with the format of data label, data length and data content Be stored in database file, regardless of in database file pieces of data be located at where, can according to data label it Between corresponding relationship and above-mentioned storage format pieces of data is stored into the corresponding position of database, therefore can be realized by Database file is introduced directly into database, improves the abundant degree of database data.
In the related art, the data label in database file and database must be completely the same, and data library text Successive position in part between each data label must be corresponding identical as the position in database, in this way could be by data library text Data in part are stored into database.And in the present embodiment, regardless of data label in database file sequence how, equal energy According to the corresponding relationship of the data label in the data label and database in database file, by the data in database file Content is stored into database, is imported the data in database file in database with realizing.
In another embodiment of the application, in the embodiment shown in fig. 1, database file may include multiple entry numbers According to including a plurality of data in every entry data.Entry data can be understood as a data.It include having in each entry data The pieces of data of different data label can have corresponding identical data label between each entry data.Table 2 is database A kind of example of entry data in file.In the table 2,2 entry datas are listed, one is Zhang San, and one is Lee xx 's.There is corresponding identical data label between the two entry datas.Include in each entry data " name " " gender " " age " " phone " " nationality " corresponding data content, the two entry datas include 10 datas altogether.
Table 2
Data label Name Gender Age Phone It is national
Data length 2 bytes 1 byte 2 bytes 11 bytes 1 byte
Data content Zhang San Male 22 12345678910 The Chinese
Data length 3 bytes 1 byte 2 bytes 11 bytes 1 byte
Data content Lee xx Male 25 23145678910 The Chinese
In the present embodiment, step S102 can be carried out according to flow diagram shown in Fig. 3, specifically include following steps S102a~step S102c:
Step S102a: each in the entry data from being determined in database for each entry data in database file The storage location of data.
Entry data has been stored in database.In the pieces of data from the entry data determining in database When storage location, it can be determined each in entry data to be stored according to the storage location for having stored entry data in database The storage location of data.Specifically, after the end that can have stored the storage location of entry data in the database identifies, Determine the storage location of pieces of data in entry data to be stored.
When from the storage location of pieces of data in the entry data is determined in database, can include according to database The corresponding distribution storage location of each data label.For example, with reference to shown in Fig. 4 a, in database file each entry data include A, B, tetra- labels of C, D, there are two entry datas in database file, and in database include five labels of A, B, C, E, F, number To have stored entry data according to there are one in library, then it can be true for entry data to be stored after this has stored entry data Determine the storage location of the corresponding data of five labels of A, B, C, E, F.
Step S102b:, will according to the corresponding relationship of the data label in the data label and database in database file In database file in each data label Yu database of the entry data entry data each data label carry out Match.
Before this step, it can also include each data label for obtaining the entry data from database file, obtain The step of taking each data label of the entry data in database.
It, can be according to the data label in the data label and database in database file in matching in this step Corresponding relationship, it is determining with the number from the database for every data label of the entry data in the database file According to the corresponding data label of label.It is also possible to every data label for the entry data in database, from data library text Data label corresponding with the data label is determined in part.
For example, when the data label in database file is with the data label difference in corresponding database, database Data label in file may include: that " 11 " are corresponding " name " with the corresponding relationship of the data label in database, and " 12 " are right " age " is answered, " 13 " correspondence " gender " can be with if some entry data includes the labels such as 11,12,13 in database file Determining and 11,12,13 matched data labels are respectively name, age, gender from database.If in database file Data label with the data label in corresponding database be it is identical, when some entry data includes surname in database file It, then can be from the data label with the tag match in the database file determining in database when the labels such as name, age, gender Respectively name, age, gender.
Step S102c: for every data where the data label of successful match in the entry data, according to above-mentioned number According to data length corresponding data content is obtained from database file, which is stored to the entry of database The storage location of the data in data.
It can be according to data label A in entry data for the data label A in database file for example, with reference to Fig. 4 a Data length in the data at place, obtains data content from database file, which is stored into database The corresponding storage location of data label A.Data storage procedure shown in dotted line in a referring to fig. 4.
In a specific embodiment, it for the data where the data label that it fails to match in database file, refuses The data are stored to database absolutely.
For example, with reference to Fig. 4 a, since data label D being not present in database, data label D is in database file Data where data label D are not stored to database, i.e., are not handled data label D by the data label that it fails to match The data at place.
In a specific embodiment, for the data where the data label that it fails to match in database, by the number According to data content empty or be set to the first preset value.Wherein, the first preset value be preset numerical value, be specifically as follows 0 or 1 or Any other value.
For example, with reference to Fig. 4 a, since data label E and F being not present in database file, data label E and F are number According to the data label that it fails to match in library, the data content of data where data label E and F in database is set to sky at this time.
B referring to fig. 4, Fig. 4 b are the reference imported two entry datas in the database file of Fig. 4 a after database Figure.As it can be seen that the data in database file below data label D do not import database, new two entry numbers for importing database In, the data below data label E and F are sky.
It to sum up, can be according in each data label and database of entry data in database file in the present embodiment Corresponding relationship after each data label matching of entry data, the data that will be obtained from database file according to data length Content stores the corresponding position into database, therefore can be realized multiple entry datas importing database, without requiring number Must be identical as in database according to the position of data label each in library file, that is, the requirement to database file format Lower, the format of database file can be more flexible.Meanwhile even if there are different data in database file and database When label, it also can be realized and import the entry data in database file in database, so that the spirit of database file Activity can be bigger.
In another embodiment of the application, in the embodiment shown in fig. 3, data content is stored in step S102c Into the entry data of database before the storage location of the data, can also include:
The version information for obtaining data content, judges version information version information whether corresponding with preset database It is compatible, if it is, executing the step that data content is stored to the storage location of the data into the entry data of database Suddenly;If incompatible, can not be handled.
When obtaining the version information of data content, the data of predetermined position in data content can be determined as version Information.Version information may include the information of version number and/or version levels etc.Specifically, can will be in data content Preceding preset quantity byte is as version information.For example, using 2 bytes preceding in data content as version number.
The corresponding version information of preset database, can be pre-stored information.
Judge that whether corresponding with preset database version information version information be compatible, be specifically as follows, judgement should Whether corresponding with preset database version information version information be identical, if identical, it is determined that the version information and default The corresponding version information of database it is compatible.Or judge whether the version levels of the version information are higher than preset number According to the version levels of the corresponding version information in library, if it is, then determining version information version corresponding with preset database This information is compatible.
To sum up, the present embodiment can improve accuracy when database file imports according to version information.
In another embodiment of the application, on the basis of the above embodiments, in the entry data of database file also It may include: image corresponding with the data content obtained.The data content of acquisition is to carry out feature to corresponding image in advance Extract obtained data.
For example, the data content can be modeling data, which can be the data extracted from facial image. It may include the faces characteristic such as interpupillary distance, facial contours inside modeling data.
It, can be by above-mentioned data content when above-mentioned version information version information corresponding with preset database is incompatible The second preset value is replaced with, the second preset value is stored to the storage location of the data into the entry data of database.Wherein, Second preset value is preset value, can be 0 or 1 or other values.
When image corresponding with above-mentioned data content has been stored to database, feature extraction is carried out to the image, is used Extract the second preset value in obtained data content replacement data library.
It in the present embodiment, can be with guide when the version information of the version information of data content and database is incompatible Enter the second preset value and corresponding image.After image importing, the electronic equipment as executing subject can be mentioned using feature It takes algorithm to carry out feature extraction to image, obtains new data content, the version information of the new data content and database Version information is matched, therefore the new data content can directly be replaced the second preset value.
To sum up, the present embodiment can import data for the second preset value as data content when version information is incompatible Library, and characteristic is extracted from image again, the characteristic of extraction is replaced into the second preset value again, can more be made full use of Image in database file makes the version for importing the data compatibility of database.
In the related art, the database stored in the electronic device is usually that a machine one is close, is considered for confidentiality, Data in database cannot be exported directly.In order to share the data of the spatial database of electronic equipment, to improve data The abundant degree of library data, for security consideration, this application provides following embodiments.
In another embodiment of the application, on the basis of embodiment shown in Fig. 1, step S102, according to data library text The corresponding relationship of the data label in data label and database in part, according to the data label of data in database file, The storage format of data length and data content specifically can be with the step of storing the data in database file to database Include:
The key for obtaining database file, is decrypted, according in database file with the data key library file The corresponding relationship of data label in data label and database, it is long according to the data label of data, data in database file The storage format of degree and data content, the data in the database file after decryption are stored to database.
In the present embodiment, database file to be imported acquired in step s101 is encrypted file.Therefore, it is holding When row step S102, database file can be decrypted, the data after decryption are stored to database.After it will decrypt When data are stored to database, the data after decryption can specifically be encrypted with pre-generated database key, will be added Data after close are stored to database.Database key can be the key that the first equipment generates at random in advance.
In the present embodiment, when to database file successful decryption, the data in database file could be imported number According to library.If the data in database file can not be imported database by database file decryption failure.
When obtaining the key of database file, specifically, the data that user can be inputted are as database file Key.The key of database file can also be obtained from other equipment.
When being decrypted with the data key library file, preset decipherment algorithm can be used, with the data key Library file is decrypted.Wherein, preset decipherment algorithm can be Message Digest Algorithm 5 (Message Digest Algorithm, MD5), RSA Algorithm or data encryption standards (Data Encryption Standard, DES) etc..Decrypting process It may refer to the relevant technologies, and will not be described here in detail.
To sum up, in the present embodiment, database file to be imported is by encryption, by the data in database file When storing to data, it can be decrypted with the data key library file of acquisition, it will be in the database file after decryption Data import database, and the present embodiment can be improved the safety of database file.
Database file may include multiple entry datas, include a plurality of data in every entry data.Each entry data Between be it is independent of each other, when being encrypted to entire database file, if decryption failure, all entry datas are all Database can not be imported.The case where all entry datas can not import when in order to avoid decryption failure, imports as much as possible Entry data, this application provides following embodiments.
In another embodiment of the application, the step S102 in Fig. 1 may include:
The corresponding key of each entry data of database file is obtained, with the correspondence item in the data key library file Mesh number is according to being decrypted, according to the corresponding relationship of the data label in the data label and database in database file, according to The data label, data length of data and the storage format of data content in database file, by the database file after decryption In the entry data pieces of data that includes store to database.
In the present embodiment, each entry data in database file separately encrypts, each entry number Encryption key between may be the same or different.
When obtaining the corresponding key of each entry data of database file, it can be made respectively according to the data that user inputs For the corresponding key of each entry data of database file.Each of database file can also be obtained from other equipment Mesh number is according to corresponding key.
The Encryption Algorithm of each entry data in database file may be the same or different.With the key logarithm When being decrypted according to the corresponding entry data in library file, same decipherment algorithm can be used, can also be calculated using different decryption Method.Above-mentioned decipherment algorithm can be MD5, RSA or DES scheduling algorithm.
To sum up, in the present embodiment, each entry data in database file is decrypted respectively, when some entry number When according to decryption failure, the importing of other entry datas is not influenced, therefore can be avoided all entry data equal nothings when decryption failure The case where method imports, so as to import entry data as much as possible.
In another embodiment of the application, it is being decrypted with the corresponding entry data in data key library file Afterwards, can also include:
The check bit data for including according to the entry data in the database file after decryption, to the data library text after decryption Entry data in part is verified.When verifying successfully, execute according in the data label and database in database file Data label corresponding relationship, according to the data label, data length of data in database file and the storage of data content Format, the step of the pieces of data that the entry data in the database file after decryption includes is stored to database.
When obtaining check bit data, can be obtained from the designated position in the entry data in the database file after decryption Take check bit data.When being verified to the entry data in the database file after decryption, it can be calculated according to preset verification Method handles all data that the entry data includes, and obtains check value, judges the verification digit of the check value and acquisition According to whether identical, if identical, success is verified.
For example, can calculate using MD5 algorithm all data that the entry data includes, MD5 value is obtained, is judged Whether the MD5 value and check bit data are identical, if identical, verify success.
To sum up, in the present embodiment, each entry data in database file is verified respectively, when some entry number When according to verification failure, the importing of other entry datas is not influenced, therefore can be avoided all entry data equal nothings when verification failure The case where method imports, so as to import entry data as much as possible.
In another embodiment of the application, store by the data in database file to database, it can be with Including database file export process shown in fig. 5, specifically include:
Step S501: the corresponding ExportRange information of data to be exported is obtained.
In this step, ExportRange information can be to be determined according to the ExportRange information of user's input.ExportRange letter Breath can be the data information of the range of expression data to be exported.ExportRange information is specifically as follows specified requirements, for example, Data label " gender " is all data of male or data label " time " is all data of 5:00 to 6:00 etc..
Step S502: according to above-mentioned ExportRange information, above-mentioned data to be exported is exported from database.
In this step, all data for meeting above-mentioned ExportRange information can be screened from database, as wait export Data.Every data to be exported includes data label and data content.
Step S503: according to the storage format of the data label of above-mentioned data, data length and data content and wait export Data generate export database file.
In this step, for every data to be exported, using the length of the data content of data to be exported as this wait export The data to be exported is stored in export according to the sequence of data label, data length and data content by the data length of data In database file.Wherein it is possible to successively store all data to be exported according to the sequence of entry data to database file In, generate export database file.
In a specific embodiment, according to the sequence of data label, data length and data content, this is waited exporting Data are stored when exporting in database file, can be according to the data mark in the data label and database in database file The corresponding relationship of label converts the data label of data to be exported, according to data label, data length and data content Sequentially, the data to be exported after change data label is stored in export database file.
For example, the data label in database includes " name " " age " " gender ", for data to be exported, if data Data label in library file may include: that " 11 " are corresponding " name " with the corresponding relationship of the data label in database, " 12 " Data label " name " in data to be exported can be then converted into " 11 " by corresponding " age ", " 13 " correspondence " gender ", will " age " is converted into " 12 ", and " gender " is converted into " 13 ", and the data to be exported after change data label is stored in export number According in library file.Exporting the data label in database file includes " 11 " " 12 " " 13 ".
In another embodiment specific implementation mode, by all data to be exported according to the sequence of entry data successively store to Before in database file, the check bit data of each entry data can also be determined according to preset checking algorithm, by the school It tests a data to be added in the entry data, according to the storage lattice of the data label of above-mentioned data, data length and data content Entry data after formula and addition check bit data, generates export database file.In this way, each in export database file A entry data verifies respectively, when importing, if entry data verification failure, can not influence other entry datas It imports, entry data can be imported as much as possible.
It, can be according to preset verification when determining the check bit data of each entry data according to preset checking algorithm Algorithm handles all data that the entry data includes, using obtained check value as check bit data.For example, can be with All data that the entry data includes are calculated using MD5 algorithm, using obtained MD5 value as check bit data.
When the check bit data are added in the entry data, which can be added to entry data In designated position.
The export database file of generation can be binary file.For example, the export database file generated can be Form shown in table 1 and Fig. 2 a, particular content is referring to the explanation in step S101, and details are not described herein again.
After generating export database file, key can also be obtained, is carried out with key pair export database file Encryption.The safety that database file can be improved in this way, avoids leaking data.
Specifically, can be calculated using MD5, RSA or DES etc. when being encrypted with key pair export database file Method is encrypted, and ciphering process may refer to the relevant technologies, and and will not be described here in detail.
In order to avoid database file decryption unsuccessfully causes all entry datas that can not import when importing, to export number When being encrypted according to library file, the corresponding key of each entry data of available database file, with the data key Corresponding entry data in library file are encrypted.
In the present embodiment, each entry data in database file separately encrypts, each entry number Encryption key between may be the same or different.
When obtaining the corresponding key of each entry data of database file, it can be made respectively according to the data that user inputs For the corresponding key of each entry data of database file.Each of database file can also be obtained from other equipment Mesh number is according to corresponding key.
The Encryption Algorithm of each entry data in database file may be the same or different.Above-mentioned Encryption Algorithm It can be MD5, RSA or DES scheduling algorithm.
It elaborates again below with reference to specific example to the application.
NVR includes GUI, SYS, STOR unit, and GUI element is used for interface display, SYS unit be used in GUI element and Intermediate scheduling is carried out between STOR unit, STOR unit is for being stored and being retrieved to face database.Face database is exported from NVR The interaction flow schematic diagram of file is referring to Fig. 6 a.
In Fig. 6 a, GUI element receives ExportRange information and the export path of the data to be exported of user's input, and mentions Show that user inputs key, receive the key of user's input, ExportRange information, export path and key are sent to SYS unit. ExportRange information is sent to STOR unit by SYS unit.It is corresponding that STOR unit retrieves ExportRange information from face database Face information is sent to SYS unit by face information.SYS unit is to face information according to data label, data length and data The format of content is assembled, and determines check bit data, and the face information after verifying position data and assembling is added together It is close, export face library file is generated, export face library file is stored into storage location corresponding to export path.In whole process Export progress can be fed back to GUI element by middle SYS unit, to show export progress to user.
Fig. 6 b is a kind of derived structural schematic diagram of face library file.It include file header, library information, personnel in this document Each entry data such as 1~personnel n.It include modulus, check bit, face database version number, device model, equipment language in file header Etc. data.It include the data such as check bit, occupied space, library attribute in the information of library.It include check bit, personnel's category in each personnel Property, modeling data length, modeling data, image length, image etc..Every data is all made of data label, data length, data Content format storage.
Face library file is imported into the interaction diagrams in NVR referring to Fig. 6 c.In fig. 6 c, GUI receives user's input Lead-in path prompts user to input key, receives the key of user's input, lead-in path and key are sent to SYS unit. SYS unit obtains face library file to be imported according to lead-in path, is decrypted and is verified with key pair face library file, Face library file after verification is sent to STOR unit.STOR unit, will for the data in the face library file after verification The data content of data, stores into database the storage location of the data label where data label in face library file, Storage returns the result after completing to SYS unit.SYS unit feeds back importing progress to GUI element, and GUI element shows to user and leads Enter progress.
Fig. 7 is a kind of structural schematic diagram of the gatherer of database file provided by the embodiments of the present application.The embodiment It is corresponding with embodiment of the method shown in Fig. 1.The embodiment is applied to electronic equipment.The device includes:
First obtains module 701, every data for obtaining database file to be imported, in the database file Including data label, data length and data content, the data length is used to indicate the length of the data content;
Memory module 702, for corresponding with the data label in database according to the data label in database file Relationship, according to the storage format of the data label, data length and data content of data in the database file, by the number It stores according to the data in library file to the database.
In another embodiment of the application, in embodiment illustrated in fig. 7, the database file includes multiple entry numbers According to including a plurality of data in every entry data;Memory module 702, comprising:
Submodule (not shown) is determined, for for each entry data in the database file, from described The storage location of pieces of data in the entry data is determined in database;
Matched sub-block (not shown), for according to the data in the data label and database in database file The corresponding relationship of label, will be described in each data label of entry data described in the database file and the database Each data label of entry data is matched;
Sub-module stored (not shown), for where the data label for successful match in the entry data Every data obtains corresponding data content according to the data length of the data from the database file, by the number The storage location of data described in the entry data to the database is stored according to content.
In another embodiment of the application, in embodiment illustrated in fig. 7 further include: processing module (not shown);
Processing module, for for the data where the data label that it fails to match in the database file, refusal will The data are stored to the database;For the data where the data label that it fails to match in the database, by the data Data content empty or be set to the first preset value.
In another embodiment of the application, in embodiment illustrated in fig. 7, sub-module stored is also used to:
The storage location that the data content is stored to data described in the entry data to the database it Before, obtain the version information of the data content;
Judge that whether corresponding with the preset database version information version information be compatible;
If it is, the data content is stored depositing for data described in the entry data to the database Storage space is set.
In another embodiment of the application, in embodiment illustrated in fig. 7, in the entry data of database file further include: Image corresponding with the data content of acquisition, the data content of acquisition carry out feature extraction to corresponding image in advance and obtain Data;Sub-module stored is also used to:
When version information version information corresponding with the preset database is incompatible, data content is replaced For the second preset value, the second preset value is stored to the storage location of data described in the entry data to the database;
When image corresponding with the data content has been stored to the database, feature is carried out to described image and is mentioned It takes, the second preset value in the database is replaced using the data content that extraction obtains.
In another embodiment of the application, in embodiment illustrated in fig. 7, memory module 702 is specifically used for:
The key for obtaining database file, is decrypted, according to data library text with database file described in the key pair The corresponding relationship of the data label in data label and database in part, according to the data mark of data in the database file The storage format of label, data length and data content, the data in the database file after decryption are stored to the database.
In another embodiment of the application, in embodiment illustrated in fig. 7, database file includes multiple entry datas, often It include a plurality of data in entry data;Memory module 702 is specifically used for:
The corresponding key of each entry data for obtaining database file, in database file described in the key pair Corresponding entry data are decrypted, and close according to the data label in database file is corresponding with the data label in database System, according to the storage format of the data label, data length and data content of data in the database file, after decryption The pieces of data that entry data in database file includes is stored to the database.
In another embodiment of the application, in embodiment illustrated in fig. 7, memory module 702 is also used to:
After being decrypted with the corresponding entry data in database file described in the key pair, after decryption The check bit data that entry data in database file includes carry out school to the entry data in the database file after decryption It tests;
When verifying successfully, closed according to the data label in database file is corresponding with the data label in database System, according to the storage format of the data label, data length and data content of data in the database file, after decryption The pieces of data that entry data in database file includes is stored to the database.
In another embodiment of the application, embodiment illustrated in fig. 7 further include:
Second obtains module (not shown), for storing by the data in the database file to the data After library, the corresponding ExportRange information of data to be exported is obtained;
Export module (not shown), described in being exported from the database according to the ExportRange information Data to be exported;
Generation module (not shown), for according to the data label of the data, data length and data content Storage format and the data to be exported generate export database file.
Since above-mentioned apparatus embodiment is obtained based on embodiment of the method, and this method technical effect having the same, Therefore details are not described herein for the technical effect of Installation practice.For device embodiment, since it is substantially similar to method Embodiment, so describing fairly simple, the relevent part can refer to the partial explaination of embodiments of method.
Fig. 8 is a kind of structural schematic diagram of electronic equipment provided by the embodiments of the present application.The electronic equipment includes processor 801, communication interface 802, memory 803 and communication bus 804, wherein processor 801, communication interface 802, memory 803 are logical It crosses communication bus 804 and completes mutual communication;
Memory, for storing computer program;
Processor when for executing the program stored on memory, realizes data library text provided by the embodiments of the present application The introduction method of part.The introduction method includes:
Database file to be imported is obtained, every data in the database file includes that data label, data are long Degree and data content, the data length are used to indicate the length of the data content;
According to the corresponding relationship of the data label in the data label and database in the database file, according to described The data label, data length of data and the storage format of data content in database file, will be in the database file Data are stored to the database.
The communication bus that above-mentioned electronic equipment is mentioned can be Peripheral Component Interconnect standard (Peripheral Component Interconnect, PCI) bus or expanding the industrial standard structure (Extended Industry Standard Architecture, EISA) bus etc..The communication bus can be divided into address bus, data/address bus, control bus etc..For just It is only indicated with a thick line in expression, figure, it is not intended that an only bus or a type of bus.
Communication interface is for the communication between above-mentioned electronic equipment and other equipment.
Memory may include random access memory (Random Access Memory, RAM), also may include non-easy The property lost memory (Non-Volatile Memory, NVM), for example, at least a magnetic disk storage.Optionally, memory may be used also To be storage device that at least one is located remotely from aforementioned processor.
Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit, CPU), network processing unit (Network Processor, NP) etc.;It can also be digital signal processor (Digital Signal Processing, DSP), it is specific integrated circuit (Application Specific Integrated Circuit, ASIC), existing It is field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete Door or transistor logic, discrete hardware components.
As a kind of specific embodiment, the electronic equipment in the present embodiment can be NVR, and database can be face Library.Face database is the database for being compared with the facial image that IPC is sent in preparatory typing NVR.
To sum up, the present embodiment can be corresponding with the data label in database according to the data label in database file Relationship stores the data in database file to data according to the storage format of data label, data length and data content Library.Since every data in database file is all stored in data with the format of data label, data length and data content In library file, regardless of in database file pieces of data be located at where, can be closed according to corresponding between data label System and above-mentioned storage format store pieces of data into the corresponding position of database, therefore can be realized database file It is introduced directly into database, improves the abundant degree of database data.
A kind of computer readable storage medium provided by the embodiments of the present application.It is stored in the computer readable storage medium Computer program, the computer program realize the importing of database file provided by the embodiments of the present application when being executed by processor Method.The introduction method includes:
Database file to be imported is obtained, every data in the database file includes that data label, data are long Degree and data content, the data length are used to indicate the length of the data content;
According to the corresponding relationship of the data label in the data label and database in the database file, according to described The data label, data length of data and the storage format of data content in database file, will be in the database file Data are stored to the database.
To sum up, the present embodiment can be corresponding with the data label in database according to the data label in database file Relationship stores the data in database file to data according to the storage format of data label, data length and data content Library.Since every data in database file is all stored in data with the format of data label, data length and data content In library file, regardless of in database file pieces of data be located at where, can be closed according to corresponding between data label System and above-mentioned storage format store pieces of data into the corresponding position of database, therefore can be realized database file It is introduced directly into database, improves the abundant degree of database data.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or any other variant be intended to it is non- It is exclusive to include, so that the process, method, article or equipment for including a series of elements not only includes those elements, It but also including other elements that are not explicitly listed, or further include solid by this process, method, article or equipment Some elements.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including There is also other identical elements in the process, method, article or equipment of the element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodiment Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.
The foregoing is merely the preferred embodiments of the application, are not intended to limit the protection scope of the application.It is all Any modification, equivalent substitution, improvement and etc. done within spirit herein and principle are all contained in the protection scope of the application It is interior.

Claims (20)

1. a kind of introduction method of database file, which is characterized in that the described method includes:
Obtain database file to be imported, every data in the database file include data label, data length and Data content, the data length are used to indicate the length of the data content;
According to the corresponding relationship of the data label in the data label and database in database file, according to the data library text The data label, data length of data and the storage format of data content in part store the data in the database file To the database.
2. the method according to claim 1, wherein the database file includes multiple entry datas, every Mesh number includes a plurality of data in;The data label according in database file is corresponding with the data label in database Relationship, according to the storage format of the data label, data length and data content of data in the database file, by the number The step of storing according to the data in library file to the database, comprising:
For each entry data in the database file, each item number in the entry data is determined from the database According to storage location;
According to the corresponding relationship of the data label in the data label and database in database file, by the database file Described in each data label of entry data matched with each data label of entry data described in the database;
For every data where the data label of successful match in the entry data, according to the data length of the data Corresponding data content is obtained from the database file, and the data content is stored to the entry of the database The storage location of data described in data.
3. according to the method described in claim 2, it is characterized by further comprising:
For the data where the data label that it fails to match in the database file, refusal stores the data to the number According to library;
For the data where the data label that it fails to match in the database, the data content of the data is emptied or is set to First preset value.
4. according to the method described in claim 2, it is characterized in that, storing by the data content to the institute of the database Before the storage location for stating data described in entry data, further includes:
Obtain the version information of the data content;
Judge that whether corresponding with the preset database version information version information be compatible;
The data content is stored into depositing for data described in the entry data to the database if it is, executing The step of storage space is set.
5. according to the method described in claim 4, it is characterized in that, in the entry data of the database file further include: with The corresponding image of the data content of acquisition, the data content of acquisition are to carry out the number that feature extraction obtains to corresponding image in advance According to;
When version information version information corresponding with the preset database is incompatible, further includes:
The data content is replaced with into the second preset value, second preset value is stored to the entry of the database The storage location of data described in data;
When image corresponding with the data content has been stored to the database, feature extraction is carried out to described image, is adopted Second preset value in the database is replaced with the data content that extraction obtains.
6. the method according to claim 1, wherein the data label and data according in database file The corresponding relationship of data label in library, in the data label, data length and data according to data in the database file The storage format of appearance, the step of the data in the database file are stored to the database, comprising:
The key of the database file is obtained, is decrypted with database file described in the key pair, according to data library text The corresponding relationship of the data label in data label and database in part, according to the data mark of data in the database file The storage format of label, data length and data content, the data in the database file after decryption are stored to the database.
7. according to the method described in claim 6, it is characterized in that, the database file includes multiple entry datas, every Mesh number includes a plurality of data in;
The key for obtaining the database file, is decrypted, according to data with database file described in the key pair The corresponding relationship of the data label in data label and database in library file, according to the number of data in the database file According to the storage format of label, data length and data content, the data in the database file after decryption are stored to the number The step of according to library, comprising:
The corresponding key of each entry data for obtaining the database file, in database file described in the key pair Corresponding entry data are decrypted, and close according to the data label in database file is corresponding with the data label in database System, according to the storage format of the data label, data length and data content of data in the database file, after decryption The pieces of data that entry data in database file includes is stored to the database.
8. the method according to the description of claim 7 is characterized in that with the correspondence in database file described in the key pair After entry data is decrypted, further includes:
The check bit data for including according to the entry data in the database file after decryption, in the database file after decryption Entry data verified;
When verifying successfully, it is corresponding with the data label in database to execute the data label according in database file Relationship, according to the storage format of the data label, data length and data content of data in the database file, after decryption Database file in the entry data pieces of data that includes the step of storing to the database.
9. described in any item methods according to claim 1~8, which is characterized in that by the data in the database file It stores to the database, further includes:
Obtain the corresponding ExportRange information of data to be exported;
According to the ExportRange information, the data to be exported is exported from the database;
Storage format and the data to be exported according to the data label of the data, data length and data content generate Export database file.
10. a kind of gatherer of database file characterized by comprising
First obtains module, and for obtaining database file to be imported, every data in the database file includes number According to label, data length and data content, the data length is used to indicate the length of the data content;
Memory module is pressed for the corresponding relationship according to the data label in the data label and database in database file According to the storage format of the data label, data length and data content of data in the database file, by the data library text Data in part are stored to the database.
11. device according to claim 10, which is characterized in that the database file includes multiple entry datas, often It include a plurality of data in entry data;The memory module, comprising:
Submodule is determined, described in being determined from the database for each entry data in the database file The storage location of pieces of data in entry data;
Matched sub-block, for the corresponding relationship according to the data label in the data label and database in database file, By each of each data label of entry data described in the database file and entry data described in the database Data label is matched;
Sub-module stored, for every data where the data label for successful match in the entry data, according to institute The data length for stating data obtains corresponding data content from the database file, and the data content is stored to described The storage location of data described in the entry data of database.
12. device according to claim 11, which is characterized in that further include: processing module;
The processing module, for for the data where the data label that it fails to match in the database file, refusal will The data are stored to the database;For the data where the data label that it fails to match in the database, by the data Data content empty or be set to the first preset value.
13. device according to claim 11, which is characterized in that the sub-module stored is also used to:
Before the storage location that the data content is stored to data described in the entry data to the database, obtain Take the version information of the data content;
Judge that whether corresponding with the preset database version information version information be compatible;
If it is, the data content to be stored to the storage position of data described in the entry data to the database It sets.
14. device according to claim 13, which is characterized in that in the entry data of the database file further include: Image corresponding with the data content of acquisition, the data content of acquisition carry out feature extraction to corresponding image in advance and obtain Data;The sub-module stored, is also used to:
When version information version information corresponding with the preset database is incompatible, the data content is replaced For the second preset value, second preset value is stored to the storage position of data described in the entry data to the database It sets;
When image corresponding with the data content has been stored to the database, feature extraction is carried out to described image, is adopted Second preset value in the database is replaced with the data content that extraction obtains.
15. device according to claim 10, which is characterized in that the memory module is specifically used for:
The key of the database file is obtained, is decrypted with database file described in the key pair, according to data library text The corresponding relationship of the data label in data label and database in part, according to the data mark of data in the database file The storage format of label, data length and data content, the data in the database file after decryption are stored to the database.
16. device according to claim 15, which is characterized in that the database file includes multiple entry datas, often It include a plurality of data in entry data;The memory module, is specifically used for:
The corresponding key of each entry data for obtaining the database file, in database file described in the key pair Corresponding entry data are decrypted, and close according to the data label in database file is corresponding with the data label in database System, according to the storage format of the data label, data length and data content of data in the database file, after decryption The pieces of data that entry data in database file includes is stored to the database.
17. device according to claim 16, which is characterized in that the memory module is also used to:
After being decrypted with the corresponding entry data in database file described in the key pair, according to the data after decryption The check bit data that entry data in library file includes, verify the entry data in the database file after decryption;
When verifying successfully, according to the corresponding relationship of the data label in the data label and database in database file, press According to the storage format of the data label, data length and data content of data in the database file, by the data after decryption The pieces of data that entry data in library file includes is stored to the database.
18. 0~17 described in any item devices according to claim 1, which is characterized in that further include:
Second acquisition module is obtained for storing by the data in the database file to the database wait lead The corresponding ExportRange information of data out;
Export module, for exporting the data to be exported from the database according to the ExportRange information;
Generation module, for according to the data label of the data, data length and data content storage format and it is described to Data are exported, export database file is generated.
19. a kind of electronic equipment, which is characterized in that including processor, communication interface, memory and communication bus, wherein processing Device, communication interface, memory complete mutual communication by communication bus;
Memory, for storing computer program;
Processor when for executing the program stored on memory, realizes any method and step of claim 1-9.
20. a kind of computer readable storage medium, which is characterized in that be stored with computer in the computer readable storage medium Program realizes claim 1-9 any method and step when the computer program is executed by processor.
CN201711403376.7A 2017-12-22 2017-12-22 A kind of introduction method and device of database file Pending CN110019226A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711403376.7A CN110019226A (en) 2017-12-22 2017-12-22 A kind of introduction method and device of database file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711403376.7A CN110019226A (en) 2017-12-22 2017-12-22 A kind of introduction method and device of database file

Publications (1)

Publication Number Publication Date
CN110019226A true CN110019226A (en) 2019-07-16

Family

ID=67187133

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711403376.7A Pending CN110019226A (en) 2017-12-22 2017-12-22 A kind of introduction method and device of database file

Country Status (1)

Country Link
CN (1) CN110019226A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101645073A (en) * 2009-08-25 2010-02-10 浪潮电子信息产业股份有限公司 Method for guiding prior database file into embedded type database
CN102841784A (en) * 2011-06-24 2012-12-26 镇江华扬信息科技有限公司 Method for dynamically importing Excel data into database
CN103995908A (en) * 2014-06-17 2014-08-20 山东中创软件工程股份有限公司 Method and device for importing data
CN104317974A (en) * 2014-11-21 2015-01-28 武汉理工大学 Reconfigurable multi-source data importing method in ERP system
US9495475B2 (en) * 2008-11-21 2016-11-15 Sap Se Method of representing an XML schema definition and data within a relational database management system using a reusable custom-defined nestable compound data type
CN106933835A (en) * 2015-12-29 2017-07-07 航天信息软件技术有限公司 The data lead-in method and system of a kind of compatibility parsing Excel file
CN107247767A (en) * 2017-06-05 2017-10-13 山东浪潮通软信息科技有限公司 A kind of method and device that database is imported by formatted data files

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9495475B2 (en) * 2008-11-21 2016-11-15 Sap Se Method of representing an XML schema definition and data within a relational database management system using a reusable custom-defined nestable compound data type
CN101645073A (en) * 2009-08-25 2010-02-10 浪潮电子信息产业股份有限公司 Method for guiding prior database file into embedded type database
CN102841784A (en) * 2011-06-24 2012-12-26 镇江华扬信息科技有限公司 Method for dynamically importing Excel data into database
CN103995908A (en) * 2014-06-17 2014-08-20 山东中创软件工程股份有限公司 Method and device for importing data
CN104317974A (en) * 2014-11-21 2015-01-28 武汉理工大学 Reconfigurable multi-source data importing method in ERP system
CN106933835A (en) * 2015-12-29 2017-07-07 航天信息软件技术有限公司 The data lead-in method and system of a kind of compatibility parsing Excel file
CN107247767A (en) * 2017-06-05 2017-10-13 山东浪潮通软信息科技有限公司 A kind of method and device that database is imported by formatted data files

Similar Documents

Publication Publication Date Title
CN108268253B (en) Interface code generation method and terminal equipment
CN108154365B (en) Safety equipment, method and system for generating dynamic two-dimensional code
CN110729028A (en) Health data processing method and device, electronic equipment and storage medium
CN107729924B (en) Picture review probability interval generation method and picture review determination method
CN110210591A (en) A kind of wiring method, computer installation and the computer readable storage medium of intellective IC card personal data
CN110473104A (en) A kind of transaction processing method and relevant device
CN110162722A (en) Products Show method, server and storage medium based on two dimensional code
CN107453874A (en) Digital sealing and its generation method, service request and offer method and electronic equipment
CN110022558A (en) The encryption and decryption method and electronic device and storage medium of a kind of upgrade package
CN107491674A (en) Feature based information carries out the method and device of user's checking
CN114826553A (en) Cloud storage data security protection method and device based on group signature and homomorphic encryption
CN110232021A (en) The method and device of page test
KR20190050691A (en) Total periodic non-identification management apparatus and method
CN111124421B (en) Abnormal contract data detection method and device for blockchain intelligent contract
CN104838416A (en) Electronic health record system with customizable compliance policies
CN110213202A (en) Mark encryption matching process and device, identification processing method and device
CN114265577A (en) Service data processing method and device, computer equipment and storage medium
CN106803116A (en) A kind of method and device for generating Asset Tag
CN111739190B (en) Vehicle diagnostic file encryption method, device, equipment and storage medium
CN116090018B (en) Bank data security processing method and system
CN116738493A (en) Data encryption storage method and device based on classification category
CN110019226A (en) A kind of introduction method and device of database file
CN110059081A (en) Data output method, device and the computer equipment shown based on data
CN114049970B (en) Medication management method and system based on multi-terminal data sharing
CN113487350A (en) Business product determination method and related 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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190716