WO2012155698A1 - 基于浏览器引擎的动态加载微件的方法及移动终端 - Google Patents

基于浏览器引擎的动态加载微件的方法及移动终端 Download PDF

Info

Publication number
WO2012155698A1
WO2012155698A1 PCT/CN2012/073209 CN2012073209W WO2012155698A1 WO 2012155698 A1 WO2012155698 A1 WO 2012155698A1 CN 2012073209 W CN2012073209 W CN 2012073209W WO 2012155698 A1 WO2012155698 A1 WO 2012155698A1
Authority
WO
WIPO (PCT)
Prior art keywords
widget
resource
memory
running
mobile terminal
Prior art date
Application number
PCT/CN2012/073209
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 WO2012155698A1 publication Critical patent/WO2012155698A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources

Definitions

  • the present invention relates to the field of widget technology, and in particular, to a method and a mobile terminal for dynamically loading a widget based on a browser engine. Background technique
  • Widgets can solve such problems. Widget applications are becoming more widespread. Currently, Widgets have certain applications on smartphones. However, there are some obstacles in the application of feature phones (also known as non-smart phones). One of the important constraints is memory. On a low-profile Feature Phone, running out of memory is a key factor in the inability of its applications to run smoothly. Insufficient memory also affects its speed. Summary of the invention
  • the main object of the present invention is to provide a method for dynamically loading a Widget based on a browser engine and a mobile terminal, which can effectively improve the memory utilization of the mobile terminal and improve the running speed of the Widget.
  • a method based on a browser engine for dynamically loading a widget comprising:
  • a running table is created, where the running table includes: a tag number of the Widget, a pointer of the Widget resource memory block, a stop time of the Widget, and a maximum time limit of the Widget resource clearing;
  • the Widget exits the timer for stopping the running time of the Widget is started, and when the timer of the Widget stop running time reaches the maximum time limit of the Widget resource clearing, the Widget resource memory block pointer is used from the memory.
  • the memory space occupied by the Widget resource is cleared when the Widget is running, and the memory occupied by the Widget resource is maintained when the timer of the Widget stop running time does not reach the maximum time limit of the Widget resource clearing.
  • the method further comprises:
  • the method further includes:
  • the browser engine kernel extension layer initiates a resource request to the server, downloads the Widget network resource required by the Widget, and stores the Widget network resource in the memory.
  • the method further includes: dynamically loading, by the browser engine kernel extension layer, a local resource or a network resource required by the Widget runtime.
  • the method further includes: loading the plug-in by using a dynamic loading interface provided by the JS extension API;
  • the method further includes:
  • the plugin is uninstalled using the dynamic offload interface provided by the JS extension API.
  • the invention also provides a mobile terminal, comprising:
  • the running table establishing unit is configured to establish a running table when the widget is started, where the running table includes: a tag number of the Widget, a pointer of the Widget resource memory block, a stop time of the Widget, and a maximum time limit of the Widget resource clearing;
  • a resource management unit configured to start the Widget to stop running when the Widget exits a time timer, when the timer of the widget stop running time reaches the maximum time limit of the Widget resource clearing, the memory occupied by the Widget resource in the Widget runtime is read from the memory by the Widget resource memory block pointer The space is cleared.
  • the timer for stopping the running time of the Widget does not reach the maximum time limit of the Widget resource clearing, the memory space occupied by the Widget resource is maintained.
  • the mobile terminal further includes a local resource obtaining unit, configured to access the local file system through the browser engine kernel extension layer, acquire the Widget local resource, and load the Widget local resource into the memory.
  • a local resource obtaining unit configured to access the local file system through the browser engine kernel extension layer, acquire the Widget local resource, and load the Widget local resource into the memory.
  • the mobile terminal further includes a network resource acquiring unit, configured to initiate a resource request to the server by using a browser engine kernel extension layer, download a Widget network resource required by the Widget, and store the Widget network resource in the In memory.
  • a network resource acquiring unit configured to initiate a resource request to the server by using a browser engine kernel extension layer, download a Widget network resource required by the Widget, and store the Widget network resource in the In memory.
  • the mobile terminal further includes a resource dynamic loading unit, configured to dynamically load local resources or network resources required by the Widget runtime by the browser engine kernel extension layer.
  • a resource dynamic loading unit configured to dynamically load local resources or network resources required by the Widget runtime by the browser engine kernel extension layer.
  • the mobile terminal further includes a plug-in management unit, configured to use a dynamic loading interface loading plug-in provided by the JS extension API when the widget needs to load the plug-in, and use the JS when the Widget exits running.
  • the dynamic uninstall interface provided by the extension API uninstalls the plugin.
  • the technical solution of the present invention has the following beneficial effects:
  • the method and the mobile terminal provided by the present invention establish a running table when the Widget is started, and when the Widget exits, the memory usage of the Widget resource is cleared by running the content of the table, which can effectively Using a mobile terminal, such as the limited memory space of the Feature Phone to apply the Widget, improves the memory utilization of the Widget runtime, and improves the speed of the Widget, thereby enhancing the user experience, effectively promoting the Widget in the Feature Phone, etc.
  • FIG. 1 is a schematic structural diagram of a Widget running framework according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of a method for dynamically loading a Widget based on a browser engine according to an embodiment of the present invention
  • FIG. 3 is still another schematic flowchart of a method for dynamically loading a Widget based on a browser engine according to an embodiment of the present invention
  • FIG. 4 is a schematic structural diagram of a structure of a mobile terminal according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of still another structure of a mobile terminal according to an embodiment of the present invention. detailed description
  • the embodiment of the invention provides a method for dynamically loading a Widget based on a browser engine.
  • the Widget running framework is mainly composed of six parts, as shown in FIG. 1 , which are a Widget application layer, a Widget engine, a browser engine kernel expansion layer, The browser engine, JS (javascript, a scripting language) extends the Application Programming Interface (API) and platform dynamic loading modules.
  • API Application Programming Interface
  • Widget application layer Install, uninstall, update Widget, support Widget multi-instance operation.
  • Widget Engine Unzip, install, update, manage Widgets of various specifications, security verification, Widget running timers, etc.
  • Browser engine kernel extension layer In order to simplify the browser engine interface, it is convenient to expand more Internet applications based on the browser engine, and expand this layer, which can not only play a role but also shield the internal architecture of the browser. And implementation details, making the application and the browser's internal #" more clear and concise.
  • Browser Engine Mainly responsible for page management, loading resources, web page parsing and rendering of web code.
  • JS extension API The extension and supplement of the JS engine of the browser kernel, mainly responsible for the interaction between the browser kernel and the plug-in, and the local system service interface of the packaged software platform as a unified specification interface, such as the acquisition device (Device M, global Global System for Mobile Communications (GSM) status, interface for telephone recording, etc.
  • acquisition device Device M, global Global System for Mobile Communications (GSM) status, interface for telephone recording, etc.
  • GSM Global System for Mobile Communications
  • Platform dynamic loading module It is used for software platform dynamic loading implementation. Its functions include dynamic program installation, uninstallation, startup, stop, memory loading, memory loading, information reading and query.
  • the method includes the steps of:
  • the running table includes: a tag number of the Widget, a pointer of the Widget resource memory block, a stop time of the Widget, and a maximum time limit of the Widget resource clearing;
  • each Widget is assigned a tag number for the Widget, and the Widget resource memory block pointer points to a memory block that stores the Widget resource.
  • the Widget stop running time refers to the time difference after the Widget runs and exits again, and the Widget resource clears the maximum.
  • the upper limit time is the maximum time limit for the Widget resource to be cleared after the Widget exits.
  • the Widget resource refers to the Widget image, the text effect, the dependent plug-in, and the like, including the Widget local resource and the Widget network resource.
  • the Widget engine of the mobile terminal starts.
  • the timer for stopping the running time of the Widget when the stop running time reaches the maximum time limit of the Widget resource clearing, the Widget engine of the mobile terminal clears the memory space occupied by the Widget runtime resource from the memory through the Widget resource memory block pointer.
  • the Widget engine of the mobile terminal maintains the memory space occupied by the Widget runtime resource.
  • the Widget resource is directly obtained from the memory space pointed to by the Widget resource memory block pointer.
  • the mobile terminal searches the running table through the Widget engine, and compares the corresponding Widget stop time T1 and the Widget resource destruction maximum upper limit time T2; if T1 > T2, the in-memory Widget resource is destroyed by the Widget engine.
  • the browser engine kernel extension layer initiates a request to load the network resource to the browser engine, and the Widget timer stops working; otherwise, according to the Widget resource memory block pointer in the running table, the resource required for the Widget operation is found, and the browser engine kernel extension layer initiates the Widget.
  • the method provided by the foregoing embodiment establishes a running table when the Widget is started.
  • the memory of the Widget resource is cleared by running the content of the table, and the mobile terminal, such as the limited memory space of the Feature Phone, can be effectively utilized.
  • the Widget improves the memory utilization of the Widget runtime and improves the speed of the Widget, thereby enhancing the user experience and effectively promoting the Widget application on mobile terminals such as the Feature Phone.
  • the method further includes the steps of: Sl11, accessing the local file system through the browser engine kernel extension layer, acquiring the Widget local resource, and loading the Widget local resource. Go to the memory.
  • the browser engine kernel extension layer of the mobile terminal accesses the local file system through the interface of the JS extension API, acquires the Widget local resource, and loads the Widget local resource into the memory, where the Widget local resource is
  • the fixed structural form is stored in the memory, wherein the fixed structural form includes a resource ID, a resource size, resource data, and the like.
  • the method further includes the steps of:
  • the browser engine kernel extension layer of the mobile terminal initiates a resource request to the server through the network module of the browser engine, and downloads the Widget network resource required by the Widget and stores the information in a fixed structure in the memory, where the fixed structure Forms include resource ID, resource size, resource data, and so on.
  • the method further includes the following steps:
  • the Widget engine of the mobile terminal uses the JS extension API to dynamically load the interface to dynamically load the resources required by the Widget runtime through the browser engine kernel extension layer. If it is a local resource of the local file system, the JS extension API local system service interface is called from the local file system.
  • the obtained structure is stored in the memory in a fixed structure, and the fixed structure is mapped to the Widget tag number, that is, the resource occupying the memory first address is assigned to the Widget resource memory block pointer in the Widget running table, so as to delete the Widget local resource,
  • the Widget tag number can be used to find the memory block occupied by the Widget local resource; if it is a network resource, the browser engine kernel expansion layer directly interacts with the browser kernel, and the browser kernel initiates a resource download request to the server, and downloads the resource.
  • the fixed structure is stored in the memory, and the fixed structure is mapped to the Widget tag number, that is, the network resource occupied memory first address is assigned to the Widget resource memory block pointer in the Widget running table, so as to delete the Widget network resource. At that time, the memory block occupied by the Widget network resource can be found by the Widget tag number.
  • the method further includes the steps of:
  • the Widget engine uses the dynamic loading interface provided by the software platform of the mobile terminal (ie, the platform dynamic loading module) to implement an interface supporting the dynamic loading of the Widget through the JS extension API.
  • the software platform of the mobile terminal ie, the platform dynamic loading module
  • the dynamic loading interface of the API is extended through the JS.
  • the plugin that the Widget runtime depends on can be dynamically loaded.
  • the Widget engine uses the dynamic loading interface provided by the JS extension API to load the plugin.
  • Widget? I Engine uninstalls the plugin using the dynamic uninstall interface provided by the JS extension API.
  • the present invention further provides a mobile terminal, which may be a mobile phone or other handheld electronic device, in particular, a non-smart mobile phone.
  • the mobile terminal as shown in FIG. 4, includes: a running table establishing unit 210, configured to When the Widget starts, a running table is created, and the running table includes: a tag number of the Widget, a pointer of the Widget resource memory block, a stop time of the Widget, and a maximum time limit of the Widget resource clearing;
  • the resource management unit 220 is configured to start a timer for stopping the running time of the Widget when the Widget exits, and when the timer of the Widget stop running time reaches the maximum time limit of the Widget resource clearing, the Widget resource memory block pointer is used.
  • the memory space occupied by the Widget resource is cleared in the memory when the Widget is running.
  • the timer of the Widget stop running time does not reach the maximum time limit of the Widget resource clearing, the memory space occupied by the Widget resource is maintained.
  • the mobile terminal provided by the foregoing embodiment establishes a running table when the Widget is started.
  • the memory of the Widget resource is cleared by running the content of the table, and the limited memory space of the mobile terminal, such as the Feature Phone, can be effectively utilized.
  • the application of the Widget improves the memory utilization of the Widget runtime and improves the speed of the Widget, thereby enhancing the user experience and effectively promoting the Widget application on mobile terminals such as the Feature Phone.
  • the mobile terminal as shown in FIG. 5, further includes a local resource obtaining unit 211, configured to access the local file system through the browser engine kernel extension layer, and obtain Take the Widget local resource and load the Widget local resource into the memory.
  • a local resource obtaining unit 211 configured to access the local file system through the browser engine kernel extension layer, and obtain Take the Widget local resource and load the Widget local resource into the memory.
  • the mobile terminal further includes a network resource acquiring unit.
  • 212 configured to initiate a resource request to the server through the browser engine kernel extension layer, download the Widget network resource required by the Widget, and store the Widget network resource in the memory.
  • the mobile terminal further includes a resource dynamic loading unit.
  • the mobile terminal further includes a plug-in management unit 214, configured to load the plug-in by using a dynamic loading interface provided by the JS extension API when the widget needs to load the plug-in, when the widget exits the runtime. , uninstall the plugin using the dynamic uninstall interface provided by the JS extension API.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Stored Programmes (AREA)

Description

基于浏览器引擎的动态加载微件的方法及移动终端 技术领域
本发明涉及微件 ( Widget )技术领域, 尤其涉及一种基于浏览器引擎 的动态加载 Widget的方法及移动终端。 背景技术
随着移动互联网的发展和手机应用的个性化, 受界面大小的影响, 用 户希望通过移动互联网浏览到个性化的页面, 而不需要为大量的无用信息 付费,借助 Widget可以解决这样的问题, 因此 Widget的应用变得越来越广 泛。 当前, Widget在智能手机上有一定的应用, 然而在功能手机( Feature Phone, 也称为非智能手机)上应用遇到了一些障碍, 其中的一个重要制约 因素是内存问题。 在低配置的 Feature Phone上, 运行 Widget时的内存不足 是导致其应用不能顺利推行的一个关键因素, 内存不足同时影响了其运行 速度。 发明内容
本发明的主要目的是提供一种基于浏览器引擎的动态加载 Widget的方 法及移动终端, 能够有效地提高移动终端内存利用率, 提高 Widget运行速 度。
本发明所采用的技术方案是:
一种基于浏览器引擎的动态加载 Widget的方法, 包括:
在微件(Widget )启动时, 建立一个运行表, 所述运行表包括: Widget 的标记号、 Widget资源内存块指针、 Widget停止运行时间和 Widget资源清 除最大上限时间; 在所述 Widget退出时, 启动所述 Widget停止运行时间的计时器, 当所 述 Widget停止运行时间的计时器达到所述 Widget资源清除最大上限时间 时, 通过所述 Widget资源内存块指针从内存中将所述 Widget运行时所述 Widget资源占用的内存空间清除, 当所述 Widget停止运行时间的计时器没 达到所述 Widget资源清除最大上限时间时,维持所述 Widget资源占用的内 存空间。
优选地, 在建立一个运行表之后, 所述方法进一步包括:
通过浏览器引擎内核拓展层访问本地文件系统, 获取所述 Widget本地 资源, 并将所述 Widget本地资源加载到所述内存中。
优选地, 在将所述 Widget本地资源加载到所述内存中之后, 所述方法 进一步包括:
通过浏览器引擎内核拓展层向服务器发起资源请求, 下载所述 Widget 需要的 Widget网络资源, 并将所述 Widget网络资源存放在所述内存中。
优选地, 在将所述 Widget网络资源存放在所述内存中之后, 所述方法 进一步包括: 通过所述浏览器引擎内核拓展层动态加载所述 Widget运行时 所需要的本地资源或者网络资源。
优选地, 在所述 Widget运行时需要加载插件时, 所述方法还包括: 使用 JS扩展 API提供的动态加载接口加载插件;
相应地, 在所述 Widget退出运行时, 所述方法还包括:
使用所述 JS扩展 API提供的动态卸载接口卸载所述插件。
本发明还提供一种移动终端, 包括:
运行表建立单元, 用于在 Widget启动时, 建立一个运行表, 所述运行 表包括: Widget的标记号、 Widget资源内存块指针、 Widget停止运行时间 和 Widget资源清除最大上限时间;
资源管理单元, 用于在所述 Widget退出时, 启动所述 Widget停止运行 时间的计时器,当所述 Widget停止运行时间的计时器达到所述 Widget资源 清除最大上限时间时, 通过所述 Widget 资源内存块指针从内存中将所述 Widget运行时所述 Widget资源占用的内存空间清除, 当所述 Widget停止 运行时间的计时器没达到所述 Widget资源清除最大上限时间时, 维持所述 Widget资源占用的内存空间。
优选地, 所述移动终端还包括本地资源获取单元, 用于通过浏览器引 擎内核拓展层访问本地文件系统, 获取所述 Widget本地资源, 并将所述 Widget本地资源加载到所述内存中。
优选地, 所述移动终端还包括网络资源获取单元, 用于通过浏览器引 擎内核拓展层向服务器发起资源请求,下载所述 Widget需要的 Widget网络 资源, 并将所述 Widget网络资源存放在所述内存中。
优选地, 所述移动终端还包括资源动态加载单元, 用于通过所述浏览 器引擎内核拓展层动态加载所述 Widget运行时所需要的本地资源或者网络 资源。
优选地, 所述移动终端还包括插件管理单元, 用于在所述 Widget运行 时需要加载插件时, 使用 JS扩展 API提供的动态加载接口加载插件, 在所 述 Widget退出运行时, 使用所述 JS扩展 API提供的动态卸载接口卸载所 述插件。
实施本发明的技术方案, 具有以下有益效果: 本发明提供的方法及移 动终端, 在 Widget启动时建立运行表, 在 Widget退出时, 通过运行表的内 容清除 Widget 资源对内存的占用, 能够有效地利用移动终端, 如 Feature Phone的有限的内存空间来应用 Widget, 提高了 Widget运行时的内存利用 率, 同时提高了 Widget运行速度, 从而增强了用户的体验感, 有效地促进 了 Widget在 Feature Phone等移动终端上的应用。 附图说明
图 1为本发明实施例提供 Widget运行框架的结构示意图;
图 2为本发明实施例提供的基于浏览器引擎的动态加载 Widget的方法 的流程示意图;
图 3为本发明实施例提供的基于浏览器引擎的动态加载 Widget的方法 的又一流程示意图;
图 4为本发明实施例提供的移动终端的组成结构示意图;
图 5为本发明实施例提供的移动终端的又一组成结构示意图。 具体实施方式
为了使本发明的目的、 技术方案及优点更加清楚明白, 以下结合附图 及实施例, 对本发明进行进一步详细说明。 应当理解, 此处所描述的具体 实施例仅仅用以解释本发明, 并不用于限定本发明。
本发明实施例提供一种基于浏览器引擎的动态加载 Widget的方法, 该 Widget运行框架主要由六部分组成, 如图 1所示, 分别是 Widget应用层、 Widget 引擎、 浏览器引擎内核拓展层、 浏览器引擎、 JS ( javascript, 一种 脚本语言)扩展应用程序编程接口( Application Programming Interface, API ) 和平台动态加载模块。
1 ) Widget应用层: 安装、 卸载、 更新 Widget, 支持 Widget多实例运 行。
2 ) Widget引擎: 解压、 安装、 更新、 管理各种规范的 Widget, 安全验 证, Widget运行计时器等。
3 )浏览器引擎内核拓展层: 为简化浏览器引擎接口, 便于基于浏览器 引擎扩展更多的互联网应用, 拓展了这样一层, 既能起到承上启下的作用, 又能屏蔽浏览器内部的架构和实现细节 , 使得应用与浏览器内部的# "接更 加清晰、 简洁。 4 )浏览器引擎: 主要负责网页代码的页面管理、 加载资源、 网页解析 和渲染。
5 ) JS扩展 API: 浏览器内核的 JS引擎的扩展和补充, 主要负责浏览 器内核和插件的交互, 以及封装软件平台本地系统服务接口为统一规范接 口,如获取装置( Device M言息、全球移动通讯系统( Global System for Mobile Communications, GSM )状态、 电话记录的接口等。
6 )平台动态加载模块: 用于软件平台动态加载实现, 其功能包括动态 程序的安装、 卸载、 启动、 停止、 内存载入、 内存载出、 信息读取和查询 等。
该如图 2所示, 该方法包括步驟:
S110、 在 Widget启动时, 移动终端建立一个运行表;
具体地, 该运行表包括: Widget的标记号、 Widget资源内存块指针、 Widget停止运行时间和 Widget资源清除最大上限时间;
步驟 S110 中, 每启动一个 Widget就为该 Widget分配一个标记号, Widget资源内存块指针指向存放 Widget资源的内存块, Widget停止运行时 间是指 Widget运行退出后到再次运行的时间差, Widget资源清除最大上限 时间是指 Widget资源在 Widget退出后被清除的最大上限时间; 该 Widget 资源指 Widget图片、 文字特效、 依赖的插件等, 包括 Widget本地资源和 Widget网络资源。
S120、 在该 Widget退出时, 启动该 Widget停止运行时间的计时器, 当 该 Widget停止运行时间的计时器达到该 Widget资源清除最大上限时间时, 通过该 Widget资源内存块指针从内存中将该 Widget运行时该 Widget资源 占用的内存空间清除, 当该 Widget停止运行时间的计时器没达到该 Widget 资源清除最大上限时间时, 维持该 Widget资源占用的内存空间。
在该步驟 S120中, 在 Widget退出时, 该移动终端的 Widget引擎启动 Widget停止运行时间的计时器, 当停止运行时间达到该 Widget资源清除最 大上限时间时,该移动终端的 Widget引擎将通过 Widget资源内存块指针从 内存中、 将该 Widget运行时资源占用的内存空间清除; 反之, 该移动终端 的 Widget引擎维持 Widget运行时资源占用的内存空间, 用户重新启动该 Widget运行时, 直接从 Widget 资源内存块指针指向的内存空间获取该 Widget资源。
当用户二次启动同一个 Widget时;移动终端通过 Widget引擎查找运行 表, 并比较对应 Widget停止时间 T1和 Widget资源销毁最大上限时间 T2; 如果 T1 > T2, 内存中的 Widget资源被 Widget引擎销毁, 则浏览器引擎内 核拓展层向浏览器引擎发起加载网络资源的请求, Widget计时器停止工作; 否则根据运行表中的 Widget资源内存块指针找到 Widget运行需要的资源, 浏览器引擎内核拓展层发起 Widget的解析和渲染显示, 同时初始化浏览器 内核对象。
上述实施例提供的方法,在 Widget启动时建立运行表,在 Widget退出 时, 通过运行表的内容清除 Widget资源对内存的占用, 能够有效地利用移 动终端, 如 Feature Phone的有限的内存空间来应用 Widget, 提高了 Widget 运行时的内存利用率, 同时提高了 Widget运行速度, 从而增强了用户的体 验感, 有效地促进了 Widget应用在 Feature Phone等移动终端上。
在其他的实施例中, 在 S110之后, 如图 3所示, 该方法还包括步驟: Slll、 通过浏览器引擎内核拓展层访问本地文件系统, 获取该 Widget 本地资源, 并将该 Widget本地资源加载到该内存中。
具体的, 在该步驟 S111中, 移动终端的浏览器引擎内核拓展层通过 JS 扩展 API的接口访问本地文件系统, 获取 Widget本地资源, 并将该 Widget 本地资源加载到内存中, 该 Widget本地资源以固定的结构形式存放在内存 中, 其中, 所述固定的结构形式包括资源 ID、 资源大小、 资源数据等。 在其他的实施例中, 该 Sill之后, 该方法还包括步驟:
5112、 通过浏览器引擎内核拓展层向服务器发起资源请求, 下载该 Widget需要的 Widget网络资源, 并将该 Widget网络资源存放在该内存中。
具体的, 移动终端的浏览器引擎内核拓展层通过浏览器引擎的网络模 块向服务器发起资源请求,下载 Widget需要的 Widget网络资源并以固定的 结构形式存放于内存中, 其中, 所述固定的结构形式包括资源 ID、 资源大 小、 资源数据等。
在其他的实施例中, 该 S112之后, 还包括步驟:
5113、 通过该浏览器引擎内核拓展层动态加载该 Widget运行时所需要 的本地资源或者网络资源。
移动终端的 Widget引擎通过浏览器引擎内核拓展层使用 JS扩展 API 动态加载接口动态加载 Widget运行时需要的资源, 如果是本地文件系统的 本地资源, 则调用 JS扩展 API本地系统服务接口从本地文件系统中获取、 并以固定结构存放于内存中, 该固定结构与该 Widget标记号进行映射, 即 将资源占用内存首地址赋予 Widget运行表中的 Widget资源内存块指针,以 便于删除 Widget本地资源的时候, 可以通过 Widget标记号找到该 Widget 本地资源占用的内存块; 如果是网络资源, 则通过浏览器引擎内核拓展层 直接与浏览器内核交互, 由浏览器内核向服务器发起资源下载请求, 并下 载资源以固定结构存放于内存中, 同样是该固定结构与该 Widget标记号进 行映射, 即将该网络资源占用内存首地址赋予 Widget运行表中的 Widget 资源内存块指针, 以便于删除 Widget 网络资源的时候, 可以通过 Widget 标记号找到该 Widget网络资源占用的内存块。
在其他的实施例中, 该 S113之后, 该方法还包括步驟:
5114、 在该 Widget运行时需要加载插件时, 使用 JS扩展 API提供的 动态加载接口加载插件, 在该 Widget退出运行时, 使用该 JS扩展 API提 供的动态卸载接口卸载该插件。
具体的, Widget引擎通过 JS扩展 API使用该移动终端的软件平台提 供的动态加载接口 (即: 平台动态加载模块) 实现支持 Widget动态加载的 接口, 如果 Widget依赖插件, 通过 JS扩展 API的动态加载接口可以动态 加载 Widget运行时依赖的插件,在该 Widget运行时需要加载插件时, Widget 引擎使用 JS扩展 API提供的动态加载接口加载插件, 在该 Widget退出运 行时, Widget? I擎使用该 JS扩展 API提供的动态卸载接口卸载该插件。
本发明实施还提供一种移动终端, 该移动终端可以为手机或者其他手 持的电子设备, 特别是非智能的手机等, 该移动终端如图 4所示, 包括: 运行表建立单元 210, 用于在 Widget启动时, 建立一个运行表, 该运 行表包括: Widget的标记号、 Widget资源内存块指针、 Widget停止运行时 间和 Widget资源清除最大上限时间;
资源管理单元 220 , 用于在该 Widget退出时, 启动该 Widget停止运行 时间的计时器,当该 Widget停止运行时间的计时器达到该 Widget资源清除 最大上限时间时,通过该 Widget资源内存块指针从内存中将该 Widget运行 时该 Widget资源占用的内存空间清除,当该 Widget停止运行时间的计时器 没达到该 Widget资源清除最大上限时间时,维持该 Widget资源占用的内存 空间。
上述实施例提供的移动终端, 在 Widget启动时建立运行表, 在 Widget 退出时, 通过运行表的内容清除 Widget资源对内存的占用, 能够有效地利 用移动终端, 如 Feature Phone 的有限的内存空间来应用 Widget, 提高了 Widget运行时的内存利用率, 同时提高了 Widget运行速度, 从而增强了用 户的体验感, 有效地促进了 Widget应用在 Feature Phone等移动终端上。
在其他的实施例中, 进一步的, 该移动终端如图 5 所示, 还包括本地 资源获取单元 211 , 用于通过浏览器引擎内核拓展层访问本地文件系统, 获 取该 Widget本地资源, 并将该 Widget本地资源加载到该内存中。
在其他的实施例中, 进一步的, 该移动终端还包括网络资源获取单元
212 , 用于通过浏览器引擎内核拓展层向服务器发起资源请求, 下载该 Widget需要的 Widget网络资源, 并将该 Widget网络资源存放在该内存中。
在其他的实施例中, 进一步的, 该移动终端还包括资源动态加载单元
213, 用于通过该浏览器引擎内核拓展层动态加载该 Widget运行时所需要 的本地资源或者网络资源。
在其他的实施例中, 进一步的, 该移动终端还包括插件管理单元 214, 用于在该 Widget运行时需要加载插件时, 使用 JS扩展 API提供的动态加 载接口加载插件, 在该 Widget退出运行时, 使用该 JS扩展 API提供的动 态卸载接口卸载该插件。
以上仅为本发明的较佳实施例而已, 并不用以限制本发明, 凡在本发 明的精神和原则之内所作的任何修改、 等同替换和改进等, 均应包含在本 发明的保护范围之内。

