CN109213512A - Offline packet loading method, system, terminal and readable storage medium storing program for executing - Google Patents

Offline packet loading method, system, terminal and readable storage medium storing program for executing Download PDF

Info

Publication number
CN109213512A
CN109213512A CN201810929469.1A CN201810929469A CN109213512A CN 109213512 A CN109213512 A CN 109213512A CN 201810929469 A CN201810929469 A CN 201810929469A CN 109213512 A CN109213512 A CN 109213512A
Authority
CN
China
Prior art keywords
offline
packet
offline packet
server
terminal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810929469.1A
Other languages
Chinese (zh)
Inventor
林湧顷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN201810929469.1A priority Critical patent/CN109213512A/en
Publication of CN109213512A publication Critical patent/CN109213512A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Abstract

The present invention provides a kind of offline packet loading method, system, terminal and readable storage medium storing program for executing.The offline packet loading method includes: request of the transmission comprising identification information to server, to obtain the offline packet of the corresponding identification information;Verification inspection is carried out to offline packet according to the check code wrapped offline;The offline packet of load, and start page parsing operation.The present invention can obtain newest offline packet by transmiting a request to server, and can load offline packet in application starting after verifying to the newest offline packet acquired, and the time of data is obtained when reducing using starting, improves user experience.

Description

