WO2013075465A1 - 一种离线运行微件的方法及客户端 - Google Patents

一种离线运行微件的方法及客户端 Download PDF

Info

Publication number
WO2013075465A1
WO2013075465A1 PCT/CN2012/075049 CN2012075049W WO2013075465A1 WO 2013075465 A1 WO2013075465 A1 WO 2013075465A1 CN 2012075049 W CN2012075049 W CN 2012075049W WO 2013075465 A1 WO2013075465 A1 WO 2013075465A1
Authority
WO
WIPO (PCT)
Prior art keywords
module
widget
network data
network
resource
Prior art date
Application number
PCT/CN2012/075049
Other languages
English (en)
French (fr)
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 WO2013075465A1 publication Critical patent/WO2013075465A1/zh

Links

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/59Providing operational support to end devices by off-loading in the network or by emulation, e.g. when they are unavailable

Definitions

  • the present invention relates to the field of Internet applications, and in particular, to a method and a client for offline operation of a Widget. Background technique
  • Widgets are an internet application. Widgets are dynamic content that is added to web pages, such as stocks, weather, games, etc., depending on the network data. Widgets can provide users with a convenient Internet access experience. Users only need to click on any Widget application in the device desktop or application menu of the Widget client to obtain network data; for example: in the mobile phone where the Widget client is installed. , click on "Weather Conditions" to get weather conditions by visiting the Internet.
  • Widgets that rely on network data are affected by the state of the network. When the network status is good, it can run smoothly and conveniently. When the network status is not good, such as: when the network signal is poor or there is no network signal, the Widget will not work properly. Display, or even can not be used normally, you need to wait for the network data to download before you can run. For example: You need the image that the Widget depends on or the object- and event-driven and relatively secure client-side scripting language (Javascript) file download to complete.
  • Javascript object- and event-driven and relatively secure client-side scripting language
  • an object of the present invention is to provide a method and a client for running a Widget offline. End, solve the problem that when the network status is not good, because the Widget cannot load important network data in time, and cannot display or even use normally, the convenience of the Widget is guaranteed.
  • the present invention provides a method for running a Widget offline, the method comprising:
  • the network data is obtained from itself.
  • the method before the saving the network data, the method further includes: querying whether the URI address is in the resource cache list, and if yes, saving the network data; otherwise, using the acquired network data to run the widget.
  • the method before the confirming that the network data required by the Widget is stored, the method further includes: querying whether the URI address is in the resource cache list, and if not, connecting to the network to obtain network data; if yes, viewing the self Whether the local file corresponding to the URI address exists, and if so, the network data required by the Widget is obtained from itself; if not, the network is connected to obtain the network data.
  • the resource cache list is: parsing a configuration file of a preset resource cache list, and generating a resource cache list.
  • the network status is: Real-time detection Whether the network data needs to be acquired during the running of the Widget, if necessary, detecting the current network status; if not, continuing to detect whether the network data needs to be acquired during the running of the Widget.
  • the present invention also provides a client running the Widget offline, the client includes: a Widget running module, a cache URI query module, a sub-resource cache module, a sub-resource download module, and a cache list parsing module;
  • the Widget running module when the network state is good, after obtaining the network data required by the Widget from the sub-resource downloading module, receiving the query result of the URI address corresponding to the network data in the confirmation resource cache list sent by the cache URI query module Sending the network data to the sub-resource cache module; when the network status is not good, after receiving the query result of the URI address corresponding to the network data in the confirmation resource cache list sent by the cache URI query module, the slave resource cache module Obtain network data;
  • a cache URI query module configured to: return, to the Widget running module, a query result that includes a corresponding URI address in a resource cache list of the cache list parsing module;
  • a sub-resource caching module configured to receive and save network data sent by the Widget running module, and provide network data for the Widget running module;
  • the cache list parsing module is configured to provide a cache cache list for the cache URI query module, and a sub-resource download module, configured to provide the Widget running module with network data required by the Widget.
  • the Widget running module is specifically configured to receive a query result of whether the URI address returned by the cache URI query module is in the resource cache list, and if the query result is yes, send the network data to the sub-resource cache module, otherwise , using the acquired network data to run
  • the cache URI query module is specifically configured to send, by the Widget running module, a query result of whether the URI address is in the resource cache list;
  • the sub-resource caching module is specifically configured to receive and save network data sent by the Widget running module.
  • the Widget running module is specifically configured to receive a query result of whether the URI address returned by the cache URI query module is in the resource cache list, and if the query result is not, notify the sub-resource download module to connect to the network, if the query result If yes, the local resource file corresponding to the URI address is stored in the sub-resource cache module. If yes, the network data required by the Widget is obtained from the sub-resource cache module. If not, the sub-resource download module is connected to the network.
  • the sub-resource downloading module is specifically configured to receive a notification of a connection network sent by the Widget running module, and obtain network data from the network;
  • the sub-resource caching module is specifically configured to provide the stored network data for the Widget running module.
  • the cache list parsing module is further configured to parse a configuration file of the resource cache list, and generate a resource cache list.
  • the client further includes: a network policy query module, configured to: after receiving the notification sent by the Widget running module to detect the current network status, start detecting the network status; correspondingly, the Widget running module is further It is used to detect whether the network data needs to be obtained during the running of any Widget in real time. If necessary, notify the network policy query module to detect the current network status. If not, repeatedly detect whether any Widget needs to obtain network data during the running process. .
  • a network policy query module configured to: after receiving the notification sent by the Widget running module to detect the current network status, start detecting the network status; correspondingly, the Widget running module is further It is used to detect whether the network data needs to be obtained during the running of any Widget in real time. If necessary, notify the network policy query module to detect the current network status. If not, repeatedly detect whether any Widget needs to obtain network data during the running process. .
  • the method and client for running the Widget offline provided by the present invention have the following advantages and features: determining the network data to be cached according to the URI address in the resource cache list, and if the network status is not good, if the Widget is If the URI address of the required network data is in the resource cache list, the network data can be directly extracted from the client's own cache, thereby solving the problem that the Widget cannot load the important network data in time, and cannot be displayed normally or even used normally. The problem, in turn, guarantees the convenience of the Widget. DRAWINGS
  • FIG. 1 is a schematic flowchart of a method for running a Widget offline according to the present invention
  • FIG. 2 is a schematic structural diagram of a client of an offline running Widget of the present invention. detailed description
  • the basic idea of the invention is: to obtain the network data required by the Widget when the network state is good After confirming that the resource cache list contains the URI address corresponding to the network data, the network data is saved; when the network status is not good, the network data required by the Widget is confirmed according to the resource cache list, and the network data is obtained from itself. .
  • the resource cache list is: a list of URI addresses corresponding to the network data to be saved;
  • the network status is good and the network status is not good, and the network signal strength can be used for judging.
  • the specific determination method is prior art, and is not mentioned here.
  • the method for running the Widget offline in the present invention is as shown in FIG. 1, and includes the following steps:
  • Step 101 Real-time detection of any Widget running process, determining whether network data needs to be acquired, if necessary, performing step 102; if not, repeating step 101.
  • whether the network data needs to be acquired is determined according to whether the data acquisition information containing the URI is issued according to the Widget runtime, and specifically: if the data acquisition information including the URI is sent, the network data needs to be acquired; if the URI is not issued Data acquisition information, in order to not need to obtain network data;
  • the URI-containing data obtaining information may include a URI address and a Widget identifier, and the generating method is a prior art, and is not mentioned here.
  • Step 102 Detect the current network status. If the network status is not good, go to step 106. If the network status is good, go to step 103.
  • the detecting the current network state may be determined by using the network signal strength, and the specific determining method is prior art, and is not mentioned here.
  • Step 103 Connect to the network to obtain network data.
  • the obtaining the network data is implemented by using the prior art, and the method may include: the client acquiring the corresponding network data from the network according to the URI address in the data acquisition information containing the URI; wherein the connection network is: the current network state When it is not good, the client tries to connect in real time. The network obtains network data until the network data is completely received, and stops connecting to the network. When the current network status is good, the client directly obtains corresponding network data from the network according to the URI address.
  • Step 104 Query whether the URI address is in the resource cache list. If yes, execute step 105; otherwise, directly use the acquired network data to run the widget, and end the processing flow.
  • the client directly uses the acquired network data to run the Widget.
  • the client directly uses the network data to complete the subsequent operation of issuing the Widget-containing data obtaining information, and does not exist in the resource cache list.
  • the URI address the client does not need to save the acquired network data.
  • Step 105 Save the network data, run the widget using the obtained network data, and end the processing flow.
  • the step is specifically: the client queries whether it has the network data corresponding to the URI address, and if not, creates a corresponding local file for the network data, saves the network data in the local file, and then the client uses the obtained data.
  • the network data runs the Widget; if yes, the original network data is updated to the newly received network data, and then the client runs the Widget using the acquired network data;
  • the local file may be named: a Widget identifier and a URI address.
  • Step 106 Query whether the URI address is in the resource cache list, if not, execute step 103; if yes, execute step 107.
  • Step 107 Check whether the local file corresponding to the URI address exists, and if so, obtain the network data required by the Widget from itself, and end the processing flow; if not, execute step 103.
  • the viewing may be: querying whether the name of the local file includes the URI address, and if so, storing the local file corresponding to the URI address; if not, the local file corresponding to the URI address is not saved by itself. ;
  • the network data required to obtain the Widget from itself is: according to the identifier and URI address of the Widget, find the file name with the same identifier and URI address of the Widget in the local file saved by the client itself, and then extract the local file to save.
  • the network data the client uses the network data to complete the subsequent operations of the Widget according to the prior art.
  • Step a Pre-configure the configuration file of the resource cache list in the client.
  • the preset may be: when the developer of the Widget publishes any Widget, preset the configuration file of the resource cache list in the configuration file of the Widget installation package, and write the URI address to be cached in the configuration file;
  • the client developer presets the configuration file of the resource cache list in the client, and writes the URI address to be cached in the configuration file;
  • the format can be written in XML format, as follows:
  • ⁇ /cache-manifest> indicates the content to be cached
  • ⁇ uri>http://test/policy.xml ⁇ /uri> indicates that the URI address is http: ⁇ test/policy.xml
  • ⁇ uri>http: ⁇ test /logo.jpg ⁇ /uri> indicates that the URI address is http: ⁇ test/logo.jpg.
  • Step b The client parses the configuration file of the resource cache list to generate a resource cache list.
  • Step b may be: when the configuration file of the preset resource cache list is in the configuration file of the Widget installation package, when the client runs the Widget installation package, according to the preset resource cache list Set the file to generate a list of resource caches;
  • Step b may also be:
  • the client developer presets the configuration file of the resource cache list in the client
  • the client runs for the first time, the client generates a resource cache list according to the configuration file of the preset resource cache list.
  • the present invention also provides a client running the Widget offline.
  • the client includes: a Widget running module 21, a cache URI query module 22, a sub-resource caching module 23, a cache list parsing module 24, and sub-resource downloading. Module 25; wherein
  • the Widget running module 21 is configured to: after obtaining the network data required by the Widget from the sub-resource downloading module 25, the acknowledgment resource cache list sent by the cache URI query module 22 includes the URI address corresponding to the network data.
  • the network data is sent to the sub-resource cache module 23; when the network status is not good, after receiving the query result of the URI address corresponding to the network data in the acknowledgment resource cache list sent by the cache URI query module 22, Obtaining network data from the sub-resource caching module 23;
  • the cache URI query module 22 is configured to return a confirmation cache list for the Widget running module 21.
  • the resource cache list of the parsing module 24 includes a query result corresponding to the URI address;
  • the sub-resource caching module 23 is configured to receive and save network data sent by the Widget running module 21, and provide network data for the Widget running module 21;
  • the cache list parsing module 24 is configured to provide a cache cache list for the cache URI query module 22;
  • the sub-resource downloading module 25 is configured to provide the Widget running module 21 with network data required by the Widget.
  • the client further includes: a network policy querying module 26, configured to: after receiving the notification sent by the Widget running module 21 to detect the current network state, start detecting the network state;
  • the Widget running module 21 is further configured to detect whether the network data needs to be acquired during the running of any Widget in real time, and if necessary, notify the network policy query module 26 to detect the current network state; if not, repeatedly detect any Widget. Whether you need to obtain network data during the operation.
  • the Widget running module 21 is specifically configured to determine whether to obtain network data according to the data acquisition information containing the URI according to the Widget runtime, and if the data acquisition information containing the URI is sent, the network data needs to be acquired; For data acquisition information containing a URI, it is not necessary to acquire network data.
  • the network policy querying module 26 is specifically configured to detect the current network state, and return the network state information to the Widget running module 21; correspondingly, the Widget running module 21 is specifically configured to receive the network state sent by the network policy query module 26 The information, when the network status information is good, the data acquisition information including the URI is sent to the sub-resource downloading module 25, and the sub-resource downloading module 25 is notified to obtain the network data, and the network data returned by the sub-resource downloading module 25 is received;
  • the sub-resource downloading module 25 is configured to receive the URI-containing data obtaining information sent by the Widget running module 21, and obtain the notification of the network data, connect the network, obtain the network data, and associate the network data with the Widget identifier of the network data. And the URI address is returned to the Widget Run Module 21.
  • the sub-resource downloading module 25 is specifically configured to implement the connection network by using the prior art to obtain the network data, and may include: acquiring the corresponding network data from the network according to the URI address in the data acquisition information containing the URI.
  • the Widget running module 21 is configured to send the URI address of the obtained network resource to the cache URI query module 22, notify the cache URI query module 22 whether the URI address is in the resource cache list, and receive the cache URI query module 22
  • the cache URI query module 22 is specifically configured to receive the URI address sent by the Widget running module 21, and whether the URI address is in the resource cache list in the query cache list parsing module 24, The query result is returned to the Widget running module 21.
  • the Widget running module 21 is specifically configured to send, when the query result is in the resource cache list, the network data, together with the Widget identifier and the URI address of the network data, to the sub-resource cache module 23, and use the acquired network data to run. Widget; otherwise, run the Widget directly using the acquired network data;
  • the sub-resource caching module 23 is configured to receive the network data sent by the Widget running module 21 together with the Widget identifier and the URI address of the network data, and query whether the network data corresponding to the URI address exists. If not, Then, the local file is created by using the URI address and the Widget identifier of the network data, and the network data is saved in the newly created local file, and if yes, the original network data is updated to the newly received network data.
  • the Widget running module 21 is specifically configured to receive network status information sent by the network policy query module 26, and send the URI address in the data acquisition information containing the URI to the cache URI query when the network status information is not good.
  • the module 22 receives the query result returned by the cache URI query module 22; correspondingly, the cache URI query module 22 is specifically configured to receive the URI address sent by the Widget running module 21, and query whether the URI address is in the cache list parsing module. In the resource cache list in 24, the query result is returned to the Widget running module 21.
  • the Widget running module 21 is specifically configured to: when the query result is not in the resource cache list, send the data acquisition information including the URI to the sub-resource downloading module 25, and notify the sub-resource downloading module 25 to obtain the network data; If the result is in the resource cache list, the sub-resource cache module 23 is checked whether the identifier of the Widget and the local file corresponding to the URI address are stored.
  • the local file required by the Widget is obtained from the sub-resource cache module 23, and then The network data saved in the local file is extracted, and the subsequent operations of the Widget are completed by using the network data according to the prior art; if not, the data acquisition information including the URI is sent to the sub-resource downloading module 25, and the sub-resource downloading module 25 is notified.
  • the view may be: querying whether the name of the local file in the sub-resource cache module 23 includes the URI address of the required network resource, and if so, storing the local file corresponding to the URI address; if not, The local file corresponding to the URI address is not saved.
  • the cache list parsing module 24 is further configured to parse the configuration file of the resource cache list, and save the finally generated resource cache list, which may be: when the configuration file of the preset resource cache list is in the configuration file of the Widget installation package, When the Widget running module 21 runs the Widget installation package, the configuration file of the resource cache list in the Widget installation package is sent to the cache list parsing module 24; the cache list parsing module 24 parses the resource cache list sent by the Widget running module 21. Configuration file, generating a resource cache list;
  • the configuration file of the resource cache list is preset in the cache list parsing module 24, and the client generates the resource according to the configuration file of the resource cache list preset in the cache list parsing module 24 when the client runs for the first time. Cache list.
  • the client described in the above solution can be installed as an integrated module and installed in the device according to the actual situation.
  • it can be installed in the mobile phone.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本发明公开了一种离线运行微件(Widget)的方法,包括:在网络状态好时,获取Widget所需的网络数据后,当确认资源缓存列表中含有网络数据对应的通用资源标识符(URI)地址时,保存该网络数据;在网络状态不好时,根据资源缓存列表确认自身已存Widget所需的网络数据后,从自身获取网络数据。本发明还同时公开了一种离线运行Widget的客户端,采用本发明能解决解决在网络状态不好时,由于Widget无法及时加载重要的网络数据,而无法正常显示、甚至无法正常使用的问题,进而,保证Widget的便捷性。

