WO2018161294A1 - Procédé et appareil de mise en mémoire cache locale pour programme d'application - Google Patents
Procédé et appareil de mise en mémoire cache locale pour programme d'application Download PDFInfo
- Publication number
- WO2018161294A1 WO2018161294A1 PCT/CN2017/076095 CN2017076095W WO2018161294A1 WO 2018161294 A1 WO2018161294 A1 WO 2018161294A1 CN 2017076095 W CN2017076095 W CN 2017076095W WO 2018161294 A1 WO2018161294 A1 WO 2018161294A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- application
- data
- local
- list page
- local data
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 39
- 238000004364 calculation method Methods 0.000 claims description 4
- 238000010586 diagram Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 4
- 238000013507 mapping Methods 0.000 description 4
- 230000008569 process Effects 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 238000013500 data storage Methods 0.000 description 2
- 238000011010 flushing procedure Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000004321 preservation Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 238000000844 transformation Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
Definitions
- the present invention relates to the field of communications technologies, and in particular, to an application local cache method and apparatus.
- the main purpose of the present invention is to solve the technical problem that the prior art has a slower speed and a larger resource overhead when the application page is loaded.
- the present invention provides an application local caching method, the method comprising:
- the first application data of the application is obtained from the server through the application program interface, and the first application data is displayed by using the list page;
- the first application data is saved as the local data.
- the method further includes:
- the local data is obtained and the local data is presented through the list page.
- the method further includes:
- the updated local data is displayed through the list page to refresh the list page.
- the method further includes:
- a local cache space is allocated from the terminal memory space for storing local data of the application.
- the local data cache mode is localStorage
- the local cache space is a localStorage space.
- an application local cache device including:
- a detecting module configured to detect, when the application list page is opened, whether the terminal has local data of the application
- An obtaining module configured to acquire first application data of the application from a server through an application program interface when the local data does not exist
- a display module configured to display the first application data by using the list page
- an update module configured to save the first application data as the local data.
- the obtaining module is further configured to acquire the local data when the local data exists;
- the presentation module is further configured to display the local data through the list page.
- the obtaining module is further configured to: when detecting a refresh operation of the user on the list page, acquire second application data of the application from a server through an application program interface;
- the application local cache device further includes:
- a calculation module configured to separately calculate and compare the md5 value of the second application data and the md5 value of the local data
- the update module is further configured to save the second application data as new local data to update the local data when the two md5 values are different;
- the display module is further configured to display the updated local data through the list page to refresh the list page.
- the application local cache device further includes:
- a dividing module configured to divide a local cache space from the terminal memory space, and store local data of the application.
- the local data cache mode is localStorage
- the local cache space is a localStorage space.
- the application local caching method and apparatus when detecting that the application list page is opened, detecting whether the terminal has local data of the application; if not, acquiring the local device from the server through the application program interface Determining the first application data of the application, displaying the first application data through the list page; and saving the first application data as the local data.
- the data of the list page is cached locally, and the display can be realized by accessing the local data when the list is displayed, which reduces the pressure of the back-end server to a certain extent, and supports the offline access of the user and improves the page loading speed. Greatly improved the user experience.
- FIG. 1 is a schematic flowchart of a first embodiment of an application local cache method according to the present invention
- FIG. 2 is a schematic flowchart of a second embodiment of an application local cache method according to the present invention.
- FIG. 3 is a schematic diagram of functional modules of a first embodiment of an application local cache device according to the present invention.
- FIG. 4 is a schematic diagram of functional modules of a second embodiment of an application local cache device of the present invention.
- the terminal includes, but is not limited to, a mobile terminal such as an IPAD or a mobile phone.
- FIG. 1 is a schematic flowchart diagram of a first embodiment of an application local cache method according to the present invention.
- the application local caching method includes:
- Step S10 when detecting that the application list page is opened, detecting whether the terminal has local data of the application;
- the application needs to verify the user.
- the application For the application that needs to verify the login, after the user opens the application and successfully logs in, the application needs to display the default list page to the user, or the user can Select a list page to open.
- the terminal detects that a certain list page of the application is opened, the page needs to be loaded. At this time, the terminal needs to acquire the page data, and firstly detects whether the local data of the application exists in the local storage space.
- step S10 the method further includes the following steps:
- a local cache space is allocated from the terminal memory space for storing local data of the application.
- a local cache space of a certain size is allocated from the terminal memory space for storing local data cached by the application on the terminal to the local. It can be understood that in the local cache space, local data of more than one application is stored.
- the storage location of each application and its corresponding local data can be recorded through a mapping table. When local data corresponding to an application needs to be acquired or detected, the storage location of the corresponding local data can be obtained from the mapping table to find The local data.
- the storage mode of the data local cache includes, but is not limited to, local storage, websql, sqllite, and the like.
- the local storage method of the HTML5 is preferably used.
- the local cache space is preferably localStorage space.
- Step S20 if not, acquiring the first application data of the application from the server through the application program interface, and displaying the first application data by using the list page;
- Step S30 saving the first application data as the local data.
- Interface Programming Interface application programming interface
- API application programming interface
- the terminal obtains the data required for the list page display, and the first application data can be displayed through the list page.
- the application data acquired from the server mainly refers to data required by the application for displaying the list page, including but not limited to audio data, video data, picture data, and text data.
- the cached local data is generally the data of one page of the current application. For example, for a list page, generally only the data of the current list page needs to be saved, and the page data of the page turning does not need to be cached.
- local data can be saved by md5 (Message Digest) Algorithm 5, MD5, Message Digest Algorithm Fifth Edition, abbreviated Abstract Algorithm) is encrypted to ensure data integrity.
- md5 Message Digest Algorithm 5
- MD5 Message Digest Algorithm Fifth Edition, abbreviated Abstract Algorithm
- Step S40 if yes, acquiring the local data and displaying the local data through the list page.
- the local data corresponding to the application is generally stored in the local cache space.
- the terminal may directly acquire the local data, load the list page, and display the local data, for example, display related picture text or video data.
- the user can click on the corresponding picture or text link to open a new list page.
- the user can also refresh the current list page by refreshing operations such as pulling down or clicking a refresh button to update the page content.
- the application local caching method detects whether the terminal has local data of the application when it is detected that the application list page is opened; if not, the application is obtained from the server through the application program interface. a first application data of the program, the first application data is displayed through the list page; and the first application data is saved as the local data.
- the data of the list page is cached locally, and the display can be realized by accessing the local data when the list is displayed, which reduces the pressure of the back-end server to a certain extent, and supports the offline access of the user and improves the page loading speed. Greatly improved the user experience.
- FIG. 2 is a schematic flowchart diagram of a second embodiment of an application local cache method according to the present invention.
- the difference from the first embodiment of the application local caching method is that, in this embodiment, in addition to steps S10-S40 (not shown again), the method further includes:
- Step S50 when detecting a refresh operation of the user on the list page, acquiring second application data of the application from a server through an application program interface;
- Step S60 respectively calculating the md5 value of the second application data and the md5 value of the local data, and comparing the values;
- Step S70 if the two md5 values are different, saving the second application data as new local data to update the local data;
- Step S80 displaying the updated local data through the list page to refresh the list page.
- the terminal detects the user's operation in real time.
- the server needs to request to confirm whether the current page has updated content to be displayed.
- the terminal will request data from the server through the API.
- the terminal returns data through two callback functions of the middle layer, one returns local cache data, and one returns the application data of the current application returned by the server through the API (ie, the second application data).
- the callback function is called, the first pass A callback returns local data.
- the server requests a return, it compares the local data with the returned second application data.
- the local data is updated, and then the second callback returns the updated page data; if there is no update, it remains unchanged. change.
- comparing the local data and the returned second application data it is mainly confirmed by comparing the md5 values of the two whether the two are consistent data. If the md5 values are different, the two are different data, and the current page needs to be updated, and vice versa.
- the second application data returned is the same as the local data currently stored locally, and the current page does not need to be updated.
- the terminal first obtains the local data presentation from the local, and then obtains the application data refresh of the current application from the application interface according to the refresh operation of the user, and simultaneously compares the md5 with the local data. Different, store a copy into the local localstorage, and md5 encrypt the data, and update the current page table page; the same, the application interface remains unchanged.
- the application local caching method provided by the above embodiment can update the local data in real time through the md5 value comparison, and can save the page update while enabling the user to seamlessly see the latest data, and realize the user angle while ensuring the page update. Seamless slot page switching.
- FIG. 4 is a schematic diagram of functional modules of a first embodiment of a mouse application local cache device according to the present invention.
- the application local cache device 100 is applied to the terminal, and includes:
- the detecting module 101 is configured to detect, when the application list page is opened, whether the terminal has local data of the application;
- the application needs to verify the user.
- the application For the application that needs to verify the login, after the user opens the application and successfully logs in, the application needs to display the default list page to the user, or the user can Select a list page to open.
- the terminal detects that a certain list page of the application is opened, the page needs to be loaded. At this time, the terminal needs to acquire the page data, and the detecting module 101 first detects whether the local data of the application exists in the local storage space.
- the application local cache device 100 further includes:
- the dividing module 106 is configured to divide a local cache space from the terminal memory space for storing local data of the application.
- the dividing module 106 divides a certain size of the local cache space from the terminal memory space for storing the local data cached by the application on the terminal to the local. It can be understood that in the local cache space, local data of more than one application is stored. The storage location of each application and its corresponding local data can be recorded through a mapping table. When local data corresponding to an application needs to be acquired or detected, the storage location of the corresponding local data can be obtained from the mapping table to find The local data.
- the storage mode of the data local cache includes, but is not limited to, local storage, websql, sqllite, and the like.
- the local storage method of the HTML5 is preferably used.
- the local cache space is preferably localStorage space.
- the obtaining module 102 is configured to: when the local data does not exist, obtain the first application data of the application from the server through the application program interface and save the data as the local data;
- the display module 103 is configured to display the first application data by using the list page;
- the update module 104 is configured to save the first data as the local data.
- the application may be used for the first time or the user performs the clearing cache operation. Therefore, the data displayed this time needs to be acquired from the server, and the module 102 is acquired at this time.
- a data request is made to the server through an application program interface (API) and the first application data of the application returned by the server is received, and the first application data is saved by the update module 104 into the local cache space as local data of the application.
- the obtaining module 102 obtains the data required for the display of the list page, and the display module 103 can display the first application data through the list page.
- API application program interface
- the application data acquired from the server mainly refers to data required by the application for displaying the list page, including but not limited to audio data, video data, picture data, and text data.
- the cached local data is generally the data of one page of the current application. For example, for a list page, generally only the data of the current list page needs to be saved, and the page data of the page turning does not need to be cached.
- the preservation of local data can be saved by md5 encryption to ensure data integrity.
- the obtaining module 102 is further configured to acquire the local data when the local data exists;
- the presentation module 103 is further configured to display the local data through the list page.
- the local data corresponding to the application is generally stored in the local cache space.
- the obtaining module 102 can directly obtain the local data, and the display module 103 loads the list page and displays the local data, for example, displaying related picture text or video data.
- the user can click on the corresponding picture or text link to open a new list page.
- the user can also refresh the current list page by refreshing operations such as pulling down or clicking a refresh button to update the page content.
- the application local cache device detects whether the terminal has local data of the application when it is detected that the application list page is opened; if not, the application is obtained from the server through the application program interface. a first application data of the program, the first application data is displayed through the list page; and the first application data is saved as the local data.
- the data of the list page is cached locally, and the display can be realized by accessing the local data when the list is displayed, which reduces the pressure of the back-end server to a certain extent, and supports the offline access of the user and improves the page loading speed. Greatly improved the user experience.
- FIG. 4 is a schematic diagram of functional modules of a second embodiment of an application local cache method according to the present invention. The difference from the first embodiment of the application local caching device is that in this embodiment:
- the obtaining module 102 is further configured to: when detecting a refresh operation of the user on the list page, acquire second application data of the application from a server through an application program interface;
- the application local cache device 100 further includes:
- the calculating module 105 is configured to separately calculate and compare the md5 value of the second application data and the md5 value of the local data;
- the update module 104 is further configured to save the second application data as new local data to update the local data when the two md5 values are different;
- the display module 103 is further configured to display the updated local data through the list page to refresh the list page.
- the terminal detects the user's operation in real time.
- the obtaining module 102 needs to request the server to confirm whether the current page has updated content to be displayed.
- the obtaining module 102 will request data from the server through the API.
- the obtaining module 102 returns data through two callback functions of the middle layer, one returns local cache data, and one returns application data of the current application returned by the server through the API (ie, second application data), when the callback function is called, first The local data is returned by the first callback.
- the calculation module 105 compares the local data with the returned second application data.
- the update module 104 completes the update of the local data, and then the second callback returns the update. Page data; remains unchanged if there are no updates.
- the calculation module 105 mainly checks whether the two are consistent data by comparing the md5 values of the two. If the md5 values are different, the two are different data, and the current page needs to be updated. On the contrary, it means that the returned second application data is the same as the currently stored local data, and the current page does not need to be updated.
- the terminal first obtains the local data display from the local, and then obtains the application data refresh of the current application from the application interface according to the refresh operation of the user, and simultaneously compares the md5 with the local data. Different, store a copy into the local localstorage, and md5 encrypt the data, and update the current page table page; the same, the application interface remains unchanged.
- the application local cache device provided by the above embodiment can update the local data in real time through the md5 value comparison, and can save the page update while enabling the user to seamlessly see the latest data, and realize the user angle while ensuring the page update. Seamless slot page switching.
Abstract
La présente invention porte sur un procédé de mise en mémoire cache locale pour un programme d'application. Le procédé comprend les étapes suivantes : lorsqu'il est détecté qu'une page de liste de programmes d'application est ouverte, détecter si des données locales du programme d'application sortent sur un terminal ; si ce n'est pas le cas, obtenir des premières données d'application du programme d'application à partir d'un serveur par l'intermédiaire d'une interface de programme d'application, et afficher les premières données d'application au moyen de la page de liste ; et stocker les premières données d'application en tant que données locales. La présente invention concerne également un appareil de mise en mémoire cache locale pour un programme d'application. Dans le procédé et l'appareil de mise en mémoire cache locale pour un programme d'application fourni dans la présente invention, des données d'une page de liste sont mises en cache localement, et lorsque la liste est affichée, les données peuvent être affichées en accédant aux données locales, en conséquence, la pression sur un serveur d'arrière-plan est réduite dans une certaine mesure, et l'accès hors ligne d'un utilisateur est pris en charge, et la vitesse de chargement de page est augmentée, ce qui permet d'améliorer considérablement l'expérience de l'utilisateur.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2017/076095 WO2018161294A1 (fr) | 2017-03-09 | 2017-03-09 | Procédé et appareil de mise en mémoire cache locale pour programme d'application |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2017/076095 WO2018161294A1 (fr) | 2017-03-09 | 2017-03-09 | Procédé et appareil de mise en mémoire cache locale pour programme d'application |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2018161294A1 true WO2018161294A1 (fr) | 2018-09-13 |
Family
ID=63447076
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2017/076095 WO2018161294A1 (fr) | 2017-03-09 | 2017-03-09 | Procédé et appareil de mise en mémoire cache locale pour programme d'application |
Country Status (1)
Country | Link |
---|---|
WO (1) | WO2018161294A1 (fr) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111506644A (zh) * | 2019-01-31 | 2020-08-07 | 北京神州泰岳软件股份有限公司 | 一种应用数据处理方法、装置和电子设备 |
CN113158107A (zh) * | 2021-04-27 | 2021-07-23 | 中国工商银行股份有限公司 | 访问通知栏消息的方法、装置、电子设备和存储介质 |
US20220091834A1 (en) * | 2020-09-23 | 2022-03-24 | Beijing Baidu Netcom Science And Technology Co., Ltd. | Method, apparatus, electronic device and readable storage medium for deploying application |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20020083132A1 (en) * | 1998-12-22 | 2002-06-27 | Holland Ian Michael | Accessing page bundles on a portable client having intermittent network connectivity |
US8700804B1 (en) * | 2011-03-16 | 2014-04-15 | EP Visual Design, Inc. | Methods and apparatus for managing mobile content |
CN104965717A (zh) * | 2014-06-05 | 2015-10-07 | 腾讯科技(深圳)有限公司 | 一种页面加载的方法及装置 |
CN105869005A (zh) * | 2015-11-23 | 2016-08-17 | 乐视网信息技术(北京)股份有限公司 | 一种app开启广告预加载方法、装置和系统 |
CN106126685A (zh) * | 2016-06-29 | 2016-11-16 | 北京小米移动软件有限公司 | 页面加载方法及装置 |
CN106446174A (zh) * | 2016-09-28 | 2017-02-22 | 江西博瑞彤芸科技有限公司 | 应用中页面加载的方法 |
-
2017
- 2017-03-09 WO PCT/CN2017/076095 patent/WO2018161294A1/fr unknown
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20020083132A1 (en) * | 1998-12-22 | 2002-06-27 | Holland Ian Michael | Accessing page bundles on a portable client having intermittent network connectivity |
US8700804B1 (en) * | 2011-03-16 | 2014-04-15 | EP Visual Design, Inc. | Methods and apparatus for managing mobile content |
CN104965717A (zh) * | 2014-06-05 | 2015-10-07 | 腾讯科技(深圳)有限公司 | 一种页面加载的方法及装置 |
CN105869005A (zh) * | 2015-11-23 | 2016-08-17 | 乐视网信息技术(北京)股份有限公司 | 一种app开启广告预加载方法、装置和系统 |
CN106126685A (zh) * | 2016-06-29 | 2016-11-16 | 北京小米移动软件有限公司 | 页面加载方法及装置 |
CN106446174A (zh) * | 2016-09-28 | 2017-02-22 | 江西博瑞彤芸科技有限公司 | 应用中页面加载的方法 |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111506644A (zh) * | 2019-01-31 | 2020-08-07 | 北京神州泰岳软件股份有限公司 | 一种应用数据处理方法、装置和电子设备 |
CN111506644B (zh) * | 2019-01-31 | 2024-01-23 | 北京神州泰岳软件股份有限公司 | 一种应用数据处理方法、装置和电子设备 |
US20220091834A1 (en) * | 2020-09-23 | 2022-03-24 | Beijing Baidu Netcom Science And Technology Co., Ltd. | Method, apparatus, electronic device and readable storage medium for deploying application |
CN113158107A (zh) * | 2021-04-27 | 2021-07-23 | 中国工商银行股份有限公司 | 访问通知栏消息的方法、装置、电子设备和存储介质 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2015030364A1 (fr) | Procédé pour partager des données multimédias et dispositif électronique associé | |
WO2011021909A2 (fr) | Procédé et appareil de fourniture de contenus par l'intermédiaire d'un réseau, procédé et appareil de réception de contenus par l'intermédiaire d'un réseau, et procédé et appareil de sauvegarde de données par l'intermédiaire d'un réseau, dispositif de fourniture de données de sauvegarde et système de sauvegarde | |
WO2018161294A1 (fr) | Procédé et appareil de mise en mémoire cache locale pour programme d'application | |
WO2012100605A1 (fr) | Procédé de gestion d'images, terminal mobile et support de stockage informatique | |
CN108566561B (zh) | 视频播放方法、装置及存储介质 | |
WO2016101441A1 (fr) | Procédé et système de synchronisation de fichier | |
EP3850521A1 (fr) | Appareil électronique gérant des données sur la base d'une chaîne de blocs et procédé de gestion de données | |
WO2015003516A1 (fr) | Procédé de génération de paquet de mise à niveau, serveur, procédé de mise à niveau de logiciel, et terminal mobile | |
WO2012055298A1 (fr) | Procédé de travail hors-ligne d'un client et client de travail hors ligne | |
WO2021027134A1 (fr) | Procédé, appareil et dispositif de stockage de données et support d'enregistrement informatique | |
WO2011129635A2 (fr) | Procédé et appareil pour la fourniture d'un service applicatif dans un système de communication mobile | |
WO2016137185A1 (fr) | Dispositif électronique et procédé permettant de fournir un contenu de drm par le dispositif électronique | |
JPWO2014192063A1 (ja) | アプリケーション実行プログラム,アプリケーション実行方法及びアプリケーションを実行する情報処理端末装置 | |
WO2020237859A1 (fr) | Procédé de migration de données employant un dispositif nbd, appareil, dispositif et support de stockage | |
WO2018161601A1 (fr) | Procédé de réglage de rétroéclairage d'écran, support de stockage et dispositif électronique | |
WO2016119414A1 (fr) | Terminal mobile, système et procédé de partage de fichier à code à barres bidimensionnel | |
WO2019137217A1 (fr) | Procédé de saut de page dans un programme d'application, terminal et support de stockage | |
WO2021027115A1 (fr) | Procédé de synchronisation de données, dispositif, équipement informatique et support d'enregistrement | |
WO2016090775A1 (fr) | Procédé et système d'utilisation synchrone pour données de message court | |
WO2018076880A1 (fr) | Procédé de sauvegarde de données, appareil, support d'informations, et terminal | |
CN113407506A (zh) | 数据处理方法、装置、设备及存储介质 | |
CN113987563A (zh) | 数据处理方法、系统、产品、设备及存储介质 | |
WO2018049879A1 (fr) | Procédé et dispositif de migration de données | |
WO2020237849A1 (fr) | Procédé de lecture-écriture d'aperçu pour dispositif de bloc de réseau, appareil, dispositif et support de stockage | |
WO2017157125A1 (fr) | Procédé et appareil de suppression d'un hôte en nuage dans un environnement informatique en nuage, serveur et support d'informations |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 17900088 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |