Background technology
Mobile information equipment characteristic (MIDP, Mobile Information Device Profile) agreement is Java process tissue (JCP, Java Community Process) formulate about on mobile device, how using the standard of the miniature version of Java2 (J2ME, Java2 Micro Edition).The purpose of MIDP agreement is definition one individual system framework and corresponding application interface (API, Application ProgramInterface), thereby the exploitation of using for third-party mobile information apparatus provides open standard environment.In addition, how the MIDP agreement has also defined mobile device by the aerial standard that receives (OTA, Over The Air) from server side acquisition MIDP application program (MIDlets).
Fig. 1 is the schematic diagram that mobile device is downloaded the MIDP application program in the prior art from server.With reference to Fig. 1, the user uses the MIDP application program that the search program in the mobile device inquires needs download, and the resource locator of the descriptor file of MIDP application program (URL, Universal ResourceLocator).The MIDP application program specifically is a java application, so the descriptor file of MIDP application program is Java application descriptor (JAD, a Java Application Descriptor) file.Start following download flow process behind the URL of mobile device acquisition JAD:
Step 1, the search program of mobile device obtains the JAD file according to the URL of JAD from server.
Contain descriptor in the JAD file, comprising: document size, Java applied compression bag (JAR, Java Application Archive) file corresponding download URL, version number and supplier's information etc. relevant for java application.Here, jar file is the MIDP application program that will download.
Step 2, search program sends to Java Application Manager (JAM, Java Application Manager) in the mobile device with the JAD file that obtains, and starts the download agent function of JAM.
Step 3, JAM resolves content in the JAD file, and whether the verification mobile device has the ability to use this Java to use.
Step 4 after JAM has resolved JAD, will be downloaded descriptor and be shown to the user, and the user confirms to download JAR.
Step 5, to server requests JAR, server is sent to JAM by http response message with JAR to JAM according to the resource locator MIDlet-JAR-URL of the MIDP application program compressed package among the JAD.
In this step, comprise JAR in the message body of http response message.
Step 6 after JAM finishes the download of JAR, is installed this JAR on mobile device.
Step 7, JAM sends the installment state report according to the result who installs to server, and report produces the station message recording to server according to installment state.
In above-mentioned flow process, the JAR of mobile device download be once download successful.If download interruption at the server shown in the step 5 to the process that JAM transmits JAR, then JAM sends the status report of expression connection interruption to server under the situation that the network connection allows, and server stops this and downloads flow process.Here, JAM status report under the situation that the network connection allows is specifically as follows: download and interrupt owing to there being the phone incoming call to cause, can switch to telephone service again this moment at JAM after the server status report; Perhaps, interruption is owing to the network service quality instability causes, the link between mobile device and the server off and on, this moment, JAM can have when connection that status report is sent.
In sum, in actual applications, mobile device is downloaded the situation of interrupting and is happened occasionally when downloading task.For example, under the situation of network service quality difference, mobile device can be lost network and connect, and then can cause downloading and interrupt; For the terminal of single task,, also can cause downloading and interrupt if in the process of downloading task, have telephone access.At this moment, if the user also wants to download the task of interruption, then must accent come again.This causes the user repeatedly to download same content, causes the waste of the network bandwidth and flow.
Summary of the invention
The embodiment of the invention provides a kind of method for down loading of MIDP application program, and this method has improved the download success rate of MIDP application program, has reduced the waste of the network bandwidth and flow.
The embodiment of the invention provides a kind of mobile device, and this mobile device has improved the download success rate of MIDP application program, has reduced the waste of the network bandwidth and flow.
The embodiment of the invention also provides a kind of server, and this server has improved the download success rate of MIDP application program, has reduced the waste of the network bandwidth and flow.
The embodiment of the invention discloses a kind of method for down loading of MIDP application program, this method comprises:
Mobile device obtains the breakpoint transmission ability information of server; Concrete acquisition methods comprises: server increases a sign and shows whether server end supports breakpoint transmission in the descriptor file of MIDP application program; Mobile device was known the breakpoint transmission ability information of server by the descriptor file of obtaining the MIDP application program before downloading the MIDP application program from server; Perhaps server informs in the head interpolation designated identification of described response message whether mobile device supports breakpoint transmission when the mobile device transmission comprises the response message of MIDP application program; After mobile device receives described response message from server, obtain the breakpoint transmission ability information of server from its head;
Mobile device is downloaded the process of MIDP application program from server, interrupts if take place to download, and then mobile device is preserved the MIDP application program segment of having downloaded;
When described download was interrupted recovering, mobile device sent MIDP application program subsequent segments downloading request message to server, wherein carries the start position information of the MIDP application program subsequent segments of being asked;
Mobile device obtains the MIDP application program subsequent segments that server returns according to the start position information that carries in the described MIDP application program subsequent segments downloading request message.
The embodiment of the invention discloses a kind of mobile device, this mobile device comprises: ability information acquisition module, download module and memory module, wherein,
The ability information acquisition module is used for obtaining from the descriptor file of MIDP application program the breakpoint transmission ability information of server, and increasing in the described descriptor file has a sign to show whether server end supports breakpoint transmission; Perhaps obtain the breakpoint transmission ability information of server the head of the response message that comprises the MIDP application program that sends from server, the head of described response message is added with designated identification and informs whether mobile device supports breakpoint transmission; And the breakpoint ability information of server informed described download module;
Download module is used for downloading the MIDP application program from server, and when MIDP application program downloading process takes place to interrupt, the MIDP application program segment of having downloaded is sent to memory module; When described download is interrupted recovering, be used for sending MIDP application program subsequent segments downloading request message to server, wherein carry the start position information of the MIDP application program subsequent segments of being asked; Obtain the download MIDP application program subsequent segments that server returns according to the start position information that carries in the described MIDP application program subsequent segments downloading request message, and send to memory module;
Memory module is used to preserve the MIDP application program that download module sends.
The embodiment of the invention also discloses a kind of server, this server comprises: downloading service module and memory module, wherein,
Memory module is used to preserve the MIDP application program;
Downloading service module is used for increasing in the descriptor file of a MIDP application program that is identified to memory module, is used for showing whether server end supports breakpoint transmission; Perhaps in the head of the response message that comprises the MIDP application program that sends to portable terminal, add designated identification and inform whether mobile device supports breakpoint transmission; And be used for obtaining the MIDP application program and sending to mobile device from memory module according to the request of mobile device; After receiving the MIDP application program subsequent segments downloading request message that mobile device sends, obtain corresponding M IDP application program segment and send to mobile device from memory module according to the start position information of wherein MIDP application program subsequent segments.
As seen from the above technical solution, this mobile device of the embodiment of the invention is downloaded the process of MIDP application program from server, interrupts if take place to download, and then mobile device is preserved the MIDP application program segment of having downloaded; When described download was interrupted recovering, mobile device sent MIDP application program subsequent segments downloading request message to server, wherein carries the start position information of the MIDP application program subsequent segments of being asked; Mobile device is downloaded the technical scheme of the MIDP application program subsequent segments asked from server, has improved the download success rate of MIDP application program, has reduced the waste of the network bandwidth and flow.
Embodiment
The embodiment of the invention is by expansion MIDP agreement, make mobile device when MIDP application program downloading process takes place to interrupt, the MIDP application program of having downloaded is preserved, and interrupting recovering the back to the follow-up MIDP application program segment of server requests, server returns the content of appointment according to the request of mobile device.This technical scheme of the embodiment of the invention, make mobile device after the interruption that the MIDP application program is downloaded recovers, can also continue to download follow-up content, thereby improve the download success rate of MIDP application program, avoid the waste of the network bandwidth and flow from interruption position.
For making purpose of the present invention, technical scheme and advantage clearer, below with reference to the accompanying drawing preferred embodiment that develops simultaneously, the present invention is described in more detail.
In the embodiment of the invention, mobile device can obtain server breakpoint transmission ability information earlier, if server is supported breakpoint transmission, then starts breakpoint transmission flow process provided by the invention when downloading interruption, otherwise the existing procedure shown in the execution graph 1.Provider server can make server can handle the breakpoint transmission process in order to guarantee compatibility, also can handle existing non-breakpoint transmission flow process.The method that mobile device obtains the breakpoint transmission ability information of server comprises:
1, server promptly increases a sign and shows whether server end supports breakpoint transmission in the descriptor file of MIDP application program in the JAD file.Mobile device is judged the breakpoint transmission ability of server according to the designated identification in the JAD file that obtains, thereby selects different handling processes.If server end is not supported breakpoint transmission, still adopt existing download process flow process; If server is supported breakpoint transmission, then can start the download flow process of breakpoint transmission of the present invention.Consider the compatibility with prior art, can think when the JAD file comprises the sign of appointment that server supports breakpoint transmission; When in the JAD file, not having described designated identification, think that server do not support breakpoint transmission.Also can indicate server whether to support breakpoint transmission by the different value of the designated identification of in the JAD file, adding.For example, can add the Attribute domain that a name is called " Resume_download " in the JAD file, the value of this Attribute domain is 0 or 1, represents server support breakpoint transmission when the value of this Attribute domain is 1, is that 0 expression server is not supported breakpoint transmission.
2, in step 5 shown in Figure 1, server is passing through http response message when mobile device transmits JAR, can add designated identification at the head of described response message and inform whether mobile device self supports breakpoint transmission.For example, in the head of described response message, add " Accept-Ranges:bytes " field, whether carry " Accept-Ranges:bytes " field in the head of the response message that comprises JAR that mobile device can return according to server and judge whether server supports breakpoint transmission.
Give mobile device below and know according to the designated identification in the JAD file that obtains whether server supports that breakpoint transmission is an example, provide a specific embodiment of realizing the breakpoint transmission of MIDP application program.
Fig. 2 is the flow chart of embodiment of the invention MIDP application program downloading process.As shown in Figure 2, may further comprise the steps:
Step 201, the user need to find the MIDP application program of download, obtains to download the URL of MIDP application descriptor file JAD correspondence, and mobile device sends the JAD download request according to the URL that the user obtains to server.
In this step, the user can need find downloaded files by the multimedia message between portal website or the user or E-MAIL and by the modes such as polling routine of mobile device, and obtains the URL of the downloaded files correspondence of wanting.
Step 202, server finds corresponding JAD file according to the URL that carries in the JAD download request, and this JAD file is upgraded processing, adds the breakpoint transmission ability information of self in this JAD file.
Server also can add the breakpoint transmission ability information of himself in advance in all JAD files, at this moment, need not to add in step 202.
The JAD file that step 203, server will be carried the breakpoint transmission ability information returns to mobile device.
Step 204, mobile device are resolved the content in the JAD file, and whether verification self this less important downloaded files of whether having the ability to use, and the breakpoint transmission ability information of preserving server can carry out breakpoint transmission to determine follow-up flow process.
Step 205, mobile device is shown to the user with the download descriptor in the JAD file, and the user confirms to download.
Step 206, mobile device obtains the download address MIDlet-JAR-URL of jar file according to the information in the JAD file, sends the JAR downloading request message to server, wherein carries MIDlet-JAR-URL.
Step 207, server are according to the JAR download request, and beginning is returned corresponding jar file to mobile device.
Step 208, the process that mobile device is downloaded JAR is interrupted.
In this step, the interruption of JAR downloading process can be that the user suspends to download and causes, and also can be to have telephone access and cause, and can also be that reason such as network service quality problem causes.
Step 209, mobile device carries out Interrupt Process, preserves the current jar file segment of having downloaded.
Whether step 210 is interrupted recovering back mobile device prompting user and is continued to download, and the user selects to continue to download.
In this step, interrupting recovering can be that the user cancels the time-out download, or the telephone finished that inserts, or the network recovery service etc.
Step 211, mobile device send JAR subsequent segments downloading request message according to the jar file segment of having downloaded to server.
In this step, mobile device comprises the start position information of the JAR segment of being asked in the JAR subsequent segments downloading request message that server sends.This start position information can represent that the jar file segment of for example having downloaded is 1024 bytes with byte, and then start position information can be " the 1025th byte ".
In this step, start position information can be arranged in " range " field of the JAR subsequent segments downloading request message that transmits with http protocol.
Step 212, server are returned the jar file segment of appointment according to the start position information in the JAR subsequent segments downloading request message.
After step 213, follow-up jar file segment are downloaded and finished, mobile device will be formed a complete jar file by the jar file segment that twice downloading process obtains, and carry out installation process.
Step 214, after the installation, mobile device sends installment state and reports server, with the notice installation results.
Step 215, server are finished according to installment state report user's charging are handled.
Step 216, server is to mobile device return state report response.
Step 217, mobile device receive that status report response back prompting user uses installation, can use.
In the step 209 of above-mentioned flow process, mobile device carries out Interrupt Process, preserve the current jar file content of having downloaded after, under the situation that network condition allows, can further return the status report of an appointment, wherein carry the size information of having downloaded jar file to server.The status report of this appointment is different from the prior art and moves the expression that device-to-server returns when taking place to interrupt and connect the status report that interrupts.
In the step 210 of above-mentioned flow process, if the user selects cancellation to download, then mobile device is deleted the jar file content of preserving in the step 209.
In above-mentioned flow process shown in Figure 2, provide the process that realizes breakpoint transmission under the scene that occurs in the downloading process once interrupting.Interrupt if occurred once more in the transmission course of the follow-up JAR segment in step 212 downloading, then its solution solution that the first time, appearance was downloaded when interrupting together is identical, no longer repetition here.
Based on the foregoing description, next provide the structured flowchart of a kind of mobile device of the embodiment of the invention and server.
Fig. 3 is the structured flowchart of a kind of mobile device of the embodiment of the invention.As shown in Figure 3, this mobile device mainly comprises: download module 301 and memory module 302.Wherein:
Download module 301 is used for downloading the MIDP application program from server, and when MIDP application program downloading process takes place to interrupt, the MIDP application program segment of having downloaded is sent to memory module 302; When described download is interrupted recovering, be used for sending MIDP application program subsequent segments downloading request message to server, wherein carry the start position information of the MIDP application program subsequent segments of being asked; Obtain the MIDP application program subsequent segments that server returns according to the start position information that carries in the described MIDP application program subsequent segments downloading request message, and send to memory module 302.
Memory module 302 is used to preserve the MIDP application program that download module 301 sends.
Mobile device shown in Figure 3 may further include ability information acquisition module 303, be used for obtaining the breakpoint transmission ability information of server from the descriptor file of MIDP application program, perhaps obtain the breakpoint transmission ability information of server the head of the response message that comprises the MIDP application program that sends from server, and the breakpoint ability information of server is informed described download module 301.
Mobile device shown in Figure 3 may further include status report module 304, be used for when downloading interruption, according to the MIDP application program segment of having downloaded in the memory module 302, to the status report messages of server transmission appointment, carry the size information of the MIDP application program segment of having downloaded in this message.
Mobile device shown in Figure 3 can further include removing module 305, is used for when the user cancels download, and deletion is saved in the MIDP application program of having downloaded in the memory module 302.
Fig. 4 is the structured flowchart of a kind of server of the embodiment of the invention.As shown in Figure 4, this server comprises: memory module 401 and downloading service module 402.Wherein:
Memory module 401 is used to preserve the MIDP application program.
Downloading service module 402 is used for obtaining the MIDP application program and sending to mobile device from memory module 401 according to the request of mobile device; After receiving the MIDP application program subsequent segments downloading request message that mobile device sends, obtain corresponding M IDP application program segment and send to mobile device from memory module 401 according to the start position information of wherein MIDP application program subsequent segments.
In Fig. 4, downloading service module 402 can be further used for the breakpoint transmission ability information of self is added in the descriptor file of the MIDP application program in the memory module; Perhaps the breakpoint transmission ability information of self is added in the head of the response message that comprises the MIDP application program that sends to portable terminal.
In sum, present embodiment is invented this mobile device and is downloaded the process of MIDP application program from server, interrupts if take place to download, and then mobile device is preserved the MIDP application program segment of having downloaded; When described download was interrupted recovering, mobile device sent MIDP application program subsequent segments downloading request message to server, wherein carries the start position information of the MIDP application program subsequent segments of being asked; Mobile device is downloaded the technical scheme of the MIDP application program subsequent segments asked from server, has improved the download success rate of MIDP application program, has reduced the waste of the network bandwidth and flow.
Through the above description of the embodiments, those skilled in the art can be well understood to the present invention and can realize by the mode that software adds essential general hardware platform, can certainly pass through hardware, but the former is better execution mode under a lot of situation.Based on such understanding, technical scheme of the present invention can embody with the form of software product, this computer software product is stored in the storage medium, comprise that some instructions are with so that a computer equipment (can be a personal computer, server, the perhaps network equipment etc.) carry out the described method of each embodiment of the present invention.
The above is preferred embodiment of the present invention only, is not to be used to limit protection scope of the present invention, all any modifications of being made within the spirit and principles in the present invention, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.