CN105760232B - Offline cache method and system for IOS application - Google Patents

Offline cache method and system for IOS application Download PDF

Info

Publication number
CN105760232B
CN105760232B CN201610094992.8A CN201610094992A CN105760232B CN 105760232 B CN105760232 B CN 105760232B CN 201610094992 A CN201610094992 A CN 201610094992A CN 105760232 B CN105760232 B CN 105760232B
Authority
CN
China
Prior art keywords
data
user
ios
information
ios application
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.)
Active
Application number
CN201610094992.8A
Other languages
Chinese (zh)
Other versions
CN105760232A (en
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.)
Sichuan Changhong Electric Co Ltd
Original Assignee
Sichuan Changhong Electric Co 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 Sichuan Changhong Electric Co Ltd filed Critical Sichuan Changhong Electric Co Ltd
Priority to CN201610094992.8A priority Critical patent/CN105760232B/en
Publication of CN105760232A publication Critical patent/CN105760232A/en
Application granted granted Critical
Publication of CN105760232B publication Critical patent/CN105760232B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory

Abstract

The invention discloses a kind of offline cache method and system for IOS application, mainly a kind of integrated universal frame for the data persistence being deployed in iOS mobile application takes different persistence strategies for the data for having offline cache to require under different magnitudes, different business background.Solve the problems, such as that developer needs to develop offline cache module again in the project every time, the development time is not only saved, and reduce maintenance and redevelopment cost, simultaneously because data cached application, reduce waiting time of user when using mobile process, facilitate its use, while greatly the user experience is improved.

Description

Offline cache method and system for IOS application
Technical field
The present invention relates to IOS field of terminal technology, and in particular to it is a kind of for IOS application offline cache method and be System.
Background technique
In recent years, smart phone is largely popularized, and has benefited from communication technology rapid development, and mobile terminal is obtained from internet Take content become to facilitate it is fast.Smart phone when there is network can automatic cache user browsing content, when user is in no net In the environment of network, can also read cache contents.Application software can access local cache file on startup, so as at first Between be user's presentation content, significantly promote user experience.In existing IOS mobile application, for such as user information or use The data such as family usage record have very high buffer size.At present in IOS there are many implementations of offline cache, commonly Data persistence technology includes document format such as Plist, Archive, mobile client database such as SQLite etc..
In the prior art, when designing IOS mobile application, the realization of offline cache is mainly by developer according to specific Business carrys out customized, and this mode has very big arbitrariness, and requires to be separately configured again in each exploitation, carries out A large amount of repetitive works, this greatly wastes working time and human resources.In addition, due to lacking unified and general data Persistence method increases the difficulty of project maintenance and Persisting exploitation, causes to perplex to successive iterations update.
Summary of the invention
The present invention overcomes in the prior art design IOS mobile application when in the presence of waste the working time and human resources not Foot, provides a kind of using unified offline cache frame, has saved the offline cache method for IOS application of development cost.
To achieve the above object, the invention adopts the following technical scheme:
It is a kind of for IOS application offline cache method, it the following steps are included:
Step S1, IOS application starting, according to the difference of data type, the storage location specified from terminal reads corresponding Data, the data include userspersonal information, user configuration information, user's browsing information or subscriber connecting equipment information;
Step S2, IOS application, which is established, establishes connection with background server, and background server is searched under consolidated network for even The equipment connect is connected with preference to the equipment that user was most recently connected according to the subscriber connecting equipment information obtained in step S1;
Step S3, IOS, which is applied, shows that the user obtained in step S1 browses information in current interface, and according in step S1 The userspersonal information of acquisition communicates with background server, and background server refreshes can data for users to use;
Step S4, IOS application response user demand, while recording the operation that user is made in being applied using IOS, the behaviour Make to include browsing, change user information, connecting equipment or increase collection, judges the data type for the change that user makes, caching Corresponding data;
When step S5, IOS application will close, checks whether there is data and do not save, if so, then saving this use again The data that family is generated using IOS application;
After the data of step S6, IOS application verification step S5 caching are without mistake, voluntarily close.
Further technical solution is that the step S1 includes:
Step S11, IOS, which is applied, uses frequent degree classification data according to business scenario or data;
Step S12, according to the data type judged in step S11, if judging result is that userspersonal information or user match Confidence breath, then with the reading data of key-value pair pattern from the NSUserDefault that IOS application sandbox is specified;
Step S13, according to the data type judged in step S11, if judging result is that user browses information, from light weight It reads in grade movable data library;
Step S14, according to the data type judged in step S11, if judging result is subscriber connecting equipment information, from With the reading data of key-value pair pattern in the archive files of IOS application sandbox.
Further technical solution is that the step S3 includes:
User in S31, IOS application obtaining step S1 browses information, and it is clear to read user from lightweight movable data library It lookes at information, and shows on IOS application interface;
S32, IOS apply the key character for being browsed according to user in step S31 and being recorded in information to propose to background server Request, obtains the corresponding more new information of the data, which includes text information, pictorial information or browsing history, And it caches;
S33, IOS are applied according to the userspersonal information in step S1, are gone out to request to background server, are obtained background service The resource that device provides;
S34, IOS apply the data storage for obtaining step S33, and show on IOS application interface;
When S35, IOS are using backstage or free time is entered, lightweight movable data library is written in the data that step S34 is obtained It is updated.
Further technical solution is that the step S4 includes:
S41, user use IOS in application, by the operation data of user with specified data format is temporary and mobile terminal In memory;
S42 writes data into according to the data of step S41 temporary cache and mobile terminal memory according to data type;
S43, according to the data type judged in step S42, if userspersonal information or user configuration information, with key assignments In the specified NSUserDefault of data write-in IOS application sandbox to pattern;
S44 browses information if user according to the data type judged in step S42, with the write-in of character string pattern data Lightweight movable data library;
S45, according to the data type judged in step S42, if subscriber connecting equipment information, with the number of key-value pair pattern In document file according to write-in IOS application sandbox.
The present invention also provides a kind of offline cache system for IOS application, it includes data type discrimination module, offline Cache loading module, equipment link block, content online updating module and the automatic curing module of caching;The data type differentiates Module determines that such data is deposited with specified reading for differentiating the data type that will be read or be written in mobile terminal Storage mode;The offline cache loading module, for the differentiation according to data type discrimination module as a result, hard for loading terminal The demand of data cached response user on disk, the demand of the user include that user browses demand, query history record demand, repairs Change personal information demand or connection device requirement;The equipment link block, for establishing connection with background server, search is moved In network environment locating for dynamic terminal for connecting equipment, establish connection with the equipment that user specifies;The content online updating Module obtains background server end and provides for proposing content update request to background server in the case where there is network connection environment What be new, show at the interface that active user uses;The automatic curing module of the caching, for IOS application it is idle or When exiting, according to the differentiation of the data type of data type discrimination module as a result, automatically saving cache contents, and check whether there is Write error.
Compared with prior art, the beneficial effects of the present invention are:
The present invention is a kind of integrated universal frame of data persistence being deployed in IOS application, for different magnitudes, no Different persistence strategies is taken with the data for having offline cache to require under business background.Solves developer in the project The problem for needing to develop offline cache module again every time, has not only been saved the development time, but also reduce maintenance and redevelopment Cost, simultaneously because data cached application, reduces waiting time of user when using mobile process, facilitates its use, Greatly the user experience is improved simultaneously.
Detailed description of the invention
Fig. 1 is the flow diagram of the offline cache method for IOS application of an embodiment of the present invention.
Fig. 2 is the flow diagram of step S1 in the offline cache method for IOS application of an embodiment of the present invention.
Fig. 3 is the flow diagram of step S3 in the offline cache method for IOS application of an embodiment of the present invention.
Fig. 4 is the offline cache system block diagram for IOS application of an embodiment of the present invention.
Specific embodiment
The present invention is further elaborated with reference to the accompanying drawing.
The offline cache method for IOS application as shown in Figs. 1-3, it the following steps are included:
Step S1, IOS application starting, according to the difference of data type, the storage location specified from terminal reads corresponding Data, the data include userspersonal information, user configuration information, user's browsing information or subscriber connecting equipment information;
Step S1 includes:
Step S11, IOS, which is applied, uses frequent degree classification data according to business scenario or data;
Step S12, according to the data type judged in step S11, if judging result is that userspersonal information or user match Confidence breath, then with the reading data of key-value pair pattern from the NSUserDefault that IOS application sandbox is specified;
Step S13, according to the data type judged in step S11, if judging result is that user browses information, from light weight It reads in grade movable data library;
Step S14, according to the data type judged in step S11, if judging result is subscriber connecting equipment information, from With the reading data of key-value pair pattern in the archive files of IOS application sandbox.
Step S2, IOS application, which is established, establishes connection with background server, and background server is searched under consolidated network for even The equipment connect is connected with preference to the equipment that user was most recently connected according to the subscriber connecting equipment information obtained in step S1;
Step S3, IOS, which is applied, shows that the user obtained in step S1 browses information in current interface, and according in step S1 The userspersonal information of acquisition communicates with background server, and background server refreshes can data for users to use;
Step S3 includes:
User in S31, IOS application obtaining step S1 browses information, and it is clear to read user from lightweight movable data library It lookes at information, and shows on IOS application interface;
S32, IOS apply the key character for being browsed according to user in step S31 and being recorded in information to propose to background server Request, obtains the corresponding more new information of the data, which includes text information, pictorial information or browsing history, And it caches;
S33, IOS are applied according to the userspersonal information in step S1, are gone out to request to background server, are obtained background service The resource that device provides;
S34, IOS apply the data storage for obtaining step S33, and show on IOS application interface;
When S35, IOS are using backstage or free time is entered, lightweight movable data library is written in the data that step S34 is obtained It is updated.
Step S4, IOS application response user demand, while recording the operation that user is made in being applied using IOS, the behaviour Make to include browsing, change user information, connecting equipment or increase collection, judges the data type for the change that user makes, caching Corresponding data;
Step S4 includes:
S41, user use IOS in application, by the operation data of user with specified data format is temporary and mobile terminal In memory;
S42 writes data into according to the data of step S41 temporary cache and mobile terminal memory according to data type;
S43, according to the data type judged in step S42, if userspersonal information or user configuration information, with key assignments In the specified NSUserDefault of data write-in IOS application sandbox to pattern;
S44 browses information if user according to the data type judged in step S42, with the write-in of character string pattern data Lightweight movable data library;
S45, according to the data type judged in step S42, if subscriber connecting equipment information, with the number of key-value pair pattern In document file according to write-in IOS application sandbox.
When step S5, IOS application will close, checks whether there is data and do not save, if so, then saving this use again The data that family is generated using IOS application;
After the data of step S6, IOS application verification step S5 caching are without mistake, voluntarily close.
Offline cache system for IOS application as shown in Figure 4, it includes data type discrimination module 501, delays offline Deposit loading module 502, equipment link block 503, content online updating module 504 and the automatic curing module 505 of caching;Data class Type discrimination module 501 determines such data with specified for differentiating the data type that will be read or be written in mobile terminal Reading storage mode;Offline cache loading module 502, for the differentiation according to data type discrimination module 501 as a result, being used for The demand of the data cached response user on terminal hard disk is loaded, the demand of the user includes that user browses demand, query history Record demand, modification personal information demand or connection device requirement;Equipment link block 503, for being established with background server Connection, search for locating for mobile terminal in network environment for connecting equipment, establish connection with the equipment that user specifies;Content exists Line update module 504 obtains backstage and takes for proposing content update request to background server in the case where there is network connection environment The what be new that business device end provides, shows at the interface that active user uses;Automatic curing module 505 is cached, for answering in IOS With free time or the when of exiting, according to the differentiation of the data type of data type discrimination module 501 as a result, automatically save cache contents, And check whether there is write error.
The above specific embodiment is described in detail for the essence of the present invention, but can not be to protection scope of the present invention It is limited, it should be apparent that, under the inspiration of the present invention, those of ordinary skill in the art can also carry out many improvement And modification, it should be noted that these improvement and modification are all fallen within the scope of the claims of the present invention.

