WO2017005095A1 - Method for caching resources and updating cached resources, client, server and system - Google Patents

Method for caching resources and updating cached resources, client, server and system Download PDF

Info

Publication number
WO2017005095A1
WO2017005095A1 PCT/CN2016/086871 CN2016086871W WO2017005095A1 WO 2017005095 A1 WO2017005095 A1 WO 2017005095A1 CN 2016086871 W CN2016086871 W CN 2016086871W WO 2017005095 A1 WO2017005095 A1 WO 2017005095A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource
offline resource
offline
control file
client
Prior art date
Application number
PCT/CN2016/086871
Other languages
French (fr)
Chinese (zh)
Inventor
邵明芝
Original Assignee
阿里巴巴集团控股有限公司
邵明芝
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 阿里巴巴集团控股有限公司, 邵明芝 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2017005095A1 publication Critical patent/WO2017005095A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • H04L67/5683Storage of data provided by user terminals, i.e. reverse caching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/16Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • H04L67/5682Policies or rules for updating, deleting or replacing the stored data

Definitions

  • the present application relates to the field of computer information processing technologies, and in particular, to a cache resource, a method for updating a cache resource, a client, a server, and a system.
  • the biggest feature of the mobile Internet is “mobile”.
  • the user terminal can use the Internet when the physical location is not fixed, which can provide great convenience to the user terminal.
  • the coverage of current mobile networks is not very wide, and it is impossible for user terminals to enjoy the convenience brought by the mobile Internet anytime and anywhere. Therefore, some mobile applications use the offline cache technology scheme to cache the downloaded resources to the local, so that the user terminal can continue to use without the network. In this way, user terminal traffic can be saved and the personalized requirements of the user terminal can be met.
  • HTML5 Hypertext Markup Languages
  • HTML5 has developed like a tea in the past decade.
  • video, audio, images, animation, and interaction with computers have been standardized.
  • the functions of HTML5 are becoming more and more abundant. The most important thing is that it has offline cache mobile web.
  • the function of the application Based on the offline caching function of HTML5, many mobile applications are developed in conjunction with HTML5.
  • Such mobile applications can be called mobile web applications, mainly using HTML5 technology, and can be run in a text browser, such as Javascript (script (CSS (Cascading Style Sheet), etc.
  • CSS CSS
  • HTML5 In HTML5's offline caching scheme, mobile devices usually use the Application Cache API (The application cache interface provides offline storage and specifies that the browser caches specific files for offline users.
  • the application cache interface provides offline storage and specifies that the browser caches specific files for offline users.
  • users When users use the HTML5 offline function to store offline resources, they usually access the target resources and download the target resources.
  • the inventor has found that at least the following problems exist in the prior art: the existing method of caching resources implemented by the HTML5 offline function usually needs to offline the page and resources after the page is accessed once, for the unvisited Pages and resources are usually unable to obtain offline resources, so existing methods of caching resources cannot flexibly cache offline resources that users need.
  • the purpose of the embodiment of the present application is to provide a cache resource, a method for updating a cache resource, a client, a server, and a system, so as to implement a flexible cache of offline resources required by the user.
  • the embodiment of the present application provides a method for caching resources, updating cache resources, a client, a server, and a system. This is achieved like this:
  • a method for caching resources includes: a server receiving an offline resource list, and generating an offline resource package and a total control file corresponding to the offline resource package according to the offline resource list; the client acquiring the server at a preset time And the total control file is stored according to the total control file cache offline resource, and the total control file is stored.
  • a method for caching resources includes: a client acquiring a total control file generated according to the offline resource list on a server at a preset time; the client buffering the offline resource according to the total control file, and storing the total Control file.
  • a method for caching resources includes: a server receiving an offline resource list; and the server generating an offline resource package and a total control file corresponding to the offline resource package according to the offline resource list.
  • a method for updating a cache resource comprising: detecting, by a server, whether an offline resource corresponding to the total control file is changed, and if so, generating a new offline resource package according to the updated offline resource and a new one corresponding to the new offline resource package a master control file; sending the new master control file to the client; the client receiving a new master control file sent by the server, comparing the new master control file with a total control file currently stored by the client Determining the target offline resource and updating the target offline resource.
  • a method for updating a cache resource comprising: detecting, by a server, whether an offline resource corresponding to the total control file is changed, and if so, generating a new offline resource package according to the updated offline resource and the new A new master control file corresponding to the offline resource package; the server sends the new master control file to the client.
  • a method for updating a cache resource comprising: receiving, by a client, a new master control file sent by a server; the client comparing the new master control file with a total control file currently stored by the client, and determining a target offline resource, Updating the target offline resource; the target offline resource is used to represent the updated offline resource.
  • a server for caching resources comprising: a list receiving unit and a file generating unit; wherein the list receiving unit is configured to receive a offline resource list; and the offline resource list is used to indicate information of an offline resource that needs to be cached;
  • the file generating unit is configured to generate an offline resource package and a total control file corresponding to the offline resource package according to the offline resource list.
  • a client for caching resources comprising: a file receiving unit and a resource buffering unit; wherein the file receiving unit is configured to acquire, at a preset time, a total control file generated on the server according to the offline resource list; And a resource cache unit, configured to cache the offline resource according to the total control file, and store the total control file.
  • a system for caching resources comprising: a server for caching resources and a client for caching resources; the server for buffering resources, configured to receive a list of offline resources, generate an offline resource package according to the offline resource list, and a total control file corresponding to the offline resource package; the client for the cache resource, configured to generate, according to the total control file, the total control file generated by the offline resource list on the server that acquires the cache resource at a preset time Cache offline resources to store the master control file.
  • a server for updating a cache resource comprising: a file update unit and an update information sending unit; wherein the file update unit is configured to detect whether an offline resource corresponding to the total control file is changed, and if so, generate the updated offline resource. a new offline resource package and a new master control file corresponding to the new offline resource package; the update information sending unit, configured to send the new master control file to a client that updates the cache resource.
  • a client for updating a cache resource comprising: an update information receiving unit and a cache update unit; wherein the update information receiving unit is configured to receive a new master control file sent by a server that updates the cache resource; a unit, configured to compare the new master control file with a total control file currently stored by the client, determine a target offline resource, and update the target offline resource; Indicates an updated offline resource.
  • a system for updating a cache resource comprising: a server for updating a cache resource and a client for updating a cache resource; wherein the server for updating a cache resource is configured to detect whether an offline resource corresponding to the total control file is changed, and if so, according to the update
  • the offline resource generates a new offline resource package and a new master control file corresponding to the new offline resource package; the new master control file is sent to the client that updates the cache resource; and the client that updates the cache resource And receiving a new master control file sent by the server that updates the cache resource; comparing the new master control file with a total control file currently stored by the client, determining a target offline resource, and updating the target offline resource;
  • the target offline resource is used to represent an updated offline resource.
  • the method of the cache resource provided by the embodiment of the present application send a list of cache resources that meet the needs of the user to the server, and the server generates a corresponding offline resource package and The master control file, the user can obtain the total control file at a specific time, and download the offline resource package according to the information in the master control file and store the offline resource, and the page that needs to access the offline resource can realize the flexible offline of the user.
  • the method, the client, the server, and the system for updating the cache resource provided by the embodiment of the present application may detect the changed offline resource to generate a new offline resource package and correspond to the new offline resource package when the offline resource is changed.
  • the new master control file the client can determine the updated target offline resource by comparing the new master control file with the total control file currently stored by the client, and update the target offline resource stored by the client to ensure the client cache.
  • the resources are updated with the update of the online resources, and the offline resources required by the user can be flexibly cached.
  • 1 is a flow chart of an embodiment of a method for buffering resources in the present application
  • FIG. 2 is a flow chart of an embodiment of a method for server-based cache resources in the present application
  • FIG. 3 is a flow chart of an embodiment of a method for a client-side cache resource in the present application
  • FIG. 4 is a flow chart of an embodiment of a method for updating a cache resource according to the present application.
  • FIG. 5 is a flowchart of an embodiment of a method for updating a cache resource by using a server as a main body;
  • FIG. 6 is a flowchart of an embodiment of a method for updating a cache resource by using a client as a main body
  • FIG. 7 is a block diagram of an embodiment of a system for caching resources of the present application.
  • FIG. 8 is a block diagram of an embodiment of a server for caching resources of the present application.
  • FIG. 9 is a block diagram of an embodiment of a client for caching resources of the present application.
  • FIG. 10 is a block diagram of an embodiment of a system for updating a cache resource of the present application.
  • FIG. 11 is a block diagram of an embodiment of a server for updating a cache resource of the present application.
  • FIG. 12 is a block diagram of one embodiment of a client that updates a cache resource of the present application.
  • the embodiment of the present application provides a method for caching resources, updating cache resources, a client, a server, and a system.
  • the method for caching resources may include:
  • S101 The server receives the offline resource list, and generates offline resources according to the offline resource list.
  • the server can receive a list of offline resources.
  • the offline resource list may be used to indicate information of an offline resource that needs to be cached.
  • the offline resource list may be sent by the client.
  • the offline resource list may also be sent by a third party, or the offline resource list information input by the server received by the server.
  • the offline resource list may include: a name of the offline resource, a uniform resource locator (referred to as a URL) of the offline resource, and a format of the offline resource.
  • the offline resource may include a hypertext markup language (HTML) page, and a cascading style sheet (referred to as css) and/or a literal translation script language (js) loaded in the HTML page.
  • HTML hypertext markup language
  • css cascading style sheet
  • js literal translation script language
  • the server may generate an offline resource package and a total control file corresponding to the offline resource package according to the offline resource list.
  • the master control file may include: version information of the master control file, version information of the offline resource package, and a storage address of the offline resource package at the server.
  • the offline resource package may include: an offline resource and configuration information of the offline resource; the configuration information of the offline resource may be used to indicate a URL of the offline resource and an address of the offline resource in the offline resource package .
  • the client acquires the total control file on the server at a preset time, and caches the offline control resource according to the total control file, and stores the total control file.
  • the client can obtain the master control file on the server at a preset time. Specifically, the client may obtain the total control file at a preset time point; for example, the implementation client obtains the master control file at 10 o'clock and 20 o'clock each time. The client may also acquire the master control file every preset time interval from the start time point; for example, the client may acquire the master control file every hour after starting from 5 o'clock every day.
  • the client may cache the offline resource according to the total control file, and may include: downloading an offline resource package corresponding to the total control file according to the total control file, and storing the offline resource in the offline resource package;
  • the uniform resource locator of the offline resource and the offline stored in the client The correspondence between the addresses of resources.
  • the client may store the master control file.
  • the client When the client receives the request for accessing a certain URL address, it may find whether the URL of the offline resource stored by the client includes the URL address to be accessed, and if it is already stored, may be based on the recorded offline resource. And a corresponding relationship between the uniform resource locator and the address of the offline resource stored in the client, and the offline resource stored by the client corresponding to the URL address to be accessed is obtained. If the URL of the offline resource stored by the client does not include the URL address to be accessed, the client may access the network to obtain the resource file corresponding to the URL.
  • FIG. 2 is a flow chart of an embodiment of a method for server-based cache resources in the present application. As shown in FIG. 2, the method may include:
  • S201 The server receives the offline resource list.
  • the server generates an offline resource package and a total control file corresponding to the offline resource package according to the offline resource list.
  • the master control file may include: version information of the master control file, version information of the offline resource package, and a storage address of the offline resource package at the server.
  • FIG. 3 is a flow chart of an embodiment of a method for client-based cache resources in the present application. As shown in FIG. 3, the method may include:
  • S301 The client acquires the total control file generated by the offline resource list on the server at a preset time.
  • S302 The client caches the offline resource according to the total control file, and stores the total control file.
  • the method for caching resources disclosed in the foregoing embodiment sends a list of cache resources that meet the needs of the user to the server, and the server generates a corresponding offline resource package and a total control file, and the user can obtain the total control file at a specific time, and according to the total control
  • the information in the file downloads the offline resource bundle and performs offline resources.
  • Storage which does not require access to offline resources, can be used to flexibly cache offline resources that users need.
  • the method for updating a cache resource may include:
  • S401 The server detects whether the offline resource corresponding to the total control file is changed, and if yes, generates a new offline resource package and a new total control file corresponding to the new offline resource package according to the updated offline resource; and sends the new The master control file to the client.
  • the server can detect whether the offline resource corresponding to the current master control file has changed. Specifically, the server may detect whether the offline resource corresponding to the total control file is changed at a preset time interval, or the server may receive a push message that the offline resource corresponding to the total control file is changed.
  • the server detects that the offline resource corresponding to the total control file is changed, the new offline resource package and the new total control file corresponding to the new offline resource package may be generated according to the updated offline resource.
  • the new master control file may include: version information of the new master control file, version information of the new offline resource package, and a storage address of the new offline resource package on the server.
  • the server may send the new master control file to the client.
  • the client receives a new master control file sent by the server, compares the new master control file with a total control file currently stored by the client, determines a target offline resource, and updates the target offline resource.
  • the client may receive a new master control file sent by the server, compare the new master control file with a total control file currently stored by the client, and determine a target offline resource.
  • the target offline resource may include: an updated offline resource.
  • the comparing the new total control file with the total control file currently stored by the client, and determining the target offline resource which may include: comparing the new total control file with the offline resource package in the total control file stored by the client.
  • the version information and the offline resource corresponding to the offline resource package whose version information changes may be the target offline resource.
  • the client may update the target offline resource.
  • an offline resource package in which the version information is changed may be downloaded, an offline resource in the new offline resource package may be stored, and an offline resource portion in which the version information stored in the client is changed may be deleted; and the updated Corresponding relationship between the uniform resource locator of the offline resource and the address of the updated offline resource stored in the client.
  • FIG. 5 is a flowchart of an embodiment of a method for updating a cache resource by a server. As shown in FIG. 5, the method may include:
  • S501 The server detects whether the offline resource corresponding to the total control file is changed. If yes, generates a new offline resource package and a new total control file corresponding to the new offline resource package according to the updated offline resource.
  • S502 The server sends the new master control file to the client.
  • FIG. 6 is a flow chart of an embodiment of a method for updating a cache resource by a client as a main body of the present application. As shown in FIG. 6, the method may include:
  • S601 The client receives a new master control file sent by the server.
  • the client compares the new master control file with a total control file currently stored by the client, determines a target offline resource, and updates the target offline resource; and the target offline resource is used to represent the updated offline resource.
  • the method for updating the cache resource disclosed in the foregoing embodiment when the offline resource is changed, can detect the changed offline resource in time to generate a new offline resource package and a new total control file corresponding to the new offline resource package.
  • the client can determine the updated target offline resource by comparing the new master control file with the total control file currently stored by the client, and update the target offline resource stored by the client.
  • the above method can ensure that the client cached resource Updates of online resources are updated to enable flexible caching of offline resources required by users.
  • the system for storing resources may include: a server 110 that caches resources and a client 120 that caches resources;
  • the server 110 of the cache resource may be configured to receive a offline resource list, and generate an offline resource package and a total control file corresponding to the offline resource package according to the offline resource list.
  • the client 120 of the cache resource may be configured to cache the offline control resource according to the total control file cache according to the total control file generated by the offline resource list on the server 110 that acquires the cache resource at a preset time.
  • the master control file may be configured to cache the offline control resource according to the total control file cache according to the total control file generated by the offline resource list on the server 110 that acquires the cache resource at a preset time.
  • the server 110 for caching resources may include: a list receiving unit 111 and a file generating unit 112;
  • the list receiving unit 111 may be configured to receive a offline resource list, where the offline resource list may be used to indicate information of an offline resource that needs to be cached.
  • the file generating unit 112 may be configured to generate an offline resource package and a total control file corresponding to the offline resource package according to the offline resource list.
  • the client 120 of the cache resource may include: a file receiving unit 121 and a resource buffer unit 122;
  • the file receiving unit 121 may be configured to acquire a total control file generated according to the offline resource list on the server 110 of the cache resource at a preset time;
  • the resource cache unit 122 may be configured to cache the offline resource according to the total control file, and store the total control file.
  • the system, the client, and the server of the cache resource disclosed in the foregoing embodiment are related to the method embodiment of the cache resource of the present application, and the method for buffering the resource of the present application can be implemented to achieve the technical effect of the method embodiment of the cache resource of the present application.
  • the system for updating a cache resource may include: a server 210 that updates a cache resource and an update cache.
  • Client 220 of the resource may include: a server 210 that updates a cache resource and an update cache.
  • the server 210 for updating the cache resource may be configured to detect whether the offline resource corresponding to the total control file is changed. If yes, generate a new offline resource package according to the updated offline resource and a new one corresponding to the new offline resource package. a master control file; sending the new master control file to the client 220 that updates the cache resource;
  • the client 220 for updating the cache resource may be configured to receive the new master control file sent by the server 210 that updates the cache resource; compare the new master control file with the total control file currently stored by the client, and determine Target offline resources, updating the target offline resources; the target offline resources are used to represent updated offline resources.
  • the server 210 that updates the cache resource may include: a file update unit 211 and an update information sending unit 212;
  • the file update unit 211 may be configured to detect whether an offline resource corresponding to the total control file is changed, and if yes, generate a new offline resource package according to the updated offline resource and a new total corresponding to the new offline resource package.
  • the update information sending unit 212 may be configured to send the new master control file to the client 220 that updates the cache resource.
  • the client 220 that updates the cache resource may include: an update information receiving unit 221 and a cache update unit 222;
  • the update information receiving unit 221 can be configured to receive a new master control file sent by the server 210 that updates the cache resource;
  • the cache update unit 222 may be configured to compare the new master control file with a total control file currently stored by the client, determine a target offline resource, and update the target offline resource; and the target offline resource is used to indicate the updated Offline resources.
  • the system, the client and the server for updating the cache resource disclosed in the above embodiment are updated with the application.
  • the method for updating the cache resource in the present application can be implemented, and the technical effect of the method for updating the cache resource in the present application is achieved.
  • PLD Programmable Logic Device
  • FPGA Field Programmable Gate Array
  • HDL Hardware Description Language
  • the controller can be implemented in any suitable manner, for example, the controller can take, for example, a microprocessor or processor and store computer readable program code (eg, software executable by the (micro)processor) Or firmware) in the form of a computer readable medium, a logic gate, a switch, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller.
  • the controller include, but are not limited to, the following micro control The ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller can also be implemented as part of the memory's control logic.
  • the controller can be logically programmed by means of logic gates, switches, ASICs, programmable logic controllers, and embedding.
  • Such a controller can therefore be considered a hardware component, and the means for implementing various functions included therein can also be considered as a structure within the hardware component.
  • a device for implementing various functions can be considered as a software module that can be both a method of implementation and a structure within a hardware component.
  • the system, device, module or unit illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product having a certain function.
  • the present application can be implemented by means of software plus a necessary general hardware platform. Based on such understanding, portions of the technical solution of the present application that contribute substantially or to the prior art may be embodied in the form of a software product.
  • the computing device includes one or more processors (CPU ), input / output interface, network interface and memory.
  • the computer software product can include instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments of the present application or portions of the embodiments.
  • the computer software product can be stored in a memory, which may include non-persistent memory, random access memory (RAM), and/or nonvolatile memory in a computer readable medium, such as read only memory (ROM) or Flash memory.
  • RAM random access memory
  • ROM read only memory
  • Memory is an example of a computer readable medium.
  • Computer readable media includes both permanent and non-persistent, removable and non-removable media.
  • Information storage can be implemented by any method or technology.
  • Information can be computer Read instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory.
  • PRAM phase change memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • RAM random access memory
  • ROM read only memory
  • EEPROM electrically erasable programmable read only memory
  • flash memory or other memory technology
  • compact disk read only memory CD-ROM
  • DVD digital versatile disk
  • Magnetic tape cartridges magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device.
  • computer readable media does not include transitory computer readable media, such as modulated data signals and carrier waves.
  • This application can be used in a variety of general purpose or special purpose computer system environments or configurations.
  • the application can be described in the general context of computer-executable instructions executed by a computer, such as a program module.
  • program modules include routines, programs, objects, components, data structures, and the like that perform particular tasks or implement particular abstract data types.
  • the present application can also be practiced in distributed computing environments where tasks are performed by remote processing devices that are connected through a communication network.
  • program modules can be located in both local and remote computer storage media including storage devices.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

Disclosed are a method for caching resources and updating cached resources, a client, a server and a system. The method for caching resources comprises: a client sending an off-line resource list to a server; the server receiving the off-line resource list sent by the client, and generating an off-line resource package and a general control file corresponding to the off-line resource package according to the off-line resource list; and the client acquiring the general control file sent by the server within a pre-set time, caching the off-line resources according to the general control file, and storing the general control file. The method for caching resources and updating cached resources, the client, the server and the system disclosed in the application can flexibly cache off-line resources needed by users.

Description

缓存资源、更新缓存资源的方法、客户端、服务器及系统Cache resources, methods for updating cache resources, clients, servers, and systems 技术领域Technical field
本申请涉及计算机信息处理技术领域,特别涉及一种缓存资源、更新缓存资源的方法、客户端、服务器及系统。The present application relates to the field of computer information processing technologies, and in particular, to a cache resource, a method for updating a cache resource, a client, a server, and a system.
背景技术Background technique
随着移动互联网的飞速发展,越来越多的移动应用被开发出来供用户终端使用,而且逐渐成为了互联网用户终端中不可或缺的一部分,在各种场合任意时间都有可能被使用到。With the rapid development of the mobile Internet, more and more mobile applications have been developed for use by user terminals, and have gradually become an indispensable part of Internet user terminals, and can be used at any time in various occasions.
移动互联网最大的特点是“移动”性,用户终端可以在物理位置不固定的情况下使用互联网,可给用户终端提供极大的方便。但是,当前移动网络的覆盖面还不是很广泛,用户终端不可能随时随地的享受移动互联网带来的便利。因此,有些移动应用采用离线缓存技术方案,把己经下载过的资源缓存到本地,使得用户终端在无网络的情况下也能继续使用。如此,可以节约用户终端流量,满足用户终端的个性化的需求。The biggest feature of the mobile Internet is "mobile". The user terminal can use the Internet when the physical location is not fixed, which can provide great convenience to the user terminal. However, the coverage of current mobile networks is not very wide, and it is impossible for user terminals to enjoy the convenience brought by the mobile Internet anytime and anywhere. Therefore, some mobile applications use the offline cache technology scheme to cache the downloaded resources to the local, so that the user terminal can continue to use without the network. In this way, user terminal traffic can be saved and the personalized requirements of the user terminal can be met.
在当前的移动应用中,一般都是用HTML5(Hypertext Markup Languages,超文本标记语言5)的离线缓存功能。HTML5近十年来发展得如火如茶,在HTML5平台上,视频、音频、图像、动画以及同电脑的交互都被标准化,HTML5的功能越来越丰富,最重要的是其具有离线缓存移动Web应用的功能。基于HTML5的离线缓存功能,许多移动应用都是结合HTML5开发出来的,此类移动应用可以称之为移动Web应用,其主要是使用HTML5技术,并能够在文本浏览器中运行,如Javascript(脚本),(CSS(Cascading Style Sheet,级联样式表)等。借助HTML5的离线缓存功能开发出来的移动应用也具有离线缓存功能。在HTML5的离线缓存方案中,移动设备通常是通过Application Cache API(应用缓存接口)提供离线存储功能,指定浏览器缓存特定文件以供离线用户访问。用户采用HTML5离线功能存储离线资源时,通常是访问目标资源并下载目标资源。 In current mobile applications, the offline caching function of HTML5 (Hypertext Markup Languages) is generally used. HTML5 has developed like a tea in the past decade. On the HTML5 platform, video, audio, images, animation, and interaction with computers have been standardized. The functions of HTML5 are becoming more and more abundant. The most important thing is that it has offline cache mobile web. The function of the application. Based on the offline caching function of HTML5, many mobile applications are developed in conjunction with HTML5. Such mobile applications can be called mobile web applications, mainly using HTML5 technology, and can be run in a text browser, such as Javascript (script (CSS (Cascading Style Sheet), etc. Mobile applications developed with HTML5's offline caching feature also have offline caching. In HTML5's offline caching scheme, mobile devices usually use the Application Cache API ( The application cache interface provides offline storage and specifies that the browser caches specific files for offline users. When users use the HTML5 offline function to store offline resources, they usually access the target resources and download the target resources.
在实现本申请过程中,发明人发现现有技术中至少存在如下问题:现有的HTML5离线功能实现的缓存资源的方法通常需要在页面访问一次后将页面及资源离线化,对于未访问过的页面及资源通常无法获取离线化资源,因此现有的缓存资源的方法不能灵活缓存用户需要的离线资源。In the process of implementing the present application, the inventor has found that at least the following problems exist in the prior art: the existing method of caching resources implemented by the HTML5 offline function usually needs to offline the page and resources after the page is accessed once, for the unvisited Pages and resources are usually unable to obtain offline resources, so existing methods of caching resources cannot flexibly cache offline resources that users need.
发明内容Summary of the invention
本申请实施例的目的是提供一种缓存资源、更新缓存资源的方法、客户端、服务器及系统,以实现灵活缓存用户需要的离线资源。The purpose of the embodiment of the present application is to provide a cache resource, a method for updating a cache resource, a client, a server, and a system, so as to implement a flexible cache of offline resources required by the user.
为解决上述技术问题,本申请实施例提供一种缓存资源、更新缓存资源的方法、客户端、服务器及系统。是这样实现的:To solve the above technical problem, the embodiment of the present application provides a method for caching resources, updating cache resources, a client, a server, and a system. This is achieved like this:
一种缓存资源的方法,包括:服务器接收离线化资源列表,根据所述离线化资源列表生成离线资源包及与所述离线资源包对应的总控文件;客户端在预设时间获取所述服务器上的总控文件,根据所述总控文件缓存离线化资源,存储所述总控文件。A method for caching resources includes: a server receiving an offline resource list, and generating an offline resource package and a total control file corresponding to the offline resource package according to the offline resource list; the client acquiring the server at a preset time And the total control file is stored according to the total control file cache offline resource, and the total control file is stored.
一种缓存资源的方法,包括:客户端在预设时间获取服务器上根据所述离线化资源列表生成的总控文件;所述客户端根据所述总控文件缓存离线化资源,存储所述总控文件。A method for caching resources includes: a client acquiring a total control file generated according to the offline resource list on a server at a preset time; the client buffering the offline resource according to the total control file, and storing the total Control file.
一种缓存资源的方法,包括:服务器接收离线化资源列表;所述服务器根据所述离线化资源列表生成离线资源包及与所述离线资源包对应的总控文件。A method for caching resources includes: a server receiving an offline resource list; and the server generating an offline resource package and a total control file corresponding to the offline resource package according to the offline resource list.
一种更新缓存资源的方法,包括:服务器检测总控文件对应的离线资源是否发生变更,若是,根据更新后的离线资源生成新的离线资源包及与所述新的离线资源包对应的新的总控文件;发送所述新的总控文件至客户端;所述客户端接收所述服务器发来的新的总控文件,比较所述新的总控文件与客户端当前存储的总控文件,确定目标离线资源,更新所述目标离线资源。A method for updating a cache resource, comprising: detecting, by a server, whether an offline resource corresponding to the total control file is changed, and if so, generating a new offline resource package according to the updated offline resource and a new one corresponding to the new offline resource package a master control file; sending the new master control file to the client; the client receiving a new master control file sent by the server, comparing the new master control file with a total control file currently stored by the client Determining the target offline resource and updating the target offline resource.
一种更新缓存资源的方法,包括:服务器检测总控文件对应的离线资源是否发生变更,若是,根据更新后的离线资源生成新的离线资源包及与所述新的 离线资源包对应的新的总控文件;所述服务器发送所述新的总控文件至客户端。A method for updating a cache resource, comprising: detecting, by a server, whether an offline resource corresponding to the total control file is changed, and if so, generating a new offline resource package according to the updated offline resource and the new A new master control file corresponding to the offline resource package; the server sends the new master control file to the client.
一种更新缓存资源的方法,包括:客户端接收服务器发来的新的总控文件;所述客户端比较所述新的总控文件与客户端当前存储的总控文件,确定目标离线资源,更新所述目标离线资源;所述目标离线资源用于表示更新的离线资源。A method for updating a cache resource, comprising: receiving, by a client, a new master control file sent by a server; the client comparing the new master control file with a total control file currently stored by the client, and determining a target offline resource, Updating the target offline resource; the target offline resource is used to represent the updated offline resource.
一种缓存资源的服务器,包括:列表接收单元和文件生成单元;其中,所述列表接收单元,用于接收离线化资源列表;所述离线化资源列表用于表示需要缓存的离线资源的信息;所述文件生成单元,用于根据所述离线化资源列表生成离线资源包及与所述离线资源包对应的总控文件。A server for caching resources, comprising: a list receiving unit and a file generating unit; wherein the list receiving unit is configured to receive a offline resource list; and the offline resource list is used to indicate information of an offline resource that needs to be cached; The file generating unit is configured to generate an offline resource package and a total control file corresponding to the offline resource package according to the offline resource list.
一种缓存资源的客户端,包括:文件接收单元和资源缓存单元;其中,所述文件接收单元,用于在预设时间获取所述服务器上根据离线化资源列表生成的总控文件;所述资源缓存单元,用于根据所述总控文件缓存离线化资源,存储所述总控文件。A client for caching resources, comprising: a file receiving unit and a resource buffering unit; wherein the file receiving unit is configured to acquire, at a preset time, a total control file generated on the server according to the offline resource list; And a resource cache unit, configured to cache the offline resource according to the total control file, and store the total control file.
一种缓存资源的系统,包括:缓存资源的服务器和缓存资源的客户端;所述缓存资源的服务器,用于接收离线化资源列表,根据所述离线化资源列表生成离线资源包及与所述离线资源包对应的总控文件;所述缓存资源的客户端,用于在预设时间获取所述缓存资源的服务器上根据所述离线化资源列表生成的总控文件,根据所述总控文件缓存离线化资源,存储所述总控文件。A system for caching resources, comprising: a server for caching resources and a client for caching resources; the server for buffering resources, configured to receive a list of offline resources, generate an offline resource package according to the offline resource list, and a total control file corresponding to the offline resource package; the client for the cache resource, configured to generate, according to the total control file, the total control file generated by the offline resource list on the server that acquires the cache resource at a preset time Cache offline resources to store the master control file.
一种更新缓存资源的服务器,包括:文件更新单元和更新信息发送单元;其中,所述文件更新单元,用于检测总控文件对应的离线资源是否发生变更,若是,根据更新后的离线资源生成新的离线资源包及与所述新的离线资源包对应的新的总控文件;所述更新信息发送单元,用于发送所述新的总控文件至更新缓存资源的客户端。A server for updating a cache resource, comprising: a file update unit and an update information sending unit; wherein the file update unit is configured to detect whether an offline resource corresponding to the total control file is changed, and if so, generate the updated offline resource. a new offline resource package and a new master control file corresponding to the new offline resource package; the update information sending unit, configured to send the new master control file to a client that updates the cache resource.
一种更新缓存资源的客户端,包括:更新信息接收单元和缓存更新单元;其中,所述更新信息接收单元,用于接收更新缓存资源的服务器发来的新的总控文件;所述缓存更新单元,用于比较所述新的总控文件与客户端当前存储的总控文件,确定目标离线资源,更新所述目标离线资源;所述目标离线资源用 于表示更新的离线资源。A client for updating a cache resource, comprising: an update information receiving unit and a cache update unit; wherein the update information receiving unit is configured to receive a new master control file sent by a server that updates the cache resource; a unit, configured to compare the new master control file with a total control file currently stored by the client, determine a target offline resource, and update the target offline resource; Indicates an updated offline resource.
一种更新缓存资源的系统,包括:更新缓存资源的服务器和更新缓存资源的客户端;所述更新缓存资源的服务器,用于检测总控文件对应的离线资源是否发生变更,若是,根据更新后的离线资源生成新的离线资源包及与所述新的离线资源包对应的新的总控文件;发送所述新的总控文件至更新缓存资源的客户端;所述更新缓存资源的客户端,用于接收所述更新缓存资源的服务器发来的新的总控文件;比较所述新的总控文件与客户端当前存储的总控文件,确定目标离线资源,更新所述目标离线资源;所述目标离线资源用于表示更新的离线资源。A system for updating a cache resource, comprising: a server for updating a cache resource and a client for updating a cache resource; wherein the server for updating a cache resource is configured to detect whether an offline resource corresponding to the total control file is changed, and if so, according to the update The offline resource generates a new offline resource package and a new master control file corresponding to the new offline resource package; the new master control file is sent to the client that updates the cache resource; and the client that updates the cache resource And receiving a new master control file sent by the server that updates the cache resource; comparing the new master control file with a total control file currently stored by the client, determining a target offline resource, and updating the target offline resource; The target offline resource is used to represent an updated offline resource.
由以上本申请实施例提供的技术方案可见,本申请实施例提供的缓存资源的方法、客户端、服务器及系统将符合用户需要的缓存资源的列表发送给服务器,服务器生成对应的离线资源包和总控文件,用户在特定的时间可以获取总控文件,并根据总控文件中的信息下载离线资源包并进行离线资源的存储,不需要访问离线资源的页面即可以实现灵活缓存用户需要的离线资源。本申请实施例提供的更新缓存资源的方法、客户端、服务器及系统,当离线资源发生变更时,可以及时检测变更的离线资源生成新的离线资源包及与所述新的离线资源包对应的新的总控文件,客户端通过比较新的总控文件和客户端当前存储的总控文件可以确定更新了的目标离线资源,并对客户端存储的目标离线资源进行更新,可以保证客户端缓存的资源随着在线资源的更新进行更新,可以实现灵活缓存用户需要的离线资源。The method of the cache resource provided by the embodiment of the present application, the client, the server, and the system send a list of cache resources that meet the needs of the user to the server, and the server generates a corresponding offline resource package and The master control file, the user can obtain the total control file at a specific time, and download the offline resource package according to the information in the master control file and store the offline resource, and the page that needs to access the offline resource can realize the flexible offline of the user. Resources. The method, the client, the server, and the system for updating the cache resource provided by the embodiment of the present application may detect the changed offline resource to generate a new offline resource package and correspond to the new offline resource package when the offline resource is changed. The new master control file, the client can determine the updated target offline resource by comparing the new master control file with the total control file currently stored by the client, and update the target offline resource stored by the client to ensure the client cache. The resources are updated with the update of the online resources, and the offline resources required by the user can be flexibly cached.
附图说明DRAWINGS
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。 In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings to be used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description are only It is a few embodiments described in the present application, and other drawings can be obtained from those skilled in the art without any inventive labor.
图1是本申请缓存资源的方法一个实施例的流程图;1 is a flow chart of an embodiment of a method for buffering resources in the present application;
图2是本申请以服务器为主体的缓存资源的方法一个实施例的流程图;2 is a flow chart of an embodiment of a method for server-based cache resources in the present application;
图3是本申请以客户端为主体的缓存资源的方法一个实施例的流程图;3 is a flow chart of an embodiment of a method for a client-side cache resource in the present application;
图4是本申请更新缓存资源的方法一个实施例的流程图;4 is a flow chart of an embodiment of a method for updating a cache resource according to the present application;
图5是本申请以服务器为主体的更新缓存资源的方法一个实施例的流程图;5 is a flowchart of an embodiment of a method for updating a cache resource by using a server as a main body;
图6是本申请以客户端为主体的更新缓存资源的方法一个实施例的流程图;6 is a flowchart of an embodiment of a method for updating a cache resource by using a client as a main body;
图7是本申请缓存资源的系统一个实施例的模块图;7 is a block diagram of an embodiment of a system for caching resources of the present application;
图8是本申请缓存资源的服务器一个实施例的模块图;8 is a block diagram of an embodiment of a server for caching resources of the present application;
图9是本申请缓存资源的客户端一个实施例的模块图;9 is a block diagram of an embodiment of a client for caching resources of the present application;
图10是本申请更新缓存资源的系统一个实施例的模块图;10 is a block diagram of an embodiment of a system for updating a cache resource of the present application;
图11是本申请更新缓存资源的服务器一个实施例的模块图;11 is a block diagram of an embodiment of a server for updating a cache resource of the present application;
图12是本申请更新缓存资源的客户端一个实施例的模块图。12 is a block diagram of one embodiment of a client that updates a cache resource of the present application.
具体实施方式detailed description
本申请实施例提供一种缓存资源、更新缓存资源的方法、客户端、服务器及系统。The embodiment of the present application provides a method for caching resources, updating cache resources, a client, a server, and a system.
为了使本技术领域的人员更好地理解本申请中的技术方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。The technical solutions in the embodiments of the present application are clearly and completely described in the following, in which the technical solutions in the embodiments of the present application are clearly and completely described. The embodiments are only a part of the embodiments of the present application, and not all of them. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope shall fall within the scope of the application.
图1是本申请缓存资源的方法一个实施例的流程图。如图1所示,所述缓存资源的方法可以包括:1 is a flow chart of one embodiment of a method of caching resources in the present application. As shown in FIG. 1, the method for caching resources may include:
S101:服务器接收离线化资源列表,根据所述离线化资源列表生成离线资 源包及与所述离线资源包对应的总控文件。S101: The server receives the offline resource list, and generates offline resources according to the offline resource list. A source package and a master control file corresponding to the offline resource package.
所述服务器可以接收离线化资源列表。The server can receive a list of offline resources.
所述离线化资源列表可以用于表示需要缓存的离线资源的信息。The offline resource list may be used to indicate information of an offline resource that needs to be cached.
所述离线化资源列表可以是客户端发来的。所述离线化资源列表还可以是第三方发来的,或者是服务器接收到的用户输入的离线化资源列表信息。The offline resource list may be sent by the client. The offline resource list may also be sent by a third party, or the offline resource list information input by the server received by the server.
所述离线化资源列表可以包括:离线资源的名称、离线资源的统一资源定位符(简称URL)及离线资源的格式。所述离线资源可以包括超文本标记语言(简称HTML)页面,以及所述HTML页面中加载的层叠样式表(简称css)和/或直译式脚本语言(js)等。The offline resource list may include: a name of the offline resource, a uniform resource locator (referred to as a URL) of the offline resource, and a format of the offline resource. The offline resource may include a hypertext markup language (HTML) page, and a cascading style sheet (referred to as css) and/or a literal translation script language (js) loaded in the HTML page.
所述服务器根据所述离线化资源列表可以生成离线资源包及与所述离线资源包对应的总控文件。所述总控文件可以包括:总控文件的版本信息、离线资源包的版本信息以及所述离线资源包在服务器的存储地址。The server may generate an offline resource package and a total control file corresponding to the offline resource package according to the offline resource list. The master control file may include: version information of the master control file, version information of the offline resource package, and a storage address of the offline resource package at the server.
所述离线资源包可以包括:离线资源和所述离线资源的配置信息;所述离线资源的配置信息可以用于表示所述离线资源的URL以及所述离线资源在所述离线资源包中的地址。The offline resource package may include: an offline resource and configuration information of the offline resource; the configuration information of the offline resource may be used to indicate a URL of the offline resource and an address of the offline resource in the offline resource package .
S102:客户端在预设时间获取所述服务器上的总控文件,根据所述总控文件缓存离线化资源,存储所述总控文件。S102: The client acquires the total control file on the server at a preset time, and caches the offline control resource according to the total control file, and stores the total control file.
客户端可以在预设时间获取所述服务器上的总控文件。具体地,所述客户端可以在预设的时间点获取所述总控文件;例如,实施客户端每天10点和20点的时候分别获取总控文件。所述客户端还可以从起始时间点开始,每间隔预设时间间隔获取所述总控文件;例如,所述客户端可以从每天5点开始,每间隔1小时获取所述总控文件。The client can obtain the master control file on the server at a preset time. Specifically, the client may obtain the total control file at a preset time point; for example, the implementation client obtains the master control file at 10 o'clock and 20 o'clock each time. The client may also acquire the master control file every preset time interval from the start time point; for example, the client may acquire the master control file every hour after starting from 5 o'clock every day.
所述客户端可以根据所述总控文件缓存离线化资源,具体可以包括:根据所述总控文件下载所述总控文件对应的离线资源包,存储所述离线资源包中的离线资源;记录所述离线资源的统一资源定位符与所述客户端中存储所述离线 资源的地址之间的对应关系。The client may cache the offline resource according to the total control file, and may include: downloading an offline resource package corresponding to the total control file according to the total control file, and storing the offline resource in the offline resource package; The uniform resource locator of the offline resource and the offline stored in the client The correspondence between the addresses of resources.
所述客户端可以存储所述总控文件。The client may store the master control file.
当客户端接收到访问某一URL地址的请求时,可以查找所述客户端存储的离线资源的URL中是否包括所述要访问的URL地址,若已经存储,可以根据所述记录的离线资源的统一资源定位符与所述客户端中存储所述离线资源的地址之间对应关系,获取所述要访问的URL地址对应的客户端存储的离线资源。若所述客户端存储的离线资源的URL中没有包括所述要访问的URL地址,所述客户端可以访问网络获取所述URL对应的资源文件。When the client receives the request for accessing a certain URL address, it may find whether the URL of the offline resource stored by the client includes the URL address to be accessed, and if it is already stored, may be based on the recorded offline resource. And a corresponding relationship between the uniform resource locator and the address of the offline resource stored in the client, and the offline resource stored by the client corresponding to the URL address to be accessed is obtained. If the URL of the offline resource stored by the client does not include the URL address to be accessed, the client may access the network to obtain the resource file corresponding to the URL.
图2是本申请以服务器为主体的缓存资源的方法一个实施例的流程图。如图2所示,所述方法可以包括:2 is a flow chart of an embodiment of a method for server-based cache resources in the present application. As shown in FIG. 2, the method may include:
S201:服务器接收离线化资源列表。S201: The server receives the offline resource list.
S202:所述服务器根据所述离线化资源列表生成离线资源包及与所述离线资源包对应的总控文件。所述总控文件可以包括:总控文件的版本信息、离线资源包的版本信息以及所述离线资源包在服务器的存储地址。S202: The server generates an offline resource package and a total control file corresponding to the offline resource package according to the offline resource list. The master control file may include: version information of the master control file, version information of the offline resource package, and a storage address of the offline resource package at the server.
图3是本申请以客户端为主体的缓存资源的方法一个实施例的流程图。如图3所示,所述方法可以包括:3 is a flow chart of an embodiment of a method for client-based cache resources in the present application. As shown in FIG. 3, the method may include:
S301:客户端在预设时间获取所述服务器上根据离线化资源列表生成的总控文件。S301: The client acquires the total control file generated by the offline resource list on the server at a preset time.
S302:所述客户端根据所述总控文件缓存离线化资源,并存储所述总控文件。S302: The client caches the offline resource according to the total control file, and stores the total control file.
上述以客户端或服务器为执行主体的缓存资源的方法实施例的具体实施过程可以参见图1所示的缓存资源的方法实施例。本申请在此不在赘述。For a specific implementation process of the foregoing method for the cache resource of the client or the server, refer to the method embodiment of the cache resource shown in FIG. 1 . This application is not described here.
上述实施例公开的缓存资源的方法,将符合用户需要的缓存资源的列表发送给服务器,服务器生成对应的离线资源包和总控文件,用户在特定的时间可以获取总控文件,并根据总控文件中的信息下载离线资源包并进行离线资源的 存储,不需要访问离线资源的页面即可以实现灵活缓存用户需要的离线资源。The method for caching resources disclosed in the foregoing embodiment sends a list of cache resources that meet the needs of the user to the server, and the server generates a corresponding offline resource package and a total control file, and the user can obtain the total control file at a specific time, and according to the total control The information in the file downloads the offline resource bundle and performs offline resources. Storage, which does not require access to offline resources, can be used to flexibly cache offline resources that users need.
图4是本申请更新缓存资源的方法一个实施例的流程图。如图4所示,所述更新缓存资源的方法可以包括:4 is a flow chart of one embodiment of a method for updating a cache resource in the present application. As shown in FIG. 4, the method for updating a cache resource may include:
S401:服务器检测总控文件对应的离线资源是否发生变更,若是,根据更新后的离线资源生成新的离线资源包及与所述新的离线资源包对应的新的总控文件;发送所述新的总控文件至客户端。S401: The server detects whether the offline resource corresponding to the total control file is changed, and if yes, generates a new offline resource package and a new total control file corresponding to the new offline resource package according to the updated offline resource; and sends the new The master control file to the client.
服务器可以检测当前总控文件对应的离线资源是否发生变更。具体地,所述服务器可以每隔预设时间间隔检测所述总控文件对应的离线资源是否发生变更,或者,所述服务器可以接收所述总控文件对应的离线资源发生变更的推送消息。The server can detect whether the offline resource corresponding to the current master control file has changed. Specifically, the server may detect whether the offline resource corresponding to the total control file is changed at a preset time interval, or the server may receive a push message that the offline resource corresponding to the total control file is changed.
若所述服务器检测到所述总控文件对应的离线资源发生了变更,可以根据更新后的离线资源生成新的离线资源包及与所述新的离线资源包对应的新的总控文件。If the server detects that the offline resource corresponding to the total control file is changed, the new offline resource package and the new total control file corresponding to the new offline resource package may be generated according to the updated offline resource.
所述新的总控文件中可以包括:新的总控文件的版本信息、新的离线资源包的版本信息以及所述新的离线资源包在所述服务器上的存储地址。The new master control file may include: version information of the new master control file, version information of the new offline resource package, and a storage address of the new offline resource package on the server.
所述服务器可以发送所述新的总控文件至客户端。The server may send the new master control file to the client.
S402:所述客户端接收所述服务器发来的新的总控文件,比较所述新的总控文件与客户端当前存储的总控文件,确定目标离线资源,更新所述目标离线资源。S402: The client receives a new master control file sent by the server, compares the new master control file with a total control file currently stored by the client, determines a target offline resource, and updates the target offline resource.
所述客户端可以接收所述服务器发来的新的总控文件,比较所述新的总控文件与客户端当前存储的总控文件,可以确定目标离线资源。所述目标离线资源可以包括:更新的离线资源。所述比较新的总控文件与客户端当前存储的总控文件,确定目标离线资源,具体可以包括:可以比较所述新的总控文件与客户端存储的总控文件中的离线资源包的版本信息,版本信息发生变化的离线资源包对应的离线资源可以为目标离线资源。 The client may receive a new master control file sent by the server, compare the new master control file with a total control file currently stored by the client, and determine a target offline resource. The target offline resource may include: an updated offline resource. And the comparing the new total control file with the total control file currently stored by the client, and determining the target offline resource, which may include: comparing the new total control file with the offline resource package in the total control file stored by the client. The version information and the offline resource corresponding to the offline resource package whose version information changes may be the target offline resource.
所述客户端可以更新所述目标离线资源。具体地,可以下载版本信息发生变化的离线资源包,存储所述新的离线资源包中的离线资源,删除所述客户端中存储的版本信息发生变化的离线资源部;记录所述更新后的离线资源的统一资源定位符与所述客户端中存储所述更新后离线资源的地址之间的对应关系。The client may update the target offline resource. Specifically, an offline resource package in which the version information is changed may be downloaded, an offline resource in the new offline resource package may be stored, and an offline resource portion in which the version information stored in the client is changed may be deleted; and the updated Corresponding relationship between the uniform resource locator of the offline resource and the address of the updated offline resource stored in the client.
图5是本申请以服务器为主体的更新缓存资源的方法一个实施例的流程图。如图5所示,所述方法可以包括:FIG. 5 is a flowchart of an embodiment of a method for updating a cache resource by a server. As shown in FIG. 5, the method may include:
S501:服务器检测总控文件对应的离线资源是否发生变更,若是,根据更新后的离线资源生成新的离线资源包及与所述新的离线资源包对应的新的总控文件。S501: The server detects whether the offline resource corresponding to the total control file is changed. If yes, generates a new offline resource package and a new total control file corresponding to the new offline resource package according to the updated offline resource.
S502:所述服务器发送所述新的总控文件至客户端。S502: The server sends the new master control file to the client.
图6是本申请以客户端为主体的更新缓存资源的方法一个实施例的流程图。如图6所示,所述方法可以包括:6 is a flow chart of an embodiment of a method for updating a cache resource by a client as a main body of the present application. As shown in FIG. 6, the method may include:
S601:客户端接收服务器发来的新的总控文件。S601: The client receives a new master control file sent by the server.
S602:所述客户端比较所述新的总控文件与客户端当前存储的总控文件,确定目标离线资源,更新所述目标离线资源;所述目标离线资源用于表示更新的离线资源。S602: The client compares the new master control file with a total control file currently stored by the client, determines a target offline resource, and updates the target offline resource; and the target offline resource is used to represent the updated offline resource.
上述以客户端或服务器为主题的更新缓存资源的方法实施例的具体实施过程可以参见图4所示的缓存资源的方法实施例。本申请在此不在赘述。For a specific implementation process of the foregoing method for updating a cache resource on a client or a server, refer to the method embodiment of the cache resource shown in FIG. 4 . This application is not described here.
上述实施例公开的更新缓存资源的方法实施例,当离线资源发生变更时,可以及时检测变更的离线资源生成新的离线资源包及与所述新的离线资源包对应的新的总控文件,客户端通过比较新的总控文件和客户端当前存储的总控文件可以确定更新了的目标离线资源,并对客户端存储的目标离线资源进行更新,上述方法可以保证客户端缓存的资源随着在线资源的更新进行更新,可以实现灵活缓存用户需要的离线资源。The method for updating the cache resource disclosed in the foregoing embodiment, when the offline resource is changed, can detect the changed offline resource in time to generate a new offline resource package and a new total control file corresponding to the new offline resource package. The client can determine the updated target offline resource by comparing the new master control file with the total control file currently stored by the client, and update the target offline resource stored by the client. The above method can ensure that the client cached resource Updates of online resources are updated to enable flexible caching of offline resources required by users.
图7是本申请缓存资源的系统一个实施例的模块图。如图7所示,所述缓 存资源的系统可以包括:缓存资源的服务器110和缓存资源的客户端120;7 is a block diagram of one embodiment of a system for caching resources in the present application. As shown in Figure 7, the The system for storing resources may include: a server 110 that caches resources and a client 120 that caches resources;
所述缓存资源的服务器110,可以用于接收离线化资源列表,根据所述离线化资源列表生成离线资源包及与所述离线资源包对应的总控文件。The server 110 of the cache resource may be configured to receive a offline resource list, and generate an offline resource package and a total control file corresponding to the offline resource package according to the offline resource list.
所述缓存资源的客户端120,可以用于在预设时间获取所述缓存资源的服务器110上根据所述离线化资源列表生成的总控文件,根据所述总控文件缓存离线化资源,存储所述总控文件。The client 120 of the cache resource may be configured to cache the offline control resource according to the total control file cache according to the total control file generated by the offline resource list on the server 110 that acquires the cache resource at a preset time. The master control file.
图8是本申请缓存资源的服务器一个实施例的模块图。如图8所示,所述缓存资源的服务器110,可以包括:列表接收单元111和文件生成单元112;其中8 is a block diagram of one embodiment of a server for caching resources of the present application. As shown in FIG. 8, the server 110 for caching resources may include: a list receiving unit 111 and a file generating unit 112;
所述列表接收单元111,可以用于接收离线化资源列表;所述离线化资源列表可以用于表示需要缓存的离线资源的信息。The list receiving unit 111 may be configured to receive a offline resource list, where the offline resource list may be used to indicate information of an offline resource that needs to be cached.
所述文件生成单元112,可以用于根据所述离线化资源列表生成离线资源包及与所述离线资源包对应的总控文件。The file generating unit 112 may be configured to generate an offline resource package and a total control file corresponding to the offline resource package according to the offline resource list.
图9是本申请缓存资源的客户端一个实施例的模块图。如图9所示,所述缓存资源的客户端120可以包括:文件接收单元121和资源缓存单元122;其中9 is a block diagram of one embodiment of a client of a cache resource of the present application. As shown in FIG. 9, the client 120 of the cache resource may include: a file receiving unit 121 and a resource buffer unit 122;
所述文件接收单元121,可以用于在预设时间获取所述缓存资源的服务器110上的根据离线化资源列表生成的总控文件;The file receiving unit 121 may be configured to acquire a total control file generated according to the offline resource list on the server 110 of the cache resource at a preset time;
所述资源缓存单元122,可以用于根据所述总控文件缓存离线化资源,存储所述总控文件。The resource cache unit 122 may be configured to cache the offline resource according to the total control file, and store the total control file.
上述实施例公开的缓存资源的系统、客户端和服务器与本申请缓存资源的方法实施例相对应,可以实现本申请缓存资源的方法,达到本申请缓存资源的方法实施例的技术效果。The system, the client, and the server of the cache resource disclosed in the foregoing embodiment are related to the method embodiment of the cache resource of the present application, and the method for buffering the resource of the present application can be implemented to achieve the technical effect of the method embodiment of the cache resource of the present application.
图10是本申请更新缓存资源的系统一个实施例的模块图。如图10所示,所述更新缓存资源的系统,可以包括:更新缓存资源的服务器210和更新缓存 资源的客户端220;10 is a block diagram of one embodiment of a system for updating cache resources in the present application. As shown in FIG. 10, the system for updating a cache resource may include: a server 210 that updates a cache resource and an update cache. Client 220 of the resource;
所述更新缓存资源的服务器210,可以用于检测总控文件对应的离线资源是否发生变更,若是,根据更新后的离线资源生成新的离线资源包及与所述新的离线资源包对应的新的总控文件;发送所述新的总控文件至更新缓存资源的客户端220;The server 210 for updating the cache resource may be configured to detect whether the offline resource corresponding to the total control file is changed. If yes, generate a new offline resource package according to the updated offline resource and a new one corresponding to the new offline resource package. a master control file; sending the new master control file to the client 220 that updates the cache resource;
所述更新缓存资源的客户端220,可以用于接收所述更新缓存资源的服务器210发来的新的总控文件;比较所述新的总控文件与客户端当前存储的总控文件,确定目标离线资源,更新所述目标离线资源;所述目标离线资源用于表示更新的离线资源。The client 220 for updating the cache resource may be configured to receive the new master control file sent by the server 210 that updates the cache resource; compare the new master control file with the total control file currently stored by the client, and determine Target offline resources, updating the target offline resources; the target offline resources are used to represent updated offline resources.
图11是本申请更新缓存资源的服务器一个实施例的模块图。如图11所示,所述更新缓存资源的服务器210,可以包括:文件更新单元211和更新信息发送单元212;其中,11 is a block diagram of one embodiment of a server for updating cache resources in the present application. As shown in FIG. 11, the server 210 that updates the cache resource may include: a file update unit 211 and an update information sending unit 212;
所述文件更新单元211,可以用于检测总控文件对应的离线资源是否发生变更,若是,根据更新后的离线资源生成新的离线资源包及与所述新的离线资源包对应的新的总控文件;The file update unit 211 may be configured to detect whether an offline resource corresponding to the total control file is changed, and if yes, generate a new offline resource package according to the updated offline resource and a new total corresponding to the new offline resource package. Control file
所述更新信息发送单元212,可以用于发送所述新的总控文件至更新缓存资源的客户端220。The update information sending unit 212 may be configured to send the new master control file to the client 220 that updates the cache resource.
图12是本申请更新缓存资源的客户端一个实施例的模块图。如图12所示,所述更新缓存资源的客户端220,可以包括:更新信息接收单元221和缓存更新单元222;其中,12 is a block diagram of one embodiment of a client that updates a cache resource of the present application. As shown in FIG. 12, the client 220 that updates the cache resource may include: an update information receiving unit 221 and a cache update unit 222;
所述更新信息接收单元221,可以用于接收更新缓存资源的服务器210发来的新的总控文件;The update information receiving unit 221 can be configured to receive a new master control file sent by the server 210 that updates the cache resource;
所述缓存更新单元222,可以用于比较所述新的总控文件与客户端当前存储的总控文件,确定目标离线资源,更新所述目标离线资源;所述目标离线资源用于表示更新的离线资源。The cache update unit 222 may be configured to compare the new master control file with a total control file currently stored by the client, determine a target offline resource, and update the target offline resource; and the target offline resource is used to indicate the updated Offline resources.
上述实施例公开的更新缓存资源的系统、客户端和服务器与本申请更新缓 存资源的方法实施例相对应,可以实现本申请更新缓存资源的方法,达到本申请更新缓存资源的方法实施例的技术效果。The system, the client and the server for updating the cache resource disclosed in the above embodiment are updated with the application. Corresponding to the method embodiment for storing resources, the method for updating the cache resource in the present application can be implemented, and the technical effect of the method for updating the cache resource in the present application is achieved.
在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上的改进(对于方法流程的改进)。然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电路结构的直接改进。设计人员几乎都通过将改进的方法流程编程到硬件电路中来得到相应的硬件电路结构。因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field Programmable Gate Array,FPGA))就是这样一种集成电路,其逻辑功能由用户对器件编程来确定。由设计人员自行编程来把一个数字系统“集成”在一片PLD上,而不需要请芯片制造厂商来设计和制作专用的集成电路芯片2。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(logic compiler)”软件来实现,它与程序开发撰写时所用的软件编译器相类似,而要编译之前的原始代码也得用特定的编程语言来撰写,此称之为硬件描述语言(Hardware Description Language,HDL),而HDL也并非仅有一种,而是有许多种,如ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description Language)等,目前最普遍使用的是VHDL(Very-High-Speed Integrated Circuit Hardware Description Language)与Verilog2。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。In the 1990s, improvements to a technology could clearly distinguish between hardware improvements (eg, improvements to circuit structures such as diodes, transistors, switches, etc.) or software improvements (for process flow improvements). However, as technology advances, many of today's method flow improvements can be seen as direct improvements in hardware circuit architecture. Designers almost always get the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented by hardware entity modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is an integrated circuit whose logic function is determined by the user programming the device. The designer is self-programming to "integrate" a digital system onto a single PLD without requiring the chip manufacturer to design and fabricate a dedicated integrated circuit chip 2 . Moreover, today, instead of manually making integrated circuit chips, this programming is mostly implemented using "logic compiler" software, which is similar to the software compiler used in programming development, but before compiling The original code has to be written in a specific programming language. This is called the Hardware Description Language (HDL). HDL is not the only one, but there are many kinds, such as ABEL (Advanced Boolean Expression Language). AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc., are currently the most commonly used VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog2. It should also be apparent to those skilled in the art that the hardware flow for implementing the logic method flow can be easily obtained by simply programming the method flow into the integrated circuit with a few hardware description languages.
控制器可以按任何适当的方式实现,例如,控制器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件 或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式,控制器的例子包括但不限于以下微控制器:ARC 625D、Atmel AT91SAM、Microchip PIC18F26K20以及Silicone Labs C8051F320,存储器控制器还可以被实现为存储器的控制逻辑的一部分。The controller can be implemented in any suitable manner, for example, the controller can take, for example, a microprocessor or processor and store computer readable program code (eg, software executable by the (micro)processor) Or firmware) in the form of a computer readable medium, a logic gate, a switch, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of the controller include, but are not limited to, the following micro control The ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller can also be implemented as part of the memory's control logic.
本领域技术人员也知道,除了以纯计算机可读程序代码方式实现控制器以外,完全可以通过将方法步骤进行逻辑编程来使得控制器以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等的形式来实现相同功能。因此这种控制器可以被认为是一种硬件部件,而对其内包括的用于实现各种功能的装置也可以视为硬件部件内的结构。或者甚至,可以将用于实现各种功能的装置视为既可以是实现方法的软件模块又可以是硬件部件内的结构。Those skilled in the art will also appreciate that in addition to implementing the controller in purely computer readable program code, the controller can be logically programmed by means of logic gates, switches, ASICs, programmable logic controllers, and embedding. The form of a microcontroller or the like to achieve the same function. Such a controller can therefore be considered a hardware component, and the means for implementing various functions included therein can also be considered as a structure within the hardware component. Or even a device for implementing various functions can be considered as a software module that can be both a method of implementation and a structure within a hardware component.
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。The system, device, module or unit illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product having a certain function.
为了描述的方便,描述以上装置时以功能分为各种单元分别描述。当然,在实施本申请时可以把各单元的功能在同一个或多个软件和/或硬件中实现。For the convenience of description, the above devices are described separately by function into various units. Of course, the functions of each unit may be implemented in the same software or software and/or hardware when implementing the present application.
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本申请可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。该计算机软件产品可以包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例或者实施例的某些部分所述的方法。该计算机软件产品可以存储在内存中,内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可 读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括短暂电脑可读媒体(transitory media),如调制的数据信号和载波。It will be apparent to those skilled in the art from the above description of the embodiments that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such understanding, portions of the technical solution of the present application that contribute substantially or to the prior art may be embodied in the form of a software product. In a typical configuration, the computing device includes one or more processors (CPU ), input / output interface, network interface and memory. The computer software product can include instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments of the present application or portions of the embodiments. The computer software product can be stored in a memory, which may include non-persistent memory, random access memory (RAM), and/or nonvolatile memory in a computer readable medium, such as read only memory (ROM) or Flash memory. Memory is an example of a computer readable medium. Computer readable media includes both permanent and non-persistent, removable and non-removable media. Information storage can be implemented by any method or technology. Information can be computer Read instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory. (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include transitory computer readable media, such as modulated data signals and carrier waves.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。The various embodiments in the specification are described in a progressive manner, and the same or similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
本申请可用于众多通用或专用的计算机系统环境或配置中。例如:个人计算机、服务器计算机、手持设备或便携式设备、平板型设备、多处理器系统、基于微处理器的系统、置顶盒、可编程的消费电子设备、网络PC、小型计算机、大型计算机、包括以上任何系统或设备的分布式计算环境等等。This application can be used in a variety of general purpose or special purpose computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor based systems, set-top boxes, programmable consumer electronics devices, network PCs, small computers, mainframe computers, including A distributed computing environment of any of the above systems or devices, and the like.
本申请可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本申请,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。The application can be described in the general context of computer-executable instructions executed by a computer, such as a program module. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform particular tasks or implement particular abstract data types. The present application can also be practiced in distributed computing environments where tasks are performed by remote processing devices that are connected through a communication network. In a distributed computing environment, program modules can be located in both local and remote computer storage media including storage devices.
虽然通过实施例描绘了本申请,本领域普通技术人员知道,本申请有许多变形和变化而不脱离本申请的精神,希望所附的权利要求包括这些变形和变化而不脱离本申请的精神。 While the present invention has been described by the embodiments of the present invention, it will be understood by those skilled in the art

Claims (20)

  1. 一种缓存资源的方法,其特征在于,包括:A method for caching resources, comprising:
    服务器接收离线化资源列表,根据所述离线化资源列表生成离线资源包及与所述离线资源包对应的总控文件;The server receives the offline resource list, and generates an offline resource package and a total control file corresponding to the offline resource package according to the offline resource list;
    客户端在预设时间获取所述服务器上的总控文件,根据所述总控文件缓存离线化资源,存储所述总控文件。The client acquires the total control file on the server at a preset time, and caches the offline resource according to the total control file, and stores the total control file.
  2. 一种缓存资源的方法,其特征在于,包括:A method for caching resources, comprising:
    客户端在预设时间获取服务器上根据所述离线化资源列表生成的总控文件;The client acquires the total control file generated by the offline resource list on the server at a preset time;
    所述客户端根据所述总控文件缓存离线化资源,存储所述总控文件。The client caches the offline resource according to the total control file, and stores the total control file.
  3. 如权利要求2所述的一种缓存资源的方法,其特征在于,所述离线化资源列表用于表示需要缓存的离线资源;所述离线化资源列表包括:离线资源的名称、离线资源的统一资源定位符及离线资源的格式。The method for buffering resources according to claim 2, wherein the offline resource list is used to represent an offline resource that needs to be cached; and the offline resource list includes: a name of an offline resource, and a unified resource of an offline resource. The format of resource locators and offline resources.
  4. 如权利要求3所述的一种缓存资源的方法,其特征在于,所述总控文件包括:总控文件的版本信息、离线资源包的版本信息以及所述离线资源包在服务器的存储地址。The method for buffering resources according to claim 3, wherein the master control file comprises: version information of the master control file, version information of the offline resource package, and a storage address of the offline resource package at the server.
  5. 如权利要求4所述的一种缓存资源的方法,其特征在于,所述离线资源包包括:离线资源和所述离线资源的配置信息;所述离线资源的配置信息用于表示所述离线资源的统一资源定位符以及所述离线资源在所述离线资源包中的地址。The method for caching resources according to claim 4, wherein the offline resource package comprises: an offline resource and configuration information of the offline resource; and the configuration information of the offline resource is used to represent the offline resource And a uniform resource locator and an address of the offline resource in the offline resource package.
  6. 如权利要求5所述的一种缓存资源的方法,其特征在于,所述根据所述总控文件缓存离线化资源,包括: The method of buffering resources according to claim 5, wherein the buffering the offline resources according to the total control file comprises:
    根据所述总控文件下载所述总控文件对应的离线资源包,存储所述离线资源包中的离线资源;And downloading an offline resource package corresponding to the total control file according to the total control file, and storing an offline resource in the offline resource package;
    记录所述离线资源的统一资源定位符与所述客户端中存储所述离线资源的地址之间的对应关系。Recording a correspondence between a uniform resource locator of the offline resource and an address of the offline resource stored in the client.
  7. 一种缓存资源的方法,其特征在于,包括:A method for caching resources, comprising:
    服务器接收离线化资源列表;The server receives the offline resource list;
    所述服务器根据所述离线化资源列表生成离线资源包及与所述离线资源包对应的总控文件。The server generates an offline resource package and a total control file corresponding to the offline resource package according to the offline resource list.
  8. 如权利要求7所述的一种缓存资源的方法,其特征在于,所述离线资源包包括:离线资源和所述离线资源的配置信息;所述离线资源的配置信息用于表示所述离线资源的统一资源定位符以及所述离线资源在所述离线资源包中的地址。The method for caching resources according to claim 7, wherein the offline resource package comprises: an offline resource and configuration information of the offline resource; and the configuration information of the offline resource is used to represent the offline resource And a uniform resource locator and an address of the offline resource in the offline resource package.
  9. 如权利要求7所述的一种缓存资源的方法,其特征在于,所述总控文件包括:总控文件的版本信息、离线资源包的版本信息以及所述离线资源包在服务器的存储地址。The method for buffering resources according to claim 7, wherein the total control file comprises: version information of the total control file, version information of the offline resource package, and a storage address of the offline resource package at the server.
  10. 一种更新缓存资源的方法,其特征在于,包括:A method for updating a cache resource, comprising:
    服务器检测总控文件对应的离线资源是否发生变更,若是,根据更新后的离线资源生成新的离线资源包及与所述新的离线资源包对应的新的总控文件;发送所述新的总控文件至客户端;The server detects whether the offline resource corresponding to the total control file is changed, and if so, generates a new offline resource package and a new total control file corresponding to the new offline resource package according to the updated offline resource; and sends the new total Control files to the client;
    所述客户端接收所述服务器发来的新的总控文件,比较所述新的总控文件与客户端当前存储的总控文件,确定目标离线资源,更新所述目标离线资源。The client receives a new master control file sent by the server, compares the new master control file with a total control file currently stored by the client, determines a target offline resource, and updates the target offline resource.
  11. 一种更新缓存资源的方法,其特征在于,包括: A method for updating a cache resource, comprising:
    服务器检测总控文件对应的离线资源是否发生变更,若是,根据更新后的离线资源生成新的离线资源包及与所述新的离线资源包对应的新的总控文件;The server detects whether the offline resource corresponding to the total control file is changed, and if so, generates a new offline resource package and a new total control file corresponding to the new offline resource package according to the updated offline resource;
    所述服务器发送所述新的总控文件至客户端。The server sends the new master control file to the client.
  12. 一种更新缓存资源的方法,其特征在于,包括:A method for updating a cache resource, comprising:
    客户端接收服务器发来的新的总控文件;The client receives a new master control file sent by the server;
    所述客户端比较所述新的总控文件与客户端当前存储的总控文件,确定目标离线资源,更新所述目标离线资源;所述目标离线资源用于表示更新的离线资源。The client compares the new master control file with the master control file currently stored by the client, determines a target offline resource, and updates the target offline resource; the target offline resource is used to represent the updated offline resource.
  13. 如权利要求12所述的一种更新缓存资源的方法,其特征在于,所述总控文件包括:总控文件的版本信息、离线资源包的版本信息以及所述离线资源包在所述服务器上的存储地址。The method for updating a cache resource according to claim 12, wherein the total control file comprises: version information of the master control file, version information of the offline resource package, and the offline resource package on the server Storage address.
  14. 如权利要求13所述的一种更新缓存资源的方法,其特征在于,所述客户端比较所述新的总控文件与客户端当前存储的总控文件,确定目标离线资源,包括:比较所述新的总控文件与客户端当前存储的总控文件中的离线资源包的版本信息,版本信息发生变化的离线资源包对应的离线资源为目标离线资源。The method for updating a cache resource according to claim 13, wherein the client compares the new master control file with a total control file currently stored by the client, and determines a target offline resource, including: The new total control file is related to the version information of the offline resource package in the total control file currently stored by the client, and the offline resource corresponding to the offline resource package whose version information is changed is the target offline resource.
  15. 一种缓存资源的服务器,其特征在于,包括:列表接收单元和文件生成单元;其中A server for caching resources, comprising: a list receiving unit and a file generating unit; wherein
    所述列表接收单元,用于接收离线化资源列表;所述离线化资源列表用于表示需要缓存的离线资源的信息;The list receiving unit is configured to receive a offline resource list, where the offline resource list is used to indicate information of an offline resource that needs to be cached;
    所述文件生成单元,用于根据所述离线化资源列表生成离线资源包及与所述离线资源包对应的总控文件。The file generating unit is configured to generate an offline resource package and a total control file corresponding to the offline resource package according to the offline resource list.
  16. 一种缓存资源的客户端,其特征在于,包括:文件接收单元和资源缓 存单元;其中,A client for caching resources, comprising: a file receiving unit and a resource slowing Storage unit; among them,
    所述文件接收单元,用于在预设时间获取所述服务器上根据离线化资源列表生成的总控文件;The file receiving unit is configured to acquire, at a preset time, an overall control file generated on the server according to the offline resource list;
    所述资源缓存单元,用于根据所述总控文件缓存离线化资源,存储所述总控文件。The resource cache unit is configured to cache the offline resource according to the total control file, and store the total control file.
  17. 一种缓存资源的系统,其特征在于,包括:缓存资源的服务器和缓存资源的客户端;A system for caching resources, comprising: a server for caching resources and a client for caching resources;
    所述缓存资源的服务器,用于接收离线化资源列表,根据所述离线化资源列表生成离线资源包及与所述离线资源包对应的总控文件;The server for the cache resource is configured to receive the offline resource list, and generate an offline resource package and a total control file corresponding to the offline resource package according to the offline resource list;
    所述缓存资源的客户端,用于在预设时间获取所述缓存资源的服务器上根据所述离线化资源列表生成的总控文件,根据所述总控文件缓存离线化资源,存储所述总控文件。The client of the cache resource is configured to: according to the total control file generated by the offline resource list on the server that obtains the cache resource at a preset time, cache the offline resource according to the total control file, and store the total Control file.
  18. 一种更新缓存资源的服务器,其特征在于,包括:文件更新单元和更新信息发送单元;其中,A server for updating a cache resource, comprising: a file update unit and an update information sending unit; wherein
    所述文件更新单元,用于检测总控文件对应的离线资源是否发生变更,若是,根据更新后的离线资源生成新的离线资源包及与所述新的离线资源包对应的新的总控文件;The file update unit is configured to detect whether an offline resource corresponding to the master control file is changed, and if yes, generate a new offline resource package according to the updated offline resource and a new master control file corresponding to the new offline resource package. ;
    所述更新信息发送单元,用于发送所述新的总控文件至更新缓存资源的客户端。The update information sending unit is configured to send the new master control file to a client that updates the cache resource.
  19. 一种更新缓存资源的客户端,其特征在于,包括:更新信息接收单元和缓存更新单元;其中,A client for updating a cache resource, comprising: an update information receiving unit and a cache update unit; wherein
    所述更新信息接收单元,用于接收更新缓存资源的服务器发来的新的总控文件;The update information receiving unit is configured to receive a new master control file sent by a server that updates the cache resource;
    所述缓存更新单元,用于比较所述新的总控文件与客户端当前存储的总控 文件,确定目标离线资源,更新所述目标离线资源;所述目标离线资源用于表示更新的离线资源。The cache update unit is configured to compare the new master control file with the total control currently stored by the client a file, determining a target offline resource, and updating the target offline resource; the target offline resource is used to represent the updated offline resource.
  20. 一种更新缓存资源的系统,其特征在于,包括:更新缓存资源的服务器和更新缓存资源的客户端;A system for updating a cache resource, comprising: a server for updating a cache resource and a client for updating a cache resource;
    所述更新缓存资源的服务器,用于检测总控文件对应的离线资源是否发生变更,若是,根据更新后的离线资源生成新的离线资源包及与所述新的离线资源包对应的新的总控文件;发送所述新的总控文件至更新缓存资源的客户端;所述更新缓存资源的客户端,用于接收所述更新缓存资源的服务器发来的新的总控文件;比较所述新的总控文件与客户端当前存储的总控文件,确定目标离线资源,更新所述目标离线资源;所述目标离线资源用于表示更新的离线资源。 The server that updates the cache resource is configured to detect whether the offline resource corresponding to the total control file is changed, and if yes, generate a new offline resource package according to the updated offline resource and a new total corresponding to the new offline resource package. Controlling a file; sending the new master control file to a client that updates the cache resource; the client that updates the cache resource is configured to receive a new master control file sent by the server that updates the cache resource; The new master control file and the master control file currently stored by the client determine the target offline resource and update the target offline resource; the target offline resource is used to represent the updated offline resource.
PCT/CN2016/086871 2015-07-03 2016-06-23 Method for caching resources and updating cached resources, client, server and system WO2017005095A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510388068.6A CN106331049A (en) 2015-07-03 2015-07-03 Resource caching method, cache resource updating method, client, server and system
CN201510388068.6 2015-07-03

Publications (1)

Publication Number Publication Date
WO2017005095A1 true WO2017005095A1 (en) 2017-01-12

Family

ID=57684711

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/086871 WO2017005095A1 (en) 2015-07-03 2016-06-23 Method for caching resources and updating cached resources, client, server and system

Country Status (2)

Country Link
CN (1) CN106331049A (en)
WO (1) WO2017005095A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112637262A (en) * 2020-11-18 2021-04-09 网宿科技股份有限公司 Content pushing method and device
CN113873013A (en) * 2018-12-25 2021-12-31 创新先进技术有限公司 Offline packet reassembly method and system

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110069729B (en) * 2017-11-15 2022-07-01 上海优扬新媒信息技术有限公司 Offline caching method and system for application
CN110716825B (en) * 2018-07-12 2023-04-28 阿里巴巴集团控股有限公司 Data disaster recovery processing method, device and system
CN110362770A (en) * 2019-07-17 2019-10-22 吉旗(成都)科技有限公司 A method of solving mobile terminal web data offline cache
CN110569456B (en) * 2019-07-26 2022-03-08 广州视源电子科技股份有限公司 WEB end data offline caching method and device and electronic equipment
CN110826000A (en) * 2019-09-20 2020-02-21 北京城市网邻信息技术有限公司 WEB application offline resource management method and device, electronic equipment and storage medium
CN114363001A (en) * 2021-12-06 2022-04-15 国网安徽省电力有限公司超高压分公司 Method, system and storage medium for client access limitation based on offline configuration

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1356644A (en) * 2000-11-30 2002-07-03 国际商业机器公司 Method for providing resource from network server to client computer
CN102427471A (en) * 2011-11-24 2012-04-25 中兴通讯股份有限公司 Method and client for offline running Widget
CN103324517A (en) * 2012-03-20 2013-09-25 华为终端有限公司 Off-line application generation and call method, terminal and system
CN103873502A (en) * 2012-12-11 2014-06-18 阿里巴巴集团控股有限公司 Cache updating method and system, and update resource providing method and system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7260600B1 (en) * 2000-11-17 2007-08-21 International Business Machines Corporation User specified parallel data fetching for optimized web access
US7543041B2 (en) * 2003-11-12 2009-06-02 International Business Machines Corporation Pattern based web services using caching
US7814234B2 (en) * 2006-10-30 2010-10-12 Microsoft Corporation Offline execution of web based applications
CN103731396B (en) * 2012-10-10 2018-03-23 中国移动通信集团江西有限公司 Resource access method, system and cache resources information push-delivery apparatus
CN104735041B (en) * 2013-12-24 2018-12-14 华为终端(东莞)有限公司 Offline resources acquisition methods and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1356644A (en) * 2000-11-30 2002-07-03 国际商业机器公司 Method for providing resource from network server to client computer
CN102427471A (en) * 2011-11-24 2012-04-25 中兴通讯股份有限公司 Method and client for offline running Widget
CN103324517A (en) * 2012-03-20 2013-09-25 华为终端有限公司 Off-line application generation and call method, terminal and system
CN103873502A (en) * 2012-12-11 2014-06-18 阿里巴巴集团控股有限公司 Cache updating method and system, and update resource providing method and system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113873013A (en) * 2018-12-25 2021-12-31 创新先进技术有限公司 Offline packet reassembly method and system
CN113873013B (en) * 2018-12-25 2023-06-16 创新先进技术有限公司 Offline package reorganization method and system
CN112637262A (en) * 2020-11-18 2021-04-09 网宿科技股份有限公司 Content pushing method and device
CN112637262B (en) * 2020-11-18 2022-12-02 网宿科技股份有限公司 Content refreshing method and device

Also Published As

Publication number Publication date
CN106331049A (en) 2017-01-11

Similar Documents

Publication Publication Date Title
WO2017005095A1 (en) Method for caching resources and updating cached resources, client, server and system
US12003562B2 (en) System and method for streaming content from multiple servers
US9699625B2 (en) Push notification middleware
US7805670B2 (en) Partial rendering of web pages
CN111581563B (en) Page response method and device, storage medium and electronic equipment
CN107451181B (en) Page rendering method and device
US9069720B2 (en) Partial object caching
JP6898452B2 (en) Data acquisition method and device
US11356533B2 (en) Facilitation of efficient web site page loading
US20130091197A1 (en) Mobile device as a local server
US11416538B1 (en) System and method for sharing trimmed versions of digital media items
WO2016110202A1 (en) Method, client and device for displaying page
TW201443670A (en) Virtual library providing content accessibility irrespective of content format and type
TWI677251B (en) Method and system for transmitting files based on network speed
US9088461B2 (en) Common web accessible data store for client side page processing
KR102632387B1 (en) Session-based information for dynamic adaptive streaming over HTTP
US20150193117A1 (en) Changing Icons for a Web Page
US20140281884A1 (en) Mobilizing a web application to take advantage of a native device capability
US10419798B2 (en) Method and apparatus for just-in-time transcoding
US9298681B2 (en) Dynamic webpage change animation
CA2803951C (en) Method and apparatus for a paged update protocol
US10101801B2 (en) Method and apparatus for prefetching content in a data stream
US9253279B2 (en) Preemptive caching of data
US9754327B2 (en) Method and apparatus for configuring social networking site sharing functions
US9369467B1 (en) System, method, and computer program for providing generic access to web content on a mobile device

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: 16820746

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16820746

Country of ref document: EP

Kind code of ref document: A1