Offline packet loading method, system, terminal and readable storage medium storing program for executing
Technical field
The present invention relates to field of software development more particularly to a kind of offline packet loading method, system, terminal and readable storages Medium.
Background technique
This part intends to provides background for the embodiments of the present invention stated in claims and specific embodiment Or context.Description herein recognizes it is the prior art not because not being included in this section.
With popularizing for mobile terminal device, the function of Html5 technology is also stronger and stronger.More and more applications (are answered With) begin to use Html5.However, needing to obtain data from network, speed experiences very poor, Wu Fabao slowly very much when application starting Demonstrate,prove loading velocity.Especially in weak net, open need to will lead to the time that terminal white screen is shown when the webpage updated it is longer, Reduce user experience.
Summary of the invention
In view of above-mentioned, the present invention provides a kind of offline packet loading method, system, terminal and readable storage medium storing program for executing, with advantageous In raising user experience.
A kind of offline packet loading method, comprising:
Request of the transmission comprising identification information is to server, to obtain the offline packet of the corresponding identification information;
Verification inspection is carried out to the offline packet according to the check code wrapped offline;
When inspection result be by when, load offline packet, and start page parsing operation.
Further, in the offline packet loading method, the request of the transmission comprising identification information is to server, to obtain Corresponding the offline of identification information is taken to include:
Identification information of the transmission comprising application identities is to the server, so that the server is according to the application mark Knowledge judges in the server with the presence or absence of newest offline packet;
Receive the offline packet of the corresponding application identities of the server transport;Or judge whether deposit in local cache It is wrapping offline, and is existing in local cache and obtain the corresponding offline packet mark wrapped offline when wrapping offline;
Identification information of the transmission comprising the offline packet mark is to server, so that the server is according to described offline Packet mark judges whether the offline packet in the local cache is newest offline packet;
It receives in the confirmation local cache of the server output and wraps the newest feedback information wrapped offline offline The offline packet of the corresponding application identities is obtained from the local cache afterwards.
Further, in the offline packet loading method, the request of the transmission comprising identification information is to server, to obtain Corresponding the offline of identification information is taken to include:
Request of the transmission comprising the identification information is to server, so that the server judges whether there is update Offline packet or incremental update packet;
Receive the offline packet or incremental update packet of the update of the server transport;Or
Receive the link address of the corresponding offline packet or incremental update packet updated of the server transport;
The offline packet or incremental update packet of the update are downloaded according to the link address.
Further, in the offline packet loading method, it is described according to the check code wrapped offline to the offline packet Carrying out verification operation includes:
It obtains server and carries out obtained first check code of verification operation for the offline packet;
Verification operation is carried out to the offline packet for acquiring the corresponding application identities, with the second obtained check code;
Judge whether first check code is identical as the second check code, determines that the offline packet is checked by verification.
Further, in the offline packet loading method, the offline packet of load, and start page parsing operation and include:
Obtain the offline packet of corresponding different service types;
Corresponding service identification is obtained according to the offline packet of different service types;
The offline packet of different service types is associated by corresponding service identification with business module corresponding in main interface.
Further, the offline packet loading method further include:
Obtain the current context information of terminal;
Judge current context information and execution condition corresponding to pretreatment operation specified in preprocessing rule whether phase Matching;
When execution condition corresponding to the pretreatment operation specified in current context information and preprocessing rule matches, Corresponding pretreatment operation is executed, to obtain new offline packet in advance.
Further, in the offline packet loading method, the current context information of the terminal includes the network-like of terminal State, current time, one or more information in geographical location, specified in the judgement current context information and preprocessing rule Whether execution condition corresponding to pretreatment operation, which matches, includes:
When whether judging the current time in current context information with execution corresponding to execution condition in preprocessing rule Between between interval be less than first threshold;Or
Judge geographical location information in current context information whether with corresponding to execution condition in the preprocessing rule The distance between geographical location be less than second threshold;Or
Judge network state in current context information whether with it is network-like corresponding to execution condition in preprocessing rule State is identical.
A kind of offline packet loading system, comprising:
Request unit is used for transmission the request comprising identification information to server, to obtain the corresponding identification information Offline packet;
Verification unit, for carrying out verification inspection to the offline packet according to the check code wrapped offline;
Loading unit, for inspection result by when the offline packet of load, and start page parsing operation.
A kind of terminal, the terminal include processor and memory, and several computer programs are stored on the memory, The step of processor realizes the offline packet loading method when being used to execute the computer program stored in memory.
A kind of readable storage medium storing program for executing is stored thereon with computer program, real when the computer program is executed by processor Now the step of offline packet loading method.
Above-mentioned offline packet loading method, system, terminal and readable storage medium storing program for executing are obtained by transmiting a request to server Newest offline packet, and offline packet can be loaded in application starting after verifying to the newest offline packet acquired, The time that data are obtained when reducing using starting, improve user experience.In addition, also by judge current context information in advance Whether execution condition corresponding to pretreatment operation specified in processing rule matches, and in current context information and pretreatment When execution condition corresponding to pretreatment operation specified in rule matches, new offline packet is obtained in advance, is also conducive to mention The experience of high user.In addition, offline packet can be configured by business module, without pressing file configuration, offline packet includes business mould The relevant all pages of block, can disposably preload, improve the experience of user.
Detailed description of the invention
It, below will be to required in embodiment description in order to illustrate more clearly of the technical solution of embodiment of the present invention The attached drawing used is briefly described, it should be apparent that, the accompanying drawings in the following description is some embodiments of the present invention, for For those of ordinary skill in the art, without creative efforts, it can also be obtained according to these attached drawings other Attached drawing.
Fig. 1 is the flow chart of the better embodiment of the offline packet loading method of first embodiment of the invention;
Fig. 2 is the flow chart of the better embodiment of the offline packet loading method of second embodiment of the invention;
Fig. 3 is the block diagram of the better embodiment of terminal of the present invention and server communication;
Fig. 4 is the illustrative block diagram for the offline packet loading system that an embodiment of the present invention provides.
Main element symbol description
Computer equipment 40
Processor 401
Memory 405
Input/output interface 407
Network interface 409
Bus 411
Display screen 403
Offline packet loading system 417
Acquiring unit 710
Judging unit 712
Request unit 714
Verification unit 716
Loading unit 718
Specific embodiment
To better understand the objects, features and advantages of the present invention, with reference to the accompanying drawing and specific real Applying mode, the present invention will be described in detail.It should be noted that in the absence of conflict, presently filed embodiment and reality The feature applied in mode can be combined with each other.
In the following description, numerous specific details are set forth in order to facilitate a full understanding of the present invention, described embodiment Only some embodiments of the invention, rather than whole embodiments.Based on the embodiment in the present invention, this field Those of ordinary skill's every other embodiment obtained without making creative work, belongs to guarantor of the present invention The range of shield.
Unless otherwise defined, all technical and scientific terms used herein and belong to technical field of the invention The normally understood meaning of technical staff is identical.Term as used herein in the specification of the present invention is intended merely to description tool The purpose of the embodiment of body, it is not intended that in the limitation present invention.
Embodiment one
Fig. 1 is the flow chart of the offline packet loading method of first embodiment of the invention, it should be noted that present embodiment The offline packet loading method be not limited to step and sequence in flow chart shown in FIG. 1.Shown according to different requirements, Step in flow chart can increase, remove or change sequence.
First better embodiment of the offline packet loading method of the present invention may include following steps:
Step S100, request of the transmission comprising identification information to server, to obtain the offline of the corresponding identification information Packet.
In present embodiment, terminal is mountable one or more application, and one or more can be achieved different or similar Function.Preferably, terminal can show that several operation interfaces, each operation interface may include the icon of corresponding application.When application Icon be triggered (such as user can click the corresponding position of terminal screen) when, corresponding application can start.In present embodiment, The identification information may include application identities and offline packet mark.
It is to be appreciated that corresponding wrap offline can be reached server by developer, and then correspondence can be stored on server The offline packet of the one or more of application.Preferably, application can have application identities (as using AP0001), server storage from Line packet can have offline packet mark (such as OL0001).For example, server can be to new offline packet when there is new offline packet to generate The new offline packet of distribution identifies (such as OL0002).The offline packet may include program file, resource file and preparation file.
It is to be appreciated that the offline packet of the server memory storage can also be relative to the previous incremental update wrapped offline Packet, as the offline mark OL0002_1 of incremental update packet can indicate the incremental update packet of previous offline packet mark OL0002.
It applies to send to server at starting (or running background) and request, to obtain offline packet, wherein what is sent asks Middle portable application is asked to identify, in turn, server can select to correspond to when receiving using the request sent according to application identities Offline packet, as application identities AP0001 can it is corresponding it is offline packet be identified as OL0001.For example, at the first time, using to clothes Portable application in the request that device is sent of being engaged in identifies AP0001, and server, can be according to answering when receiving using the request sent Corresponding offline packet OL0001 is selected with mark AP0001.
In another embodiment, it is wrapped using in the local cache of terminal also detectable when starting with the presence or absence of offline.When When there is offline packet in local caching, when using requesting to server transmission, application can obtain the offline packet institute of local cache Corresponding offline packet mark, and send in the request comprising the offline packet mark and application identities and be sent to server.Server Whether the offline packet that application cache is judged after receiving offline packet mark is newest.When the offline packet of application cache is not most When new, newest offline packet is transferred to the terminal where application by server.In addition, server can exist newest offline packet The position of server storage is sent to application, and newest offline packet is downloaded from server according to the position of storage by application.When When the offline packet of application cache is newest, indicate that the corresponding offline packet of application has been downloaded, at this point, server can transmit confirmation institute It states in local cache and wraps the newest feedback information wrapped offline offline to terminal, so that application can be loaded directly into local cache In offline packet.Wherein, the storage mode of local cache includes but is not limited to SQLite, cell phone system memory etc., can be more preferable The fluency of page load is improved, brings better experience for user.
In other embodiments, it when server is only stored for an offline packet applied, is sent out using to server Application identities can not included in the request sent, that is, indicating in the request that sends to server of application can not comprising application identities or only Comprising wrapping mark offline.
For example, obtaining offline packet OL0001 using from server at the first time.Using offline packet OL0001 can be deposited Storage is in local cache, when applying in the starting of the second time, since local caching has offline packet OL0001.Thus, when When there is offline packet OL0001 in local caching, using sent to server request when, application can obtain local cache from The offline packet of line packet identifies OL0001, and the offline packet mark OL0001 is sent to server in the request of transmission.At this point, If there is also offline packets OL0002 (being expressed as new offline packet) for server.At this point, server receive terminal transmission from Judge that the offline packet of application cache is not newest after line packet OL0001 mark.Server passes newest offline packet OL0002 The terminal being defeated by where application.In addition, newest offline packet OL0002 can be sent to by server in the position that server stores Using by downloading newest offline packet OL0002 from server using according to the position of storage.
In addition, in the third time, requested using can also be sent to server, at this point, using it is corresponding wrap offline it is offline Packet mark OL0002 is sent to server in the request of transmission using the offline packet is then identified OL0002.At this point, for feelings Condition one, if the offline packet of server storage when being identified as OL0002, indicate the local cache of terminal it is offline wrap be it is newest, into And feedback information can be transmitted to terminal in server, and then the application of terminal can load offline packet directly from local cache;For Situation two, if server there is also incremental update packet OL0002_1, thus, server is after receiving offline packet OL0002 mark Judge the offline packet of application cache be not it is newest, server is using newest incremental update packet OL0002_1 as offline packet biography The terminal being defeated by where application.In addition, incremental update packet OL0002_1 can be sent to by server in the position that server stores Using by downloading incremental update packet OL0002_1 from server using according to the position of storage.
Step S102 carries out verification inspection to offline packet according to the check code wrapped offline.
In present embodiment, offline packet can have check code, and wherein the check code can carry out MD5 to offline packet by server Verification operation obtains.It is to be appreciated that using MD5 veritification can also be carried out to obtained offline packet or incremental update packet, to obtain Corresponding MD5 check code, and then advantageously ensure that the consistency and integrality of data transmission.In addition, server can be to offline packet Compression processing is carried out, is conducive to save user's surfing flow.
The full name of MD5 (one-way Hash algorithm) is Message-Digest Algorithm 5 (md5-challenge), warp MD2, MD3 and MD4 are developed.
MD5 after treatment, exports the information (digital finger-print) for 128 by the information to input random length;No The different results (uniqueness) that same input obtains;(no according to the impossible anti-information for releasing input of 128 output results It is reversible).
For example server sends an offline packet.Before transmission, server carries out MD5 verification operation to offline packet, first obtains The first check code a of MD5.Then after application receives offline packet, MD5 verification operation is also carried out using to offline packet, obtains one The second check code b of a MD5.If a as b, indicates that offline packet is not tampered on the way in transmission, checked by verification.
Step S104 loads offline packet, and starts page parsing operation.
After offline packet is by safety inspection, using offline packet can be loaded on startup, and start page parsing.Wherein, Page parsing is used to carry out parsing and rendering to offline packet or incremental update packet.Offline packet can also be loaded integrally in advance into interior It deposits, reduces the time-consuming of disk input and output, guarantee loading velocity, promote user experience.It is to be appreciated that applying start-up loading It also can be performed after offline packet and execute step S100 again, to continue to judge whether server has new offline packet.
It is to be appreciated that the file needed for application operates normally includes using shell script (program file) needed for operation And/or resource file and prepare file.Shell script is JavaScript program;Resource file may include picture file, Audio file, video file or combinations thereof.Normally, there are two types of the modes of one HTML5 document of JavaScript script addition. First, the JavaScript program is directly contained in html document, when html document operation, call corresponding Interpreter is explained and is run to it;Second, already existing JavaScript foot can be inserted into the html document This source program (such as already present js formatted file).It, should for function compared with horn of plenty JavaScript program JavaScript program needs to call some multi-medium datas, such as the figure of bmp format or jpg format when operating normally The video file of piece file, the audio file of wav format or mid format and some more typical formats.Program file and resource File has been compiled as the form of binary file.Preparing in file may include offline packet mark, also may include script file and The information such as the path of resource file, wherein the path of script file can be lib/ionic/js/ionic.bundle.js, lib/ Angular-ui-router.js, js/app.js, the Lu Kewei lib/ionic/sample.png of resource file.Using can be with The offline packet comprising program file and resource file is called from buffer area, and is operated normally.For example, when receiving server hair When the offline packet mark (first offline packet mark) sent, terminal can parse the preparation file in offline packet, with obtain from Offline packet mark (the second offline packet mark) corresponding to line packet, and compare the first offline packet and identify whether to mark with the second offline packet Know, when the first offline packet mark with second wrap offline mark it is identical when, using can then start page parsing.Using so can basis Preparing file calls corresponding script file and resource file to be executed, to achieve the purpose that load is wrapped offline.
Above-mentioned offline packet loading method obtains newest offline packet by transmiting a request to server, and to acquiring Newest offline packet verified after can load offline packet in application starting, obtain data when reducing using starting Time improves user experience.
Embodiment two
Fig. 2 is the flow chart of the offline packet loading method of second embodiment of the invention, it should be noted that present embodiment The offline packet loading method be not limited to step and sequence in flow chart shown in Fig. 2.Shown according to different requirements, Step in flow chart can increase, remove or change sequence.
Second better embodiment of the offline packet loading method of present embodiment may include following steps:
Step S200, obtains terminal current context information, and the current context information includes the network state, current of terminal The information such as time, geographical location.
It is to be appreciated that the network state of terminal can the mobile networks such as wireless networks, 3G, 4G, 5G such as Wi-Fi.Terminal Current time can the clock of calling system obtain, or obtain the current time information of third-party transmission by network.Eventually The geographical location at end can be obtained by the positioning device (such as global positioning system) of terminal.
Step S202, judges whether current context information is held with corresponding to pretreatment operation specified in preprocessing rule Row condition matches.
It is to be appreciated that can be stored with preprocessing rule in terminal, wherein preprocessing rule includes execution condition and correspondence Pretreatment operation, execution condition includes several preset ranges or preset value of current context information.
Preferably, can determine whether to hold corresponding to execution condition in the current time and preprocessing rule in current context information Whether the interval between the row time (preset value) is less than first threshold.When the execution time in preprocessing rule may include activity Between, the behaviour example of holiday time or user.It is needed more due to being applied when activity time, holiday time etc. execute the time A possibility that new, is bigger, can first prepare the corresponding activity time, therefore the offline packet of festivals or holidays is applied in preprocessing rule In before the corresponding execution time, can corresponding offline packet be downloaded from a server and be cached, when implemented between when arriving, answer It is wrapped offline with that can be loaded directly from caching.
For example, in activity time or festivals or holidays, some manufacturers can release Special Events, such as be promoted.And in work The usage amount of dynamic time or festivals or holidays, user may be more, thus, correspondence can be prepared in advance for the activity time or festivals or holidays The offline packet of promotion, the purpose for causing server performance to decline to reduce the offline packet of multi-user's downloading.
Preferably, being directed to the advertising campaign that activity time or festivals or holidays are released can be used as a business module of application. When the business module of promotion is triggered (icon or key as clicked promotion business module), which can be loaded offline Packet, and show the page of entire advertising campaign.
Preferably, can determine whether to execute condition institute in the geographical location information and the preprocessing rule in current context information Whether the distance between corresponding geographical location is less than second threshold.When movable outdoors, user generally will use mobile network, And in the case of weaker there may be mobile network in, subway more for personnel or other places, therefore, in preprocessing rule Geographical location information can be above-mentioned place.When user is in relatively close from above-mentioned place or before will entering above-mentioned place, application It can first send and request to server, and can corresponding offline packet be downloaded from a server and be cached, behind above-mentioned place, application Offline packet can be loaded directly from local cache.
For example, the geographical location information where terminal can be indicated with longitude and latitude, can also be indicated with address, than City, area, street, subway station where being such as represented by when indicating with address, also can be used LAC (Location Area Code, Location Area Code), TAC (Tracking Area Code, tracking area code) etc. indicates to indicate, or with cell ID.Wherein, With LAC or TAC or cell ID come when indicating geographical location, geographical location is a regional scope, if with address come table Show geographical location, in the lower situation of precision, also illustrates that a regional scope, such as the area b of the city a street c, wherein a, b, c are equal For the signal in city, area, subway station.
If opening positioning function in terminal, such as GPS (Global Positioning System, global positioning system System) function or Big Dipper positioning function can trigger the positioning function and obtain location data, to obtain then when application starting Geographical location information where terminal.In general, including longitude and latitude in the location data obtained in this way, in order to obtain end Address where holding, the SDK (Software Development Kit, software development kit) that can use electronic map determine this Position data are converted to corresponding address, such as city, the area, street, subway station at place, further to be differentiated.
Preferably, can determine whether net corresponding to execution condition in network state and the preprocessing rule in current context information Whether network state is identical.Network state in preprocessing rule can be Wireless LAN (such as Wi-Fi).I.e. when terminal is in It when under Wireless LAN, is requested using can first be sent to server, and corresponding offline packet is downloaded from a server and delayed It deposits, when entering mobile network, is wrapped offline using that can be loaded directly from local cache.
Step S204, if execution condition corresponding to pretreatment operation specified in current context information and preprocessing rule When matching, request of the transmission comprising identification information to server, to obtain the offline packet of the corresponding identification information.
Preferably, the execution time corresponding to execution condition in current time and preprocessing rule in current context information Interval between (preset value) is less than geographical location information and the preprocessing rule in first threshold or current context information The distance between geographical location corresponding to middle execution condition be less than network state in second threshold or current context information with When network state corresponding to execution condition is identical in preprocessing rule, it can determine whether to advise in current context information and preprocessing rule Execution condition corresponding to fixed pretreatment operation matches.At this point, application can be transmitted comprising application identities and/or offline packet mark The request of knowledge is to server, to obtain the offline packet of the corresponding application identities." transmission includes application identities in the present embodiment And/or the request of offline packet mark is to server, and to obtain the offline packet of the corresponding application identities " in step and embodiment one The function of being completed of step S100 is identical, therefore details are not described herein.
Step S206 carries out verification inspection to offline packet according to the veritification code for including in offline packet.
Step S206 is identical as the function of being completed of step S102 in embodiment one in the present embodiment, therefore no longer superfluous herein It states.
Step S208 loads offline packet, and starts page parsing operation.
Step S208 is identical as the function of being completed of step S104 in embodiment one in the present embodiment, therefore no longer superfluous herein It states.In addition, when offline packet corresponds to different types of service, also settable corresponding industry in the preparation file in the offline packet Business mark.Thus, terminal can by identifying the corresponding service identification of offline packet, and in the application by business module with it is corresponding Service identification is associated, to open the interface of corresponding business when business module triggers.When application is opened, the main boundary of application Face may include several business modules (such as the first business module, the second business module), when application carries out parsing load to offline packet When, it can recognize comprising service identification in the offline packet, and corresponding service identification is wrapped the offline of different service types and master Corresponding business module, which is associated, in interface (such as closes the corresponding offline packet of the service identification of promotion with the first business module The corresponding offline packet of connection, the service identification for spelling purchase is associated with the second business module), in this way, user is facilitated to pass through application master Different business module loads corresponding offline packet in interface.
Above-mentioned offline packet loading method further comprises judgement current environment other than comprising the technical effect in embodiment one Whether information matches with execution condition corresponding to pretreatment operation specified in preprocessing rule, and in current context information When matching with execution condition corresponding to pretreatment operation specified in preprocessing rule, corresponding pretreatment operation is executed, To obtain new offline packet in advance, be also conducive to the experience for improving user.In addition, offline packet can be configured by business module, Without pressing file configuration, offline packet includes the relevant all pages of business module, can disposably preload, improve the body of user It tests.
Referring to Fig. 3, terminal 40 of the present invention is communicated by network with server 50.The terminal 40 is that one kind can According to the instruction for being previously set or storing, the automatic equipment for carrying out numerical value calculating and/or information processing, hardware includes but unlimited In microprocessor, specific integrated circuit (applying lication Specific Integrated Circuit, ASIC), may be programmed Gate array (Field-Programmable Gate Array, FPGA), digital processing unit (Digital Signal Processor, DSP), embedded device etc..
The terminal 40, which may be, but not limited to, any one, to pass through keyboard, mouse, remote controler, touch tablet with user Or the modes such as voice-operated device carry out the electronic product of human-computer interaction, for example, tablet computer, smart phone, personal digital assistant (Personal Digital Assistant, PDA), game machine, intellectual wearable device etc..
Network locating for the terminal 40 includes, but are not limited to internet, wide area network, Metropolitan Area Network (MAN), local area network, virtual private Network (Virtual Private Network, VPN) etc., such as terminal 40 can the access of network interface 409 internets, wide area Net, Metropolitan Area Network (MAN), local area network, Virtual Private Network.
The memory 405 can be different type storage equipment or computer readable storage medium, all kinds of for storing Data.For example, it may be the memory of terminal 40, can also be the storage card that can be external in the terminal 40, such as flash memory, SM card (Smart Media Card, smart media card), SD card (Secure Digital Card, safe digital card) etc..Memory 405 for storing Various types of data, for example, the application (using lications) including information processing installed in the terminal 40, The information such as the data be arranged using above- mentioned information processing method, obtained.
The processor 401 is used to execute all kinds of softwares installed in the computation processing method and the terminal 40, Such as operating system, messaging software etc..The processor 401 is including but not limited to processor (Central Processing Unit, CPU), micro-control unit (Micro Controller Unit, MCU) etc. refers to for interpretive machine The device for enabling and handling the data in computer software, may include one or more microprocessor, digital processing unit.Institute State display screen 403 can be touch screen etc. other be used for show picture equipment.
The module of one or more corresponding to the offline packet loading system 417 that the terminal 40 may include, it is one Or multiple modules can be stored in the memory 405 of terminal 40 and may be configured to by one or more processors (this Embodiment is a processor 401) it executes, to complete the present invention.For example, as shown in fig.3, the terminal 40 includes memory 405, input/output interface 407, display screen 403 and pass through bus 411 and the memory 405, input/output interface 407 and aobvious The processor 401 of the progress data exchange of display screen 403.Wherein, the input/output interface 407 may connect to mouse and/or keyboard (not shown).The so-called module of the present invention is to complete the program segment of a specific function, is being located than program more suitable for description software Manage the implementation procedure in device.
In the present embodiment, the display screen 403 is used to provide convenience for the operation of user.The memory 405 can store There are several program codes, to be executed by the processor 401, and then realizes the function of the offline packet loading system 417.
Referring to Figure 4 together in present embodiment, the offline packet loading system 417 may include acquiring unit 710, judgement Unit 712, request unit 714, verification unit 716 and loading unit 718.
The so-called module of the present invention can be the program segment for completing a specific function, exist than program more suitable for description software Implementation procedure in processor.
The acquiring unit 710 is used to obtain the current context information of terminal 40, and the current context information includes terminal The information such as network state, current time, geographical location.It is to be appreciated that the network state of terminal can the wireless networks such as Wi-Fi The mobile networks such as network, 3G, 4G, 5G.The current time of terminal can the clock of calling system obtain, or obtain the by network The current time information of the transmission of tripartite.The geographical location of terminal can by the positioning device (such as global positioning system) of terminal come It obtains.
The judging unit 712 for judge current context information whether with pretreatment operation specified in preprocessing rule Corresponding execution condition matches.It holds corresponding to the current context information and pretreatment operation specified in preprocessing rule When row condition matches, the request unit 714 sends to the server 50 and requests.
It is to be appreciated that can be stored with preprocessing rule in terminal, wherein preprocessing rule includes execution condition and correspondence Pretreatment operation, execution condition includes several preset ranges or preset value of current context information.
Preferably, the judging unit 712 can determine whether to hold in current time and preprocessing rule in current context information Whether the interval between the execution time (preset value) corresponding to row condition is less than first threshold.When execution in preprocessing rule Between may include activity time, holiday time or user behaviour example.Due to when activity time, holiday time etc. execute Between when using needing a possibility that updating bigger, can first prepare the corresponding activity time, therefore the offline packet of festivals or holidays is answered In preprocessing rule before the corresponding execution time, can corresponding offline packet be downloaded from a server and be cached, when holding When the row time arrives, wrapped offline using that can be loaded directly from caching.
For example, in activity time or festivals or holidays, some manufacturers can release Special Events, such as be promoted.And in work The usage amount of dynamic time or festivals or holidays, user may be more, thus, correspondence can be prepared in advance for the activity time or festivals or holidays The offline packet of promotion, the purpose for causing server performance to decline to reduce the offline packet of multi-user's downloading.
Preferably, being directed to the advertising campaign that activity time or festivals or holidays are released can be used as a business module of application. When the business module of promotion is triggered (icon or key as clicked promotion business module), which can be loaded offline Packet, and show the page of entire advertising campaign.
Preferably, the judging unit 712 also can determine whether geographical location information and the pre- place in current context information Whether the distance between geographical location corresponding to execution condition is less than second threshold in reason rule.When movable outdoors, user Generally will use mobile network, and it is weaker there may be mobile network in, subway more for personnel or other places in the case of, Therefore, the geographical location information in preprocessing rule can be above-mentioned place.When user is relatively close from above-mentioned place or will be into Before entering above-mentioned place, the request unit 714 can first send to server and request, and corresponding offline can will wrap from server Upper downloading simultaneously caches, and behind above-mentioned place, wraps offline using that can load directly from local cache.
For example, the geographical location information where terminal can be indicated with longitude and latitude, can also be indicated with address, than City, area, street, subway station where being such as represented by when indicating with address, also can be used LAC (Location Area Code, Location Area Code), TAC (Tracking Area Code, tracking area code) etc. indicates to indicate, or with cell ID.Wherein, With LAC or TAC or cell ID come when indicating geographical location, geographical location is a regional scope, if with address come table Show geographical location, in the lower situation of precision, also illustrates that a regional scope, such as the area b of the city a street c, wherein a, b, c are equal For the signal in city, area, subway station.
If opening positioning function in terminal, such as GPS (Global Positioning System, global positioning system System) function or Big Dipper positioning function can trigger the positioning function and obtain location data, to obtain then when application starting Geographical location information where terminal.In general, including longitude and latitude in the location data obtained in this way, in order to obtain end Address where holding, the SDK (Software Development Kit, software development kit) that can use electronic map determine this Position data are converted to corresponding address, such as city, the area, street, subway station at place, further to be differentiated.
Preferably, the judging unit 712 also can determine whether in network state and preprocessing rule in current context information Whether network state corresponding to execution condition is identical.Network state in preprocessing rule can be Wireless LAN (such as Wi-Fi).I.e. when terminal is under Wireless LAN, the request unit 714 can first send to server and request, and will Corresponding offline packet is downloaded from a server and is cached, when entering mobile network, using can directly load from local cache Offline packet.
The request unit 714 is used for transmission the request comprising application identities and/or offline packet mark to server, to obtain Take the offline packet of the corresponding application identities.
It is to be appreciated that corresponding wrap offline can be reached server 50 by developer, and then can be stored on server 50 The offline packet of the one or more of corresponding application.Preferably, application can have application identities, (as using AP0001), server 50 is deposited The offline packet of storage can have offline packet mark (such as OL0001).For example, server 50 can be to new when there is new offline packet to generate The new offline packet mark (such as OL0002) of offline packet distribution.The offline packet may include program file, resource file and preparation File.
It is to be appreciated that the offline packet stored in the server 50 can also be relative to the previous increment wrapped offline more New packet, as the offline mark OL0002_1 of incremental update packet can indicate the incremental update packet of previous offline packet mark OL0002.
Apply at starting (or running background) can the request unit 714 can send and request to server, with obtain from Line packet, wherein portable application identifies in the request sent, in turn, server, can root when receiving using the request sent Select corresponding offline packet according to application identities, as application identities AP0001 can corresponding offline packet be identified as OL0001.For example, At the first time, portable application identifies AP0001 in the request that the request unit 714 can be sent to server, and server is connecing When receiving using the request sent, corresponding offline packet OL0001 can be selected according to application identities AP0001.
When in another embodiment, using starting, it is in the local cache of the also detectable terminal of the request unit 714 It is no to there is offline packet.When there is offline packet in local caching, when the request unit 714 can be requested to server transmission, 714 cocoa of request unit obtains offline packet mark corresponding to the offline packet of local cache, and sending includes the offline packet Server 50 is sent in the request of mark and application identities.Server 50 judges application cache after receiving offline packet mark It is offline packet whether be newest.When the offline packet of application cache is not newest, server transmits newest offline packet To the terminal 40 where application.It is answered in addition, newest offline packet can be sent to by server 50 in the position that server 50 stores With newest offline packet can be downloaded from server according to the position of storage by the request unit 714.When application cache from When line packet is newest, indicate that corresponding offline wrap of application has been downloaded, at this point, server can transmitting feedback information to terminal, with So that the request unit 714 can be loaded directly into the offline packet in local cache.Wherein, the storage mode of local cache include but It is not limited to SQLite, cell phone system memory etc., can more preferably improve the fluency of page load, is brought preferably for user Experience.
In other embodiments, when server 50 storages are for an offline packet applied, the request unit Application identities can not included in 714 requests that can be sent to server, that is, indicate that the request unit 714 can be sent to server Request in can not include application identities or only comprising offline packet mark.
For example, the request unit 714 can obtain offline packet OL0001 from server at the first time.The request Offline packet OL0001 is stored in local cache by 714 cocoa of unit, when applying in the starting of the second time, since local is delayed There is offline packet OL0001.Thus, when there is offline packet OL0001 in local caching, the request unit 714 can be to When server sends request, 714 cocoa of request unit obtains the offline packet mark OL0001 of local cache wrapped offline, and The offline packet mark OL0001 is sent to server in the request of transmission.At this point, if server is wrapped there is also offline OL0002 (is expressed as new offline packet).At this point, server judges after the offline packet OL0001 mark for receiving terminal transmission The offline packet of application cache is not newest.The request unit 714 can receive server for newest offline packet OL0002.In addition, newest offline packet OL0002 can be sent to the request unit in the position that server stores by server 714 can, newest offline packet OL0002 can be downloaded according to the position of storage from server by the request unit 714.
In addition, the request unit 714 can also send to server and request, at this point, the request is single in the third time The offline packet then can be identified OL0002 by the offline packet mark OL0002 that member 714 corresponding can wrap offline, the request unit 714 Server is sent in the request of transmission.At this point, for situation one, if the offline packet of server storage is identified as OL002, Indicate the offline packet of the local cache of terminal be it is newest, in turn, feedback information can be transmitted to the request unit 714 in server Can, in turn, 714 cocoa of request unit loads offline packet directly from local cache;For situation two, if server is also deposited In incremental update packet OL0002_1, thus, server judges the offline of application cache after receiving offline packet OL0002 mark Packet be not it is newest, newest incremental update packet OL0002_1 is transferred to the request unit by server 714 can.In addition, incremental update packet OL0002_1 can be sent to the request unit in the position that server stores by server 714 can, incremental update packet OL0002_1 can be downloaded according to the position of storage from server by the request unit 714.
The verification unit 716 is used to carry out safety inspection to offline packet according to the check code wrapped offline.Present embodiment In, offline packet can have check code, and wherein the check code can obtain offline packet progress md5 encryption by server.It is understood that Ground, the verification unit 716 can also carry out MD5 veritification to obtained offline packet or incremental update packet, to obtain the corresponding school MD5 Code is tested, and then advantageously ensures that the consistency and integrality of data transmission.In addition, server can carry out at compression offline packet Reason is conducive to save user's surfing flow.
The loading unit 718 starts page parsing operation for loading offline packet.When offline packet passes through safety inspection Afterwards, the loading unit 718 can load offline packet in application starting, and start page parsing.Wherein, page parsing be used for into Parsing and rendering of the row to offline packet or incremental update packet.Offline packet can also be loaded integrally in advance into memory, and it is defeated to reduce disk Enter the time-consuming of output, guarantee loading velocity, promotes user experience.
Above-mentioned terminal obtains newest offline packet by transmiting a request to server, and to acquire it is newest from Line packet can load offline packet in application starting after being verified, and the time of data is obtained when reducing using starting, is improved User experience.In addition, also by judging corresponding to pretreatment operation specified in current context information and preprocessing rule Whether execution condition matches, and execution corresponding to the pretreatment operation specified in current context information and preprocessing rule When condition matches, new offline packet is obtained in advance, is also conducive to the experience for improving user.In addition, offline packet can be by business mould Block is configured, and without pressing file configuration, offline packet includes the relevant all pages of business module, can disposably be preloaded, Improve the experience of user.
If the integrated module of terminal of the present invention is realized in the form of SFU software functional unit and as independent product When selling or using, it can store in a computer readable storage medium.Based on this understanding, in present invention realization The all or part of the process in the method for controlling volume of each embodiment is stated, can also be instructed by computer program relevant Hardware is completed, and the computer program can be stored in a computer readable storage medium, which is being located Step, it can be achieved that in the method for controlling volume of the respective embodiments described above is managed when device executes.Wherein, the computer program includes Computer program code, the computer program code can for source code form, object identification code form, executable file or certain A little intermediate forms etc..The computer-readable medium may include: any entity that can carry the computer program code Or device, recording medium, USB flash disk, mobile hard disk, magnetic disk, CD, computer storage, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software Distribution medium etc..It should be noted that the content that the computer-readable medium includes can be according to making laws in jurisdiction Requirement with patent practice carries out increase and decrease appropriate, such as in certain jurisdictions, according to legislation and patent practice, computer Readable medium does not include electric carrier signal and telecommunication signal.
It is obvious to a person skilled in the art that invention is not limited to the details of the above exemplary embodiments, Er Qie In the case where without departing substantially from spirit or essential attributes of the invention, the present invention can be realized in other specific forms.Therefore, no matter From the point of view of which point, the present embodiments are to be considered as illustrative and not restrictive, and the scope of the present invention is by appended power Benefit requires rather than above description limits, it is intended that all by what is fallen within the meaning and scope of the equivalent elements of the claims Variation is included in the present invention.Any reference signs in the claims should not be construed as limiting the involved claims.This Outside, it is clear that one word of " comprising " does not exclude other units or steps, and odd number is not excluded for plural number.System, device or mobile terminal apparatus Multiple units, module or the device stated in claim can also by the same unit, module or device by software or Hardware is realized.The first, the second equal words are used to indicate names, and are not indicated any particular order.
Embodiment of above is only used to illustrate the technical scheme of the present invention and not to limit it, although referring to the above preferable embodiment party Formula describes the invention in detail, those skilled in the art should understand that, it can be to technical solution of the present invention It modifies or equivalent replacement should not all be detached from the spirit and scope of technical solution of the present invention.