Claims (5)

1. it is a kind of for IOS application offline cache method, which is characterized in that it the following steps are included:
Step S1, IOS application starting, according to the difference of data type, the storage location specified from terminal reads corresponding data, The data include userspersonal information, user configuration information, user's browsing information or subscriber connecting equipment information;
Step S2, IOS, which is applied, establishes connection with background server, and background server searches for setting for connection under consolidated network It is standby, the equipment that user was most recently connected is connected with preference to according to the subscriber connecting equipment information obtained in step S1;
Step S3, IOS, which is applied, shows that the user obtained in step S1 browses information in current interface, and obtains according in step S1 Userspersonal information communicated with background server, background server refreshes can data for users to use;
Step S4, IOS application response user demand, while the operation that user is made in being applied using IOS is recorded, the operation packet It includes browsing, change user information, connection equipment or increases collection, judge the data type for the change that user makes, caching is corresponding Data;
When step S5, IOS application will close, checks whether there is data and do not save, if so, then saving this user again makes The data generated with IOS application;
After the data of step S6, IOS application verification step S5 caching are without mistake, voluntarily close.
2. the offline cache method according to claim 1 for IOS application, which is characterized in that the step S1 includes:
Step S11, IOS, which is applied, uses frequent degree classification data according to business scenario or data;
Step S12, according in step S11 to the classification results of data, if data type is userspersonal information or user configuration Information, then with the reading data of key-value pair pattern from the NSUserDefault that IOS application sandbox is specified;
Step S13, according in step S11 to the classification results of data, if data type is that user browses information, from lightweight It reads in movable data library;
Step S14, according in step S11 to the classification results of data, if data type is subscriber connecting equipment information, from With the reading data of key-value pair pattern in the archive files of IOS application sandbox.
3. the offline cache method according to claim 2 for IOS application, which is characterized in that the step S3 includes:
User in S31, IOS application obtaining step S1 browses information, reads user from lightweight movable data library and browses letter Breath, and show on IOS application interface;
S32, IOS, which are applied, to file a request according to the key character recorded in user's browsing information in step S31 to background server, It obtains user and browses the corresponding more new information of key character recorded in information, which includes text information, picture letter Breath or browsing history, and cache;
S33, IOS are applied according to the userspersonal information in step S1, are filed a request to background server, and background server is obtained The resource of offer;
S34, IOS apply the data storage for obtaining step S33, and show on IOS application interface;
When S35, IOS are using backstage or free time is entered, the progress of lightweight movable data library is written in the data that step S34 is obtained It updates.
4. the offline cache method according to claim 1 for IOS application, which is characterized in that the step S4 includes:
S41, user is using IOS in application, the operation data of user is temporarily stored into mobile terminal memory with specified data format In;
S42 writes data into the data of mobile terminal memory according to data type according to step S41 temporary cache;
S43, according to the data type in step S42, if userspersonal information or user configuration information, with key-value pair pattern Data are written in the specified NSUserDefault of IOS application sandbox;
S44 browses information if user according to the data type in step S42, is moved with character string pattern data write-in lightweight Dynamic formula database;
S45 is written according to the data type in step S42 if subscriber connecting equipment information with the data of key-value pair pattern In the document file of IOS application sandbox.
5. it is a kind of for IOS application offline cache system, which is characterized in that it include data type discrimination module (501), from Line caches loading module (502), equipment link block (503), content online updating module (504) and the automatic curing module of caching (505);
The data type discrimination module (501), for differentiating the data type that will be read or be written in mobile terminal, really Various types of data is determined with specified reading storage mode;
The offline cache loading module (502), for the differentiation according to data type discrimination module (501) as a result, for adding The demand of data cached response user on mounted terminal hard disk, the demand of the user include that user browses demand, query history note Record demand, modification personal information demand or connection device requirement;The equipment link block (503), is used for and background server Establish connection, search in network environment locating for mobile terminal for connecting equipment, establish connection with the equipment that user specifies;
The content online updating module (504), for proposing content update to background server in the case where there is network connection environment Request obtains the what be new that background server end provides, and shows at the interface that active user uses;
The automatic curing module (505) of the caching, for idle or when exiting in IOS application, according to data type discrimination module (501) differentiation of data type is as a result, automatically save cache contents, and check whether there is write error.
CN201610094992.8A 2016-02-19 2016-02-19 Offline cache method and system for IOS application Active CN105760232B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610094992.8A CN105760232B (en) 2016-02-19 2016-02-19 Offline cache method and system for IOS application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610094992.8A CN105760232B (en) 2016-02-19 2016-02-19 Offline cache method and system for IOS application