Claims

权利要求书
1、 一种基于浏览器引擎的动态加载微件 Widget的方法, 其特征在于, 所述方法包括:
在 Widget启动时, 建立一个运行表, 所述运行表包括: Widget的标记 号、 Widget资源内存块指针、 Widget停止运行时间和 Widget资源清除最大 上限时间;
在所述 Widget退出时, 启动所述 Widget停止运行时间的计时器, 当所 述 Widget停止运行时间的计时器达到所述 Widget资源清除最大上限时间 时, 通过所述 Widget资源内存块指针从内存中将所述 Widget运行时所述 Widget资源占用的内存空间清除, 当所述 Widget停止运行时间的计时器没 达到所述 Widget资源清除最大上限时间时,维持所述 Widget资源占用的内 存空间。
2、 如权利要求 1所述方法, 其特征在于, 在建立一个运行表之后, 所 述方法进一步包括:
通过浏览器引擎内核拓展层访问本地文件系统, 获取所述 Widget本地 资源, 并将所述 Widget本地资源加载到所述内存中。
3、 如权利要求 2所述方法, 其特征在于, 在将 Widget本地资源加载 到内存中之后, 所述方法进一步包括:
通过浏览器引擎内核拓展层向服务器发起资源请求, 下载所述 Widget 需要的 Widget网络资源, 并将所述 Widget网络资源存放在所述内存中。
4、 如权利要求 3所述方法, 其特征在于, 在将 Widget网络资源存放 在内存中之后, 所述方法进一步包括: 通过所述浏览器引擎内核拓展层动 态加载所述 Widget运行时所需要的本地资源或者网络资源。
5、 如权利要求 1至 4任一项所述方法, 其特征在于, 在所述 Widget 运行时需要加载插件时, 所述方法还包括: 使用 JS扩展应用程序编程接口 API提供的动态加载接口加载插件; 相应地, 在所述 Widget退出运行时, 所述方法还包括:
使用所述 JS扩展 API提供的动态卸载接口卸载所述插件。
6、 一种移动终端, 其特征在于, 包括:
运行表建立单元, 用于在 Widget启动时, 建立一个运行表, 所述运行 表包括: Widget的标记号、 Widget资源内存块指针、 Widget停止运行时间 和 Widget资源清除最大上限时间;
资源管理单元, 用于在所述 Widget退出时, 启动所述 Widget停止运行 时间的计时器,当所述 Widget停止运行时间的计时器达到所述 Widget资源 清除最大上限时间时, 通过所述 Widget 资源内存块指针从内存中将所述 Widget运行时所述 Widget资源占用的内存空间清除, 当所述 Widget停止 运行时间的计时器没达到所述 Widget资源清除最大上限时间时, 维持所述 Widget资源占用的内存空间。
7、 如权利要求 6所述移动终端, 其特征在于, 所述移动终端还包括: 本地资源获取单元, 用于通过浏览器引擎内核拓展层访问本地文件系 统,获取所述 Widget本地资源, 并将所述 Widget本地资源加载到所述内存 中。
8、 如权利要求 7所述移动终端, 其特征在于, 所述移动终端还包括: 网络资源获取单元, 用于通过浏览器引擎内核拓展层向服务器发起资 源请求, 下载所述 Widget需要的 Widget网络资源, 并将所述 Widget网络 资源存放在所述内存中。
9、 如权利要求 8所述移动终端, 其特征在于, 所述移动终端还包括: 资源动态加载单元, 用于通过所述浏览器引擎内核拓展层动态加载所 述 Widget运行时所需要的本地资源或者网络资源。
10、 如权利要求 6至 9任一项所述移动终端, 其特征在于, 所述移动 终端还包括:
插件管理单元, 用于在所述 Widget运行时需要加载插件时, 使用 JS 扩展 API提供的动态加载接口加载插件, 在所述 Widget退出运行时, 使用 所述 JS扩展 API提供的动态卸载接口卸载所述插件。
PCT/CN2012/073209 2011-06-30 2012-03-28 基于浏览器引擎的动态加载微件的方法及移动终端 WO2012155698A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110182357.2 2011-06-30
CN201110182357.2A CN102323887B (zh) 2011-06-30 2011-06-30 基于浏览器引擎的动态加载Widget的方法及移动终端