Description

一种离线运行微件的方法及客户端 技术领域
本发明涉及互联网应用领域, 具体涉及一种离线运行^!件 ( Widget ) 的方法及客户端。 背景技术
Widget是一种互联网应用程序。 Widget为依赖于网络数据、 在 Web页 面上添加的一些动态内容, 如股票、 天气预 ·^艮、 游戏等。 Widget可以为用 户提供便捷的互联网访问体验, 用户只需在安装了 Widget的客户端的设备 桌面或应用菜单中单击任意一个 Widget应用软件即可获取网络数据;比如: 在安装了 Widget客户端的手机中, 点击 "天气情况" 就可以通过访问互联 网获取天气情况。
但是, 依赖于网络数据的 Widget, 受到网络状态的影响, 在网络状态 好的时候, 能够便捷的顺畅运行; 在网络状态不好时, 比如: 网络信号差 或无网络信号时, Widget会无法正常显示、 甚至无法正常使用, 需要等网 络数据下载完成后才能运行, 比如: 需要 Widget所依赖的图片或基于对象 和事件驱动并具有相对安全性的客户端脚本语言 (Javascript )文件下载完 成才能运行。
可见, 目前已有的 Widget运行的方法, 会在网络状态不好时, 由于 Widget无法及时加载重要的网络数据, 而无法正常显示, 甚至无法正常使 用, 如此, 就极大地降低了 Widget的便捷性。 发明内容
有鉴于此, 本发明的目的在于提供一种离线运行 Widget的方法及客户 端, 解决在网络状态不好时, 由于 Widget无法及时加载重要的网络数据, 而无法正常显示、甚至无法正常使用的问题, 进而,保证 Widget的便捷性。
为达到上述目的, 本发明的技术方案是这样实现的:
本发明提供了一种离线运行 Widget的方法, 该方法包括:
在网络状态好时, 获取 Widget所需的网络数据后, 当确认资源緩存列 表中含有网络数据对应的通用资源标识符 ( URI , Universal Resources
Identifier )地址时, 保存该网络数据;
在网络状态不好时, 根据资源緩存列表确认自身已存 Widget所需的网 络数据后, 从自身获取网络数据。
上述方案中, 所述保存该网络数据之前, 该方法还包括: 查询 URI地 址是否在资源緩存列表中, 如果在, 则保存网络数据; 否则, 使用获取的 网络数据运行 Widget。
上述方案中, 所述确认自身已存 Widget所需的网络数据之前, 该方法 还包括: 查询 URI地址是否在资源緩存列表中, 如果不在, 则连接网络, 获取网络数据; 如果在, 则查看自身是否存有 URI地址所对应的本地文件, 如果有, 则从自身获取 Widget所需的网络数据; 如果没有, 则连接网络, 获取网络数据。
上述方案中, 所述资源緩存列表为: 解析预置的资源緩存列表的配置文 件, 生成的资源緩存列表。
上述方案中, 所述网络状态为: 实时检测 Widget运行过程中, 是否需 要获取网络数据, 如果需要, 则检测当前网络状态; 如果不需要, 则继续 检测 Widget运行过程中, 是否需要获取网络数据。
本发明还提供了一种离线运行 Widget的客户端,该客户端包括: Widget 运行模块、 緩存 URI查询模块、 子资源緩存模块、 子资源下载模块和緩存 列表解析模块; 其中, Widget运行模块, 用于网络状态好时, 从子资源下载模块获取 Widget 所需的网络数据后, 接收到緩存 URI查询模块发来的确认资源緩存列表中 含有网络数据对应的 URI地址的查询结果时, 将该网络数据发送给子资源 緩存模块; 在网络状态不好时, 接收到緩存 URI查询模块发来的确认资源 緩存列表中含有网络数据对应的 URI地址的查询结果后, 从子资源緩存模 块获取网络数据;
緩存 URI查询模块,用于为 Widget运行模块返回确认緩存列表解析模 块的资源緩存列表中含有对应的 URI地址的查询结果;
子资源緩存模块, 用于接收并保存 Widget运行模块发来的网络数据, 以及为 Widget运行模块提供网络数据;
緩存列表解析模块, 用于为緩存 URI查询模块提供资源緩存列表; 子资源下载模块,用于为 Widget运行模块提供 Widget所需的网络数据。 上述方案中, 所述 Widget运行模块, 具体用于接收緩存 URI查询模块 返回的 URI地址是否在资源緩存列表中的查询结果, 如果查询结果为在, 则将网络数据发送给子资源緩存模块, 否则, 使用获取的网络数据运行
Widget;
相应的, 所述緩存 URI 查询模块, 具体用于为 Widget运行模块发送 URI地址是否在资源緩存列表中的查询结果;
所述子资源緩存模块, 具体用于接收并保存 Widget运行模块发来的网 络数据。
上述方案中, 所述 Widget运行模块, 具体用于接收緩存 URI查询模块 返回的 URI地址是否在资源緩存列表中的查询结果,如果查询结果为不在, 则通知子资源下载模块连接网络, 如果查询结果为在, 则查看子资源緩存 模块中是否存有 URI地址所对应的本地文件, 如果有, 则从子资源緩存模 块获取 Widget所需的网络数据; 如果没有, 则通知子资源下载模块连接网 络;
相应的, 所述子资源下载模块, 具体用于接收 Widget运行模块发来的 连接网络的通知, 从网络中获取网络数据;
所述子资源緩存模块, 具体用于为 Widget运行模块提供已存的网络数 据。
上述方案中, 所述緩存列表解析模块,还用于解析资源緩存列表的配置 文件, 生成资源緩存列表。
上述方案中, 所述客户端, 还包括: 网络策略查询模块, 用于接收到 Widget运行模块发来的检测当前网络状态的通知后, 开始检测网络状态; 相应的, 所述 Widget运行模块, 还用于实时检测任意一个 Widget运行 过程中, 是否需要获取网络数据, 如果需要, 则通知网络策略查询模块检 测当前网络状态; 如果不需要, 则重复检测任意一个 Widget运行过程中, 是否需要获取网络数据。
本发明所提供的离线运行 Widget的方法及客户端, 具有以下的优点和 特点: 通过依照资源緩存列表中的 URI地址, 来确定所需緩存的网络数据, 当网络状态不好时,如果 Widget所需的网络数据的 URI地址在资源緩存列 表中, 则可以直接从客户端自身緩存中直接提取网络数据, 从而解决了由 于 Widget无法及时加载重要的网络数据, 而无法正常显示、 甚至无法正常 使用的问题, 进而, 保证 Widget的便捷性。 附图说明
图 1为本发明离线运行 Widget的方法流程示意图;
图 2为本发明离线运行 Widget的客户端的组成结构示意图。 具体实施方式
本发明的基本思想是: 在网络状态好时, 获取 Widget所需的网络数据 后, 当确认资源緩存列表中含有网络数据对应的 URI地址时, 保存该网络 数据; 在网络状态不好时, 根据资源緩存列表确认自身已存 Widget所需的 网络数据后, 从自身获取网络数据。
其中, 所述资源緩存列表为: 需要保存的网络数据所对应的 URI地址 列表;
所述网络状态好及所述网络状态不好, 可以为使用网络信号强度进行 判断, 具体判定方法为已有技术, 这里不做赞述。
下面结合附图及具体实施例对本发明再作进一步详细的说明。
本发明离线运行 Widget的方法如图 1所示, 包括下步驟:
步驟 101: 实时检测任意一个 Widget运行过程中, 判断是否需要获取 网络数据, 如果需要, 则执行步驟 102; 如果不需要, 则重复执行步驟 101。
这里, 所述是否需要获取网络数据为根据 Widget运行时, 是否发出含 有 URI的数据获取信息来判断, 具体的: 如果发出含有 URI的数据获取信 息, 则为需要获取网络数据; 如果没有发出含有 URI的数据获取信息, 则 为不需要获取网络数据;
其中,所述含有 URI的数据获取信息可以包含 URI地址和 Widget标识, 产生方法为已有技术, 这里不做赞述。
步驟 102: 检测当前网络状态, 如果网络状态不好, 则执行步驟 106; 如果网络状态好, 则执行步驟 103。
这里, 所述检测当前网络状态可以为使用网络信号强度进行判断, 具 体判定方法为已有技术, 这里不做赞述。
步驟 103: 连接网络, 获取网络数据。
这里, 所述获取网络数据为使用已有技术实现, 可以包括: 客户端根 据含有 URI的数据获取信息中的 URI地址, 从网络获取对应的网络数据; 其中, 所述连接网络为: 当前网络状态不好时, 客户端实时尝试连接 网络、 获取网络数据, 直至完全接收到该网络数据, 停止连接网络; 当前 网络状态好时, 客户端直接根据 URI地址从网络获取对应的网络数据。
步驟 104: 查询 URI地址是否在资源緩存列表中, 如果在, 则执行步 驟 105; 否则, 直接使用获取的网络数据运行 Widget, 结束处理流程。
这里, 所述客户端直接使用获取的网络数据运行 Widget, 为已有技术, 客户端直接使用网络数据, 完成发出该含有 URI的数据获取信息的 Widget 的后续操作, 且对于资源緩存列表中不存在的 URI地址, 客户端不需要保 存获取的网络数据。
步驟 105: 保存网络数据, 使用获取的网络数据运行 Widget, 结束处 理流程。
本步驟具体为:客户端查询自身是否已有该 URI地址对应的网络数据, 如果没有, 则为该网络数据创建对应的本地文件, 将网络数据保存在该本 地文件中, 然后客户端使用获取的网络数据运行 Widget; 如果有, 则将原 网络数据更新为新接收的网络数据, 然后客户端使用获取的网络数据运行 Widget;
这里, 所述创建对应的本地文件, 创建的方式为已有技术, 这里不做 赘述; 所述本地文件, 其名称可为: Widget的标识和 URI地址。
步驟 106: 查询 URI地址是否在资源緩存列表中, 如果不在, 则执行 步驟 103; 如果在, 则执行步驟 107。
步驟 107: 查看自身是否存有 URI地址所对应的本地文件, 如果有, 则从自身获取 Widget所需的网络数据, 结束处理流程; 如果没有, 则执行 步驟 103。
这里, 所述查看可以为: 查询本地文件的名称中是否包含该 URI地址, 如果包含, 则自身存有 URI地址所对应的本地文件; 如果不包含, 则自身 没有保存 URI地址所对应的本地文件; 所述从自身获取 Widget所需的网络数据为:根据 Widget的标识和 URI 地址,在客户端自身保存的本地文件中找到与 Widget的标识和 URI地址相 同的文件名称, 然后提取该本地文件中保存的网络数据, 客户端根据已有 技术利用网络数据完成该 Widget的后续操作。
另外, 执行上述步驟 101之前, 需要在客户端中配置资源緩存列表, 具体包括:
步驟 a: 在客户端中预置资源緩存列表的配置文件。
这里, 所述预置可以为: Widget的开发者在发布任意一项 Widget时, 在 Widget安装包的配置文件中预置资源緩存列表的配置文件, 将需要緩存 的 URI地址编写在配置文件中;其编写格式可以为可扩展标记语言( XML, extensible markup language ) 格式 , t匕 ^口 : <cache-manifest uri= "http://test/policy.xml" ></cache-manifest> , 表示需要緩存的 URI 地址为 http://test/policy.xml;
也可以为: 客户端开发商在客户端中预置资源緩存列表的配置文件,, 将需要緩存的 URI地址编写在配置文件中; 其编写格式可以为 XML格式, 如下所示:
<cache-manifest>
<uri>http://test/policy.xml</uri>
<uri>http://test/logo.jpg</uri>
</cache-manifest>
其 中 , </cache-manifest〉 表 示 需 要 緩 存 的 内 容 , <uri>http://test/policy.xml</uri>表示 URI 地址为 http:〃 test/policy.xml , <uri〉http:〃 test/logo.jpg</uri〉表示 URI地址为 http:〃 test/logo. jpg。
步驟 b: 客户端解析资源緩存列表的配置文件, 生成资源緩存列表。 步驟 b可以为: 当预置资源緩存列表的配置文件在 Widget安装包的配 置文件中时, 客户端运行该 Widget安装包时, 根据预置资源緩存列表的配 置文件, 生成资源緩存列表;
步驟 b还可以为: 当客户端开发商在客户端中预置资源緩存列表的配 置文件时, 客户端在初次运行时, 根据预置的资源緩存列表的配置文件, 生成资源緩存列表。
这里, 所述生成资源緩存列表, 其具体生成方法, 为已有技术, 这里 不做赘述。
本发明还提供了一种离线运行 Widget的客户端, 如图 2所示, 该客 户端包括: Widget运行模块 21、 緩存 URI查询模块 22、 子资源緩存模块 23、 緩存列表解析模块 24和子资源下载模块 25; 其中,
Widget运行模块 21 , 用于网络状态好时, 从子资源下载模块 25获取 Widget所需的网络数据后,接收到緩存 URI查询模块 22发来的确认资源緩 存列表中含有网络数据对应的 URI地址的查询结果时, 将该网络数据发送 给子资源緩存模块 23; 在网络状态不好时, 接收到緩存 URI查询模块 22 发来的确认资源緩存列表中含有网络数据对应的 URI地址的查询结果后, 从子资源緩存模块 23获取网络数据;
緩存 URI查询模块 22, 用于为 Widget运行模块 21返回确认緩存列表 解析模块 24的资源緩存列表中含有对应的 URI地址的查询结果;
子资源緩存模块 23, 用于接收并保存 Widget运行模块 21发来的网络 数据, 以及为 Widget运行模块 21提供网络数据;
緩存列表解析模块 24, 用于为緩存 URI查询模块 22提供资源緩存列 表;
子资源下载模块 25 , 用于为 Widget运行模块 21提供 Widget所需的网 络数据。
所述客户端, 还包括: 网络策略查询模块 26, 用于接收到 Widget运行 模块 21发来的检测当前网络状态的通知后, 开始检测网络状态; 相应的, 所述 Widget运行模块 21 , 还用于实时检测任意一个 Widget运行过程中, 是否需要获取网络数据, 如果需要, 则通知网络策略查询模块 26检测当前 网络状态; 如果不需要, 则重复检测任意一个 Widget运行过程中, 是否需 要获取网络数据。
所述 Widget运行模块 21 , 具体用于根据 Widget运行时, 是否发出含 有 URI的数据获取信息来判断是否需要获取网络数据, 如果发出含有 URI 的数据获取信息, 则为需要获取网络数据; 如果没有发出含有 URI的数据 获取信息, 则为不需要获取网络数据。
所述网络策略查询模块 26, 具体用于检测当前网络状态, 为 Widget运 行模块 21返回网络状态信息; 相应的, 所述 Widget运行模块 21 , 具体用 于接收网络策略查询模块 26发来的网络状态信息, 当网络状态信息为网络 状态好时, 将含有 URI的数据获取信息发送给子资源下载模块 25、 并通知 子资源下载模块 25获取网络数据, 接收子资源下载模块 25返回的网络数 据; 所述子资源下载模块 25, 具体用于接收 Widget运行模块 21发来的含 有 URI的数据获取信息, 和获取网络数据的通知后, 连接网络, 获取网络 数据 ,将网络数据连同该网络数据的 Widget标识及 URI地址返回给 Widget 运行模块 21。
所述子资源下载模块 25, 具体用于使用已有技术实现连接网络, 获取 网络数据, 可以包括: 根据含有 URI的数据获取信息中的 URI地址, 从网 络获取对应的网络数据。
所述 Widget运行模块 21 ,具体用于将获取的网络资源的 URI地址发送 给緩存 URI查询模块 22、 通知緩存 URI查询模块 22查询该 URI地址是否 在资源緩存列表中,并接收緩存 URI查询模块 22返回的查询结果;相应的, 所述緩存 URI查询模块 22, 具体用于接收 Widget运行模块 21发来的 URI 地址, 查询緩存列表解析模块 24中的资源緩存列表中是否有该 URI地址, 并将查询结果返回给 Widget运行模块 21。
所述 Widget运行模块 21 ,具体用于当查询结果为在资源緩存列表中时, 则该网络数据连同该网络数据的 Widget标识及 URI地址发送给子资源緩存 模块 23 , 同时使用获取的网络数据运行 Widget; 否则, 直接使用获取的网 络数据运行 Widget;
相应的, 所述子资源緩存模块 23 , 具体用于接收 Widget运行模块 21 发来的网络数据连同该网络数据的 Widget标识及 URI地址,查询是否已有 该 URI地址对应的网络数据, 如果没有, 则利用该网络数据的 URI地址和 Widget标识创建对应的本地文件,将网络数据保存在新创建的本地文件中, 如果有, 则将原网络数据更新为新接收的网络数据。
所述 Widget运行模块 21 , 具体用于接收网络策略查询模块 26发来的 网络状态信息, 当网络状态信息为网络状态不好时, 将含有 URI的数据获 取信息中的 URI地址发送给緩存 URI查询模块 22, 并接收緩存 URI查询 模块 22返回的查询结果; 相应的, 所述緩存 URI查询模块 22, 具体用于 接收 Widget运行模块 21发来的 URI地址, 查询该 URI地址是否在緩存列 表解析模块 24中的资源緩存列表中, 并将查询结果返回给 Widget运行模 块 21。
所述 Widget运行模块 21 ,具体用于当查询结果为不在资源緩存列表中 时, 则将含有 URI的数据获取信息发送给子资源下载模块 25、 并通知子资 源下载模块 25获取网络数据; 当查询结果为在资源緩存列表中时, 则查看 子资源緩存模块 23是否存有 Widget的标识和 URI地址所对应的本地文件, 如果有, 则从子资源緩存模块 23获取 Widget所需的本地文件, 然后提取 该本地文件中保存的网络数据, 根据已有技术利用网络数据完成该 Widget 的后续操作; 如果没有, 则将含有 URI的数据获取信息发送给子资源下载 模块 25、 并通知子资源下载模块 25获取网络数据; 这里, 所述查看可以为: 查询子资源緩存模块 23中的本地文件的名称 中是否包含该所需网络资源的 URI地址, 如果包含, 则存有 URI地址所对 应的本地文件; 如果不包含, 则没有保存 URI地址所对应的本地文件。
所述緩存列表解析模块 24, 还用于解析资源緩存列表的配置文件, 保 存最终生成的资源緩存列表, 具体可以为: 当预置资源緩存列表的配置文 件在 Widget安装包的配置文件中时, Widget运行模块 21运行该 Widget安 装包时, 将 Widget安装包中的资源緩存列表的配置文件发送给緩存列表解 析模块 24; 所述緩存列表解析模块 24, 解析 Widget运行模块 21发来的资 源緩存列表的配置文件, 生成资源緩存列表;
也可以为: 客户端开发商在緩存列表解析模块 24中预置资源緩存列表 的配置文件, 客户端在初次运行时, 根据緩存列表解析模块 24中预置的资 源緩存列表的配置文件, 生成资源緩存列表。
上述方案中所述的客户端可以作为集成模块, 根据实际情况安装在设 备中, 比如, 可以安装在手机中。
以上所述, 仅为本发明的较佳实施例而已, 并非用于限定本发明的保 护范围。

