CN110362322B - Electronic device and method for updating program offline - Google Patents
Electronic device and method for updating program offline Download PDFInfo
- Publication number
- CN110362322B CN110362322B CN201810319943.9A CN201810319943A CN110362322B CN 110362322 B CN110362322 B CN 110362322B CN 201810319943 A CN201810319943 A CN 201810319943A CN 110362322 B CN110362322 B CN 110362322B
- Authority
- CN
- China
- Prior art keywords
- offline
- service
- network
- application program
- program
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 25
- 239000000306 component Substances 0.000 description 50
- 238000010586 diagram Methods 0.000 description 8
- 238000004891 communication Methods 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 5
- 239000008358 core component Substances 0.000 description 3
- 238000011161 development Methods 0.000 description 3
- 239000007787 solid Substances 0.000 description 3
- VYZAMTAEIAYCRO-UHFFFAOYSA-N Chromium Chemical compound [Cr] VYZAMTAEIAYCRO-UHFFFAOYSA-N 0.000 description 2
- 230000009471 action Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000007774 longterm Effects 0.000 description 2
- 230000008520 organization Effects 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000013515 script Methods 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
本发明提供一种电子装置与其离线更新程序的方法。所述方法包括:当所述网络模块连接至网络时,由网络伺服器取得服务代理元件以及离线执行数据。安装并运行所述服务代理元件,并存储所述离线执行数据。当所述网络模块未连接至网络时,通过应用程序的内嵌浏览器来触发所述服务代理元件存取所述离线执行数据而获取离线执行结果。通过所述应用程序依据所述离线执行结果执行一操作。
The invention provides an electronic device and a method for updating programs offline. The method includes: when the network module is connected to the network, the network server obtains the service agent component and the offline execution data. Installing and running the service agent component, and storing the offline execution data. When the network module is not connected to the network, the embedded browser of the application program is used to trigger the service proxy element to access the offline execution data to obtain an offline execution result. Execute an operation according to the offline execution result through the application program.
Description
技术领域technical field
本发明涉及一种电脑技术,尤其涉及一种电子装置与其离线更新程序的方法。The invention relates to a computer technology, in particular to an electronic device and its off-line updating program method.
背景技术Background technique
随着科技日新月异,网际网络也快速地发展,越来越多的网络信息与网络应用服务通过网络而唾手可得。进一步而言,由于网际网络的发达,许多网络服务营运者可于网络中建置网络服务平台供使用者来使用,例如网络购物平台、网络新闻平台、单车共享平台等等。对应的,使用者的移动电子装置也装载有这些网络服务营运者提供的应用程序,以通过应用程序从上述网络服务平台获取网络应用服务。With the rapid development of science and technology, the Internet is also developing rapidly, and more and more network information and network application services are readily available through the network. Furthermore, due to the development of the Internet, many network service operators can build network service platforms in the network for users to use, such as online shopping platforms, online news platforms, bicycle sharing platforms and so on. Correspondingly, the user's mobile electronic device is also loaded with application programs provided by these network service operators, so as to obtain network application services from the above-mentioned network service platform through the application programs.
然而,为了让这些应用程序能够应付网络离线的状态,而常见的方法是由程序开发者在上架应用程序前就先写好离线程序,好让使用者于下载应用程序时可以同步获取应用程序的离线程序。然而,上述方法将产生无法即时反应离线网络服务已更新的问题。举例而言,当应用程序的离线程序被再度更新时,使用者需要进入应用程序供应平台(例如应用程序商店)进行应用程序的更新动作,才有办法获取离线程序的最新版本而执行版本更新。倘若使用者迟迟没有更新应用程序,移动电子装置也就无法尽早提供更新后的离线服务。此外,由于移动电子装置上作业系统的原生程序语言的种类不只一种,因此网络服务营运者/程序开发者也就需要维护多套对应至不同程序语言的离线程序版本,其对于软件信息服务的维护与开发是不小的负担。However, in order to allow these applications to cope with the offline state of the network, a common method is for the program developer to write an offline program before launching the application, so that the user can obtain the application synchronously when downloading the application. offline program. However, the above method will cause the problem that it cannot immediately reflect that the offline network service has been updated. For example, when the offline program of the application program is updated again, the user needs to enter the application program supply platform (such as an application program store) to update the application program, so as to obtain the latest version of the offline program and perform the version update. If the user does not update the application program for a long time, the mobile electronic device will not be able to provide the updated offline service as soon as possible. In addition, since there is more than one type of native programming language of the operating system on the mobile electronic device, the network service operator/program developer also needs to maintain multiple sets of offline program versions corresponding to different programming languages, which is very important for software information services. Maintenance and development is no small burden.
发明内容Contents of the invention
有鉴于此,本发明提供一种电子装置与其离线更新程序的方法,可在离线状态下利用超文件标记语言规范来跨平台更新客户端的离线程序,从而降低离线程序开发的负担并快速更新客户端的离线程序。In view of this, the present invention provides an electronic device and a method for updating its program offline, which can use the hyperfilemarkup language specification to update the offline program of the client side across platforms in an offline state, thereby reducing the burden of offline program development and quickly updating the client side. offline program.
本发明的一实施例提供一种离线更新程序的方法,用于具有网络模块的电子装置,所述方法包括下列步骤。当所述网络模块连接至网络时,由网络伺服器取得服务代理元件以及离线执行数据。安装并运行所述服务代理元件,并存储所述离线执行数据。当所述网络模块未连接至网络时,通过应用程序的内嵌浏览器来触发所述服务代理元件存取所述离线执行数据而获取离线执行结果。通过所述应用程序依据所述离线执行结果执行一操作。An embodiment of the present invention provides a method for updating programs offline for an electronic device with a network module. The method includes the following steps. When the network module is connected to the network, the service agent component and offline execution data are obtained from the network server. Installing and running the service agent component, and storing the offline execution data. When the network module is not connected to the network, the embedded browser of the application program is used to trigger the service proxy component to access the offline execution data to obtain an offline execution result. Execute an operation according to the offline execution result through the application program.
本发明的另一实施例提供一种电子装置,其包括存储电路、网络模块及处理器。所述处理器耦接至所述存储电路及所述网络模块。所述处理器经配置用以:当所述网络模块连接至网络时,由网络伺服器取得服务代理元件以及离线执行数据;安装并运行所述服务代理元件,并存储所述离线执行数据;当所述网络模块未连接至网络时,通过应用程序的内嵌浏览器来触发所述服务代理元件存取所述离线执行数据而获取离线执行结果;以及通过所述应用程序依据所述离线执行结果执行一操作。Another embodiment of the present invention provides an electronic device, which includes a storage circuit, a network module, and a processor. The processor is coupled to the storage circuit and the network module. The processor is configured to: when the network module is connected to the network, obtain the service proxy element and the offline execution data from the network server; install and run the service agent element, and store the offline execution data; When the network module is not connected to the network, the embedded browser of the application program is used to trigger the service proxy element to access the offline execution data to obtain the offline execution result; and according to the offline execution result through the application program Perform an action.
基于上述,本发明提出的离线更新程序的方法与电子装置,可于连网状态由网络伺服器取得服务代理元件以及离线执行数据,并于未连网状态通过应用程序的内嵌浏览器呼叫服务代理元件存取离线执行数据。于此,服务代理元件于可以在浏览器背后运行并对应于网络服务营运者所架设的特定网站,以将一网络伺服器提供的离线执行数据存储于浏览存储器中。因此,当电子装置未连接至网络时,应用程序的离线程序可基于服务代理元件产生的离线执行结果来更新。Based on the above, the method and electronic device for offline program update proposed by the present invention can obtain the service proxy component and offline execution data from the network server in the connected state, and call the service through the embedded browser of the application program in the disconnected state. The proxy component accesses offline execution data. Here, the service proxy component can run behind the browser and correspond to a specific website set up by the network service operator, so as to store offline execution data provided by a network server in the browsing memory. Therefore, when the electronic device is not connected to the network, the offline program of the application program can be updated based on the offline execution result generated by the service proxy component.
为让本发明的上述特征和优点能更明显易懂,下文特举实施例,并配合附图作详细说明如下。In order to make the above-mentioned features and advantages of the present invention more comprehensible, the following specific embodiments are described in detail with reference to the accompanying drawings.
附图说明Description of drawings
图1是根据本发明的一实施例所示出的网络服务系统的示意图。Fig. 1 is a schematic diagram of a network service system according to an embodiment of the present invention.
图2是根据本发明的一实施例所示出的电子装置的示意图。FIG. 2 is a schematic diagram of an electronic device according to an embodiment of the present invention.
图3是根据本发明的一实施例所示出的离线更新程序的方法的流程图。Fig. 3 is a flow chart of a method for updating a program offline according to an embodiment of the present invention.
图4是根据本发明的一实施例所示出的电子装置处于连线情境的示意图。FIG. 4 is a schematic diagram showing an electronic device in a connection situation according to an embodiment of the present invention.
图5是根据本发明的一实施例所示出的电子装置处于离线情境的示意图。FIG. 5 is a schematic diagram showing an offline situation of the electronic device according to an embodiment of the present invention.
图6是根据本发明的一实施例所示出的离线更新程序的方法的流程图。Fig. 6 is a flow chart of a method for updating a program offline according to an embodiment of the present invention.
附图标记说明Explanation of reference signs
10:网络服务系统;10: Network service system;
111:电子装置;111: electronic device;
121:网络伺服器;121: network server;
101:网络;101: network;
21:输入接口;21: input interface;
22:输出接口;22: output interface;
23:存储电路;23: storage circuit;
24:网络模块;24: network module;
25:处理器;25: processor;
231:应用程序;231: application program;
232:内嵌式浏览器;232: Embedded browser;
233:独立浏览器;233: independent browser;
234:浏览器核心元件;234: browser core components;
235:服务代理元件;235: service proxy element;
236:浏览存储器;236: browse memory;
237:软件通讯接口;237: software communication interface;
A1:离线执行数据;A1: Offline execution data;
B1:程序数据;B1: program data;
C1:离线执行结果;C1: offline execution result;
S301~S304、S601~S610:步骤。S301-S304, S601-S610: steps.
具体实施方式Detailed ways
图1是根据本发明的一实施例所示出的网络服务系统的示意图。请参照图1,在一实施例中,网络服务系统10包括网络101、电子装置111及网络伺服器121。在一实施例中,网络101是指网际网络(Internet)。在另一实施例中,网络101也可以是指本地区域网络或私有网络。电子装置111及网络伺服器121可分别经由有线或无线方式连接至网络101。此外,电子装置111可以是智能手机、平板电脑、台式电脑或笔记本电脑等各式具有信号输入、信号输出、连网及运算功能的电子装置。Fig. 1 is a schematic diagram of a network service system according to an embodiment of the present invention. Please refer to FIG. 1 , in one embodiment, the network service system 10 includes a network 101 , an electronic device 111 and a network server 121 . In one embodiment, the network 101 refers to the Internet. In another embodiment, the network 101 may also refer to a local area network or a private network. The electronic device 111 and the network server 121 can be respectively connected to the network 101 via wired or wireless methods. In addition, the electronic device 111 may be a smart phone, a tablet computer, a desktop computer or a notebook computer, etc., which have functions of signal input, signal output, networking and calculation.
在一实施例中,电子装置111是客户端装置,而网络伺服器121是网络服务的服务提供装置。例如,网络伺服器121可以是某企业组织架设的伺服器主机。网络伺服器121连接至网络101,网络伺服器121可提供网络服务(例如,通讯社交服务、新闻信息提供服务、交通购票与查询服务、网络金融服务等)的入口网页供客户端装置查询与使用。例如,若电子装置111与网络伺服器121皆连接至网络101,电子装置111可浏览或登入某企业组织的入口网页以获得相关的网络服务。In one embodiment, the electronic device 111 is a client device, and the network server 121 is a service provider device for network services. For example, the network server 121 may be a server host set up by an enterprise organization. The web server 121 is connected to the network 101, and the web server 121 can provide portal webpages of web services (such as social communication services, news information provision services, traffic ticket purchase and query services, network financial services, etc.) for client devices to query and use. For example, if both the electronic device 111 and the network server 121 are connected to the network 101, the electronic device 111 can browse or log in a portal webpage of an enterprise organization to obtain related network services.
在一实施例中,电子装置111的网页浏览器(Web browser)可传送一服务请求来存取由网络伺服器121提供的内容(例如,通过输入全球资源定位器(Uniform ResourceLocator,URL)到网页浏览器中)。如果网页浏览器的使用者被授权存取该内容,网络伺服器121基本上即提供该内容给电子装置111的网页浏览器。在网络环境中,内容及对内容的请求经常使用超文字转换协定(Hypertext Transfer Protocol,HTTP)来传送。网络式内容由符合超文字标记语言(HyperText Markup Language,HTML)规范的页面、样式板、图像及指令码(script)等所提供。In one embodiment, the web browser (Web browser) of the electronic device 111 may send a service request to access the content provided by the web server 121 (for example, by entering a global resource locator (Uniform Resource Locator, URL) into the web page browser). If the user of the web browser is authorized to access the content, the web server 121 basically provides the content to the web browser of the electronic device 111 . In a network environment, content and requests for content are often transmitted using Hypertext Transfer Protocol (HTTP). Web-style content is provided by pages, style sheets, images, scripts, etc. conforming to HyperText Markup Language (HTML) specifications.
在一实施例中,上述的网页浏览器包括独立浏览器与内嵌式浏览器。独立浏览器是一套完整的软件或应用程序本身(例如,Chrome、Internet Explore、Firefox、Safari、Opera等等),使用者可通过开启独立浏览器而经由网络101连结至特定网站。此外,有别于独立浏览器,内嵌式浏览器并非完整的应用程序本身,而是依据独立浏览器的核心而运作于其他应用程序内的一种浏览器元件(例如,Android系统的WebView、iOS系统的WebView或即时通讯软件Facebook Messenger的WebView等等)。举例而言,Android系统的WebView采用Chrome的核心技术,可让Android应用程序显示网页内容。In one embodiment, the above-mentioned web browser includes an independent browser and an embedded browser. The stand-alone browser is a complete set of software or application program itself (for example, Chrome, Internet Explorer, Firefox, Safari, Opera, etc.), and the user can connect to a specific website via the network 101 by opening the stand-alone browser. In addition, different from the independent browser, the embedded browser is not a complete application itself, but a browser component that operates in other applications based on the core of the independent browser (for example, WebView of the Android system, WebView of iOS system or WebView of instant messaging software Facebook Messenger, etc.). For example, the WebView of the Android system adopts the core technology of Chrome, which allows Android applications to display web content.
图2是根据本发明的一实施例所示出的电子装置的示意图。请参照图2,电子装置111包括输入接口21、输出接口22、存储电路23、网络模块24及处理器25。输入接口21、输出接口22、存储电路23及网络模块24皆耦接至处理器25。输入接口21用以接收使用者输入的操作指令。例如,输入接口21可包括鼠标、键盘、触控板或麦克风(即,语音输入装置)等各式用于输入信号的实体接口电路。输出接口22用以输出信号。例如,输出接口22可包括屏幕(或,显示器)、投影机或扬声器(即,语音输出装置)等用于输出信号的实体接口电路。在一实施例中,输入接口21与输出接口22也可结合为触控屏幕或类似同时具有信号输入与输出功能的装置。例如,输入接口21与输出接口22可结合为电阻式触控面板、电容式触控面板、光学式触控面板、声波式触控面板或电磁式触控面板等。FIG. 2 is a schematic diagram of an electronic device according to an embodiment of the present invention. Please refer to FIG. 2 , the electronic device 111 includes an input interface 21 , an output interface 22 , a storage circuit 23 , a network module 24 and a processor 25 . The input interface 21 , the output interface 22 , the storage circuit 23 and the network module 24 are all coupled to the processor 25 . The input interface 21 is used for receiving operation instructions input by the user. For example, the input interface 21 may include various physical interface circuits for inputting signals, such as a mouse, a keyboard, a touch panel, or a microphone (ie, a voice input device). The output interface 22 is used for outputting signals. For example, the output interface 22 may include a physical interface circuit for outputting signals, such as a screen (or display), a projector, or a speaker (ie, a voice output device). In one embodiment, the input interface 21 and the output interface 22 can also be combined into a touch screen or a similar device with both signal input and output functions. For example, the input interface 21 and the output interface 22 can be combined into a resistive touch panel, a capacitive touch panel, an optical touch panel, an acoustic wave touch panel, or an electromagnetic touch panel.
存储电路23用以非易失性地存储数据与程序码。在此,非易失性地存储数据是指,存储电路23所存储的数据不会因为电源停止供应至存储电路23而遗失。例如,存储电路23可包括传统硬盘(HDD)、固态硬盘(SDD)、固态混合式硬盘(Solid State Hybrid Drive,SSHD)或快闪存储器等各式非易失性存储媒体。The storage circuit 23 is used for non-volatile storage of data and program codes. Here, storing data in a non-volatile manner means that the data stored in the storage circuit 23 will not be lost due to power supply to the storage circuit 23 being stopped. For example, the storage circuit 23 may include various non-volatile storage media such as conventional hard disk (HDD), solid state disk (SDD), solid state hybrid disk (Solid State Hybrid Drive, SSHD) or flash memory.
网络模块24用于将电子装置111连接至网络101并经由网络101传递信息。例如,网络模块24可包括有线和/或无线网络接口卡等实体网络接口电路。例如,在无线通讯方面,网络模块24可支持第三代无线通讯技术(3G)、蓝牙(Bluetooth)、通用封包无线电服务(General Packet Radio Service,GPRS)、高速下载封包存取(High Speed DownlinkPacket Access,HSDPA)、高速上传封包存取(High Speed Uplink Packet Access,HSUPA)、无线相容认证(Wireless-Fidelity,Wi-Fi)、无线广域网络(Wireless Wide AreaNetwork,WWAN)以及长期演进技术(Long Term Evolution,LTE)等各式无线通讯协定。此外,在有线网络方面,网络模块24可例如支持以太网络(Ethernet)等有线通讯协定。The network module 24 is used to connect the electronic device 111 to the network 101 and transmit information via the network 101 . For example, network module 24 may include physical network interface circuits such as wired and/or wireless network interface cards. For example, in terms of wireless communication, the network module 24 can support third-generation wireless communication technology (3G), Bluetooth (Bluetooth), General Packet Radio Service (General Packet Radio Service, GPRS), high-speed download packet access (High Speed Downlink Packet Access) , HSDPA), High Speed Uplink Packet Access (HSUPA), Wireless Compatibility Authentication (Wireless-Fidelity, Wi-Fi), Wireless Wide Area Network (Wireless Wide Area Network, WWAN) and Long Term Evolution Technology (Long Term Evolution, LTE) and other wireless communication protocols. In addition, in terms of wired network, the network module 24 can support wired communication protocols such as Ethernet.
处理器25负责电子装置111的整体运作。例如,处理器25可包括中央处理器、或是其他可程序化的一般用途或特殊用途的微处理器(Microprocessor)、数字信号处理器(Digital Signal Processor,DSP)、控制器、特殊应用集成电路(Application SpecificIntegrated Circuit,ASIC)、可程序化逻辑装置(Programmable Logic Device,PLD)或其他类似装置或这些装置的组合。此外,处理器25中可配置有随机存取存储器(RAM)或唯读存储器(ROM)等易失性存储媒体。The processor 25 is responsible for the overall operation of the electronic device 111 . For example, the processor 25 may include a central processing unit, or other programmable general-purpose or special-purpose microprocessor (Microprocessor), digital signal processor (Digital Signal Processor, DSP), controller, application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), Programmable Logic Device (Programmable Logic Device, PLD) or other similar devices or a combination of these devices. In addition, volatile storage media such as random access memory (RAM) or read only memory (ROM) may be configured in the processor 25 .
图3是根据本发明的一实施例所示出的离线更新程序的方法的流程图。以下将以前述图1与图2的实施例来搭配图3进行说明。请参照图1至图3,于步骤S301,当网络模块24连接至网络101时,处理器25由网络伺服器121取得服务代理元件以及离线执行数据。在步骤S302,处理器25安装并运行服务代理元件,并存储离线执行数据。Fig. 3 is a flow chart of a method for updating a program offline according to an embodiment of the present invention. The following will be described with reference to the embodiments of FIGS. 1 and 2 in conjunction with FIG. 3 . Please refer to FIG. 1 to FIG. 3 , in step S301 , when the network module 24 is connected to the network 101 , the processor 25 obtains the service agent component and the offline execution data from the network server 121 . In step S302, the processor 25 installs and runs the service agent component, and stores offline execution data.
在一实施例中,当电子装置111处于网络连线状态时,处理器25可从提供网络服务的网络伺服器121取得一特定网站的服务代理元件。此服务代理元件是可以在独立浏览器或内嵌浏览器的背后(独立于网页页面)运行的一种脚本程序。在一实施例中,此服务代理元件可为“Service Worker”程序。每个网站都可以向电子装置111的网页浏览器注册以安装属于自己的“Service Worker”,以在使用者浏览到自己的网站时独自帮使用者进行一些工作。尤其是,完成安装的“Service Worker”是可以在离线状态下运行的。换言之,处理器25经由网络101从网络伺服器121获取服务代理元件,并将服务代理元件事先安装于存储电路23中。In one embodiment, when the electronic device 111 is in the network connection state, the processor 25 may obtain a service agent component of a specific website from the network server 121 providing network services. The service agent component is a script program that can run behind the stand-alone browser or the embedded browser (independent of the web page). In one embodiment, the service agent component may be a "Service Worker" program. Each website can register with the web browser of the electronic device 111 to install its own "Service Worker", so as to help the user perform some work independently when the user browses to his own website. In particular, the installed "Service Worker" can be run offline. In other words, the processor 25 obtains the service proxy component from the network server 121 via the network 101 and installs the service proxy component in the storage circuit 23 in advance.
在一实施例中,在服务代理元件完成安装后,服务代理元件会被激活(activated)而控制管辖范围内的网页页面,于此同时,服务代理元件可以进行离线执行数据与网页相关数据的缓存,以将离线执行数据存储于存储电路23中的浏览存储器之中。上述浏览存储器泛指网页浏览器用以存储文字、文件、程序码等形式的数据的存储元件,例如是应用快取(Application Cache)、本地存储库(Local Storage)、对话存储库(Session Storage)、指示符数据库(IndexDB)等等。In one embodiment, after the service proxy component is installed, the service proxy component will be activated (activated) to control the web pages within the jurisdiction, and at the same time, the service proxy component can cache offline execution data and web page related data , so as to store the offline execution data in the browse memory in the storage circuit 23 . The above-mentioned browsing memory generally refers to the storage elements used by web browsers to store data in the form of text, files, program codes, etc., such as Application Cache, Local Storage, Session Storage, Indicator Database (IndexDB) and more.
之后,在步骤S303,当网络模块24未连接至网络101时,处理器25通过应用程序的内嵌浏览器来触发服务代理元件存取离线执行数据而获取离线执行结果。在步骤S304,处理器25通过应用程序依据离线执行结果执行一操作。Afterwards, in step S303 , when the network module 24 is not connected to the network 101 , the processor 25 triggers the service agent component to access the offline execution data through the embedded browser of the application program to obtain the offline execution result. In step S304, the processor 25 executes an operation according to the offline execution result through the application program.
在一实施例中,当电子装置111处于网络离线状态时,处理器25可通过运行应用程序而一并运行其内嵌浏览器。基此,即便处于离线状态,由于应用程序的内嵌浏览器被要求去呼叫对应的服务代理元件,因此服务代理元件也将运行或读取在连线状态下取得的离线执行数据。在一实施例中,在连线状态下获取的网页相关数据与离线执行数据可包括图片、影片、动画、JavaScript程序码、FLASH动画数据以及串联样式表(Cascading StyleSheets,CSS)等等。特别是,离线执行数据可包括应用程序的离线程序码,其例如是符合html5规格的程序码。In one embodiment, when the electronic device 111 is offline from the network, the processor 25 can run the embedded browser by running the application program. Based on this, even in the offline state, since the embedded browser of the application program is required to call the corresponding service agent element, the service agent element will also run or read the offline execution data acquired in the connection state. In one embodiment, the webpage related data and offline execution data obtained in the connection state may include pictures, videos, animations, JavaScript codes, FLASH animation data, Cascading Style Sheets (CSS) and so on. In particular, the offline execution data may include the offline program code of the application program, for example, the program code conforming to the html5 specification.
因此,服务代理元件可运行与读写离线执行数据而获取对应的离线执行结果,而服务代理元件获取的离线执行结果例如是应用程序的离线参数设定、离线程序码本身或离线网页内容等等。最后,处理器25可通过应用程序依据离线执行结果执行一操作,像是通过应用程序呈现离线网页内容、变更应用程序的参数设定、变更应用程序的离线服务设定、更新应用程序的离线程序码等等操作。Therefore, the service proxy component can run and read and write offline execution data to obtain the corresponding offline execution result, and the offline execution result obtained by the service proxy component is, for example, the offline parameter setting of the application program, the offline program code itself or the content of the offline webpage, etc. . Finally, the processor 25 can perform an operation according to the offline execution result through the application program, such as presenting offline webpage content through the application program, changing the parameter setting of the application program, changing the offline service setting of the application program, and updating the offline program of the application program Code and so on.
为了清楚说明本发明,图4是根据本发明的一实施例所示出的电子装置处于连线情境的示意图。图5是根据本发明的一实施例所示出的电子装置处于离线情境的示意图。In order to clearly illustrate the present invention, FIG. 4 is a schematic diagram showing an electronic device in a connection situation according to an embodiment of the present invention. FIG. 5 is a schematic diagram showing an offline situation of the electronic device according to an embodiment of the present invention.
请先参照图4,电子装置111可装载有独立浏览器233以及应用程序231。应用程序231内嵌有一内嵌式浏览器232,致使应用程序231可通过内嵌式浏览器232呈现网页内容。于此,独立浏览器233与内嵌式浏览器232可使用共同的浏览器核心元件234来获取符合HTML规范的网页相关的数据。浏览器核心元件234包括服务代理元件235以及浏览存储器236。Please refer to FIG. 4 first, the electronic device 111 can be loaded with an independent browser 233 and an application program 231 . The application program 231 is embedded with an embedded browser 232 , so that the application program 231 can present webpage content through the embedded browser 232 . Here, the stand-alone browser 233 and the embedded browser 232 can use the common browser core component 234 to acquire data related to the webpage conforming to the HTML specification. The browser core component 234 includes a service proxy component 235 and a browsing memory 236 .
在一实施例中,独立浏览器233与内嵌式浏览器232都可于一连线状态中经由网络101而耦接至网络伺服器121,以由网络伺服器121取得与网页相关的内容。当使用者使用网页浏览器(独立浏览器233或内嵌式浏览器232)连结至网络伺服器121所建立的特定网站时,网络伺服器121可将关于此特定网站的服务代理元件235的程序数据B1提供给网页浏览器。处理器25依据程序数据B1完成服务代理元件235的安装或更新。In one embodiment, both the stand-alone browser 233 and the embedded browser 232 can be coupled to the web server 121 through the network 101 in a connected state, so that the web server 121 can obtain content related to web pages. When the user uses a web browser (stand-alone browser 233 or embedded browser 232) to link to the specific website established by the web server 121, the web server 121 can transfer the program of the service agent component 235 about this specific website Data B1 is provided to the web browser. The processor 25 completes the installation or update of the service agent component 235 according to the program data B1.
此外,当使用者使用网页浏览器(独立浏览器233或内嵌式浏览器232)连结至网络伺服器121时,浏览存储器236可将网络伺服器121所提供的最新的离线执行数据A1以及一些与网页相关的数据缓存于存储电路23中的浏览存储器236。在一实施例中,服务代理元件235可协助网页浏览器将浏览过的网页相关数据进行缓存,因此即便处于连线状态,服务代理元件235也可协助网页浏览器从浏览存储器234提取一些曾经浏览过的网页相关数据,以避免下载重复的网页相关数据而节省网络流量。值得一提的是,一旦应用程序231的开发者发布了最新版本的离线执行数据A1,处于连线状态的电子装置111可从经由网络101而立即获取应用程序231的离线执行数据A1。In addition, when the user uses a web browser (standalone browser 233 or embedded browser 232) to connect to the web server 121, the browsing memory 236 can store the latest offline execution data A1 provided by the web server 121 and some The data related to the webpage is cached in the browsing memory 236 in the storage circuit 23 . In one embodiment, the service proxy element 235 can assist the web browser to cache the related data of the web pages browsed, so even in the connection state, the service proxy element 235 can also assist the web browser to extract some previously browsed data from the browsing memory 234. The related data of the web page has been saved, so as to avoid downloading the related data of the repeated web page and save network traffic. It is worth mentioning that once the developer of the application program 231 releases the latest version of the offline execution data A1 , the connected electronic device 111 can immediately obtain the offline execution data A1 of the application program 231 via the network 101 .
接着,请参照图5,当电子装置111处于离线状态(网络模块24没有连接至网络101)时,应用程序231可要求内嵌式浏览器232去呼叫服务代理元件235。因此,被呼叫的服务代理元件235将从浏览存储器236中存取与应用程序231相关的离线执行数据A1。服务代理元件235运行离线执行数据A1中的离线程序码并读写离线执行数据A1中的离线服务相关数据,并据以产生离线执行结果C1。基此,应用程序231可通过桥接内嵌浏览器232的软件通讯接口237取得服务代理元件235产生的离线执行结果C1,并依据离线执行结果C1而于离线状态执行一离线操作。例如,应用程序231既有的离线程序可依据离线执行结果C1而于离线状态被更新。此外,软件通讯接口237是一种使内嵌浏览器232与应用程序231可以互相沟通的元件接口,软件通讯接口237让内嵌浏览器232与应用程序231可以互相调用彼此的程序码。Next, please refer to FIG. 5 , when the electronic device 111 is offline (the network module 24 is not connected to the network 101 ), the application program 231 may request the embedded browser 232 to call the service proxy component 235 . Therefore, the called service agent component 235 will access the offline execution data A1 related to the application program 231 from the browse memory 236 . The service agent component 235 runs the offline program code in the offline execution data A1 and reads and writes the offline service related data in the offline execution data A1, and generates an offline execution result C1 accordingly. Based on this, the application program 231 can obtain the offline execution result C1 generated by the service agent component 235 through the software communication interface 237 bridging the embedded browser 232, and perform an offline operation in the offline state according to the offline execution result C1. For example, the existing offline program of the application program 231 can be updated in the offline state according to the offline execution result C1. In addition, the software communication interface 237 is a component interface enabling the embedded browser 232 and the application program 231 to communicate with each other. The software communication interface 237 allows the embedded browser 232 and the application program 231 to call each other's program codes.
在一应用范例中,假设应用程序231是台铁购票应用程序,使用者可通过台铁购票应用程序来购买或查询台铁车票。台铁网站的服务代理元件235已在电子装置111处于连线状态时被下载并完成安装。并且,最新的台铁时刻表以及台铁购票应用程序的离线程序码(也即离线执行数据A1)可以通过服务代理元件235的运行而纪录于浏览存储器236里。如此一来,当使用者于网络离线状态开启台铁购票应用程序(也即应用程序231)时,应用程序231里的内嵌浏览器232可以触发服务代理元件235从浏览存储器236存取最新的台铁时刻表以及台铁购票应用程序的离线程序码,以提供最新的离线购票查询服务给使用者。如此一来,通过本发明实施例的方法,因为没有立即更新应用程序231的版本而导致使用者获取旧的台铁时刻表或尚未更新的离线购票查询服务的现象是可以避免的。In an application example, assuming that the application program 231 is a Taiwan Railway ticketing application, a user can purchase or inquire about a Taiwan Railway ticket through the Taiwan Railway ticketing application. The service agent component 235 of the Taiwan Railway website has been downloaded and installed when the electronic device 111 is in the connection state. And, the latest Taiwan Railway timetable and the offline program code (that is, the offline execution data A1) of the Taiwan Railway ticketing application program can be recorded in the browsing memory 236 through the operation of the service agent component 235 . In this way, when the user opens the Taiwan Railways ticketing application program (that is, the application program 231) in the offline state of the network, the embedded browser 232 in the application program 231 can trigger the service agent component 235 to access the latest The Taiwan Railway timetable and the offline program code of the Taiwan Railway ticketing application to provide users with the latest offline ticketing inquiry service. In this way, through the method of the embodiment of the present invention, the phenomenon that the user obtains the old Taiwan Railway timetable or the offline ticketing query service that has not been updated because the version of the application program 231 is not updated immediately can be avoided.
此外,在一实施例中,独立浏览器233的同步元件还可将浏览器元件的相关设定同步至内嵌浏览器232。更具体而言,当同步元件开启同步机制时,独立浏览器233与内嵌浏览器232可相互同步读写最新的服务代理元件235的程序码B1与浏览器存储236中最新的离线执行数据A1。基此,内嵌浏览器232可于后续触发服务代理元件235来取得离线执行数据A1。图6是根据本发明的一实施例所示出的离线更新程序的方法的流程图。本实施例的离线更新程序的方法的相关实施细节以及相关装置特征可由上述关于图1至图5的各实施例的叙述当中,获得足够的教示、建议以及实施方式,在此不再加以重复赘述。In addition, in an embodiment, the synchronization component of the stand-alone browser 233 can also synchronize the related settings of the browser component to the embedded browser 232 . More specifically, when the synchronization component starts the synchronization mechanism, the stand-alone browser 233 and the embedded browser 232 can read and write the latest program code B1 of the service agent component 235 and the latest offline execution data A1 in the browser storage 236 synchronously. . Based on this, the embedded browser 232 can subsequently trigger the service agent component 235 to obtain the offline execution data A1. Fig. 6 is a flow chart of a method for updating a program offline according to an embodiment of the present invention. The relevant implementation details and related device features of the method for updating the program offline in this embodiment can be obtained from the descriptions of the above-mentioned embodiments in FIGS. .
请参照图6,在步骤S601,执行应用程序。在步骤S602,判断是否连接至网络。若步骤S602判断为是,在步骤S603,当网络模块连接至网络时,由网络伺服器取得服务代理元件以及离线执行数据。之后,在步骤S604,安装并运行服务代理元件,并存储离线执行数据。此外,服务代理元件与浏览存储器内的离线执行数据是可以被定时或不定时更新的。因此,在步骤S605,当网络模块连接至该网络时,更新服务代理元件以及浏览存储器内的离线执行数据。此外,应用程序可于连线状态下正常提供对应的网络服务。Referring to FIG. 6, in step S601, an application program is executed. In step S602, it is determined whether to connect to the network. If the determination in step S602 is yes, in step S603, when the network module is connected to the network, the network server obtains the service agent component and the offline execution data. Afterwards, in step S604, install and run the service agent component, and store offline execution data. In addition, the offline execution data in the service agent component and the browsing memory can be updated regularly or irregularly. Therefore, in step S605, when the network module is connected to the network, update the service agent component and browse the offline execution data in the memory. In addition, the application program can normally provide corresponding network services in the connected state.
另一方面,若步骤S602判断为否,在步骤S606,将独立浏览器的浏览器元件的相关设定同步至内嵌浏览器,其中浏览器元件包括服务代理元件。然而,需说明的是,虽然步骤S606执行于图6所示的实施例中,但步骤S606的执行是选择性的。在其他实施例中,步骤S606的执行是可以省略的。在步骤S607,当网络模块未连接至网络时,通过应用程序的内嵌浏览器来触发服务代理元件存取离线执行数据。在步骤S608,通过服务代理元件在内嵌浏览器的背后运行并读写浏览存储器内的离线执行数据。在步骤S609,基于应用程序产生的服务请求,利用应用程序经由软件通讯接口从内嵌浏览器取得离线执行结果。在步骤S610,利用应用程序依据对应于服务请求的离线执行结果来提供离线服务。On the other hand, if the determination in step S602 is negative, in step S606 , the related settings of the browser component of the stand-alone browser are synchronized to the embedded browser, wherein the browser component includes a service proxy component. However, it should be noted that although step S606 is performed in the embodiment shown in FIG. 6 , the execution of step S606 is optional. In other embodiments, the execution of step S606 may be omitted. In step S607, when the network module is not connected to the network, the embedded browser of the application program is used to trigger the service agent component to access the offline execution data. In step S608, the service proxy component runs behind the embedded browser and reads and writes the offline execution data in the browsing memory. In step S609, based on the service request generated by the application program, the application program is used to obtain the offline execution result from the embedded browser through the software communication interface. In step S610, the offline service is provided by the application program according to the offline execution result corresponding to the service request.
综上所述,本发明提出的离线更新程序的方法与电子装置,可于连网状态由网络伺服器取得服务代理元件以及离线执行数据,并于未连网状态通过应用程序的内嵌浏览器呼叫服务代理元件存取离线执行数据。于此,服务代理元件于可以在浏览器背后运行并对应于网络服务运者所架设的特定网站,以将一网络伺服器提供的离线执行数据存储于浏览存储器中。因此,当电子装置未连接至网络时,应用程序可基于服务代理元件产生的离线执行结果来更新离线程序或提供最新的离线服务。如此一来,即便电子装置当前是处于未连网的状态且应用程序尚未经历版本的更新动作,使用者也可以获得与所要求的服务相关的最新离线服务信息。另外,由于程序开发者仅需要维护可以跨平台使用的离线程序码,因而可降低维护多种程序语言版本的离线程序的负担。To sum up, the method and electronic device for offline program update proposed by the present invention can obtain the service agent components and offline execution data from the network server in the connected state, and use the embedded browser of the application program in the disconnected state The call service agent component accesses offline execution data. Here, the service proxy component can run behind the browser and correspond to a specific website set up by the network service operator, so as to store the offline execution data provided by a network server in the browsing memory. Therefore, when the electronic device is not connected to the network, the application program can update the offline program or provide the latest offline service based on the offline execution result generated by the service agent component. In this way, even if the electronic device is currently not connected to the Internet and the application program has not undergone a version update action, the user can obtain the latest offline service information related to the required service. In addition, since program developers only need to maintain offline program codes that can be used across platforms, the burden of maintaining offline programs in multiple programming language versions can be reduced.
虽然本发明已以实施例揭示如上,然其并非用以限定本发明,任何所属技术领域中技术人员,在不脱离本发明的精神和范围内,当可作些许的更改与润饰,故本发明的保护范围当视权利要求所界定者为准。Although the present invention has been disclosed above with the embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some changes and modifications without departing from the spirit and scope of the present invention. Therefore, the present invention The scope of protection shall prevail as defined by the claims.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810319943.9A CN110362322B (en) | 2018-04-11 | 2018-04-11 | Electronic device and method for updating program offline |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810319943.9A CN110362322B (en) | 2018-04-11 | 2018-04-11 | Electronic device and method for updating program offline |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110362322A CN110362322A (en) | 2019-10-22 |
CN110362322B true CN110362322B (en) | 2023-08-01 |
Family
ID=68214368
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810319943.9A Expired - Fee Related CN110362322B (en) | 2018-04-11 | 2018-04-11 | Electronic device and method for updating program offline |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110362322B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7730159B1 (en) * | 2002-10-01 | 2010-06-01 | Apple Inc. | Method and apparatus for dynamically locating resources |
TW201145044A (en) * | 2010-06-10 | 2011-12-16 | Acer Inc | Method for offline browse web pages and system thereof |
CN104063269A (en) * | 2013-03-20 | 2014-09-24 | 腾讯科技(深圳)有限公司 | Method and device for achieving off-line application |
CN105847430A (en) * | 2016-05-20 | 2016-08-10 | 北京小米移动软件有限公司 | Hybrid application page data access method and device |
CN105867974A (en) * | 2016-03-31 | 2016-08-17 | 浪潮通用软件有限公司 | Offline updating method of CS framework application |
CN107193576A (en) * | 2016-03-15 | 2017-09-22 | 阿里巴巴集团控股有限公司 | The update method and device of a kind of application program for mobile terminal |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9049247B2 (en) * | 2010-04-01 | 2015-06-02 | Cloudfare, Inc. | Internet-based proxy service for responding to server offline errors |
US20170331915A1 (en) * | 2016-05-13 | 2017-11-16 | Sap Se | Providing an offline mode for applications and interfaces across multiple platforms |
-
2018
- 2018-04-11 CN CN201810319943.9A patent/CN110362322B/en not_active Expired - Fee Related
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7730159B1 (en) * | 2002-10-01 | 2010-06-01 | Apple Inc. | Method and apparatus for dynamically locating resources |
TW201145044A (en) * | 2010-06-10 | 2011-12-16 | Acer Inc | Method for offline browse web pages and system thereof |
CN104063269A (en) * | 2013-03-20 | 2014-09-24 | 腾讯科技(深圳)有限公司 | Method and device for achieving off-line application |
CN107193576A (en) * | 2016-03-15 | 2017-09-22 | 阿里巴巴集团控股有限公司 | The update method and device of a kind of application program for mobile terminal |
CN105867974A (en) * | 2016-03-31 | 2016-08-17 | 浪潮通用软件有限公司 | Offline updating method of CS framework application |
CN105847430A (en) * | 2016-05-20 | 2016-08-10 | 北京小米移动软件有限公司 | Hybrid application page data access method and device |
Also Published As
Publication number | Publication date |
---|---|
CN110362322A (en) | 2019-10-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP2815311B1 (en) | Using an application cache to update resources of installed applications | |
CN100465956C (en) | System, web server and method for adding personalized value to a website | |
CN104704468B (en) | The cross-system installation of WEB application program | |
CN108287836B (en) | Resource caching method and device | |
US20100251084A1 (en) | Input content to application via web browser | |
WO2017206626A1 (en) | Network resource access apparatus, mixed apparatus, and method | |
US8516041B1 (en) | Pre-fetching asynchronously requested content | |
WO2020048189A1 (en) | Image generation | |
CN110825990A (en) | Page access method, client, server and system | |
US9426202B2 (en) | Transforming application cached template using personalized content | |
US20230195999A1 (en) | Cross-domain storage for browsers | |
US12039309B2 (en) | Information processing apparatus, method of activating an application and storage medium | |
KR20220003464A (en) | Information processing apparatus, storage medium, and control method | |
US9734160B1 (en) | Virtual file system for hosted network sites | |
CN110362322B (en) | Electronic device and method for updating program offline | |
CN111580997A (en) | A content synchronization method, system, device and storage medium for application and website | |
TWI669614B (en) | Electronic device and method for offline updating application program thereof | |
Amarasinghe | Service worker development cookbook | |
CN116244545A (en) | HTML-based mobile device offline storage method and device, medium and equipment | |
CN116166911A (en) | Page loading method, device, storage medium and electronic equipment | |
US20190146644A1 (en) | Integrating remote assets from content management service with content developed by content creation applications | |
EP3001311A1 (en) | Method for automatically converting web applications into application that can be installed automatically on a plurality of platforms | |
WO2017197889A1 (en) | Keyword link method, device and system | |
US20130111433A1 (en) | Method and apparatus for generating application programs | |
TW201917568A (en) | Electronic device and offline operation of Web application program interface method thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20230801 |
|
CF01 | Termination of patent right due to non-payment of annual fee |