Publications (1)

Publication Number Publication Date
WO2012155698A1 true WO2012155698A1 (zh) 2012-11-22

Family

ID=45451632

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/073209 WO2012155698A1 (zh) 2011-06-30 2012-03-28 基于浏览器引擎的动态加载微件的方法及移动终端

Country Status (2)

Country Link
CN (1) CN102323887B (zh)
WO (1) WO2012155698A1 (zh)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102323887B (zh) * 2011-06-30 2017-02-08 中兴通讯股份有限公司 基于浏览器引擎的动态加载Widget的方法及移动终端
CN102761659A (zh) * 2012-06-11 2012-10-31 广东欧珀移动通信有限公司 一种使用场景展示手机widget插件的实现方法
CN102955696B (zh) * 2012-11-06 2016-05-04 广东欧珀移动通信有限公司 一种桌面插件部署方法及系统
CN103077054B (zh) * 2012-12-29 2015-12-23 百度在线网络技术(北京)有限公司 一种云应用引擎中版本预览的控制方法及装置
CN104636152B (zh) * 2013-11-06 2018-07-27 青岛海信移动通信技术股份有限公司 一种基于浮层的应用程序调用方法和装置
CN104615458B (zh) * 2014-12-31 2017-10-31 福建天晴数码有限公司 一种基于json数据格式模块加载的方法及系统
CN105094920B (zh) * 2015-08-14 2018-07-03 网易(杭州)网络有限公司 一种游戏渲染方法和装置
CN105446774B (zh) * 2015-11-19 2018-11-13 广东欧珀移动通信有限公司 一种插件处理方法及用户终端
CN108469968A (zh) * 2018-02-08 2018-08-31 维沃移动通信有限公司 一种应用程序处理方法及移动终端
CN111343409B (zh) * 2020-02-13 2021-12-28 北京翼鸥教育科技有限公司 多个视频窗口动态排布的发起、同步方法及系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101344861A (zh) * 2007-07-10 2009-01-14 凤凰微电子(中国)有限公司 一种智能卡内存管理方法
US20100064207A1 (en) * 2008-09-10 2010-03-11 Chi Mei Communication Systems, Inc. System and method for displaying widget contents using a mobile device
CN101887376A (zh) * 2010-07-09 2010-11-17 中兴通讯股份有限公司 Widget引擎加载脚本插件的方法及Widget引擎
CN102323887A (zh) * 2011-06-30 2012-01-18 中兴通讯股份有限公司 基于浏览器引擎的动态加载Widget的方法及移动终端

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101661392B (zh) * 2008-08-29 2012-07-25 中国移动通信集团公司 在移动终端上运行专用界面工具的方法、装置及设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101344861A (zh) * 2007-07-10 2009-01-14 凤凰微电子(中国)有限公司 一种智能卡内存管理方法
US20100064207A1 (en) * 2008-09-10 2010-03-11 Chi Mei Communication Systems, Inc. System and method for displaying widget contents using a mobile device
CN101887376A (zh) * 2010-07-09 2010-11-17 中兴通讯股份有限公司 Widget引擎加载脚本插件的方法及Widget引擎
CN102323887A (zh) * 2011-06-30 2012-01-18 中兴通讯股份有限公司 基于浏览器引擎的动态加载Widget的方法及移动终端