Claims (10)

1. a kind of offline packet loading method, which is characterized in that the described method includes:
Request of the transmission comprising identification information is to server, to obtain the offline packet of the corresponding identification information;
Verification inspection is carried out to the offline packet according to the check code wrapped offline;
When inspection result be by when, load the offline packet, and start page parsing operation.
2. offline packet loading method as described in claim 1, which is characterized in that the request of the transmission comprising identification information is extremely Server, corresponding to the offline of identification information with acquisition includes:
Identification information of the transmission comprising application identities is to the server, so that the server is sentenced according to the application identities The server that breaks is interior with the presence or absence of newest offline packet;
Receive the offline packet of the corresponding application identities of the server transport;Or
Judge to whether there is offline packet in local cache, and exists in local cache and obtain the corresponding offline packet when wrapping offline Offline packet mark;
Identification information of the transmission comprising the offline packet mark is to the server, so that the server is according to described offline Packet mark judges whether the offline packet in the local cache is newest offline packet;
Receive in the confirmation local cache of server output wrap offline after the newest feedback information wrapped offline from The offline packet of the corresponding application identities is obtained in the local cache.
3. offline packet loading method as described in claim 1, which is characterized in that the request of the transmission comprising identification information is extremely Server, corresponding to the offline of identification information with acquisition includes:
Request of the transmission comprising the identification information is to server, so that the server judges whether there is the offline of update Packet or incremental update packet;
Receive the offline packet or incremental update packet of the update of the server transport;Or
Receive the link address of the corresponding offline packet or incremental update packet updated of the server transport;
The offline packet or incremental update packet of the update are downloaded according to the link address.
4. offline packet loading method as described in claim 1, which is characterized in that described according to the check code pair wrapped offline The offline packet carries out verification operation
It obtains server and carries out obtained first check code of verification operation for the offline packet;
Verification operation is carried out to the offline packet for acquiring the corresponding application identities, with the second obtained check code;
Judge whether first check code is identical as the second check code, determines that the offline packet is checked by verification.
5. offline packet loading method as described in claim 1, which is characterized in that the offline packet of load, and start page solution Analysis operates
Obtain the offline packet of corresponding different service types;
Corresponding service identification is obtained according to the offline packet of different service types;
The offline packet of different service types is associated by corresponding service identification with business module corresponding in main interface.
6. the offline packet loading method as described in any one of claim 1-5, which is characterized in that the method also includes:
Obtain the current context information of terminal;
Judge whether current context information matches with execution condition corresponding to pretreatment operation specified in preprocessing rule;
When execution condition corresponding to the pretreatment operation specified in current context information and preprocessing rule matches, execute Corresponding pretreatment operation, to obtain new offline packet in advance.
7. offline packet loading method as claimed in claim 6, the current context information of the terminal includes the network-like of terminal State, current time, one or more information in geographical location, which is characterized in that the judgement current context information and pretreatment Whether execution condition corresponding to pretreatment operation specified in rule, which matches, includes:
Judge current time in current context information whether with the execution time corresponding to execution condition in preprocessing rule it Between interval be less than first threshold;Or
Judge geographical location information in current context information whether with ground corresponding to execution condition in the preprocessing rule It manages the distance between position and is less than second threshold;Or
Judge network state in current context information whether with network state phase corresponding to execution condition in preprocessing rule Together.
8. a kind of offline packet loading system, which is characterized in that the system comprises:
Request unit is used for transmission the request comprising identification information to server, to obtain the offline of the corresponding identification information Packet;
Verification unit, for carrying out verification inspection to the offline packet according to the check code wrapped offline;
Loading unit, for inspection result by when the offline packet of load, and start page parsing operation.
9. a kind of terminal, the terminal includes processor and memory, and several computer programs are stored on the memory, It is characterized in that, is realized when the processor is for executing the computer program stored in memory as any in claim 1-7 The step of offline packet loading method described in one.
10. a kind of readable storage medium storing program for executing, is stored thereon with computer program, which is characterized in that the computer program is processed The step of offline packet loading method as described in any one of claim 1-7 is realized when device executes.
CN201810929469.1A 2018-08-15 2018-08-15 Offline packet loading method, system, terminal and readable storage medium storing program for executing Pending CN109213512A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810929469.1A CN109213512A (en) 2018-08-15 2018-08-15 Offline packet loading method, system, terminal and readable storage medium storing program for executing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810929469.1A CN109213512A (en) 2018-08-15 2018-08-15 Offline packet loading method, system, terminal and readable storage medium storing program for executing