Claims

1、 一种离线运行微件 Widget的方法, 其特征在于, 该方法包括: 在网络状态好时, 获取 Widget所需的网络数据后, 当确认资源緩存列 在网络状态不好时, 根据资源緩存列表确认自身已存 Widget所需的网 络数据后, 从自身获取网络数据。
2、 根据权利要求 1所述的方法, 其特征在于, 所述保存该网络数据之 前, 该方法还包括: 查询 URI地址是否在资源緩存列表中, 如果在, 则保 存网络数据; 否则, 使用获取的网络数据运行 Widget。
3、 根据权利要求 1 所述的方法, 其特征在于, 所述确认自身已存 Widget所需的网络数据之前, 该方法还包括: 查询 URI地址是否在资源緩 存列表中, 如果不在, 则连接网络, 获取网络数据;
如果在, 则查看自身是否存有 URI地址所对应的本地文件, 如果有, 则从自身获取 Widget所需的网络数据; 如果没有, 则连接网络, 获取网络 数据。
4、 根据权利要求 1所述的方法, 其特征在于, 所述资源緩存列表为: 解析预置的资源緩存列表的配置文件, 生成的资源緩存列表。
5、 根据权利要求 1所述的方法, 其特征在于, 所述网络状态为: 实时 检测 Widget运行过程中, 是否需要获取网络数据, 如果需要, 则检测当前 网络状态; 如果不需要, 则继续检测 Widget运行过程中, 是否需要获取网 络数据。
6、一种离线运行 Widget的客户端,其特征在于,该客户端包括: Widget 运行模块、 緩存 URI查询模块、 子资源緩存模块、 子资源下载模块和緩存 列表解析模块; 其中,
Widget运行模块, 用于网络状态好时, 从子资源下载模块获取 Widget 所需的网络数据后, 接收到緩存 URI查询模块发来的确认资源緩存列表中 含有网络数据对应的 URI地址的查询结果时, 将该网络数据发送给子资源 緩存模块; 在网络状态不好时, 接收到緩存 URI查询模块发来的确认资源 緩存列表中含有网络数据对应的 URI地址的查询结果后, 从子资源緩存模 块获取网络数据;
緩存 URI查询模块,用于为 Widget运行模块返回确认緩存列表解析模 块的资源緩存列表中含有对应的 URI地址的查询结果;
子资源緩存模块, 用于接收并保存 Widget运行模块发来的网络数据, 以及为 Widget运行模块提供网络数据;
緩存列表解析模块, 用于为緩存 URI查询模块提供资源緩存列表; 子资源下载模块,用于为 Widget运行模块提供 Widget所需的网络数据。
7、 根据权利要求 6所述的客户端, 其特征在于,
所述 Widget运行模块,具体用于接收緩存 URI查询模块返回的 URI地 址是否在资源緩存列表中的查询结果, 如果查询结果为在, 则将网络数据 发送给子资源緩存模块, 否则, 使用获取的网络数据运行 Widget;
相应的, 所述緩存 URI 查询模块, 具体用于为 Widget运行模块发送 URI地址是否在资源緩存列表中的查询结果;
所述子资源緩存模块, 具体用于接收并保存 Widget运行模块发来的网 络数据。
8、 根据权利要求 6所述的客户端, 其特征在于,
所述 Widget运行模块,具体用于接收緩存 URI查询模块返回的 URI地 址是否在资源緩存列表中的查询结果, 如果查询结果为不在, 则通知子资 源下载模块连接网络, 如果查询结果为在, 则查看子资源緩存模块中是否 存有 URI地址所对应的本地文件,如果有,则从子资源緩存模块获取 Widget 所需的网络数据; 如果没有, 则通知子资源下载模块连接网络; 相应的, 所述子资源下载模块, 具体用于接收 Widget运行模块发来的 连接网络的通知, 从网络中获取网络数据;
所述子资源緩存模块, 具体用于为 Widget运行模块提供已存的网络数 据。
9、 根据权利要求 6所述的客户端, 其特征在于,
所述緩存列表解析模块,还用于解析资源緩存列表的配置文件,生成资 源緩存列表。
10、根据权利要求 6所述的客户端,其特征在于,所述客户端,还包括: 网络策略查询模块, 用于接收到 Widget运行模块发来的检测当前网络状态 的通知后, 开始检测网络状态;
相应的, 所述 Widget运行模块, 还用于实时检测任意一个 Widget运行 过程中, 是否需要获取网络数据, 如果需要, 则通知网络策略查询模块检 测当前网络状态, 如果不需要, 则重复检测任意一个 Widget运行过程中, 是否需要获取网络数据。
PCT/CN2012/075049 2011-11-24 2012-05-03 一种离线运行微件的方法及客户端 WO2013075465A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110378887.4 2011-11-24
CN201110378887.4A CN102427471B (zh) 2011-11-24 2011-11-24 一种离线运行微件的方法及客户端