Publications (2)

Publication Number Publication Date
CN105760232A CN105760232A (en) 2016-07-13
CN105760232B true CN105760232B (en) 2019-03-22

Family

ID=56330991

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610094992.8A Active CN105760232B (en) 2016-02-19 2016-02-19 Offline cache method and system for IOS application

Country Status (1)

Country Link
CN (1) CN105760232B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106453590B (en) * 2016-10-31 2020-08-04 车智互联(北京)科技有限公司 System for iOS end _ back end can dispose general information
CN107332843A (en) * 2017-07-01 2017-11-07 华泰证券股份有限公司 IOS network requests intercept forwarding cache method and system
CN108846141B (en) * 2018-07-11 2022-05-24 中国建设银行股份有限公司 Offline cache loading method and device
CN113535721A (en) * 2018-08-31 2021-10-22 创新先进技术有限公司 Data writing method and device
CN109558375B (en) * 2018-12-05 2021-03-16 武汉斗鱼网络科技有限公司 Optimized file storage method, storage medium, equipment and system
US10880583B2 (en) 2019-04-26 2020-12-29 Advanced New Technologies Co., Ltd. Method, apparatus, terminal, and readable storage medium for offline caching
CN110267077B (en) * 2019-04-26 2020-11-06 创新先进技术有限公司 Offline caching method, device, terminal and readable storage medium
CN112800074B (en) * 2021-01-27 2023-09-15 北京字跳网络技术有限公司 Offline data management method, device, terminal equipment, system and readable medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104252513A (en) * 2013-11-11 2014-12-31 新华瑞德(北京)网络科技有限公司 File caching device, system and method
CN104657358A (en) * 2013-11-15 2015-05-27 腾讯科技(深圳)有限公司 Method and system for caching webpage program offline

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8769073B2 (en) * 2011-06-29 2014-07-01 International Business Machines Corporation Intelligent offline caching of non-navigated content based on usage metrics
US8886743B2 (en) * 2011-08-30 2014-11-11 Open Text S.A. System and method of browsing offline and queried content

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104252513A (en) * 2013-11-11 2014-12-31 新华瑞德(北京)网络科技有限公司 File caching device, system and method
CN104657358A (en) * 2013-11-15 2015-05-27 腾讯科技(深圳)有限公司 Method and system for caching webpage program offline