Publications (1)

Publication Number Publication Date
CN109213512A true CN109213512A (en) 2019-01-15

Family

ID=64988754

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810929469.1A Pending CN109213512A (en) 2018-08-15 2018-08-15 Offline packet loading method, system, terminal and readable storage medium storing program for executing

Country Status (1)

Country Link
CN (1) CN109213512A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110275866A (en) * 2019-04-25 2019-09-24 武汉众邦银行股份有限公司 Exchange method, device, server and the user terminal of file generated process
CN110401702A (en) * 2019-07-09 2019-11-01 北京达佳互联信息技术有限公司 A kind of offline packet method for down loading, device, electronic equipment and storage medium
CN113821244A (en) * 2021-07-30 2021-12-21 北京达佳互联信息技术有限公司 Offline package updating method, device, system, electronic device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110307583A1 (en) * 2010-06-11 2011-12-15 Sony Computer Entertainment Inc. Information Processing Device
CN104765622A (en) * 2014-01-03 2015-07-08 腾讯科技(深圳)有限公司 Page resource loading method and device
CN106547582A (en) * 2015-09-22 2017-03-29 阿里巴巴集团控股有限公司 A kind of preprocess method and device
CN108287839A (en) * 2017-01-09 2018-07-17 阿里巴巴集团控股有限公司 A kind of page loading method and equipment
CN108345632A (en) * 2017-12-29 2018-07-31 中国平安财产保险股份有限公司 Call method, device, equipment and the computer readable storage medium of the H5 pages

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110307583A1 (en) * 2010-06-11 2011-12-15 Sony Computer Entertainment Inc. Information Processing Device
CN104765622A (en) * 2014-01-03 2015-07-08 腾讯科技(深圳)有限公司 Page resource loading method and device
CN106547582A (en) * 2015-09-22 2017-03-29 阿里巴巴集团控股有限公司 A kind of preprocess method and device
CN108287839A (en) * 2017-01-09 2018-07-17 阿里巴巴集团控股有限公司 A kind of page loading method and equipment
CN108345632A (en) * 2017-12-29 2018-07-31 中国平安财产保险股份有限公司 Call method, device, equipment and the computer readable storage medium of the H5 pages

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110275866A (en) * 2019-04-25 2019-09-24 武汉众邦银行股份有限公司 Exchange method, device, server and the user terminal of file generated process
CN110401702A (en) * 2019-07-09 2019-11-01 北京达佳互联信息技术有限公司 A kind of offline packet method for down loading, device, electronic equipment and storage medium
CN110401702B (en) * 2019-07-09 2022-03-25 北京达佳互联信息技术有限公司 Offline package downloading method and device, electronic equipment and storage medium
CN113821244A (en) * 2021-07-30 2021-12-21 北京达佳互联信息技术有限公司 Offline package updating method, device, system, electronic device and storage medium