Publications (1)

Publication Number Publication Date
WO2013075465A1 true WO2013075465A1 (zh) 2013-05-30

Family

ID=45961414

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/075049 WO2013075465A1 (zh) 2011-11-24 2012-05-03 一种离线运行微件的方法及客户端

Country Status (2)

Country Link
CN (1) CN102427471B (zh)
WO (1) WO2013075465A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102427471B (zh) * 2011-11-24 2014-06-11 中兴通讯股份有限公司 一种离线运行微件的方法及客户端
CN103686684A (zh) * 2012-09-20 2014-03-26 腾讯科技(深圳)有限公司 离线缓存的方法及装置
CN105991829B (zh) * 2015-02-12 2018-03-27 广东欧珀移动通信有限公司 一种内容推荐方法及终端
CN106331049A (zh) * 2015-07-03 2017-01-11 阿里巴巴集团控股有限公司 缓存资源、更新缓存资源的方法、客户端、服务器及系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101533410A (zh) * 2009-04-13 2009-09-16 浙江大学 面向移动终端的widget内容缓存方法
CN101552836A (zh) * 2009-05-18 2009-10-07 浙江大学 应用于手机中移动Widget引擎的实现方法
CN101690128A (zh) * 2007-06-29 2010-03-31 诺基亚公司 用于下载内容以便离线浏览的系统、方法、设备以及计算机程序产品
CN102427471A (zh) * 2011-11-24 2012-04-25 中兴通讯股份有限公司 一种离线运行微件的方法及客户端

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8458612B2 (en) * 2007-07-29 2013-06-04 Hewlett-Packard Development Company, L.P. Application management framework for web applications
CN101799821B (zh) * 2010-02-11 2013-01-02 北京易路联动技术有限公司 一种通过微件实现网页应用的方法及系统
CN102195934B (zh) * 2010-03-09 2016-08-24 华为技术有限公司 互动业务的实现方法、装置及系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101690128A (zh) * 2007-06-29 2010-03-31 诺基亚公司 用于下载内容以便离线浏览的系统、方法、设备以及计算机程序产品
CN101533410A (zh) * 2009-04-13 2009-09-16 浙江大学 面向移动终端的widget内容缓存方法
CN101552836A (zh) * 2009-05-18 2009-10-07 浙江大学 应用于手机中移动Widget引擎的实现方法
CN102427471A (zh) * 2011-11-24 2012-04-25 中兴通讯股份有限公司 一种离线运行微件的方法及客户端

