Summary of the invention
The problem that the present invention solves is to provide the binding method of a kind of file destination and its related information and the lookup method of related information, reduces the amendment of related information and the complicacy reading.
For addressing the above problem, the invention provides the binding method of a kind of file destination and its related information, comprising:
Extract file destination and the related information corresponding with described file destination;
Set up index file, in described index file, record the corresponding relation of described file destination and described related information.
Optionally, the described index file of setting up comprises: add heading and an article or item in a contract, and the filename that described heading is described file destination, described an article or item in a contract is pointed to described related information.
Optionally, described related information comprises descriptor, and described descriptor is described the attribute of described file destination.
Optionally, described related information is recorded in resource file.
Optionally, also comprise described file destination, resource file and index file are integrated in identical file bag.
Optionally, described resource file is text file format or hypertext document form.
Optionally, the described index file of setting up comprises: add heading and an article or item in a contract, described heading comprises the filename of described file destination, and described an article or item in a contract comprises the filename of described resource file.
Optionally, the described index file of setting up comprises: add heading and an article or item in a contract, described heading comprises the filename of described file destination, and described an article or item in a contract comprises the attribute type of the related information in filename and the described resource file of described resource file.
Optionally, described file destination is audio file.
Optionally, described file destination is MP3 format.
Optionally, described index file is text file format or hypertext document form.
For addressing the above problem, the invention provides a kind of lookup method of related information of file destination, comprising:
Obtain index file based on described file destination, in described index file, record the corresponding relation of described file destination and related information;
Determine the related information corresponding with described file destination based on described index file;
Read described related information.
Optionally, described related information comprises descriptor, and described descriptor is described the attribute of described file destination.
Optionally, described related information is recorded in resource file.
Optionally, described index file comprises heading and an article or item in a contract, and described heading comprises the filename of described file destination, and described an article or item in a contract comprises the attribute type of the related information in filename and the described resource file of described resource file.
Optionally, also comprise: the attribute type that reads described related information.
Optionally, described resource file is text file format or hypertext document form.
Optionally, described file destination, resource file and index file are integrated in identical file bag.
Optionally, described file destination is audio file.
Optionally, described file destination is MP3 format.
Optionally, described index file is text file format or hypertext document form.
Compared with prior art, the present invention has the following advantages:
In technique scheme, record the corresponding relation of related information and file destination by index file, described related information can be stored in the independently resource file outside described file destination, therefore can easier revise and read.
In addition, because described resource file is the individual files that is independent of file destination, therefore, its storage space is not subject to the restriction of file destination itself, can store more jumbo related information.
Embodiment
For above-mentioned purpose of the present invention, feature and advantage can more be become apparent, below in conjunction with accompanying drawing, the specific embodiment of the present invention is described in detail.
Set forth detail in the following description so that fully understand the present invention.But the present invention can be different from alternate manner described here and implements with multiple, and those skilled in the art can do similar popularization without prejudice to intension of the present invention in the situation that.Therefore the present invention is not subject to the restriction of following public embodiment.
In prior art, often store related information associated with the file with the ID3 label of MP3 audio file inside, but because ID3 label is embedded in mp3 file inside, the complexity that reads and revise is higher.And because its storage space that can take is less, make the content of the related information that wherein can store less.
Technical scheme of the present invention is associated described related information and corresponding audio file by index file, for different audio files, determine corresponding related information based on described index file, and it is read and is revised, reduced the complicacy that reads and revise.Be independent of outside audio file owing to recording the resource file of described related information, therefore its storage space taking is not subject to the restriction of audio file itself, can store more jumbo related information.
Fig. 2 shows the schematic flow sheet of the file destination of the embodiment of the present invention and the binding method of its related information, comprising: execution step S101, extracts file destination and the related information corresponding with described file destination; Execution step S102, sets up index file, records the corresponding relation of described file destination and described related information in described index file.
Described in the present embodiment step S101, file destination is audio file, is preferably the audio file of MP3 format.Described in step S101, related information comprises descriptor, described descriptor is described the attribute of described file destination, as comprise title, singer, age, album name, the lyrics of the audio file of MP3 format etc., it is the content that leaves the related information in ID3 label in prior art in, in addition, related information in the present embodiment can also comprise user-defined information, as user to as described in the comment, scoring, recording cover picture etc. of MP3 audio file.
Index file described in the present embodiment step S102 is for storing the corresponding relation of described file destination and related information.Related information described in the present embodiment is recorded in resource file, and described index file is corresponding with resource file by described file destination, thereby can from corresponding resource file, find the related information corresponding with described file destination.Described index file is text file format or hypertext document form, in the present embodiment, be preferably text file format, text file format is the file layout of the storage text message commonly used, can, by several operation systems and file system support and identification, therefore have higher compatibility.In addition, text file format relatively simple for structure, its analytic method is simpler, is easy to the later stage it is modified and read.
Described index file comprises heading and an article or item in a contract, and the described index file of setting up comprises interpolation heading and an article or item in a contract, the filename that described heading is described file destination, the filename that described an article or item in a contract is described resource file.Described heading is corresponding with an article or item in a contract, described heading is the filename of file destination, the filename that its corresponding an article or item in a contract is corresponding one or more resource files, described one or more resource files have comprised with the file destination of heading sensing thinks corresponding related information.By such scheme, described index file associates file destination and corresponding resource file, is convenient to access and reads.
An article or item in a contract in described index file is except comprising the filename of resource file, can also comprise the attribute type of the related information recording in described resource file, as title, age, the lyrics etc., for example in one embodiment, if the lyrics content that the related information recording in described resource file is file destination, the an article or item in a contract in index file, except comprising the filename of described resource file, also comprises its attribute type, i.e. " lyrics ".
Resource file described in the present embodiment is used for storing described related information, and resource file corresponding and same file destination can be one or more.For in described related information for describing the descriptor of different attribute, as title, singer, age etc., it is deposited in respectively in different resource files, and by index file by described different resource file corresponding to same file destination.
The file layout of described resource file is text file format or hypertext document form, is preferably text file format in the present embodiment, and its advantage and above-mentioned index file are similar, repeat no more here.Compared with text file format, hypertext document form can insert pictures and multimedia messages, the front cover picture of for example disc or for self-defining picture.Because described resource file is the individual files being independent of outside file destination, its form is relatively simple, therefore can easier modify and read, and its space taking is not subject to the restriction of file destination, can preserve more related information.
File destination in Fig. 2 and the binding method of its related information are realized by software in the present embodiment, described step S101 is specially the filename that reads in described file destination, and read in resource file and obtain related information wherein, described step S102 is specially and sets up a new index file or open an index file having existed, and add therein heading and an article or item in a contract, described heading is the filename of described file destination, and described an article or item in a contract is the filename of the resource file that comprises described associated with.
Fig. 3 shows the file structure schematic diagram of the file destination of the embodiment of the present invention and the binding method of its related information.As shown in Figure 3, comprise file destination 201, resource file 202, resource file 203, resource file 204 and index file 205, wherein said resource file 202,203,204 has comprised the related information corresponding with file destination 201, in one embodiment, in described resource file 202,203 and 204, record different descriptors, be respectively title, singer, age.Described index file 205 has comprised the corresponding relation of described file destination 201 and resource file 202,203,204, be that heading in described index file 205 is the filename of described file destination 201, and corresponding an article or item in a contract is the filename of described resource file 204,205,206.
In the present embodiment, described file destination 201, resource file 204,205,206 and index file 207 are integrated in identical file bag, are convenient to management.For example, while needing file destination 201 to add extra related information, described extra related information can be increased to any one in corresponding resource file 202,203,204, and do not revise alternative document, also can in identical file bag, set up again in addition another resource file, described extra related information is stored in described another resource file, and revise described index file 205, in an article or item in a contract corresponding to the filename of described file destination 201, increase the filename of described another resource file, set up corresponding relation.
It should be noted that, in file structure schematic diagram shown in Fig. 3, only comprise single file destination 201, in fact, according to the needs of practical application, multiple file destinations and the resource file corresponding with it can be integrated in identical file bag, and record the corresponding relation of each file destination and corresponding resource file by index file.In this case, the heading of described resource file comprises the information such as deposit position and filename of each file destination, comprises filename, attribute type and the deposit position of the resource file corresponding with this file destination in corresponding an article or item in a contract.
Fig. 4 shows the schematic flow sheet of the lookup method of the related information of the file destination of the embodiment of the present invention, comprise: execution step S201, obtain index file based on described file destination, in described index file, record the corresponding relation of described file destination and related information; Execution step S202, determines and the related information of described file destination based on described index file; Execution step S203, reads described related information.
The file destination that in Fig. 4, each step relates to and index file are corresponding with the file destination and the index file that relate in file destination in Fig. 2 and its related information binding method, and its file layout and content just repeat no more here.Similarly, described related information is also recorded in resource file.
In conjunction with Fig. 3 and Fig. 4, to read file destination 201 and to search its corresponding related information as example, as play the audio file of a certain mp3 file form, in reading file destination 201, read described index file 201, and determine the resource file corresponding with described file destination 201, in Fig. 3, be resource file 204.Afterwards, read described resource file 204, obtain comprising related information, for example obtain the descriptors such as the singer corresponding with the audio file of MP3 format, special edition, the lyrics, and it processed, show described related information playing in music.If also comprise the attribute type of related information in an article or item in a contract of described index file, it is read and is processed simultaneously.In one embodiment, if the related information recording in a resource file is singer (as " Li Jia "), its corresponding attribute type is " singer ", and player shows " singer: Li Jia " accordingly.
During the lookup method of the related information of the file destination shown in Fig. 4 is concrete in the present embodiment, realize by software, described step S201 is specially the filename according to described file destination, obtains the filename of index file in corresponding file bag; Step S202 is specially and opens described index file, and reads the wherein corresponding relation of heading and an article or item in a contract, determines the filename of the resource file corresponding with described file destination; Step S203 is specially and opens described resource file, reads related information wherein.
Because the ID3 label of prior art is embedded in file destination, therefore reading related information need to read and resolve whole file destination, memory cost is larger, and the technical program is because resource file and file destination are mutually independently, therefore can only read the resource file corresponding with file destination, and needn't read described file destination itself, thereby reduce memory consumption.
Above-described embodiment is that audio file taking MP3 format is as example, in fact, related information storage and the read method of the technical program can be used in alternative document form, as video file, data file etc., by user add as in the related information saving such as version information, comment, remarks and resource file independently, and carry out association by index file.
In sum, the related information of technique scheme file destination is stored in independently in resource file, and by index file, described resource file is associated with corresponding file destination, thereby has reduced amendment and read the complexity of described related information.
In addition, because described resource file is the individual files that is independent of file destination, therefore it takes up room and not limited by file destination, can store more jumbo related information.
Although the present invention with preferred embodiment openly as above; but it is not for limiting the present invention; any those skilled in the art without departing from the spirit and scope of the present invention; can utilize method and the technology contents of above-mentioned announcement to make possible variation and amendment to technical solution of the present invention; therefore; every content that does not depart from technical solution of the present invention; any simple modification, equivalent variations and the modification above embodiment done according to technical spirit of the present invention, all belong to the protection domain of technical solution of the present invention.