Also Published As

Publication number Publication date
CN102323887B (zh) 2017-02-08
CN102323887A (zh) 2012-01-18

Similar Documents

Publication Publication Date Title
WO2012155698A1 (zh) 基于浏览器引擎的动态加载微件的方法及移动终端
US20210216700A1 (en) Information Processing Method and System
US9083774B2 (en) Local streaming proxy server
TWI708185B (zh) 程式的運行方法及裝置、計算設備以及儲存介質
CN101656789B (zh) 手机实现管理应用程序信息的方法及应用程序管理器
WO2014107987A1 (en) File presenting method and apparatus for a smart terminal
CN108496198B (zh) 一种图像处理方法及设备
WO2013097592A1 (zh) 脚本加载技术
WO2012045238A1 (zh) 一种移动设备上应用程序的启动方法及装置
CN102209111A (zh) 云计算移动网络终端设备开放性跨平台系统
WO2020206691A1 (zh) 应用程序的处理方法、装置、存储介质及电子设备
WO2011088759A1 (zh) 嵌入式浏览器的实现方法、装置和数字电视接收终端
CN110968331B (zh) 应用程序运行的方法和装置
CN102017673A (zh) 在用户终端和智能卡之间执行窗件的交互工作系统及其方法
CN113837939A (zh) 一种图像处理方法及设备
CN101945133A (zh) 一种用于移动终端的数据连接方法、装置及系统
KR20050094372A (ko) 멀티미디어 콘텐츠 서비스 시스템과 방법 및 그 기록매체
WO2015117278A1 (zh) 时钟中断信号的获取方法和nfv功能实体
WO2012079386A1 (zh) 一种移动终端及其浏览器的实现方法
WO2014067368A1 (zh) 资源预览图的获取方法、装置以及设备
US9787755B2 (en) Method and device for browsing network data, and storage medium
CN103631621A (zh) 一种信息提示方法及装置
CN103793459B (zh) 一种网页打开方法及装置
WO2009062396A1 (fr) Procédé d'accès à des ressources et système d'accès à des ressources
Ito et al. Application Push & Play–Proposal on Dynamic Execution Environment Combined with Personal Devices and Cloud Computing.-

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

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

Country of ref document: EP

Kind code of ref document: A1