Summary of the invention
The invention provides a kind of stream media format file downloading method and device, the download efficiency when downloading stream media format file by mobile communications network in order to raising.
The embodiment of the invention provides a kind of stream media format file downloading method, is applied to portable terminal, comprising:
According to the file header information of the stream media format file respective file of downloading, determine the article unit that described stream media format file comprises;
Create described article unit corresponding download thread;
Start described download thread and download described stream media format file.
The described article unit corresponding download thread of described establishment comprises:
Be that a corresponding download thread is created in an article unit; Perhaps
For creating a corresponding download thread in two or more article unit.
The described download thread of described startup is downloaded described stream media format file, is specially:
Start all download thread simultaneously and download described stream media format file; Perhaps
The one or more download thread of each startup are downloaded described stream media format file.
Described stream media format file downloading method also comprises:
Determine the priority of described download thread;
The one or more download thread of described each startup are downloaded described stream media format file, are specially:
Start described download thread by the priority orders of downloading thread and download described stream media format file.
Described stream media format file downloading method also comprises: the order by article unit described in the described file is that corresponding storage area is determined in described article unit, and the described article unit of downloading is stored in the corresponding described storage area.
Described stream media format file downloading method also comprises: after a piece download of described article unit finishes, show described block message.
Each download thread becomes described stream media format file according to described file header information with described article unit combination after downloading and finishing.
The embodiment of the invention also provides a kind of portable terminal, comprising:
Determining unit is used for the file header information according to the stream media format file respective file of downloading, and determines the article unit that described stream media format file comprises;
Creating unit is used to create described article unit corresponding download thread;
Download unit is used to start described download thread and downloads described stream media format file.
Described creating unit also is used to an article unit to create a corresponding download thread; Perhaps
For creating a corresponding download thread in two or more article unit.
Described download unit also is used for starting simultaneously all download thread and downloads described stream media format file; The one or more download thread of perhaps each startup are downloaded described stream media format file.
Described download unit also is used for determining the priority of described download thread; Start described download thread by the priority orders of downloading thread and download described stream media format file.
Described portable terminal also comprises:
Memory cell, the order that is used for by article unit described in the described file is that corresponding storage area is determined in described article unit, and the described article unit of downloading is stored in the corresponding described storage area.
Described portable terminal also comprises:
Show assembled unit, be used for after a piece download of described article unit finishes, showing described block message; And each download thread download finish after, according to described file header information described article unit combination is become described stream media format file.
Beneficial effect of the present invention is as follows:
The stream media format file downloading method that the embodiment of the invention provides is applied to portable terminal, according to the file header information of the stream media format file respective file of downloading, determines the article unit that stream media format file comprises; Create article unit corresponding download thread; Start download thread and download stream media format file.Adopt method provided by the invention and device, corresponding download thread is separately created in each article unit to document to be downloaded, the one or more download thread of each startup, realize the independent download of each article unit, the purpose of reach progressive download, jumping and downloading or download simultaneously, improved download efficiency, simultaneously, the inventive method can also be determined the priority of download thread, sequence starting download thread is according to priority downloaded document, reach the purpose of certain articles unit in the preferential download document, make things convenient for the user to read.
Embodiment
The embodiment of the invention provides a kind of stream media format file downloading method, is applied to portable terminal, comprising:
According to the file header information of the stream media format file respective file of downloading, determine the article unit that stream media format file comprises;
Create article unit corresponding download thread;
Start download thread and download stream media format file.
Below in conjunction with accompanying drawing said method of the present invention is described in detail.
Figure 1 shows that a kind of stream media format file downloading method flow chart that the embodiment of the invention provides, the mobile phone newspaper document that present embodiment is downloaded " Beijing Morning-0825 " on August 25th, 2008 with portable terminal by mobile communications network is that example describes, and comprising:
Step S101, according to the file header information of the stream media format file respective file of downloading, determine the article unit that this stream media format file comprises.
The formal definition of the stream media format file respective file of downloading in the embodiment of the invention as shown in Figure 2, as seen, file is made up of file header and follow-up a plurality of articles unit in order, and wherein file header is made up of a piece, one piece of article is represented in an article unit, is made up of a piece or a plurality of.
In the embodiment of the invention, file header adopts the OEB packet format to create, and file header information comprises summary info, length information and each article unit positional information hereof of every piece of article in the metadata information, stream media format file of stream media format file.For example:
" Beijing Morning-0825 " on August 25th, 2008, the metadata information of its file header information comprises: newspaper name (Beijing Morning), publishing house (Beijing Morning society), issue (0825), price (existing content is free), propelling movement mode (are regularly downloaded, every day, 10:30 pushed, about each issue 400K), store path (storage card ApabiMobi), newspaper brief introduction be (as the leader of capital morning newspaper, distinct style, press close to the epoch, closeness to life, press close to citizen, with the ageing and readable combination of news.) etc. information;
The summary info of every piece of article comprises: the catalogue of every piece of article summary in this phase " Beijing Morning-0825 ";
The length information of every piece of article is represented by its shared byte number, with the two pieces of articles " Beijing Olympic Games draws to a complete close " in this phase " Beijing Morning-0825 " and " the trade and investment promotion real estate is bought the building for 17.5 hundred million yuan " is example, file header length that wherein should the phase " Beijing Morning-0825 " is 2055 bytes, article " Beijing Olympic Games draws to a complete close " is the 1st a piece of article, length is 10220 bytes, " the trade and investment promotion real estate is bought the building for 17.5 hundred million yuan " is the 23rd piece of article, and length is 9978 bytes.
In the embodiment of the invention, each article unit positional information hereof defines with the side-play amount of each article unit with respect to file header, file header is the 1st piece of file, determine the 1st piece of each article unit afterwards in order by calculation document length and file header length, to write file header after the processing such as this piece annotation information process compress-encrypt, and a piece annotation information that generates is write in the document flow.
For example, article " Beijing Olympic Games draws to a complete close " is the 1st article unit, so its positional information is: 2055 bytes (file header length), article " the trade and investment promotion real estate is bought the building for 17.5 hundred million yuan " is the 23rd article unit, so its positional information is: the length of 2055 (file header length)+10220 (length of the 1st article unit)+2-22 article unit.Can accurately locate each position hereof, article unit by these positional informations.
Step S102, establishment article unit corresponding download thread.
Determine the starting position of each article unit in the embodiment of the invention according to above-mentioned each article unit positional information hereof, create article unit corresponding download thread, can adopt dual mode when specifically creating:
A kind of is to create a corresponding download thread for an article unit;
Another kind is to create a corresponding download thread for two or more article unit.
Step S103, startup download thread are downloaded this stream media format file.
In the embodiment of the invention,,, this step downloads this stream media format file so can taking multiple mode to start download thread owing to created a plurality of download thread before, as shown in Figure 3,
First kind of mode: start all download thread simultaneously and download documents,, can realize that so every piece of article downloads simultaneously if a corresponding download thread has all been created in each article unit.
The second way: start several times, start one or more download thread at every turn and download document, until starting all download thread.
Such as each 2 download thread, perhaps one or several download thread of random start of starting.
Preferable, can before starting download thread, determine the priority of download thread, sequence starting download thread is according to priority downloaded document, and the download thread that is in same priority starts simultaneously.For example, catalogue summary by every piece of article in the reading file header, can an overall understanding be arranged to this phase newspaper, and then can be defined as high priority with being intended to preferential article corresponding download thread of reading, the preferential download, a plurality of article corresponding download thread can also be defined as same priority, download simultaneously.The 1st piece of article " Beijing Olympic Games draws to a complete close " corresponding download thread as the above-mentioned newspaper of preferential startup, then start the 23rd piece of article " the trade and investment promotion real estate is bought the building for 17.5 hundred million yuan " corresponding download thread, also can start these two pieces of article corresponding download thread simultaneously.
Adopt aforesaid way to start download thread and download document, realize the independent download of each article unit, the purpose of reach progressive download, jumping and downloading or download simultaneously, improved download efficiency, and adopt the third mode to start download thread and download document, can also reach the purpose of certain articles unit in the preferential download document, make things convenient for the user to read.
Figure 4 shows that the stream media format file of downloading in the embodiment of the invention shows schematic diagram, before the startup download thread begins to download stream media format file, length information according to each article unit in the file header information, positional information, reserve the storage area of each article unit in order, after the startup download thread begins to download stream media format file, each article unit is that unit downloads with the piece, the piece that download is finished stores in the corresponding storage area, every download is finished one, promptly can be according to the positional information of article unit in the file header information, find this article unit to download the piece of finishing, show this piece content for user's reading, show the purpose of reading, save the time that the user waits for downloads while reach to download.
After step S104, download are finished, each article unit combination is become document according to file header information.
The embodiment of the invention can also become former document with each article unit combination in order according to each article unit positional information hereof in the file header information after each article unit download of file is finished; Also can adopt the method among the step S103, before download, reserve the storage area of each article unit in order, the article unit that download is finished stores in the corresponding accessing zone.
Based on same inventive concept, according to the stream media format file downloading method that the above embodiment of the present invention provides, correspondingly, the embodiment of the invention also provides a kind of portable terminal, and its structural representation is as shown in Figure 5, and is specific as follows,
Determining unit 501 is used for the file header information according to the stream media format file respective file of downloading, and determines the article unit that stream media format file comprises;
Creating unit 502 is used to create article unit corresponding download thread;
Download unit 503 is used to start download thread and downloads stream media format file.
Among other embodiment,
Above-mentioned creating unit 502 also is used to an article unit to create a corresponding download thread; Perhaps be that a corresponding download thread is created in two or more article unit.
Above-mentioned download unit 503 also is used for starting simultaneously all download thread and downloads stream media format file; The one or more download thread of perhaps each startup are downloaded stream media format files.
Preferable, above-mentioned download unit 503 also is used for determining the priority of download thread; Start download thread by the priority orders of downloading thread and download stream media format file.
Among other embodiment, above-mentioned portable terminal can also comprise:
Memory cell 504 is used for determining corresponding storage area by the order of file article unit for the article unit, and the article unit of downloading is stored in the corresponding storage area.
Among other embodiment, above-mentioned portable terminal can also comprise:
Show assembled unit 505, be used for after a piece download of article unit finishes, showing this block message; And each download thread download finish after, according to file header information the article unit combination is become stream media format file.
In sum, the scheme that the embodiment of the invention provides according to the file header information of the stream media format file respective file of downloading, is determined the article unit that stream media format file comprises; Create article unit corresponding download thread; Start download thread and download stream media format file; After a piece download of article unit finishes, show this block message; And download finish after, according to file header information the article unit combination is become stream media format file.Adopt method provided by the invention and device, the download efficiency when having improved by mobile communications network download stream media format file.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.