Summary of the invention
The problem that the present invention solves provides the binding method of a kind of file destination and its related information and the lookup method of related information, reduces the modification of related information and the complicacy that reads.
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, record the corresponding relation of described file destination and described related information in the described index file.
Optionally, the described index file of setting up comprises: add 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 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 the resource file.
Optionally, also comprise described file destination, resource file and index file are integrated in the 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 filename of described resource file and the attribute type of the related information in the described resource file.
Optionally, described file destination is an audio file.
Optionally, described file destination is a 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, record the corresponding relation of described file destination and related information in the described index file;
Determine the related information corresponding based on described index file with described file destination;
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 the 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 filename of described resource file and the attribute type of the related information in the 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 the identical file bag.
Optionally, described file destination is an audio file.
Optionally, described file destination is a 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 the technique scheme,, make described related information can be stored in the independently resource file outside the described file destination, so can easier revise and read by the corresponding relation of index file record related information with file destination.
In addition, because described resource file is the individual files that is independent of file destination, therefore, its storage space is not subjected 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, the specific embodiment of the present invention is described in detail below in conjunction with accompanying drawing.
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 under the situation of intension of the present invention.Therefore the present invention is not subjected to the restriction of following public embodiment.
Often use the ID3 label of MP3 audio file inside to store related information associated with the file in the prior art, but because the 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 wherein can correlation information stored content less.
Technical scheme of the present invention is associated described related information and corresponding audio files by index file, for different audio files, determine corresponding related information based on described index file, and it is read and revises, reduced the complicacy that reads and revise.Because the resource file of the described related information of record is independent of outside the audio file, so its storage space that takies is not subjected to the restriction of audio file itself, can store more jumbo related information.
Fig. 2 shows the schematic flow sheet of the binding method of the file destination of the embodiment of the invention and its related information, comprising: execution in step S101, extract file destination and the related information corresponding with described file destination; Execution in step S102 sets up index file, records the corresponding relation of described file destination and described related information in the described index file.
File destination is an audio file described in the present embodiment step S101, is preferably the audio file of MP3 format.Related information comprises descriptor described in the step S101, 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 the ID3 label in the prior art in, in addition, related information in the present embodiment can also comprise user-defined information, as the user to as described in the comment, scoring, recording cover picture etc. of MP3 audio file.
Index file is used to store the corresponding relation of described file destination and related information described in the present embodiment step S102.Related information described in the present embodiment is recorded in the resource file, and described index file is corresponding with resource file with described file destination, thereby can find the related information corresponding with described file destination from corresponding resource file.Described index file is text file format or hypertext document form, be preferably text file format in the present embodiment, text file format is the file layout than storage text message commonly used, can therefore be had higher compatibility by several operation systems and file system support and identification.In addition, text file format relatively simple for structure, its analytic method is simpler, is easy to the later stage it is made amendment and read.
Comprise heading and an article or item in a contract in the described index file, the described index file of setting up comprises interpolation heading and an article or item in a contract, and described heading is the filename of described file destination, and described an article or item in a contract is the filename of described resource file.Described heading is corresponding with an article or item in a contract, described heading is the filename of file destination, its corresponding an article or item in a contract is the filename of corresponding one or more resource files, has comprised in described one or more resource files with the file destination of heading sensing thinking corresponding related information.By such scheme, described index file associates file destination and corresponding resource file, is convenient to visit and read.
An article or item in a contract in the described index file is except the filename that comprises resource file, the attribute type that can also comprise the related information that writes down in the described resource file, as title, age, the lyrics etc., for example in one embodiment, if the related information that writes down in the described resource file is the lyrics content of file destination, then an article or item in a contract in the index file also comprises its attribute type except the filename that comprises described resource file, i.e. " lyrics ".
Resource file described in the present embodiment is used to store described related information, and resource file corresponding and same file destination can be for one or more.For the descriptor that is used to describe different attribute in the described related information, as title, singer, age etc., it is deposited in respectively in the different resource files, and by index file with 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.Compare with text file format, the hypertext document form can insert picture and multimedia messages, for example the front cover picture of disc or be used for self-defining picture.Because described resource file is the individual files that is independent of outside the file destination, its form is simple relatively, therefore can easier make amendment and read, and its occupation space is not subjected to the restriction of file destination, can preserve more related information.
The file destination among 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 wherein related information, described step S102 is specially and sets up a new index file or open an index file that has existed, and add heading and an article or item in a contract therein, described heading is the filename of described file destination, and described an article or item in a contract is the filename that comprises the resource file of described associated with.
Fig. 3 shows the file structure synoptic diagram of the binding method of the file destination of the embodiment of the invention and 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 have comprised the related information corresponding with file destination 201, in one embodiment in the wherein said resource file 202,203,204, the different descriptor of record is respectively title, singer, age in the described resource file 202,203 and 204.The corresponding relation that has comprised described file destination 201 and resource file 202,203,204 in the described index file 205, be that heading in the 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 the identical file bag, are convenient to management.When for example needing that file destination 201 added extra related information, described extra related information can be increased to any one in the corresponding resource file 202,203,204, and do not revise alternative document, also can in the identical file bag, set up another resource file more in addition, 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 of the filename correspondence of described file destination 201, increase the filename of described another resource file, set up corresponding relation.
Need to prove, only comprise single file destination 201 in the file structure synoptic diagram shown in Figure 3, in fact, needs according to practical application, can be integrated in the identical file bag with a plurality of file destinations and with its corresponding resource file, and write down the corresponding relation of each file destination and corresponding resource file by index file.In this case, the heading of described resource file comprises information such as the deposit position of each file destination and filename, then comprises filename, attribute type and deposit position with this file destination corresponding resource file in the corresponding an article or item in a contract.
Fig. 4 shows the schematic flow sheet of lookup method of related information of the file destination of the embodiment of the invention, comprise: execution in step S201, obtain index file based on described file destination, record the corresponding relation of described file destination and related information in the described index file; Execution in step S202 determines related information with described file destination based on described index file; Execution in step S203 reads described related information.
The file destination and the index file that relate in file destination among the file destination that each step relates among Fig. 4 and index file and Fig. 2 and its related information binding method are corresponding, and its file layout and content just repeat no more here.Similarly, described related information also is recorded in the resource file.
In conjunction with Fig. 3 and Fig. 4, to read file destination 201 and to search its corresponding related information is example, as play the audio file of a certain mp3 file form, when reading file destination 201, read described index file 201, and determine and described file destination 201 corresponding resource files, in Fig. 3 resource file 204.Afterwards, read described resource file 204, obtain comprising related information, for example obtain descriptors such as the singer corresponding, special edition, the lyrics, and it handled with the audio file of MP3 format, in playing back music, show described related information.If also comprise the attribute type of related information in an article or item in a contract of described index file, then simultaneously it read and handles.In one embodiment, if the related information that writes down in the resource file is singer (as " Li Jia "), its corresponding attribute type is " singer ", and then player shows " singer: Li Jia " accordingly.
Realize that by software described step S201 is specially the filename according to described file destination during the lookup method of the related information of file destination shown in Figure 4 is concrete in the present embodiment, in corresponding literature kit, obtain the filename of index file; 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 with described file destination corresponding resource file; Step S203 is specially and opens described resource file, reads related information wherein.
Because the ID3 label of prior art is embedded in the file destination, therefore reading related information need read and resolve whole file destination, memory cost is bigger, and the technical program is because resource file is mutually independently with file destination, therefore can only read and the corresponding resource file of file destination, and needn't read described file destination itself, thereby reduced memory consumption.
The foregoing description is that the audio file with MP3 format is an example, in fact, the related information storage and the read method of the technical program can be used in the alternative document form, as video file, data file etc., with the user add as in related information saving such as version information, comment, remarks and the 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 the resource file, and by index file described resource file is associated with corresponding file destination, thereby has reduced the complexity of revising and read described related information.
In addition, because described resource file is the individual files that is independent of file destination, so it takes up room and not limited by file destination, can store more jumbo related information.
Though the present invention with preferred embodiment openly as above; but it is not to be used for limiting the present invention; any those skilled in the art without departing from the spirit and scope of the present invention; can utilize the method and the technology contents of above-mentioned announcement that technical solution of the present invention is made possible change and modification; therefore; every content that does not break away from technical solution of the present invention; to any simple modification, equivalent variations and modification that above embodiment did, all belong to the protection domain of technical solution of the present invention according to technical spirit of the present invention.