Similar Documents

Publication Publication Date Title
US10282191B2 (en) Updating web resources
CN109857515B (en) Bridge communication method, device, equipment and computer readable storage medium
CN109213512A (en) Offline packet loading method, system, terminal and readable storage medium storing program for executing
CN109254914A (en) Software development kit test method, system, computer installation and readable storage medium storing program for executing
GB2589658A (en) Method and apparatus for running an applet
CN108255701B (en) Scene testing method and mobile terminal
CN106598678A (en) Method and device for supplying application installation packages to terminal equipment
CN110096660A (en) Method, apparatus and electronic equipment for loading page picture
CN113590974B (en) Recommendation page configuration method and device, electronic equipment and computer readable medium
CN109815105A (en) Applied program testing method and device based on Btrace
CN113254105B (en) Resource processing method and device, storage medium and electronic equipment
CN111061956A (en) Method and apparatus for generating information
CN112579928A (en) Page jump method, page jump device, computer equipment and computer readable storage medium
CN109766127A (en) Method for updating application version information
CN113010405A (en) Application program testing method and device
CN111694629A (en) Information display method and device and electronic equipment
CN110365745A (en) Data processing system, method, apparatus, server and computer-readable medium
EP3879795A1 (en) Method and apparatus for acquiring information, device, medium and computer program product
CN113626512A (en) Data processing method, device, equipment and readable storage medium
CN108667915A (en) Information transmission system, method and apparatus
CN112217880A (en) Attribution method, attribution device, attribution medium and electronic equipment for application program activation
CN111338666A (en) Method, device, medium and electronic equipment for realizing application program upgrading
CN109145591B (en) Plug-in loading method of application program
CN106372267A (en) Page loading method and page loading device based on browser
CN114610446B (en) Method, device and system for automatically injecting probe

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20190115

RJ01 Rejection of invention patent application after publication