CN103914481A - Data storage method and device - Google Patents

Data storage method and device Download PDF

Info

Publication number
CN103914481A
CN103914481A CN201310004818.6A CN201310004818A CN103914481A CN 103914481 A CN103914481 A CN 103914481A CN 201310004818 A CN201310004818 A CN 201310004818A CN 103914481 A CN103914481 A CN 103914481A
Authority
CN
China
Prior art keywords
file
index
key message
independent
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201310004818.6A
Other languages
Chinese (zh)
Other versions
CN103914481B (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

Abstract

An embodiment of the invention discloses a data storage method. The method comprises generating and storing data file independent index files; generating index key information according to the independent index files, wherein the index key information comprises file identification information and part index information of the independent index files; combining and storing the index key information and the data files. By means of the method and device, the independent index files can be searched from the data files reversely, and reverse data analysis and reverse storage resource recovery are achieved.

Description

Date storage method and device
Technical field
The present invention relates to electronic technology field, relate in particular to a kind of date storage method and device.
Background technology
In existing data storage technology, conventionally can adopt the management of independent index file assitance data file, for example need save data file to disk, traditional method is the independent index file of setting up independent completion, data writing, then can be obtained data file and be analyzed by independent index file; In the time deleting data, also need first to find independent index file, then reclaim according to data directory the storage resources that these data take.
The existing technological deficiency of carrying out management data file by independent index file is: in the time causing can not find the independent index file of data file or independent index file content because of a variety of causes and make mistakes, can cause and cannot reclaim the storage resources that this data file takies.
Summary of the invention
Embodiment of the present invention technical matters to be solved is, a kind of date storage method and device are provided, and can realize from data file is reverse and search independent index file.
In order to solve the problems of the technologies described above, the embodiment of the present invention provides a kind of date storage method, and described method comprises:
Generate the also independent index file of save data file;
According to described data independence index file generating indexes key message, described index key message comprises the file identification information of described independent index file and the partial index information of described independent index file;
Described index key message and described data file are merged to preservation.
Wherein, described in, obtain and will after described index key message and described data file merging preservation, also comprise:
Obtain the index key message that merges the described data file of preserving with data file;
Search the independent index file of described data file according to described index key message.
On the other hand, the embodiment of the present invention also provides a kind of date storage method, and described method comprises:
Obtain the index key message that merges the described data file of preserving with data file, described index key message comprises the file identification information of independent index file and the partial index information of described independent index file of described data file;
Search the independent index file of described data file according to described index key message.
Wherein, the index key message that obtains the described data file of preserving with data file merging described in also comprises before:
Generate and preserve the independent index file of described data file;
Generate described index key message according to described independent index file;
Described index key message and described data file are merged to preservation.
Wherein, described method also comprises:
Carry out data analysis according to the described independent index file finding.
Wherein, described partial index information comprises the data length of described data file.
Wherein, described method also comprises:
Delete described data file and described in the independent index file that finds.
Correspondingly, the embodiment of the present invention also provides a kind of data storage device, and described data storage device comprises:
Index file generation module, for generating the also independent index file of save data file;
Key message generation module, for according to described data independence index file generating indexes key message, described index key message comprises the file identification information of described independent index file and the partial index information of described independent index file;
Data are preserved module, for described index key message and described data file are merged to preservation.
Wherein, described data storage device also comprises:
Key message acquisition module, for obtaining the index key message that merges the described data file of preserving with described data file;
Index file is searched module, for search the independent index file of described data file according to described index key message.
On the other hand, the embodiment of the present invention also provides a kind of data storage device, and described data storage device comprises:
Key message acquisition module, for obtaining the index key message that merges the described data file of preserving with data file, described index key message comprises the file identification information of described independent index file and the partial index information of described independent index file;
Index file is searched module, for search the independent index file of described data file according to described index key message.
Wherein, described data storage device also comprises:
Index file generation module, for generating and preserve the independent index file of described data file;
Key message generation module, for generating described index key message according to described independent index file;
Data are preserved module, for described index key message and described data file are merged to preservation.
Wherein, described data storage device also comprises:
Data analysis module, carries out data analysis for the independent index file finding described in basis.
Wherein, described partial index information comprises the data length of described data file.
Wherein, described data storage device also comprises:
Resource recycling module, for delete described data file and described in the independent index file that finds.
The embodiment of the present invention passes through to generate the index key message of independent index file, and merges and preserve with data file, can realize from data file is reverse and search independent index file, and then realize conversed analysis data and reverse reclamation storage resources.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, to the accompanying drawing of required use in embodiment or description of the Prior Art be briefly described below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skills, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is the schematic flow sheet of a kind of date storage method in the embodiment of the present invention;
Fig. 2 is the schematic flow sheet of a kind of reverse method of searching independent index file in the embodiment of the present invention;
Fig. 3 is the method flow schematic diagram of a kind of reverse reclamation data file in the embodiment of the present invention;
Fig. 4 is the structural representation of a kind of data storage device in the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, rather than whole embodiment.Based on the embodiment in the present invention, those of ordinary skills, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
The date storage method proposing in the embodiment of the present invention and device can be applied in the scene process of the remote data storage under the local storage of terminal and C/S structure.
Fig. 1 is the schematic flow sheet of the date storage method in the embodiment of the present invention.Data Stored Procedure in the embodiment of the present invention comprises as shown in the figure:
S101, generates and preserves the independent index file of described data file.
Concrete, the independent index file in the embodiment of the present invention is independent of data file to be preserved, and wherein includes the complete index information of described data file, can carry out detailed data analysis and the recovery of data file according to independent index file.
S102, generates described index key message according to described data independence index file.
Concrete, the index key message of described data file comprises the file identification information of the independent index file of described data file, for searching the independent index file of described data file, for example comprise that user's client logs in the file name of account and independent index file, the independent index file of independently depositing that corresponds to a data file that can be unique by described index key message.Further, described index key message can also comprise the partial index information of described independent index file, for example comprise the data length of described data file etc., when supposing only to need the partial index information of data file is analyzed, can directly adopt that to get be that partial index information in index key message is analyzed and need not go the independent index file that obtains independent completion to analyze again.The example of the data structure definition of a kind of index key (key) information as follows:
{
Char*key; ∥ index key information
Unsigned data_len; ∥ data length
S103, merges preservation by described index key message and described data file.
Concrete, index key message and the described data file that generation can be obtained merge, and preserve and merge the data that obtain.
Fig. 2 is the schematic flow sheet of reverse method of searching independent index file in the date storage method in the embodiment of the present invention.Reverse flow process of searching independent index file in the present embodiment comprises as shown in the figure:
S201, obtains the index key message that merges the described data file of preserving with data file.
Concrete, the index key message in the embodiment of the present invention as mentioned before, repeats no more here.
S202, searches the independent index file of described data file according to described index key message.
Concrete, can find in the position of depositing independent index file the independent index file of described data file according to merging with data file the index key message of preserving, to realize reverse object of searching data directory, and then can carry out labor to data file according to the independent index file finding, or according to the independent index file finding, the shared storage resources of data file is reclaimed; On the other hand, if search the independent index file less than this data file according to described index key message, the independent index file that represents this data file has been lost or has damaged, and at this moment can select to rebuild the independent index file of described data file or select to delete described data file to reclaim the shared resource of this data file.
Fig. 3 is the method flow schematic diagram of a kind of reverse reclamation data file in the embodiment of the present invention.The flow process of the reverse reclamation data file providing in the embodiment of the present invention as shown in the figure comprises:
S301, obtains the index key message that merges the described data file of preserving with data file.
Concrete, index key message in the embodiment of the present invention comprises the file identification information of independent index file and the partial index information of described independent index file of described data file, file identification information is for searching the independent index file of described data file, for example comprise that user's client logs in the file name of account and independent index file, the independent index file of independently depositing that corresponds to a data file that can be unique by described index key message, described index key message can also comprise the partial index information of described independent index file, comprise the data length of described data file.
S302, searches the independent index file of described data file according to described index key message.Concrete, in the present embodiment, can be according to merging the index key message of preserving at the independent index file of depositing data file described in the location lookup of independent index file with data file, can perform step S303 if found and carry out again S304, if search the independent index file less than this data file according to described index key message, the independent index file that represents this data file has been lost or has damaged, and at this moment can directly perform step S304 by skips steps S303.
S303, the independent index file finding described in deletion.
S304, deletes described data file.In the present embodiment, can reclaim the shared storage resources of described data file according to the described independent index file finding, also can be according to the data length of the described data file comprising in described index key message, the storage resources shared to described data file reclaims, and finally realizes the object of reverse reclamation storage resources.
Fig. 4 is the structural representation of the data storage device in the embodiment of the present invention.Data storage device in the embodiment of the present invention comprises as shown in the figure:
Index file generation module 410, for generating and preserve the independent index file of described data file.Concrete, the independent index file in the embodiment of the present invention is independent of data file to be preserved, and wherein includes the complete index information of described data file, can carry out detailed data analysis and the recovery of data file according to independent index file.
Key message generation module 420, for generating described index key message according to described data independence index file.Concrete, index key message in the embodiment of the present invention can comprise the file identification information of the independent index file of described data file, for searching the independent index file of described data file, for example comprise that user's client logs in the file name of account and independent index file, the independent index file that corresponds to a data file that can be unique by described index key message.Further, described index key message can also comprise the partial index information of described independent index file, for example comprise the data length of described data file etc., in the time only needing the partial index information of data file to analyze, can directly adopt that to get be that partial index information in index key message is analyzed and need not be removed to obtain independent index file again and analyze.The example of the data structure definition of a kind of index key (key) information as follows:
{
Char*key; ∥ index key information
Unsigned data_len; ∥ data length
Data are preserved module 430, for described index key message and described data file are merged to preservation.
Concrete, data preservation module 430 can generate the index key message and the described data file that obtain by key message generation module 420 and merge, and preserves and merges the data that obtain.
Key message acquisition module 440, for obtaining the index key message that merges the described data file of preserving with data file.
In specific implementation, in the time that user need to be according to the reverse index information that calls this data file of data file, can obtain the index key message that merges the described data file of preserving with data file, be used for searching the independent index file of described data file.
Index file is searched module 450, for search the independent index file of described data file according to described index key message.
Concrete, index file is searched module 450 and can find in the position of depositing independent index file according to index key message the independent index file of described data file, to realize reverse object of searching data directory.
Further, the data storage device in the embodiment of the present invention can also comprise:
Data analysis module 460, for carrying out data analysis according to described independent index file.Concrete, data analysis module 460 can also carry out partial data analysis to described data file according to the partial index information in index key message, the data length that for example comprises data file in index key message, when ought only needing so the partial index information of data file to analyze, data analysis module 460 also can directly adopt and get is that partial index information in index key message is analyzed and need not go the independent index file that obtains independent completion to analyze again.
Further, the data storage device in the embodiment of the present invention can also comprise:
Resource recycling module 470, for delete described data file and described in the independent index file that finds.
In the present embodiment, can reclaim the shared storage resources of described data file according to the described independent index file finding, also can be according to the data length of the described data file comprising in described index key message, the storage resources shared to described data file reclaims, and finally realizes the object of reverse reclamation storage resources.On the other hand, if search the independent index file less than this data file according to described index key message, the independent index file that represents this data file has been lost or has damaged, and at this moment can select to rebuild the independent index file of described data file or select to delete described data file to reclaim the shared resource of this data file.
The embodiment of the present invention passes through to generate the index key message of independent index file, and merges and preserve with data file, can realize from data file is reverse and search independent index file, and then realize conversed analysis data and reverse reclamation storage resources.
One of ordinary skill in the art will appreciate that all or part of flow process realizing in above-described embodiment method, can carry out the hardware that instruction is relevant by computer program to complete, described program can be stored in a computer read/write memory medium, this program, in the time carrying out, can comprise as the flow process of the embodiment of above-mentioned each side method.Wherein, described storage medium can be magnetic disc, CD, read-only store-memory body (Read-Only Memory, ROM) or random store-memory body (Random Access Memory, RAM) etc.
Above disclosed is only preferred embodiment of the present invention, certainly can not limit with this interest field of the present invention, and the equivalent variations of therefore doing according to the claims in the present invention, still belongs to the scope that the present invention is contained.

Claims (14)

1. a date storage method, is characterized in that, described method comprises:
Generate the also independent index file of save data file;
According to described independent index file generating indexes key message, described index key message comprises the file identification information of described independent index file and the partial index information of described independent index file;
Described index key message and described data file are merged to preservation.
2. date storage method as claimed in claim 1, is characterized in that, described also comprising after described index key message and described data file merging preservation:
Obtain the index key message that merges the described data file of preserving with described data file;
Search the independent index file of described data file according to described index key message.
3. a date storage method, is characterized in that, described method comprises:
Obtain the index key message that merges the described data file of preserving with data file, described index key message comprises the file identification information of independent index file and the partial index information of described independent index file of described data file;
Search the independent index file of described data file according to described index key message.
4. date storage method as claimed in claim 3, is characterized in that, described in obtain before merging with data file the index key message of described data file of preserving and also comprise:
Generate and preserve the independent index file of described data file;
Generate described index key message according to described independent index file;
Described index key message and described data file are merged to preservation.
5. date storage method as claimed in claim 3, is characterized in that, described method also comprises:
Carry out data analysis according to the described independent index file finding.
6. date storage method as claimed in claim 3, is characterized in that, described partial index information comprises the data length of described data file.
7. date storage method as claimed in claim 6, is characterized in that, described method also comprises:
Delete described data file and described in the independent index file that finds.
8. a data storage device, is characterized in that, described data storage device comprises:
Index file generation module, for generating the also independent index file of save data file;
Key message generation module, for according to described independent index file generating indexes key message, described index key message comprises the file identification information of described independent index file and the partial index information of described independent index file;
Data are preserved module, for described index key message and described data file are merged to preservation.
9. data storage device as claimed in claim 8, is characterized in that, described data storage device also comprises:
Key message acquisition module, for obtaining the index key message that merges the described data file of preserving with described data file;
Index file is searched module, for search the independent index file of described data file according to described index key message.
10. a data storage device, is characterized in that, described data storage device comprises:
Key message acquisition module, for obtaining the index key message that merges the described data file of preserving with data file, described index key message comprises the file identification information of described independent index file and the partial index information of described independent index file;
Index file is searched module, for search the independent index file of described data file according to described index key message.
11. data storage devices as claimed in claim 10, is characterized in that, described data storage device also comprises:
Index file generation module, for generating and preserve the independent index file of described data file;
Key message generation module, for generating described index key message according to described independent index file;
Data are preserved module, for described index key message and described data file are merged to preservation.
12. data storage devices as claimed in claim 10, is characterized in that, described data storage device also comprises:
Data analysis module, carries out data analysis for the independent index file finding described in basis.
13. data storage devices as claimed in claim 10, it is characterized in that, described index key message comprises the file identification information of described independent index file and the partial index information of described independent index file, and described partial index information comprises the data length of described data file.
14. data storage devices as claimed in claim 13, is characterized in that, described data storage device also comprises:
Resource recycling module, for delete described data file and described in the independent index file that finds.
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 true CN103914481A (en) 2014-07-09
CN103914481B 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)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105740369A (en) * 2016-01-27 2016-07-06 桂林长海发展有限责任公司 Multi-view-point sub-frame fusion system and method
WO2021017647A1 (en) * 2019-07-29 2021-02-04 华为技术有限公司 Method and apparatus for merging data units

Citations (6)

* 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
CN1677401A (en) * 2004-04-02 2005-10-05 三星电子株式会社 File management and apparatus for controlling digital contents and information recording medium therefor
US20060179083A1 (en) * 2005-02-08 2006-08-10 Raghavendra Kulkarni Systems and methods for storing, backing up and recovering computer data files
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

Patent Citations (6)

* 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
CN1677401A (en) * 2004-04-02 2005-10-05 三星电子株式会社 File management and apparatus for controlling digital contents and information recording medium therefor
CN1584883A (en) * 2004-05-27 2005-02-23 威盛电子股份有限公司 Related document connecting managing system, method and recording media
US20060179083A1 (en) * 2005-02-08 2006-08-10 Raghavendra Kulkarni Systems and methods for storing, backing up and recovering computer data files
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

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105740369A (en) * 2016-01-27 2016-07-06 桂林长海发展有限责任公司 Multi-view-point sub-frame fusion system and method
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

Also Published As

Publication number Publication date
CN103914481B (en) 2019-09-13

Similar Documents

Publication Publication Date Title
CN102567427B (en) Method and device for processing object data
CN103049491A (en) Method and device for managing picture file
CN104199967A (en) Cellphone file recovery method and device
CN107870928A (en) File reading and device
CN105630834A (en) Method and device for realizing deletion of repeated data
CN103778259A (en) Method for realizing data recovery of smart phone on basis of Sqlite3
CN105630923A (en) Method for realizing archives administration informatization
CN110750372A (en) Log system based on shared memory and log management method
CN104219639A (en) Method and device for displaying text message record
CN103136264B (en) Attachment query method and user terminal
CN103914481A (en) Data storage method and device
CN104239231A (en) Method and device for accelerating preheating of second-level cache
US9710337B1 (en) Systems and methods for restoring web parts in content management systems
CN103207916A (en) Metadata processing method and device
CN102799423B (en) Method and the device of dynamic approach is performed in JSF
CN104182479A (en) Method and device for processing information
CN104699688A (en) File searching method and electronic device
CN107436848B (en) Method and device for realizing conversion between user data and compressed data
CN102915324B (en) Data storage and retrieval device and data storage and retrieval method
CN113051186B (en) Method and device for processing page bump in memory recovery and electronic equipment
CN104408056A (en) Data processing method and device
CN110866380A (en) Method and terminal for filling in information field content
CN105488047A (en) Metadata read-write method and device
CN104714930A (en) Immediate processing method and device for document
CN108090128A (en) A kind of merging memory space recovery method, device and electronic equipment

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