Summary of the invention
The first object of the present invention is to provide the control method of a kind of mobile terminal, so that the scope of application of caching functionWider.
The second object of the present invention is to provide a kind of mobile terminal, so that the scope of application of caching function is wider.
In order to realize the first object of the present invention, the present invention provides the control method at a kind of mobile terminal, wherein, bagInclude: start application program;Judge whether application program has caching mechanism, the most then the network request of application program is turned to thisWay address;If local address comprises the data of correspondence, then obtain data corresponding in local address.
From such scheme, when judging that application program has caching mechanism, the network request of application program is turned toLocal address, when local address comprises the data of correspondence, then obtains data corresponding in local address so that mobile terminal is carried outAfter the pre-cache of data, it is no longer necessary to when user re-uses obtain additionally by mixed-media network modules mixed-media networking, therefore is effectively saved movementThe electricity of terminal and the flow of saving wireless telecommunications, the scope of application simultaneously also making caching function is wider.
Further scheme is, if local address does not comprise the data of correspondence, then turns to the actual address of network requestObtain data.
Further scheme is, turns to local address to include the network request of application program: by the net of application programNetwork server address in network request address replaces with the local address of local built-in server.
Therefore, then to Network Capture data when there is no a corresponding data in this locality, and after data are carried out pre-cache, whenWhen user needs the content of viewer applications, the data that the request address of this content is corresponding pass through pre-cache and download and protectBeing stored in caching, therefore by the replacement of network server address and local address, i.e. being cached by reading just can promptly logarithmBrowse according to content, as cache contents does not exists, go to obtain data normally through network..
Further scheme is, also includes: judge whether mobile terminal is in preset state before starting application program,If then backstage starts application program;If application program does not has caching mechanism, then by the network request of application program by built-inServer forwards and intercepts the data received;The data that storage receives are to local address.
Further scheme is, preset state include following at least one: mobile terminal is in breath screen state, moveDynamic terminal accesses the Internet by WiFi, and the electricity of mobile terminal reaches preset value, and mobile terminal is in charged state, mobile wholeEnd is in preset period of time.
Therefore, under mobile terminal is in preset state, then system automatically opens up relevant default application program, makesThe application program that must preset is at running background, and makes this application program preset download relevant preset data to cachingIn so that user is when using the application of mobile terminal, it is possible to reduce the waiting time browsed, user can read more gliblyReading browses, and when carrying out the pre-cache of data under WiFi connection status, user is no longer necessary in use additionally by network mouldBlock networking obtains, therefore is effectively saved the electricity of mobile terminal and saves the flow of wireless telecommunications, owing to certain applications do not have phaseThe caching mechanism answered, therefore system can carry out judging and being forwarded and intercepted the data received by built-in server so that formerOriginally the application not having caching mechanism still can carry out the pre-cache of data, and its suitability is wide.
In order to realize the second object of the present invention, the present invention provides at the control device of a kind of mobile terminal, including forThe memorizer of storage program and for performing the processor of program, wherein, processor is used for performing to start application program, judging shouldWhether there is caching mechanism by program and the network request of application program is turned to local address;If local address comprises the number of correspondenceAccording to, processor is additionally operable to obtain data corresponding in local address.
From such scheme, when judging that application program has caching mechanism, the network request of application program is turned toLocal address, when local address comprises the data of correspondence, then obtains data corresponding in local address so that mobile terminal is carried outAfter the pre-cache of data, it is no longer necessary to when user re-uses obtain additionally by mixed-media network modules mixed-media networking, therefore is effectively saved movementThe electricity of terminal and the flow of saving wireless telecommunications, the scope of application simultaneously also making caching function is wider.
Detailed description of the invention
It is the flow chart of pre-cache method of the present invention with reference to Fig. 1, Fig. 1.Step S1 is first carried out, i.e. setting steps, arrangesStep includes screen setting steps, set of time step, updates interval setting steps, deletion setting, electricity consumption setting steps, networkSetting steps, application program setting steps and curriculum offering step, wherein, screen setting steps includes that being arranged on breath screen state existsCarrying out pre-cache, set of time step includes being arranged on such as 0 o'clock to 7 o'clock time period of preset time period or 11 o'clock to 12 o'clock time periodsCarry out pre-cache, update interval setting steps and include that being arranged on preset interval time is updated and inside the Pass re-request download mutuallyHolding, deletion setting includes arranging deletes old content according to Preset Time, and to empty related cache space, electricity arranges stepSuddenly include arranging and carry out pre-cache in the charge state and carry out pre-cache, network settings again in the case of meeting default electricityStep includes that being arranged on the networks such as WiFi network connection status and/or 4G, 3G, 2G carries out pre-cache application program setting, applicationProgram setting steps includes that arranging which application program needs to carry out pre-cache is made without pre-cache with which application program,Curriculum offering step includes, to needing the pre-cache content carrying out the application program of pre-cache to be configured, i.e. arranging which contentNeed to carry out pre-cache, as the content of application homepage is carried out pre-cache or high to subscription, concern or the click frequency of applicationContent carries out pre-cache.
Perform subsequently to judge to move whether be in preset state, specifically include: whether mobile terminal is in breath screen state, moveWhether dynamic terminal accesses the Internet by WiFi, and whether the electricity of mobile terminal reaches preset value, and whether mobile terminal is in is filledElectricity condition, whether mobile terminal is in preset period of time.
Mobile terminal is in breath screen state, mobile terminal accesses the Internet by WiFi, the electricity of mobile terminal reaches pre-If value, mobile terminal are in charged state, mobile terminal is in preset period of time, mobile terminal is in above-mentioned preset stateAt least one, then perform step S2, perform pre-cache step.
It is the flow chart of pre-cache step with reference to Fig. 2, Fig. 2, step S21 is first carried out, opens default application program, subsequentlyPerform step S22, it is judged that whether the default application program opened exists caching mechanism, and the default application program as opened does not existsCaching mechanism, then perform step S23, arrange and preset the caching that application program associates, i.e. service at the built-in http of system, and openWard off relevant spatial cache, the network request of application program is forwarded and intercepted the data received by built-in server, soRear execution step S24, downloads and stores the data received to local address, owing to being provided with the content needing pre-cache, thereforeThe host address acquisition data of the request address url that the content of pre-cache is corresponding as required, and these data are downloaded and preservedIn corresponding caching, also carry out preserving stand-by by request address corresponding for these data simultaneously.Such as the default application program openedThere is caching mechanism, then application can have been used self to have had caching mechanism, and perform step S24.
It is the flow chart using step with reference to Fig. 3, Fig. 3, after pre-cache step S2 is finished, performs step S3, i.e.Perform to use step.Step S31 is first carried out, starts application program, and the content that object browse is read is clicked on, and clicks on justCorresponding network request can be obtained, perform step S32 subsequently, find corresponding data cached, subsequently of network request in the bufferPerform step S33, it is judged that whether local address exists corresponding data cached of network request, as existed, then perform stepS34, obtains data corresponding in local address, and judges whether application program has caching mechanism, the most then by application programNetwork request turns to local address, and is replaced with in this locality by the network server address in the network request address of application programBuild the local address of server, for there is no the application of caching mechanism, the host address of the networking request url of application is replaced toLocal built-in http address of service, completes then by the data cached application program being back to correspondence.As caching in the most notThere is corresponding data cached of request address, then perform step S35, turn to the actual address of network request to obtain data, i.e. fromReal request address is applied to go to obtain data by the Internet.Finally performing step S36, display corresponding contents browses for userRead.
But, the step in above-described embodiment can carry out selecting to perform according to practical situation under many circumstances, andAccording to practical situation executed in parallel, can arrange when using first such as setting steps rather than operation is intended to arrange every time, arrangeSetting steps, direct pre-cache step it is no longer needed for after Hao.And for example screen state judge step, electricity consumption condition adjudgement step andWiFi its execution sequence of connection judgment step can be have multiple, as long as meeting the screen state, with electricity condition and WiFi even presetConnect one of them in the preset state such as state and just can perform pre-cache step.
Pre-cache device embodiment:
Being pre-cache apparatus system block diagram with reference to Fig. 4, Fig. 4, and combine above-mentioned pre-cache embodiment of the method, pre-cache device includesFor storing the memorizer 12 of program and for performing the processor 11 of program, processor 11 includes arranging module 111, judging mouldBlock 112, startup module 113, cache module 114, download module 115, searching module 116, return module 117 and display module118.Arrange module 111 for perform arrange screen settings, set of time, renewal interval arrange, delete arrange, electricity consumption setting,Network settings, application program are arranged and curriculum offering, it is judged that module 112 is used for judging whether mobile terminal is in preset state,Preset state include following at least one: mobile terminal is in breath screen state, mobile terminal by WiFi access the Internet,The electricity of mobile terminal reaches preset value, and mobile terminal is in charged state, and mobile terminal is in preset period of time.
Processor is additionally operable to perform pre-cache, specifically, starts module 113 and is used for starting application program and being opened by backstageDynamic application program, cache module 114 is used for judging whether application program has caching mechanism, cache module 114 to be additionally operable to applyThe network request of program is forwarded by built-in server and is intercepted the data received, and download module 114 receives for storageData to local address.
Find module 116 for obtaining the network request of application program and finding corresponding the delaying of network request in the bufferDeposit data, and find module 116 and be additionally operable to judge whether local address comprises the data of correspondence, return module 117 is used for obtainingTake data corresponding in local address and the network server address in the network request address of application program is replaced with this localityThe local address of built-in server, download module 115 obtains data, display module for turning to the actual address of network request118 are used for showing that corresponding contents is for user's brose and reading.
Therefore, when judging that application program has caching mechanism, the network request of application program is turned to locallyLocation, when local address comprises the data of correspondence, then obtains data corresponding in local address so that mobile terminal carries out dataAfter pre-cache, it is no longer necessary to when user re-uses obtain additionally by mixed-media network modules mixed-media networking, therefore is effectively saved mobile terminalElectricity and the flow of saving wireless telecommunications, the scope of application simultaneously also making caching function is wider.