Summary of the invention
At the defective that exists in the prior art, the objective of the invention is to improve the medium 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, download the needed number content to portable terminal from server automatically, 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 judges whether downloading task is outdated task, and in this way, directly the download request that 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 by server authentication with its time, as asynchronous, return server time information and point out the user synchronous to portable terminal.
Further, as the change of mobile terminal system time, then point out user's synchronization server time; If the user do not carry out synchronously, then in the subscription list file all last download times of downloading contents be made as the same day, to keep the synchronous of download message.
Further, also comprise following operation: the server process download request, if the digital content of being asked has been upgraded really, return the download address of this digital content, download by portable terminal.
Further, also comprise following operation: after having downloaded the respective digital content, reset timing.
Further, judge whether being operating as for outdated task: 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.
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 at the timing of timer.
Further, the generation method of random number time-delay is, with expected update time of subscribing to digital content as random number seed, generate random number, as this time-delay of digital content expected update time in 30 minutes less than 30.
Further, also comprise following operation: the expected update time to each digital content increases the random number time-delay, and the time of downloading that regularly starts is set again, and when making server numeral content update, each portable terminal is initiated download request 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 information of the described file of subscription list preservation comprises: subscribed to the title and the ID of digital content, 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 is used for the subscription information of process user, and downloading task is managed;
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, be used for the synchronous of handle mobile terminal system time and server time.
Further, the timing task management module specifically comprises:
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 is provided with module, is used to be provided with digital content and downloads timing, and timing arrives, and is started by the digital content download module and downloads.
Further, described timing is provided with 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 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 at the timing of timer.
Further, user subscription information is kept in the subscription list file, and particular content comprises: subscribed to digital content identification, subscribed to the last download time of digital content update time and this content.
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, 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 is provided with module, is used to be provided with 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 handles 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, be used for the synchronous of handle mobile terminal system time and server time.
Effect of the present invention is: when having solved present mobile device downloads of media effectively, 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 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 is obtained under the creative work prerequisite.
As described in Figure 1, digital content is subscribed to server and is carried out alternately, realizes that the user is to the subscription of needed number content and quit the subscription of the important evidence that the file of being safeguarded of subscription list 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 following method in this example: user's digital content that at first selection will be subscribed to from the digital content tabulation; Send the message that comprises this digital content ID to server then; 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.
Preferable situation is that the subscription list file uses user mobile phone number to encrypt, with the binding of assurance cell-phone number and subscribed content, and improves safety of 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 ", " opening the capsule caricature ", the cognizance code of digital content (ID) is respectively: 159,176,203, also have update time and last download time in addition, 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 |
|
" opening the 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 system time-issues or date: 24 hours system time ... ".
Renewal frequency is represented 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 is represented several weekly renewals; If semimonthly or monthly magazine are then represented 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; " opening the capsule caricature " is monthly magazine, and every month No. 12 10:00 upgrades, 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 timer processing subscription list file.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 " opening the capsule caricature " is 2008/09/12/10:00.
3) portable terminal judges whether downloading task is outdated task, and in this way, directly the download request that 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 of each subscribed content with the portable terminal current time and compare, as 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, this moment only need with expected update time of each subscribed content with the portable terminal current time and compare, as if early than the current time, then be 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 user's shutdown in the morning on November 29th, 2008,10 user's starts in the morning on November 30th, second day, 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 points in the mornings 8 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, start after downloading and compare with the last download time of this content, 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, the specific implementation method is: the expected update time is added random number time-delay, be made as the download timing, when having subscribed to many umbers word content simultaneously, then adopt ordering to get the minimum expected update time, be set at the timing of timer.
The generation method of random number time-delay is, with expected update time of subscribing to digital content as random number seed, generate random number, as this time-delay of digital content expected update time in 30 minutes less than 30.
The purpose that the random number time-delay is set is: same digital content has a plurality of users and subscribes to, if directly the expected update time of this content is set to 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 on 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.
Still the digital content of subscribing at the described user of table 1 is an 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 phase in " Beijing Daily " 10 days the 1st September in 2008 downloads; All the other times are all greater than the current time, each expected update time is added random delay, time as formation is: " Beijing Daily " 2008/09/10/10:10, " consumption quality newspaper " 2008/09/10/15:20, " opening the capsule caricature " 2008/09/12/10:05.Three times are sorted get minimum value, be made as timer time, then timing is set is 2008/09/10/10:10 to timer.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 is used to add up user's subscription and download message; Subscribed content ID, the content identification of downloading; Subscription phase number of the edition identifies concrete update content.
The server process download request if the digital content of being asked has been 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 to start 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 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 has 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 at the download timing, and the time downloads to starting this task;
Each timing arrives, and all can form regularly downloading task sequence again, 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 set second day 0 for timing, timing is attended the meeting according to new expected update time set 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 preferable implementation, such as, at the situation that the mobile terminal system time 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 server the current system time of portable terminal at portable terminal, as the synchronous foundation of judgement time, thereby start-up system time synchronized module is uploaded current system time to server, server judges whether with its time synchronous, asynchronously then returns server time and points out the user's modification time to carry out synchronously.
If prompting back user does not carry out simultaneous operation, then in the subscription list file all last download times of downloading contents be made as the same day, reset timer, the download time that guarantees to have subscribed to digital content is synchronous with 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, promptly " Beijing Daily " changes 2008/09/15/08:15 into, and " consumption quality newspaper " is empty, and " opening the 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 new expected update time of respectively subscribing to digital content and the time of satisfying timing sequence condition (judgment rule is seen Fig. 3).
Title |
The expected update time |
The timing sequence |
" Beijing Daily " |
The 2nd phase of the 1st phase: 2008/09/15/08:00: 2008/09/15/10:00 |
??2008/09/15/10:08 |
" consumption quality newspaper " |
2008/09/17/15:00 (Wednesday) |
??2008/09/17/15:20 |
" opening the capsule caricature " |
??2008/10/12/10:00 |
??2008/10/12/10:10 |
Table 2 system time is revised the expected update time of each subscribed content of back
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 and the synchronous processing of current system time of download digital content, can avoid the user that the time is revised forward, cause some to download the repeated downloads of content, 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 is used for the subscription information of process user, and downloading task is managed;
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 information of subscription list file preservation comprises: subscribed to the title and the ID of digital content, the last download time of the update time of subscribed content and this content.Last download time is used to judge whether predetermined content is downloaded on time.The subscription list file can use user mobile phone number to encrypt, with the binding of assurance cell-phone number and subscribed content, and improves safety of data.
The digital content that server provided, its more new model have various ways: upgrade once a day, repeatedly upgrade every day, upgrades weekly, upgraded in every 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.
The task of timer administration module mainly act as, handle subscription list file, according to the update time of subscribing to 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 is provided with module, is used to be provided with 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 many umbers word content simultaneously, then the minimum expected update time is got in ordering, is set at the timing of timer herein.Timing is provided with 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 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 at the timing of timer.
The expected update time to each digital content increases the random number time-delay, the time of downloading that regularly starts can also be set again, when making server numeral content update, each portable terminal is initiated download request in the different periods, to alleviate the burden of server and wireless network.
For the digital content download module, timing arrives, and promptly 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 preferable implementation also to comprise the system time synchronization module, is used for the synchronous of handle mobile terminal system time and server time.Implementation is: the mobile terminal system time 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, return server time as asynchronous to portable terminal, the prompting user carries out synchronously.For the processing that the mobile terminal system time changes, the task of timer administration module captures the message that system time changes, and start-up system time synchronized module prompting user's modification is to server time.If the user do not carry out synchronously, then in the subscription list file all last download times of downloading contents be made as the same day, reset timer, guarantee to have subscribed to the synchronous of download time of digital content and 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 is provided with module, is used to be provided with 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 is used for the synchronous of handle mobile terminal system time and server time.
Described server is preserved digital content, and handles 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 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 thereto; 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.