Also Published As

Publication number Publication date
CN105760232A (en) 2016-07-13

Similar Documents

Publication Publication Date Title
CN105760232B (en) Offline cache method and system for IOS application
CN103246595B (en) Application management method, device, server and terminating unit
CN101373468B (en) Method for loading word stock, method for inputting character and input method system
KR100999267B1 (en) On-device application catalog updated by management servers
CN1799051B (en) Method for browsing contents using page storing file
US10489476B2 (en) Methods and devices for preloading webpages
US20070073787A1 (en) Method and apparatus for synchronizing databases connected by wireless interface
CN106648725A (en) Terminal, server and configuration file upgrading method
CN108230113A (en) User's portrait generation method, device, equipment and readable storage medium storing program for executing
CN101702173A (en) Method and device for increasing access speed of mobile portal dynamic page
CN104050276A (en) Cache processing method and system of distributed database
CN107580032B (en) Data processing method, device and equipment
CN110109958A (en) Method for caching and processing, device, equipment and computer readable storage medium
CN100363890C (en) System and method for synchronously renewing file of remote computer
CN110069264A (en) Construct method, apparatus, computer equipment and the storage medium of resource packet
CN112363871A (en) Data file returning method, device and storage medium
CN103327163A (en) Method for searching contact information and communication terminal thereof
CN112052420A (en) Page sharing picture generation method and device and page sharing method and device
CN102959546A (en) Method and apparatus for converting content
CN111666383A (en) Information processing method, information processing device, electronic equipment and computer readable storage medium
CN111782731A (en) Data synchronization method and device
CN103123651A (en) Method of rapidly searching multiple same-kind paper, device and mobile equipment
CN101888396B (en) Method for calling equipment capacity, micro technical equipment and server
CN106484691B (en) data storage method and device of mobile terminal
CN103309677A (en) Built-in resource management method, device and terminal

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant