Summary of the invention
For the defective that exists in the prior art, the objective of the invention is to improve the media downloading mode of mobile device, guarantee that the user can promptly and accurately obtain needed digital content, a kind of method and application of stable timing automatic download digital content are provided.
For reaching above purpose, the invention provides a kind of method of mobile device to automatically download digital content, after the user finishes the digital content subscription information from server, automatically download the needed number content to portable terminal from server, mainly may further comprise the steps:
A: portable terminal generates the expected update time according to the update time in cycle of ordered digital content;
B: portable terminal compares expected update time and the portable terminal current time of each subscribed content, if early than the current time, and be later than last download time of this digital content, then be judged to be outdated task, in this way, the download request that directly sends this digital content to server is downloaded; Download timing otherwise set;
C: timing arrives, and the download request that sends this digital content to server is downloaded.
Further, also comprise following operation: upload the portable terminal time to server, whether synchronous with its time by server authentication, as asynchronous, synchronous to portable terminal return service device temporal information and prompting user.
Further, change such as time of mobile terminal system, then the prompting user synchronization server time; If the user does not carry out synchronously, then will be in the subscription list file the last download time of all downloading contents be made as the same day, with keep Download Info synchronously.
Further, also comprise following operation: the server process download request, if the digital content of asking is upgraded really, return the download address of this digital content, downloaded by portable terminal.
Further, also comprise following operation: after having downloaded the respective digital content, reset timing.
Further, method that set to download timing is: the expected update time is added the random number time-delay, and the minimum expected update time is got in ordering, is set as the timing of timer.
Further, the generation method of random number time-delay is, with expected update time of subscription digital content as random number seed, generate the random number less than 30, as this time-delay of digital content expected update time in 30 minutes.
Further, also comprise following operation: expected update time of each digital content is increased the random number time-delay, the time that start by set date is downloaded is set again, so that during server numeral content update, each portable terminal is initiated download requests in the different periods.
Further, described digital content subscription procedure is: user's digital content that selection will be subscribed to from the digital content tabulation; Send the message that comprises this digital content ID to server; Server returns to subscribe to determines information, and portable terminal is preserved described information in subscription list.
Further, the described subscription list file information of preserving comprises: the title of subscription digital content and ID, the last download time of the update time in cycle of subscribed content and this content.
The present invention also provides a kind of portable terminal, is used for automatically download digital content from the server, and described portable terminal specifically comprises with lower module:
The digital content subscribing module is used for the digital content of needs is subscribed to, and preserves user's subscription information;
The timing task management module comprises that expected update time generation module, outdated task judge module and timing arrange module; Described expected update time generation module is used for the update time in cycle according to ordered digital content, generates the expected update time; Described outdated task judge module, judge according to being kept at the subscription digital content identification of surely readding in the listing file whether downloading task is outdated task, if the subscription digital content update time in the subscription digital content identification is early than the current time of portable terminal, and be later than the last download time of this content, then be judged to be outdated task, directly started by the digital content download module and download, carry out timing otherwise by timing module is set; Described timing arranges module, is used for arranging digital content and downloads timing, and timing arrives, and is started by the digital content download module and downloads;
The digital content download module is used for sending download request to server and obtains digital content.
Further, also comprise the system time synchronization module, for the treatment of time of mobile terminal system and server time synchronously.
Further, described timing arranges module and specifically comprises:
The random number generation unit is used for the time-delay of this subscribed content expected update time, with expected update time of subscribed content as random number seed, generate the random number less than 30 minutes;
Delay unit, to the expected update time increase random number time-delay of ordered digital content, the minimum expected update time is got in ordering, is set as the timing of timer.
The present invention is a kind of system of automatically download digital content also, comprises portable terminal, and server, and described portable terminal specifically comprises with lower module:
The digital content subscribing module is used for the digital content of needs is subscribed to, and preserves user's subscription information;
Expected update time generation module is used for the update time in cycle according to ordered digital content, generates the expected update time;
The outdated task judge module, expected update time and the portable terminal current time of each subscribed content are compared, if early than the current time, and be later than the last download time of this digital content, then be judged to be outdated task, directly started by the digital content download module and download, carry out timing otherwise by timing module is set;
Timing arranges module, is used for arranging digital content and downloads timing, and timing arrives, and is started by the digital content download module and downloads;
The digital content download module is used for sending download request to server and obtains digital content.
Described server is preserved digital content, and processes the download request of described portable terminal, if institute's request content upgrades really, returns the download address of this content, is downloaded by portable terminal.
Further, also comprise the system time synchronization module, for the treatment of time of mobile terminal system and server time synchronously.
Effect of the present invention is: when effectively having solved present mobile device downloads of media, user's complex operation can not make things convenient for the problem of in time obtaining content.This invention greatly reduces the download cost, and adopts the means such as random delay request, time synchronized to guarantee stability and promptness.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that obtains under the creative work prerequisite.
As described in Figure 1, digital content is subscribed to server and is carried out alternately, realizes the user to the subscription of needed number content and quits the subscription of the important evidence that the subscription list file of safeguarding is regularly downloaded as native system.
Concrete grammar of the present invention is:
1) user at first finishes the digital content subscription, and the user subscribes to can take diverse ways, owing to be prior art, and be not emphasis of the present invention, specifically do not enumerate at this.
Adopt in this example following methods: user's digital content that at first selection will be subscribed to from the digital content tabulation; Then send the message that comprises this digital content ID to server; Server returns to subscribe to determines information, and portable terminal is preserved described information in subscription list.
The subscription list file content of preserving comprises: the title of subscribed content and ID, the update time of subscribed content and last download time.
Better situation is, subscription list file user cell-phone number is encrypted, guaranteeing the binding of cell-phone number and subscribed content, and the fail safe of raising data.
As described in Table 1, the user has subscribed to 3 umber word contents altogether in the present embodiment, title is respectively: " Beijing Daily ", " consumption quality newspaper ", " a capsule caricature ", the cognizance code of digital content (ID) is respectively: 159,176,203, also have in addition update time and last download time, certainly, if the user has just finished subscription, also do not download corresponding digital content, then last download time is empty.
Title |
ID |
Update time |
Last download time |
" Beijing Daily " |
159 |
1~1:08:00-2:10:00 |
2008/09/10/08:15 |
" consumption quality newspaper " |
176 |
2~3:15:00 |
|
" a capsule caricature " |
203 |
4~12:10:00 |
2008/08/12/10:20 |
Table 1 is the subscription list file
The preservation form of update time is: " renewal frequency ~ issue or date: 24 hours meta-issue or dates when processed: 24 hours time processed ... ".
Renewal frequency represents the number of times that periodical upgrades, and adopts Digital ID, and 1 is daily magazine, and 2 is weekly, and 3 is semimonthly, and 4 is monthly magazine.
Be separated out different periodical by "-" update time, and issue or date are corresponding with renewal frequency, if daily magazine, expression issue on the same day; If weekly, weekly several renewals of expression; If semimonthly or monthly magazine then represent update date.
According to the content of preserving in the subscription list file, can obtain the information of ordered digital content: " Beijing Daily " is daily magazine, and every day, 8:00 and 10:00 upgraded, and last download time is 2008/09/10/08:15; " consumption quality newspaper " is weekly, and 15:00 upgrades on every Wendesdays, and last download time is empty, and the download of not carrying out this content is described; " a capsule caricature " is monthly magazine, and No. 12 10:00 upgrade per month, and last download time is 2008/08/12/10:20.
2) portable terminal generates the expected update time according to the update time in cycle of ordered digital content;
After the user finishes subscription, according to the update time in cycle of ordered digital content, and the current time of portable terminal, generate the expected update time, concrete generative process can be as described in Figure 2, and the embodiment of associative list 1 is described, can be easy to obtain, no longer specifically set forth at this.
For the digital content that periodically updates, we obtain its expected update time according to the portable terminal current time, and for example, certain content 8:00 every day upgrades, then its expected update time is 8:00 on the same day, and the expected update time is according to the difference of portable terminal time and difference.
If the current time is 2008/09/10/09:00, user's start starts subscription list file of timer processing.The expected update time of each subscribed content is respectively: two phases of " Beijing Daily " every day, expected update time today is 2008/09/10/08:00 and 2008/09/10/10:00; " consumption quality newspaper " upgrades on every Wendesdays, and September 10 was nearest Wednesday just, and then its expected update time is 2008/09/10/15:00; The expected update time of " a capsule caricature " is 2008/09/12/10:00.
3) portable terminal judges whether downloading task is outdated task, and in this way, the download request that directly sends this digital content to server is downloaded; Download timing otherwise set.
Concrete judge that whether downloading task is that the rule of outdated task is: with expected update time and the portable terminal current time of each subscribed content and compare, if early than the current time, and be later than last download time of this digital content, then be judged to be outdated task.Certainly, if subscribe to for the first time, then the last download time of this digital content be empty, and only need to and compare expected update time and the portable terminal current time of each subscribed content this moment, if early than the current time, then is judged to be outdated task.
Example for an outdated task, be every mornings 9 points the update time in cycle of certain digital content, for example 8 a.m. user shutdown on November 29th, 2008, second day 10 user's starts in the morning on November 30th, 2008, then this digital content No. 29 with contents No. 30 be outdated task just, the direct digital content of startup this two phase of download;
If user's available machine time is 8 a.m. on November 30th, 2008, then regularly at point in the mornings 9 on November 30th, 2008, time arrives, start the download of No. 30 update content, startup is downloaded the last download time of rear and this content and is compared, find No. 29 not download of content, be outdated task, then start the download of outdated task.
For the operation that is judged as non-outdated task, need to set the download timing, concrete methods of realizing is: the expected update time is added random number time-delay, be made as the download timing, when having subscribed to simultaneously many umbers word content, then adopt ordering to get the minimum expected update time, be set as the timing of timer.
The generation method of random number time-delay is, with expected update time of subscription digital content as random number seed, generate the random number less than 30, as this time-delay of digital content expected update time in 30 minutes.
The purpose that the random number time-delay is set is: same digital content may have a plurality of users to subscribe to, if directly the expected update set of time with this content is regularly download time, after this content expectation was upgraded, a plurality of users can initiate to download simultaneously, may cause network blockage and server overload.
The expected update time is carried out random delay, is in order to form different timing download times at each portable terminal, and after digital content was upgraded, different terminals can initiate to download in the different periods.
Less than 30 being less than 30 minutes, be the real-time that guarantees digital content, the download after digital content is upgraded can not unrestrictedly be delayed time, and is 30 minutes to the maximum so present embodiment is set time-delay download time.Certainly other delay times also can.
Or the digital content of subscribing to for the described user of table 1 is example, as described in Figure 2, enter the timing judgment rule shown in Fig. 2 right frame, 2008/09/10/08:00 is early than the current time, entering outdated task judges, its last download time is 2008/09/10/08:40, does not satisfy the outdated task condition, illustrates that the 1st phase of " Beijing Daily " on September 10th, 2008 downloads; All the other times are all greater than the current time, each expected update time is added random delay, time such as formation is: " Beijing Daily " 2008/09/10/10:10, " consumption quality newspaper " 2008/09/10/15:20, " a capsule caricature " 2008/09/12/10:05.Three times are sorted get minimum value, be made as timer time, then the set timer timing is 2008/09/10/10:10.Timing arrives, and starts the portable terminal download module and carries out " Beijing Daily " download of the 2nd phase.
4) timing arrives, and the download request that sends this digital content to server is downloaded.
Portable terminal is uploaded download request to server, and content comprises: user mobile phone number, for subscription and the Download Info of counting user; Subscribed content ID, institute's downloading contents sign; Subscription phase number of the edition identifies concrete update content.
The server process download request if the digital content of asking is upgraded really, is returned the download address of this digital content, is downloaded by portable terminal.
5) after the user finishes the digital content download, reset timing, be used for starting the download after follow-up digital content is upgraded.
The user produces new subscription, and the timer timing arrives, and timer starts, the task of timer administration module is restarted in the capital, need to read subscription list file this moment, each digital content formed the new expected update time, as the criterion of timer timed task.
Another situation of the present invention is, the user may subscribe to a plurality of digital contents, and each digital content may have a plurality of downloading task (thinking a downloading task each update time), and this just causes the task that may exist a plurality of needs regularly to download.
At this moment, portable terminal judges that at first whether downloading task is outdated task, in this way, directly downloads; As not being adding timing downloading task sequence; The download of outdated task and the regularly formation of downloading task sequence are synchronous substantially.
Certainly, portable terminal can only be managed the timing of a task at every turn, in this invention nearest person of time in the timing downloading task sequence is set as the download timing, and the time downloads to starting this task;
Each timing arrives, and all can again form regularly downloading task sequence, and the time of getting, nearest person was as timing.
When downloading outdated task, if regularly have content in the downloading task sequence, can set timing by top mode, if regularly do not have in the downloading task sequence content (as, the user subscribes to the digital content of upgrading every day, the same day, content was downloaded), then to set 0 of second day and be timing, timing is attended the meeting according to new expected update time setting timed task.
For time and the server time that makes portable terminal is consistent, guarantee the up-to-date digital content of download promptly and accurately, present embodiment provides better implementation, such as, for the situation that time of mobile terminal system changes, can take corresponding processing method.
The message that system time changes can be caught by the task of timer administration module, also can when uploading download request, upload the portable terminal current system time server at portable terminal, as the foundation of judging time synchronized, thereby start-up system time synchronized module is uploaded the current system time to server, server judges whether with its time synchronous, and asynchronous then return service device time and prompting user modification time carry out synchronously.
If the user does not carry out simultaneous operation after the prompting, then will be in the subscription list file the last download time of all downloading contents be made as the same day, reset timer, the download time that guarantees subscription digital content is synchronous with the current system time.Concrete operations are as follows:
Suppose that the current time is revised as 2008/09/15/09:00 by 2008/09/10/09:00, revise and downloaded the subscribed content final updating date, namely " Beijing Daily " changes 2008/09/15/08:15 into, and " consumption quality newspaper " is empty, and " a capsule caricature " changes 2008/09/15/10:20 into.
Cancel original timer, reenter the judgement of task of timer administration module, obtain new timing.Table 2 is listed the new expected update time of each subscription digital content, and the time of satisfying timing sequence condition (judgment rule is seen Fig. 3).
The expected update time of each subscribed content after table 2 system time is revised
2008/09/15/08:00 is less than the current time, and last download time is 2008/09/15/08:15, is not outdated task, i.e. " Beijing Daily " the 1st phase of server time 2008/09/10/08:00 renewal can not download again; The 3rd classifies the timed task sequence that adds after delaying time as in the table 2, and ordering obtains minimum time and is made as new timing.
The FTP client FTP time modification, with the download time of download digital content and the processing of current system time synchronized, can avoid the user that the time is revised forward, cause some repeated downloads of downloading contents, with the user time is revised backward, cause timer regularly to be made mistakes.
Equally, the embodiment of the invention also provides a kind of portable terminal, is used for automatically download digital content from the server, and described portable terminal specifically comprises with lower module:
The digital content subscribing module is used for the digital content of needs is subscribed to, and preserves user's subscription information;
The timing task management module, the subscription information for the treatment of the user manages downloading task;
The digital content download module is used for sending download request to server and obtains digital content.
The digital content subscribing module is responsible for the subscription that process user carries out the needed number content or is quit the subscription of operation, and user's subscription information is kept in the subscription list file.The subscription list file information of preserving comprises: the title of subscription digital content and ID, the last download time of the update time of subscribed content and this content.Last download time is used for judging whether predetermined content is downloaded on time.The subscription list file can be encrypted by user's cell-phone number, with the binding of assurance cell-phone number and subscribed content, and the fail safe that improves data.
The digital content that server provides, its more new model various ways may be arranged: upgrade once a day, repeatedly upgrade every day, upgrades weekly, upgrades per month etc.The user preserves the concrete more new model of each subscribed content when subscribing to, be used for determining of task of timer administration module timing.
Task of timer administration module Main Function is, process subscription list file, according to update time of subscription digital content, form the expected update time of each subscribed content, by specific judgment rule, set the timing of timer, timing arrives, and sends the download request of relevant this content to server.Specifically comprise with lower module:
Expected update time generation module is used for the update time in cycle according to ordered digital content, generates the expected update time.
The outdated task judge module, according to the expected update time whether be outdated task to downloading task, outdated task is in this way directly started by the digital content download module and downloads, and carries out timing otherwise by timing module is set; The outdated task judgment rule is as follows: with expected update time of each subscribed content and portable terminal current time with compare, if early than the current time, and be later than last download time of this digital content, then be judged to be outdated task.
Timing arranges module, is used for arranging digital content and downloads timing, and timing arrives, and is started by the digital content download module and downloads.
For timing rule is set, for being increased certain random number time-delay the expected update time that satisfies condition, as having subscribed to simultaneously many umbers word content, then the minimum expected update time is got in ordering, is set as the timing of timer herein.Timing arranges module and specifically comprises:
The random number generation unit is used for the time-delay of this subscribed content expected update time, with expected update time of subscribed content as random number seed, generate the random number less than 30 minutes;
Delay unit, to the expected update time increase random number time-delay of ordered digital content, same, many umbers word content is got the minimum expected update time according to ordering, is set as the timing of timer.
The expected update time to each digital content increases the random number time-delay, the time that start by set date is downloaded can also be set again, so that during server numeral content update, each portable terminal is initiated download requests in the different periods, to alleviate the burden of server and wireless network.
For the digital content download module, timing arrives, and namely certain subscribed content download time arrives, and when perhaps being judged as outdated task, starts the download module of client.Comprise two steps:
11) send download request to server, content comprises user mobile phone number, subscribed content ID, the current system time of subscribed content phase number of the edition and portable terminal;
12) server process download request if institute's request content upgrades really, is returned the download address of this content, is downloaded by portable terminal.
For time and the server time that makes portable terminal is consistent, guarantee the up-to-date digital content of download promptly and accurately, present embodiment provides better implementation also to comprise the system time synchronization module, for the treatment of time of mobile terminal system and server time synchronously.Implementation is: time of mobile terminal system changes or when sending the download request of certain subscribed content, upload its system time to server, whether the server inspection is synchronous with its time, server time with upload the FTP client FTP time phase difference and be considered as in 5 minutes synchronously, to the portable terminal return service device time, prompting user carries out synchronously as asynchronous.For the processing that time of mobile terminal system changes, the task of timer administration module captures the message that system time changes, and start-up system time synchronized module prompting user is modified to server time.If the user does not carry out synchronously, then will be in the subscription list file the last download time of all downloading contents be made as the same day, reset timer, the download time that guarantees subscription digital content is synchronous with the current system time.
Synchronous operation is above-mentioned had done introduction, no longer carefully stated herein.
The present invention also provides a kind of system of automatically download digital content, comprises portable terminal, and server, and as shown in Figure 4, described portable terminal specifically comprises with lower module:
The digital content subscribing module is used for the digital content of needs is subscribed to, and preserves user's subscription information;
Expected update time generation module is used for the update time in cycle according to ordered digital content, generates the expected update time;
The outdated task judge module, according to the expected update time whether be outdated task to downloading task, outdated task is in this way directly started by the digital content download module and downloads, and carries out timing otherwise by timing module is set;
Timing arranges module, is used for arranging digital content and downloads timing, and timing arrives, and is started by the digital content download module and downloads;
The digital content download module is used for sending download request to server and obtains digital content.
The system time synchronization module, for the treatment of time of mobile terminal system and server time synchronously.
Described server is preserved digital content, and processes the download request of described portable terminal, if institute's request content upgrades really, returns the download address of this content, is downloaded by portable terminal.
By above-described technical scheme, portable terminal is according to setting several timer times the update time of ordered digital content, timer time arrives, terminal sends download request and obtains digital content from the trend server, this invention greatly reduces the download cost, and adopts the means such as random delay request, time synchronized to guarantee stability and promptness.
The above; it only is the embodiment of the embodiment of the invention; but the protection range of the embodiment of the invention is not limited to this; anyly be familiar with those skilled in the art in the technical scope that the present invention discloses; the variation that can expect easily or replacement all should be encompassed within protection scope of the present invention.Therefore, the protection range of the embodiment of the invention should be as the criterion with the protection range of claim.