Also Published As

Publication number Publication date
CN102427471B (zh) 2014-06-11
CN102427471A (zh) 2012-04-25

Similar Documents

Publication Publication Date Title
US20240168616A1 (en) Information processing terminal and control method
JP2019032883A (ja) ウェブアプリケーションを実施する方法、装置、サーバ、及びシステム
US8640224B2 (en) Embedded device and state display control
WO2019037660A1 (zh) 设备控制方法、装置、终端设备和操作系统
US20150301873A1 (en) Method and system for expanding webapp application function
CN109120684B (zh) 信息化管理方法、装置、esb总线平台以及存储介质
US10003633B2 (en) Method and device for resuming file download
WO2013097592A1 (zh) 脚本加载技术
CN108415804B (zh) 获取信息的方法、终端设备及计算机可读存储介质
KR101700458B1 (ko) 웹 사이트에 대한 대체적인 사용자 경험 검색
WO2013075465A1 (zh) 一种离线运行微件的方法及客户端
US9519511B2 (en) Application activation framework
CN106815055B (zh) 移动应用动态布局的方法与系统
CN102214224A (zh) 一种访问网络资源的优化方法、网页浏览器和终端
WO2016050124A1 (zh) 网页转码方法、装置以及服务器
EP3813326A1 (en) Method and apparatus for processing webpage, device, and storage medium
US20130081010A1 (en) Template and server content download using protocol handlers
US20140245124A1 (en) System and method thereof for browser agnostic extension models
TWI713342B (zh) 物件上傳方法及裝置
JP2013168129A (ja) 情報処理システム、データ提供装置、電子機器、情報処理方法、データ提供方法、データ取得方法、及びプログラム
US11301227B2 (en) Server apparatus, information processing apparatus, and control method for installing application
JP2013534678A (ja) 遠隔ユーザインターフェース管理装置及び方法とそのためのシステム
CN112468611B (zh) 应用程序启动方法、终端设备及计算机存储介质
US20130091201A1 (en) Methods, systems, and computer program products for processing an attached command response
US9769246B2 (en) Information processing terminal and control method

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

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

Country of ref document: EP

Kind code of ref document: A1