CN103914481B - Date storage method and device - Google Patents

Date storage method and device Download PDF

Info

Publication number
CN103914481B
CN103914481B CN201310004818.6A CN201310004818A CN103914481B CN 103914481 B CN103914481 B CN 103914481B CN 201310004818 A CN201310004818 A CN 201310004818A CN 103914481 B CN103914481 B CN 103914481B
Authority
CN
China
Prior art keywords
file
index
data
independent
key message
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.)
Active
Application number
CN201310004818.6A
Other languages
Chinese (zh)
Other versions
CN103914481A (en
Inventor
郭振宇
邹方明
陈焱雄
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Tencent Computer Systems Co Ltd
Original Assignee
Shenzhen Tencent Computer Systems 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 Shenzhen Tencent Computer Systems Co Ltd filed Critical Shenzhen Tencent Computer Systems Co Ltd
Priority to CN201310004818.6A priority Critical patent/CN103914481B/en
Publication of CN103914481A publication Critical patent/CN103914481A/en
Application granted granted Critical
Publication of CN103914481B publication Critical patent/CN103914481B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • G06F16/144Query formulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/1727Details of free space management performed by the file system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0608Saving storage space on storage systems

Landscapes

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

Abstract

The embodiment of the invention discloses date storage methods, which comprises generates and save the independent index file of data file;Index key message is generated according to the independent index file, the index key message includes the file identification information of the independent index file and the segment index information of the independent index file;The index key message is merged into preservation with the data file.The embodiment of the invention also discloses a kind of data storage devices.It using the present invention, may be implemented inversely to search independent index file from data file, and then realize conversed analysis data and reverse reclamation storage resource.

Description

Date storage method and device
Technical field
The present invention relates to electronic technology field more particularly to a kind of date storage methods and device.
Background technique
In existing data storage technology, it will usually assist the management of data file using independent index file, such as need Data file is saved to disk, traditional method is the independent index file for establishing independent completion, and data are written, then can lead to Independent index file is crossed to obtain data file and be analyzed;When deleting data, it is also desirable to find independent index first Then file recycles the storage resource of data occupancy according to data directory.
The existing technological deficiency that data file is managed by independent index file is: when because a variety of causes causes to look for When malfunctioning less than the independent index file of data file or independent index file content, will cause, which can not recycle the data file, is accounted for Storage resource.
Summary of the invention
The technical problem to be solved by the embodiment of the invention is that a kind of date storage method and device are provided, it can be achieved that Independent index file is inversely searched from data file.
In order to solve the above-mentioned technical problem, the embodiment of the invention provides a kind of date storage methods, which comprises
Generate and save the independent index file of data file;
Index key message is generated according to the Dynamic data exchange index file, the index key message includes the independence The segment index information of the file identification information of index file and the independent index file;
The index key message is merged into preservation with the data file.
Wherein, it is described obtain the index key message merge preservation with the data file after further include:
Obtain the index key message for merging the data file saved with data file;
The independent index file of the data file is searched according to the index key message.
On the other hand, the embodiment of the invention also provides a kind of date storage methods, which comprises
Obtain the index key message for merging the data file saved with data file, the index key message packet Include the file identification information of the independent index file of the data file and the segment index information of the independent index file;
The independent index file of the data file is searched according to the index key message.
Wherein, the index key message that the acquisition merges the data file saved with data file also wraps before It includes:
Generate and save the independent index file of the data file;
The index key message is generated according to the independent index file;
The index key message is merged into preservation with the data file.
Wherein, the method also includes:
Data analysis is carried out according to the independent index file found.
Wherein, the segment index information includes the data length of the data file.
Wherein, the method also includes:
Delete the data file and the independent index file found.
Correspondingly, the embodiment of the invention also provides a kind of data storage device, the data storage device includes:
Index file generation module, for generating and saving the independent index file of data file;
Key message generation module, for generating index key message, the rope according to the Dynamic data exchange index file Draw the partial index letter of file identification information and the independent index file that key message includes the independent index file Breath;
Data storage module, for the index key message to be merged preservation with the data file.
Wherein, the data storage device further include:
Key message obtains module, for obtaining the index pass for merging the data file saved with the data file Key information;
Index file searching module, for searching the independent index text of the data file according to the index key message Part.
On the other hand, the embodiment of the invention also provides a kind of data storage device, the data storage device includes:
Key message obtains module, for obtaining the index key letter for merging the data file saved with data file Breath, the index key message includes the file identification information of the independent index file and the portion of the independent index file Subindex information;
Index file searching module, for searching the independent index text of the data file according to the index key message Part.
Wherein, the data storage device further include:
Index file generation module, for generating and saving the independent index file of the data file;
Key message generation module, for generating the index key message according to the independent index file;
Data storage module, for the index key message to be merged preservation with the data file.
Wherein, the data storage device further include:
Data analysis module, the independent index file for finding according to carry out data analysis.
Wherein, the segment index information includes the data length of the data file.
Wherein, the data storage device further include:
Resource reclaim module, for deleting the data file and the independent index file found.
The embodiment of the present invention merges preservation with data file by generating the index key message of independent index file, It may be implemented inversely to search independent index file from data file, and then realize conversed analysis data and reverse reclamation storage money Source.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention 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 the flow diagram of one of embodiment of the present invention date storage method;
Fig. 2 is the flow diagram for the method that one of embodiment of the present invention inversely searches independent index file;
Fig. 3 is the method flow schematic diagram of one of embodiment of the present invention reverse reclamation data file;
Fig. 4 is the structural schematic diagram of one of embodiment of the present invention data storage device.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
The date storage method and device proposed in the embodiment of the present invention can be applied in terminal local storage and C/S knot The scene process of remote data storage under structure.
Fig. 1 is the flow diagram of the date storage method in the embodiment of the present invention.In the embodiment of the present invention as shown in the figure Data Stored Procedure include:
S101 generates and saves the independent index file of the data file.
Specifically, the independent index file in the embodiment of the present invention is saved independently of data file, wherein including The complete index information of the data file can carry out detailed data analysis and data file according to independent index file Recycling.
S102 generates the index key message according to the Dynamic data exchange index file.
Specifically, the index key message of the data file includes the file of the independent index file of the data file Identification information, for searching the independent index file of the data file, client login account for example including user and solely The file name of vertical index file, can uniquely correspond to independently depositing for a data file by the index key message The independent index file put.Further, the index key message can also include the part rope of the independent index file Fuse breath, the data length etc. for example including the data file, it is assumed that when only needing the segment index information to data file When analysis, the segment index information got be in index key message can be directly used and analyzed and do not had to The independent index file for obtaining independent completion is gone to be analyzed again.It is a kind of data structure for indexing crucial (key) information as follows The example of definition:
{
char*key;∥ index key information
unsigned data_len;∥ data length
}
The index key message is merged preservation with the data file by S103.
It is merged specifically, obtained index key message can will be generated with the data file, preservation merges The data arrived.
Fig. 2 is that the process for the method for inversely searching independent index file in date storage method in the embodiment of the present invention is shown It is intended to.The process for inversely searching independent index file in the present embodiment includes: as shown in the figure
S201 obtains the index key message for merging the data file saved with data file.
Specifically, the index key message in the embodiment of the present invention is as it was noted above, which is not described herein again.
S202 searches the independent index file of the data file according to the index key message.
Specifically, can be in the position for storing independent index file according to the index key message saved is merged with data file The independent index file for finding the data file is set, to realize the reverse purpose for searching data directory, and then can be according to looking into The independent index file found carries out detailed analysis to data file, or according to the independent index file found to data file Occupied storage resource is recycled;On the other hand, if being searched according to the index key message less than the data file Independent index file, then it represents that the independent index file of the data file has been lost or damaged, and at this moment can choose described in reconstruction The independent index file of data file or selection delete the data file to recycle the occupied resource of the data file.
Fig. 3 is the method flow schematic diagram of one of embodiment of the present invention reverse reclamation data file.As shown in the figure originally The process of the reverse reclamation data file provided in inventive embodiments includes:
S301 obtains the index key message for merging the data file saved with data file.
Specifically, the index key message in the embodiment of the present invention includes the text of the independent index file of the data file The segment index information of part identification information and the independent index file, file identification information is for searching the data file Independent index file, the file name of client login account and independent index file for example including user, passes through the rope The independent index file independently stored an of data file, the crucial letter of the index can uniquely be corresponded to by drawing key message Breath can also include the segment index information of the independent index file, the data length including the data file.
S302 searches the independent index file of the data file according to the index key message.Specifically, this implementation It, can be according to location lookup of the index key message in the independent index file of storage for merging preservation with data file in example The independent index file of the data file can execute step S303 if having found and execute S304 again, if according to described Index independent index file of the key message lookup less than the data file, then it represents that the independent index file of the data file is It loses or damages, at this moment can skip step S303 and directly execute step S304.
S303, the independent index file found described in deletion.
S304 deletes the data file.It can be recycled according to the independent index file found in the present embodiment The occupied storage resource of data file, can also be according to the data file for including in the index key message Data length recycles the occupied storage resource of the data file, the final mesh for realizing reverse reclamation storage resource 's.
Fig. 4 is the structural schematic diagram of the data storage device in the embodiment of the present invention.In the embodiment of the present invention as shown in the figure Data storage device include:
Index file generation module 410, for generating and saving the independent index file of the data file.Specifically, Independent index file in the embodiment of the present invention is saved independently of data file, wherein including the complete of the data file Whole index information can carry out detailed data analysis and the recycling of data file according to independent index file.
Key message generation module 420, for generating the index key message according to the Dynamic data exchange index file. Specifically, the index key message in the embodiment of the present invention may include the files-designated of the independent index file of the data file Know information, for searching the independent index file of the data file, client login account and independence for example including user The file name of index file can uniquely correspond to the independent of a data file by the index key message and index File.Further, the index key message can also include the segment index information of the independent index file, such as wrap The data length etc. for including the data file can when only needing to analyze the segment index information of data file It is analyzed and with directlying adopt the segment index information got be in index key message without going to obtain independent index again File is analyzed.It is a kind of example of data structure definition for indexing crucial (key) information as follows:
{
char*key;∥ index key information
unsigned data_len;∥ data length
}
Data storage module 430, for the index key message to be merged preservation with the data file.
Specifically, key message generation module 420 can be generated obtained index key message by data storage module 430 It is merged with the data file, saves the data for merging and obtaining.
Key message obtains module 440, for obtaining the index pass for merging the data file saved with data file Key information.
It, can be in the specific implementation, when user needs inversely to call according to data file the index information of the data file The index key message for merging the data file saved with data file is obtained, for searching the independence of the data file Index file.
Index file searching module 450, for searching the independent rope of the data file according to the index key message Quotation part.
Specifically, index file searching module 450 can store independent index file according to index key message Position find the independent index file of the data file, to realize the reverse purpose for searching data directory.
Further, the data storage device in the embodiment of the present invention can also include:
Data analysis module 460, for carrying out data analysis according to the independent index file.Specifically, data are analyzed Module 460 can also carry out partial data analysis to the data file according to the segment index information in index key message, Such as the data length comprising data file in index key message, then when only needing the segment index information to data file When analysis, it is the partial index indexed in key message that data analysis module 460, which also can be directly used and get, Information is analyzed and is not had to that the independent index file for obtaining independent completion is gone to be analyzed again.
Further, the data storage device in the embodiment of the present invention can also include:
Resource reclaim module 470, for deleting the data file and the independent index file found.
It can be deposited according to the independent index file recycling data file found is occupied in the present embodiment Resource is stored up, it can also be according to the data length for the data file for including in the index key message, to the data text The occupied storage resource of part is recycled, the final purpose for realizing reverse reclamation storage resource.On the other hand, if according to described Index independent index file of the key message lookup less than the data file, then it represents that the independent index file of the data file is Lose or damage, at this moment can choose the independent index file for rebuilding the data file or the selection deletion data file with Recycle the occupied resource of the data file.
The embodiment of the present invention merges preservation with data file by generating the index key message of independent index file, It may be implemented inversely to search independent index file from data file, and then realize conversed analysis data and reverse reclamation storage money Source.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, the program can be stored in a computer-readable storage medium In, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, the storage medium can be magnetic Dish, CD, read-only memory (Read-Only Memory, ROM) or random access memory (Random Access Memory, RAM) etc..
The above disclosure is only the preferred embodiments of the present invention, cannot limit the right model of the present invention with this certainly It encloses, therefore equivalent changes made in accordance with the claims of the present invention, is still within the scope of the present invention.

Claims (15)

1. a kind of date storage method, which is characterized in that the described method includes:
The independent index file of data file is generated and saves, the independent index file be used to carry out the data file Data analysis or the recycling of data file;
Index key message is generated according to the independent index file, the index key message includes the independent index file File identification information and the independent index file segment index information, the independent index file file identification letter The independent index file for searching the data file is ceased, the segment index information is for counting the data file According to analysis or the recycling of data file;
The index key message is merged into preservation with the data file.
2. date storage method as described in claim 1, which is characterized in that described by the index key message and the number After being saved according to file mergences further include:
Obtain the index key message for merging the data file saved with the data file;
The independent index file of the data file is searched according to the index key message.
3. a kind of method for searching independent index file, which is characterized in that the described method includes:
The index key message for merging the data file saved with data file is obtained, the index key message includes institute The file identification information of the independent index file of data file and the segment index information of the independent index file are stated, it is described The file identification information of independent index file is used to search the independent index file of the data file;
The independent index file of the data file is searched according to the index key message, the independent index file is used for Data analysis or the recycling of data file are carried out to the data file;
If searching the independent index file less than the data file according to the index key message, closed according to the index Segment index information in key information carries out data analysis or the recycling of data file to the data file.
4. method as claimed in claim 3, which is characterized in that the acquisition merges the data text saved with data file Before the index key message of part further include:
Generate and save the independent index file of the data file;
The index key message is generated according to the independent index file;
The index key message is merged into preservation with the data file.
5. method as claimed in claim 3, which is characterized in that the method also includes:
Data analysis is carried out according to the independent index file found.
6. method as claimed in claim 3, which is characterized in that the segment index information includes the data of the data file Length.
7. method as claimed in claim 6, which is characterized in that the method also includes:
Delete the data file and the independent index file found.
8. a kind of data storage device, which is characterized in that the data storage device includes:
Index file generation module, for generating and saving the independent index file of data file, the independent index file quilt For carrying out data analysis or the recycling of data file to the data file;
Key message generation module, for generating index key message, the crucial letter of the index according to the independent index file The segment index information of file identification information and the independent index file of the breath including the independent index file, it is described only The file identification information of vertical index file is used to search the independent index file of the data file, and the segment index information is used In to data file progress data analysis or the recycling of data file;
Data storage module, for the index key message to be merged preservation with the data file.
9. data storage device as claimed in claim 8, which is characterized in that the data storage device further include:
Key message obtains module, for obtaining the index key letter for merging the data file saved with the data file Breath;
Index file searching module, for searching the independent index file of the data file according to the index key message.
10. a kind of device for searching independent index file, which is characterized in that the device for searching independent index file includes:
Key message obtains module, for obtaining the index key message for merging the data file saved with data file, The file identification information for indexing the independent index file that key message includes the data file and the independent index The segment index information of file, the file identification information of the independent index file are used to search the independent rope of the data file Quotation part;
Index file searching module, for searching the independent index file of the data file according to the index key message, The file identification information of the independent index file is used to search the independent index file of the data file;
Data analysis module is searched according to the index key message less than the data text for indexed file searching module When the independent index file of part, data analysis is carried out according to the segment index information in the index key message;
Resource reclaim module is searched according to the index key message less than the data text for indexed file searching module When the independent index file of part, the data file is deleted according to the segment index information in the index key message.
11. device as claimed in claim 10, which is characterized in that further include:
Index file generation module, for generating and saving the independent index file of the data file;
Key message generation module, for generating the index key message according to the independent index file;
Data storage module, for the index key message to be merged preservation with the data file.
12. device as claimed in claim 10, which is characterized in that the data analysis module is also used to according to the index The independent index file that file search module is found carries out data analysis.
13. device as claimed in claim 10, which is characterized in that the index key message includes the independent index file File identification information and the independent index file segment index information, the segment index information includes the data The data length of file.
14. device as claimed in claim 13, which is characterized in that further include:
Resource reclaim module, the independent index file for being found according to the index file searching module delete the data File and the independent index file found.
15. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, the calculating Machine program includes program instruction, and described program is instructed when being executed by a processor, executed as described in any one of claim 1-6 Method.
CN201310004818.6A 2013-01-07 2013-01-07 Date storage method and device Active CN103914481B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310004818.6A CN103914481B (en) 2013-01-07 2013-01-07 Date storage method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310004818.6A CN103914481B (en) 2013-01-07 2013-01-07 Date storage method and device

Publications (2)

Publication Number Publication Date
CN103914481A CN103914481A (en) 2014-07-09
CN103914481B true CN103914481B (en) 2019-09-13

Family

ID=51040173

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310004818.6A Active CN103914481B (en) 2013-01-07 2013-01-07 Date storage method and device

Country Status (1)

Country Link
CN (1) CN103914481B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105740369B (en) * 2016-01-27 2019-06-28 桂林长海发展有限责任公司 A kind of multiple views framing emerging system and method
WO2021017647A1 (en) * 2019-07-29 2021-02-04 华为技术有限公司 Method and apparatus for merging data units

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1492362A (en) * 2002-10-25 2004-04-28 联想(北京)有限公司 Data back up and recovering method of embedded data bank
CN1584883A (en) * 2004-05-27 2005-02-23 威盛电子股份有限公司 Related document connecting managing system, method and recording media
CN101546342A (en) * 2009-05-08 2009-09-30 阿里巴巴集团控股有限公司 Method and system for implementing search service
CN102314383A (en) * 2011-09-28 2012-01-11 成都市华为赛门铁克科技有限公司 Failure recovery method and device for data index

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1583005A3 (en) * 2004-04-02 2007-01-10 Samsung Electronics Co., Ltd. File management and apparatus for controlling digital contents in multimedia appliances and information recording medium therefor
US7483929B2 (en) * 2005-02-08 2009-01-27 Pro Softnet Corporation Systems and methods for storing, backing up and recovering computer data files

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1492362A (en) * 2002-10-25 2004-04-28 联想(北京)有限公司 Data back up and recovering method of embedded data bank
CN1584883A (en) * 2004-05-27 2005-02-23 威盛电子股份有限公司 Related document connecting managing system, method and recording media
CN101546342A (en) * 2009-05-08 2009-09-30 阿里巴巴集团控股有限公司 Method and system for implementing search service
CN102314383A (en) * 2011-09-28 2012-01-11 成都市华为赛门铁克科技有限公司 Failure recovery method and device for data index

Also Published As

Publication number Publication date
CN103914481A (en) 2014-07-09

Similar Documents

Publication Publication Date Title
CN103186919B (en) A kind of word rendering intent and device
CN104133822B (en) A kind of method and device that file on memorizer is scanned
CN103593333B (en) A kind of processing method, terminal and the electronic equipment of e-book document
CN105718272B (en) A kind of method and terminal of terminal factory reset
CN103324763B (en) Presenting method for tree-form data structure of mobile phone terminal
CN111198856B (en) File management method, device, computer equipment and storage medium
CN108021590A (en) A kind of destination object attribute determining method, attribute update method and device
CN105677904B (en) Small documents storage method and device based on distributed file system
CN106844089A (en) A kind of method and apparatus for recovering tree data storage
CN105550246A (en) System and method for loading network picture under Android platform
CN106294886A (en) A kind of method and system of full dose extracted data from HBase
CN113094355A (en) Model instantiation method, device, equipment and medium based on domestic communication protocol
CN105447168A (en) Method for restoring and recombining fragmented files in MP4 format
CN107526627A (en) A kind of virtual resource life cycle information management method and device
CN103914481B (en) Date storage method and device
CN106326040A (en) Method and device for managing snapshot metadata
CN106802928B (en) Power grid historical data management method and system
CN110020272A (en) Caching method, device and computer storage medium
CN104778252A (en) Index storage method and index storage device
CN105159997B (en) Report processing method and report processing system
CN102567377B (en) Electronic map data management system and method
CN106484755A (en) The method of asynchronous quick loading video thumbnails
CN106250501A (en) Report processing method and reporting system
CN106126555B (en) A kind of file management method and file system
CN106557530B (en) Operation system, data recovery method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant