TW201939304A - Electronic device and method for offline updating application program thereof - Google Patents

Electronic device and method for offline updating application program thereof Download PDF

Info

Publication number
TW201939304A
TW201939304A TW107107768A TW107107768A TW201939304A TW 201939304 A TW201939304 A TW 201939304A TW 107107768 A TW107107768 A TW 107107768A TW 107107768 A TW107107768 A TW 107107768A TW 201939304 A TW201939304 A TW 201939304A
Authority
TW
Taiwan
Prior art keywords
offline
network
service
browser
offline execution
Prior art date
Application number
TW107107768A
Other languages
Chinese (zh)
Other versions
TWI669614B (en
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 宏碁股份有限公司
Priority to TW107107768A priority Critical patent/TWI669614B/en
Application granted granted Critical
Publication of TWI669614B publication Critical patent/TWI669614B/en
Publication of TW201939304A publication Critical patent/TW201939304A/en

Links

Abstract

An electronic device and method for offline updating application program thereof are provided. The method includes the following steps. A service proxy element and offline execution data are obtained from a web server when a network module is connected to a network. The service proxy element is installed and executed, and the offline execution data is recorded. The service proxy element is activated to access the offline execution data by an embedded browser of an application program to obtain an offline execution result when the network module is connected to the network. An operation is performed according to the offline execution result through the application program.

Description

電子裝置與其離線更新程式的方法Electronic device and method for updating program offline

本發明是有關於一種電腦技術,且特別是有關於一種電子裝置與其離線更新程式的方法。The invention relates to a computer technology, and in particular to an electronic device and a method for updating programs offline.

隨著科技日新月異,網際網路亦快速地發展,越來越多的網路資訊與網路應用服務透過網路而唾手可得。進一步而言,由於網際網路的發達,許多網路服務營運者可於網路中建置網路服務平台供使用者來使用,例如網路購物平台、網路新聞平台、單車共享平台等等。對應的,使用者的行動電子裝置也裝載有這些網路服務營運者提供的應用程式,以透過應用程式從上述網路服務平台獲取網路應用服務。With the rapid development of technology and the rapid development of the Internet, more and more network information and network application services are readily available through the Internet. 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, etc. . Correspondingly, the user's mobile electronic device is also loaded with applications provided by these network service operators, so as to obtain network application services from the aforementioned network service platform through the applications.

然而,為了讓這些應用程式能夠應付網路離線的狀態,而常見的方法是由程式開發者在上架應用程式前就先寫好離線程式,好讓使用者於下載應用程式時可以同步獲取應用程式的離線程式。然而,上述方法將產生無法即時反應離線網路服務已更新的問題。舉例而言,當應用程式的離線程式被再度更新時,使用者需要進入應用程式供應平台(例如應用程式商店)進行應用程式的更新動作,才有辦法獲取離線程式的最新版本而執行版本更新。倘若使用者遲遲沒有更新應用程式,行動電子裝置也就無法盡早提供更新後的離線服務。此外,由於行動電子裝置上作業系統之原生程式語言的種類不只一種,因此網路服務營運者/程式開發者也就需要維護多套對應至不同程式語言的離線程式版本,其對於軟體資訊服務的維護與開發是不小的負擔。However, in order for these applications to cope with the offline state of the network, the common method is for the program developer to write the offline program before the application is put on the shelf, so that users can get the application synchronously when downloading the application Offline program. However, the above method will cause the problem that the offline network service is not updated immediately. For example, when the offline program of the application is updated again, the user needs to enter an application supply platform (such as an application store) to perform an application update action, so as to obtain a latest version of the offline program and perform a version update. If the user does not update the application late, the mobile electronic device will not be able to provide the updated offline service as soon as possible. In addition, since there are 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. Maintenance and development are no small burden.

有鑑於此,本發明提供一種電子裝置與其離線更新程式的方法,可在離線狀態下利用超文件標記語言規範來跨平台更新客戶端的離線程式,從而降低離線程式開發的負擔並快速更新客戶端的離線程式。In view of this, the present invention provides an electronic device and a method for updating a program offline, which can update a client's offline program across platforms by using a super document markup language specification in an offline state, thereby reducing the burden of offline program development and quickly updating the client's offline Program.

本發明的一實施例提供一種離線更新程式的方法,用於具有網路模組的電子裝置,所述方法包括下列步驟。當所述網路模組連接至網路時,由網路伺服器取得服務代理元件以及離線執行資料。安裝並運行所述服務代理元件,並儲存所述離線執行資料。當所述網路模組未連接至網路時,透過應用程式的內嵌瀏覽器來觸發所述服務代理元件存取所述離線執行資料而獲取離線執行結果。透過所述應用程式依據所述離線執行結果執行一操作。An embodiment of the present invention provides a method for updating a program offline for an electronic device having a network module. The method includes the following steps. When the network module is connected to the network, the network server obtains the service agent component and executes the data offline. Install and run the service agent component, and store the offline execution data. When the network module is not connected to the network, the service proxy component is triggered to access the offline execution data through the embedded browser of the application to obtain the offline execution result. Perform an operation according to the offline execution result through the application program.

本發明的另一實施例提供一種電子裝置,其包括儲存電路、網路模組及處理器。所述處理器耦接至所述儲存電路及所述網路模組。所述處理器經配置用以:當所述網路模組連接至網路時,由網路伺服器取得服務代理元件以及離線執行資料;安裝並運行所述服務代理元件,並儲存所述離線執行資料;當所述網路模組未連接至網路時,透過應用程式的內嵌瀏覽器來觸發所述服務代理元件存取所述離線執行資料而獲取離線執行結果;以及透過所述應用程式依據所述離線執行結果執行一操作。Another embodiment of the present invention provides an electronic device including 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 a service agent component and offline execution data from a network server; install and run the service agent component, and store the offline Execution data; when the network module is not connected to the network, triggering the service proxy component to access the offline execution data to obtain offline execution results through an embedded browser of the application; and through the application The program performs an operation according to the offline execution result.

基於上述,本發明提出的離線更新程式的方法與電子裝置,可於連網狀態由網路伺服器取得服務代理元件以及離線執行資料,並於未連網狀態藉由應用程式的內嵌瀏覽器呼叫服務代理元件存取離線執行資料。於此,服務代理元件於可以在瀏覽器背後運行並對應於網路服務營運者所架設的特定網站,以將一網路伺服器提供的離線執行資料儲存於瀏覽儲存器中。因此,當電子裝置未連接至網路時,應用程式的離線程式可基於服務代理元件產生的離線執行結果來更新。Based on the above, the method and electronic device for offline updating of programs provided by the present invention can obtain service agent components and offline execution data from a network server in a connected state, and use an embedded browser of an application in a non-connected state. The call service agent component accesses offline execution data. Here, the service agent 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 storage. Therefore, when the electronic device is not connected to the network, the offline program of the application can be updated based on the offline execution result generated by the service agent component.

為讓本發明的上述特徵和優點能更明顯易懂,下文特舉實施例,並配合所附圖式作詳細說明如下。In order to make the above features and advantages of the present invention more comprehensible, embodiments are hereinafter described in detail with reference to the accompanying drawings.

圖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. Referring to FIG. 1, in an 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 connected to the network 101 through a wired or wireless method, respectively. In addition, the electronic device 111 may be various types of electronic devices with signal input, signal output, networking, and computing functions, such as a smart phone, a tablet computer, a desktop computer, or a notebook computer.

在一實施例中,電子裝置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 providing 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 web 101, and the web server 121 can provide web portals for web services (e.g., communication and social services, news and information services, transportation ticket purchase and inquiry services, online financial services, etc.) for Client device query and use. For example, if the electronic device 111 and the network server 121 are both connected to the network 101, the electronic device 111 can browse or log in to the portal page of a certain enterprise organization to obtain related network services.

在一實施例中,電子裝置111的網頁瀏覽器(Web browser)可傳送一服務請求來存取由網路伺服器121提供的內容(例如,藉由輸入全球資源定位器(Uniform Resource Locator,URL)到網頁瀏覽器中)。如果網頁瀏覽器的使用者被授權存取該內容,網路伺服器121基本上即提供該內容給電子裝置111的網頁瀏覽器。在網路環境中,內容及對內容之請求經常使用超文字轉換協定(Hypertext Transfer Protocol,HTTP)來傳送。網路式內容由符合超文字標記語言(HyperText Markup Language,HTML)規範的頁面、樣式板、影像及指令碼(script)等所提供。In an embodiment, the 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 Uniform Resource Locator (URL) ) Into your web 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-based content is provided by pages, style boards, images, and scripts that conform to the HyperText Markup Language (HTML) specification.

在一實施例中,上述的網頁瀏覽器包括獨立瀏覽器與內嵌式瀏覽器。獨立瀏覽器是一套完整的軟體或應用程式本身(例如,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 a standalone browser and an embedded browser. A stand-alone browser is a complete set of software or the application itself (for example, Chrome, Internet Explore, Firefox, Safari, Opera, etc.), and a user can link to a specific website via the network 101 by opening a separate browser. In addition, unlike 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 for Android, iOS System WebView or instant messaging software Facebook Messenger WebView, etc.). For example, Android ’s WebView uses Chrome ’s core technology to allow 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 invention. Referring 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 to receive an operation instruction input by a user. For example, the input interface 21 may include various physical interface circuits for inputting signals, such as a mouse, a keyboard, a touchpad, or a microphone (ie, a voice input device). The output interface 22 is used to output signals. For example, the output interface 22 may include a physical interface circuit such as a screen (or display), a projector or a speaker (ie, a voice output device) for outputting signals. In one embodiment, the input interface 21 and the output interface 22 can also be combined into a touch screen or similar device having both signal input and output functions. For example, the input interface 21 and the output interface 22 may 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 to store data and codes in a non-volatile manner. Here, the non-volatile storage of data means that the data stored in the storage circuit 23 will not be lost because the power supply is stopped from being supplied to the storage circuit 23. For example, the storage circuit 23 may include various non-volatile storage media such as a conventional hard disk drive (HDD), a solid state drive (SDD), a solid state hybrid drive (Solid State Hybrid Drive, SSHD), or a flash memory.

網路模組24用於將電子裝置111連接至網路101並經由網路101傳遞訊息。例如,網路模組24可包括有線及/或無線網路介面卡等實體網路介面電路。例如,在無線通訊方面,網路模組24可支援第三代無線通訊技術(3G)、藍芽(Bluetooth)、通用封包無線電服務(General Packet Radio Service,GPRS)、高速下載封包存取(High Speed Downlink Packet Access,HSDPA)、高速上傳封包存取(High Speed Uplink Packet Access,HSUPA)、無線相容認證(Wireless-Fidelity,Wi-Fi)、無線廣域網路(Wireless Wide Area Network,WWAN)以及長期演進技術(Long Term Evolution,LTE)等各式無線通訊協定。此外,在有線網路方面,網路模組24可例如支援乙太網路(Ethernet)等有線通訊協定。The network module 24 is used for connecting the electronic device 111 to the network 101 and transmitting messages via the network 101. For example, the network module 24 may include a physical network interface circuit such as a wired and / or wireless network interface card. For example, in terms of wireless communication, the network module 24 can support third-generation wireless communication technology (3G), Bluetooth, General Packet Radio Service (GPRS), and high-speed download packet access (High Speed Downlink Packet Access (HSDPA), High Speed Uplink Packet Access (HSUPA), Wireless-Fidelity (Wi-Fi), Wireless Wide Area Network (WWAN), and long-term Various wireless communication protocols such as Long Term Evolution (LTE). In addition, in terms of a wired network, the network module 24 may support, for example, a wired communication protocol such as Ethernet.

處理器25負責電子裝置111的整體運作。例如,處理器25可包括中央處理器、或是其他可程式化之一般用途或特殊用途的微處理器(Microprocessor)、數位訊號處理器(Digital Signal Processor,DSP)、控制器、特殊應用積體電路(Application Specific Integrated 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, special application integrated circuit Circuit (Application Specific Integrated Circuit, ASIC), Programmable Logic Device (PLD) or other similar devices or a combination of these devices. In addition, the processor 25 may be provided with a volatile storage medium such as a random access memory (RAM) or a read-only memory (ROM).

圖3是根據本發明的一實施例所繪示的離線更新程式的方法的流程圖。以下將以前述圖1與圖2的實施例來搭配圖3進行說明。請參照圖1至圖3,於步驟S301,當網路模組24連接至網路101時,處理器25由網路伺服器121取得服務代理元件以及離線執行資料。於步驟S302,處理器25安裝並運行服務代理元件,並儲存離線執行資料。FIG. 3 is a flowchart of a method for updating a program offline according to an embodiment of the present invention. In the following, the embodiments in FIG. 1 and FIG. 2 will be used in conjunction with FIG. 3 for description. Referring 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 a service agent component, and stores offline execution data.

在一實施例中,當電子裝置111處於網路連線狀態時,處理器25可從提供網路服務的網路伺服器121取得一特定網站的服務代理元件。此服務代理元件是可以在獨立瀏覽器或內嵌瀏覽器的背後(獨立於網頁頁面)運行的一種腳本程式。在一實施例中,此服務代理元件可為「Service Worker」程式。每個網站都可以向電子裝置111的網頁瀏覽器註冊以安裝屬於自己的「Service Worker」,以在使用者瀏覽到自己的網站時獨自幫使用者進行一些工作。尤其是,完成安裝的「Service Worker」是可以在離線狀態下運行的。換言之,處理器25經由網路101從網路伺服器121獲取服務代理元件,並將服務代理元件事先安裝於儲存電路23中。In an embodiment, when the electronic device 111 is in a network connection state, the processor 25 may obtain a service proxy component of a specific website from the network server 121 that provides network services. This service proxy component is a script program that can be run behind a stand-alone browser or an embedded browser (independent of web pages). 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" to help the user to do some work alone when the user browses to his website. In particular, the completed "Service Worker" can be run offline. In other words, the processor 25 obtains the service agent element from the network server 121 via the network 101 and installs the service agent element in the storage circuit 23 in advance.

於一實施例中,於服務代理元件完成安裝後,服務代理元件會被激活(activated)而控制管轄範圍內的網頁頁面,於此同時,服務代理元件可以進行離線執行資料與網頁相關資料的緩存,以將離線執行資料儲存於儲存電路23中的瀏覽儲存器之中。上述瀏覽儲存器泛指網頁瀏覽器用以儲存文字、檔案、程式碼等形式之資料的儲存元件,例如是應用快取(Application Cache)、本地儲存庫(Local Storage)、對話儲存庫(Session Storage)、指示符資料庫(IndexDB)等等。In one embodiment, after the installation of the service agent component is completed, the service agent component is activated to control the web pages in the jurisdiction. At the same time, the service agent component can cache the offline execution data and webpage related data. To store offline execution data in a browsing memory in the storage circuit 23. The aforementioned browsing storage generally refers to a storage component used by a web browser to store data in the form of text, files, code, and the like, such as an application cache, local storage, and session storage. , Index Database (IndexDB), and more.

之後,於步驟S303,當網路模組24未連接至網路101時,處理器25透過應用程式的內嵌瀏覽器來觸發服務代理元件存取離線執行資料而獲取離線執行結果。於步驟S304,處理器25透過應用程式依據離線執行結果執行一操作。After that, 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 Style Sheets,CSS)等等。特別是,離線執行資料可包括應用程式的離線程式碼,其例如是符合html5規格的程式碼。In one embodiment, when the electronic device 111 is offline, the processor 25 can run an embedded browser by running an application program. Based on this, even in the offline state, since the application's embedded browser is required to call the corresponding service agent component, the service agent component will also run or read the offline execution data obtained in the connected state. In an embodiment, the webpage related data and offline execution data obtained in the online state may include pictures, videos, animations, JavaScript code, FLASH animation data, Cascading Style Sheets (CSS), and so on. In particular, the offline execution data may include offline code of an application, such as code that conforms to the html5 specification.

因此,服務代理元件可運行與讀寫離線執行資料而獲取對應的離線執行結果,而服務代理元件獲取的離線執行結果例如是應用程式的離線參數設定、離線程式碼本身或離線網頁內容等等。最後,處理器25可透過應用程式依據離線執行結果執行一操作,像是透過應用程式呈現離線網頁內容、變更應用程式的參數設定、變更應用程式的離線服務設定、更新應用程式的離線程式碼等等操作。Therefore, the service agent component can run and read and write offline execution data to obtain corresponding offline execution results. The offline execution results obtained by the service agent component are, for example, the offline parameter settings of the application, the offline code itself, or the offline webpage content. Finally, the processor 25 can perform an operation according to the offline execution result through the application, such as presenting offline web content through the application, changing the parameter settings of the application, changing the offline service setting of the application, updating the offline code of the application, etc. And so on.

為了清楚說明本發明,圖4是根據本發明的一實施例所繪示的電子裝置處於連線情境的示意圖。圖5是根據本發明的一實施例所繪示的電子裝置處於離線情境的示意圖。In order to clearly illustrate the present invention, FIG. 4 is a schematic diagram of an electronic device in a connection situation according to an embodiment of the present invention. FIG. 5 is a schematic diagram illustrating an electronic device in an offline situation according to an embodiment of the present invention.

請先參照圖4,電子裝置111可裝載有獨立瀏覽器233以及應用程式231。應用程式231內嵌有一內嵌式瀏覽器232,致使應用程式231可透過內嵌式瀏覽器232呈現網頁內容。於此,獨立瀏覽器233與內嵌式瀏覽器232可使用共同的瀏覽器核心元件234來獲取符合HTML規範的網頁相關的資料。瀏覽器核心元件234包括服務代理元件235以及瀏覽儲存器234。Please refer to FIG. 4 first, the electronic device 111 can be loaded with an independent browser 233 and an application 231. The application program 231 has an embedded browser 232 embedded therein, so that the application program 231 can present webpage content through the embedded browser 232. Here, the independent browser 233 and the embedded browser 232 can use a common browser core component 234 to obtain data related to a webpage that complies with the HTML specification. The browser core element 234 includes a service proxy element 235 and a browsing storage 234.

於一實施例中,獨立瀏覽器233與內嵌式瀏覽器232都可於一連線狀態中經由網路101而耦接至網路伺服器121,以由網路伺服器121取得與網頁相關的內容。當使用者使用網頁瀏覽器(獨立瀏覽器233或內嵌式瀏覽器232)連結至網路伺服器121所建立的特定網站時,網路伺服器121可將關於此特定網站的服務代理元件235的程式資料B1提供給網頁瀏覽器。處理器25依據程式資料B1完成服務代理元件235的安裝或更新。In an embodiment, both the independent browser 233 and the embedded browser 232 can be coupled to the web server 121 via the network 101 in a connection state, so that the web server 121 can obtain the webpage-related information. Content. When a user uses a web browser (a standalone browser 233 or an embedded browser 232) to connect to a specific website created by the web server 121, the web server 121 may use a service proxy component 235 for this particular website. The program data B1 is provided to the web browser. The processor 25 completes the installation or update of the service agent element 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 a user uses a web browser (standalone browser 233 or embedded browser 232) to connect to the web server 121, the browsing storage 236 can upload the latest offline execution data provided by the web server 121 A1 and some webpage-related data are 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 data related to the webpage that has been viewed. Therefore, the service proxy element 235 can also assist the web browser to retrieve some of the past data from the browsing storage 234 even when it is connected Information about webpages you have visited to avoid downloading duplicate webpage-related data and save network traffic. It is worth mentioning that once the developer of the application 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 231 from 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, referring 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 agent element 235. Therefore, the called service agent component 235 will access the offline execution data A1 related to the application 231 from the browsing storage 236. The service agent component 235 runs the offline code in the offline execution data A1 and reads and writes the offline service related data in the offline execution data A1, and generates the 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 of the embedded browser 232, and perform an offline operation in an offline state according to the offline execution result C1. For example, the existing offline program of the application program 231 may be updated in an offline state according to the offline execution result C1. In addition, the software communication interface 237 is a component interface that enables the embedded browser 232 and the application 231 to communicate with each other. The software communication interface 237 allows the embedded browser 232 and the application 231 to call each other's code.

於一應用範例中,假設應用程式231是臺鐵購票應用程式,使用者可透過臺鐵購票應用程式來購買或查詢臺鐵車票。臺鐵網站的服務代理元件235已在電子裝置111處於連線狀態時被下載並完成安裝。並且,最新的臺鐵時刻表以及臺鐵購票應用程式的離線程式碼(亦即離線執行資料A1)可以透過服務代理元件235的運行而紀錄於瀏覽儲存器236裡。如此一來,當使用者於網路離線狀態開啟臺鐵購票應用程式(亦即應用程式231)時,應用程式231裡的內嵌瀏覽器232可以觸發服務代理元件235從瀏覽儲存器236存取最新的臺鐵時刻表以及臺鐵購票應用程式的離線程式碼,以提供最新的離線購票查詢服務給使用者。如此一來,透過本發明實施例的方法,因為沒有立即更新應用程式231的版本而導致使用者獲取舊的臺鐵時刻表或尚未更新的離線購票查詢服務的現象是可以避免的。In an application example, it is assumed that the application program 231 is a ticket purchase application of the Taiwan Railway, and a user can purchase or query the ticket of the Taiwan Railway through the ticket purchase application of the Taiwan Railway. The service agent component 235 of the Taiwan Railways website has been downloaded and installed when the electronic device 111 is online. In addition, the latest Taiwan Railway timetable and offline code of the Taiwan Railway ticket purchase application (that is, the offline execution data A1) can be recorded in the browsing memory 236 through the operation of the service agent element 235. In this way, when the user opens the Taiwan Railways ticketing application (ie, application 231) when the network is offline, the embedded browser 232 in the application 231 can trigger the service agent component 235 to save the data from the browsing storage 236. Obtain the latest Taiwan Railway timetable and offline code of the Taiwan Railway Ticketing Application to provide the latest offline ticket inquiry service to users. 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 ticket inquiry service that has not been updated because the version of the application 231 is not immediately updated 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 independent browser 233 can further synchronize the related settings of the browser component to the embedded browser 232. More specifically, when the synchronization mechanism is enabled, the independent browser 233 and the embedded browser 232 can read and write the code B1 of the latest service agent element 235 and the latest offline execution data A1 in the browser storage 236 in synchronization with each other. . 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 flowchart of a method for updating a program offline according to an embodiment of the present invention. The relevant implementation details and related device characteristics of the method for offline updating the program in this embodiment can be obtained from the above description of the embodiments of FIGS. 1 to 5, and sufficient teachings, suggestions and implementation methods can be obtained, which will not be repeated here. .

請參照圖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 it is connected to the network. If it is determined as YES in step S602, 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. After that, in step S604, the service agent component is installed and run, and the offline execution data is stored. In addition, the offline execution data in the service agent component and the browsing storage can be updated periodically or irregularly. Therefore, in step S605, when the network module is connected to the network, the service agent component is updated and the offline execution data in the storage is browsed. In addition, the application can provide corresponding network services normally when connected.

另一方面,若步驟S602判斷為否,於步驟S606,將獨立瀏覽器的瀏覽器元件的相關設定同步至內嵌瀏覽器,其中瀏覽器元件包括服務代理元件。然而,需說明的是,雖然步驟S606執行於圖6所示的實施例中,但步驟S606的執行是選擇性的。於其他實施例中,步驟S606的執行是可以省略的。於步驟S607,當網路模組未連接至網路時,透過應用程式的內嵌瀏覽器來觸發服務代理元件存取離線執行資料。於步驟S608,透過服務代理元件在內嵌瀏覽器的背後運行並讀寫瀏覽儲存器內的離線執行資料。於步驟S609,基於應用程式產生的服務請求,利用應用程式經由軟件通訊介面從內嵌瀏覽器取得離線執行結果。於步驟S610,利用應用程式依據對應於服務請求的離線執行結果來提供離線服務。On the other hand, if the determination in step S602 is no, in step S606, the relevant settings of the browser components of the independent browser are synchronized to the embedded browser, where the browser components include 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 proxy of the application program is used to trigger the service proxy component to access the offline execution data. In step S608, the service agent component runs behind the embedded browser and reads and writes offline execution data in the browsing storage. 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 application program is used to provide the offline service according to the offline execution result corresponding to the service request.

綜上所述,本發明提出的離線更新程式的方法與電子裝置,可於連網狀態由網路伺服器取得服務代理元件以及離線執行資料,並於未連網狀態藉由應用程式的內嵌瀏覽器呼叫服務代理元件存取離線執行資料。於此,服務代理元件於可以在瀏覽器背後運行並對應於網路服務運者所架設的特定網站,以將一網路伺服器提供的離線執行資料儲存於瀏覽儲存器中。因此,當電子裝置未連接至網路時,應用程式可基於服務代理元件產生的離線執行結果來更新離線程式或提供最新的離線服務。如此一來,即便電子裝置當前是處於未連網的狀態且應用程式尚未經歷版本的更新動作,使用者也可以獲得與所要求之服務相關的最新離線服務資訊。另外,由於程式開發者僅需要維護可以跨平台使用的離線程式碼,因而可降低維護多種程式語言版本之離線程式的負擔。To sum up, the method and electronic device for updating the program offline according to the present invention can obtain service agent components and perform data offline by the network server in the connected state, and use the embedded application program in the unconnected state. The browser calls the service agent component to access offline execution data. Here, the service agent component can be run behind the browser and corresponds 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 storage. Therefore, when the electronic device is not connected to the network, the application 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 network and the application has not yet undergone the update of the version, the user can obtain the latest offline service information related to the requested service. In addition, because the program developer only needs to maintain offline code 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 as above with the examples, it is not intended to limit the present invention. Any person with ordinary knowledge in the technical field can make some modifications and retouching without departing from the spirit and scope of the present invention. The protection scope of the present invention shall be determined by the scope of the attached patent application.

10‧‧‧網路服務系統10‧‧‧Internet Service System

111‧‧‧電子裝置111‧‧‧Electronic device

121‧‧‧網路伺服器121‧‧‧ Web Server

101‧‧‧網路101‧‧‧Internet

21‧‧‧輸入介面21‧‧‧Input interface

22‧‧‧輸出介面22‧‧‧Output interface

23‧‧‧儲存電路23‧‧‧Storage Circuit

24‧‧‧網路模組24‧‧‧ Network Module

25‧‧‧處理器25‧‧‧ processor

231‧‧‧應用程式231‧‧‧Apps

232‧‧‧內嵌式瀏覽器232‧‧‧Embedded Browser

233‧‧‧獨立瀏覽器233‧‧‧ Independent browser

234‧‧‧瀏覽器核心元件234‧‧‧ Browser Core Components

235‧‧‧服務代理元件235‧‧‧service agent component

236‧‧‧瀏覽儲存器236‧‧‧View Memory

237‧‧‧軟件通訊介面237‧‧‧Software communication interface

A1‧‧‧離線執行資料A1‧‧‧Offline execution data

B1‧‧‧程式資料B1‧‧‧Program data

C1‧‧‧離線執行結果C1‧‧‧ offline execution results

S301~S304、S601~S610‧‧‧步驟S301 ~ S304, S601 ~ S610‧‧‧step

圖1是根據本發明的一實施例所繪示的網路服務系統的示意圖。 圖2是根據本發明的一實施例所繪示的電子裝置的示意圖。 圖3是根據本發明的一實施例所繪示的離線更新程式的方法的流程圖。 圖4是根據本發明的一實施例所繪示的電子裝置處於連線情境的示意圖。 圖5是根據本發明的一實施例所繪示的電子裝置處於離線情境的示意圖。 圖6是根據本發明的一實施例所繪示的離線更新程式的方法的流程圖。FIG. 1 is a schematic diagram of a network service system according to an embodiment of the present invention. FIG. 2 is a schematic diagram of an electronic device according to an embodiment of the invention. FIG. 3 is a flowchart of a method for updating a program offline according to an embodiment of the present invention. FIG. 4 is a schematic diagram of an electronic device in a connection situation according to an embodiment of the present invention. FIG. 5 is a schematic diagram illustrating an electronic device in an offline situation according to an embodiment of the present invention. FIG. 6 is a flowchart of a method for updating a program offline according to an embodiment of the present invention.

Claims (10)

一種離線更新程式的方法,用於具有一網路模組的一電子裝置,所述方法包括: 當該網路模組連接至一網路時,由一網路伺服器取得一服務代理元件以及離線執行資料; 安裝並運行該服務代理元件,並儲存該離線執行資料; 當該網路模組未連接至該網路時,透過一應用程式的內嵌瀏覽器來觸發該服務代理元件存取該離線執行資料而獲取一離線執行結果;以及 透過該應用程式依據該離線執行結果執行一操作。A method for updating a program offline for an electronic device having a network module. The method includes: when the network module is connected to a network, obtaining a service proxy element by a network server and Offline execution data; install and run the service agent component, and store the offline execution data; when the network module is not connected to the network, trigger the service agent component access through an application's embedded browser Obtaining the offline execution result by the offline execution data; and performing an operation according to the offline execution result through the application. 如申請專利範圍第1項所述的離線更新程式的方法,其中對應至一特定網站的該服務代理元件在一獨立瀏覽器或該內嵌瀏覽器的背後運行,所述方法更包括: 將該獨立瀏覽器的瀏覽器元件的相關設定同步至該內嵌瀏覽器,其中該瀏覽器元件包括該服務代理元件。The method for offline updating the program as described in the first scope of the patent application, wherein the service agent component corresponding to a specific website runs behind an independent browser or the embedded browser, and the method further includes: The related settings of the browser component of the independent browser are synchronized to the embedded browser, wherein the browser component includes the service proxy component. 如申請專利範圍第1項所述的離線更新程式的方法,其中透過該應用程式依據該離線執行結果執行該操作的步驟包括: 利用該應用程式依據該離線執行結果來提供離線服務。The method for updating the program offline according to item 1 of the scope of patent application, wherein the step of performing the operation according to the offline execution result by the application program includes: using the application program to provide an offline service according to the offline execution result. 如申請專利範圍第3項所述的離線更新程式的方法,其中利用該應用程式依據該離線執行結果來提供該離線服務的步驟包括: 基於一服務請求,利用該應用程式經由一軟件通訊介面從該內嵌瀏覽器取得該離線執行結果;以及 利用該應用程式依據對應於該服務請求的該離線執行結果來提供該離線服務。The method for updating the program offline according to item 3 of the patent application scope, wherein the step of using the application program to provide the offline service according to the offline execution result includes: based on a service request, using the application program through a software communication interface from The embedded browser obtains the offline execution result; and uses the application to provide the offline service according to the offline execution result corresponding to the service request. 如申請專利範圍第3項所述的離線更新程式的方法,更包括: 當該網路模組連接至該網路時,更新該服務代理元件以及該瀏覽儲存器內的該離線執行資料,其中該離線執行資料包括圖片、影片,以及離線程式碼。The method for updating the program offline according to item 3 of the scope of patent application, further comprising: when the network module is connected to the network, updating the service agent component and the offline execution data in the browsing storage, wherein The offline execution data includes images, videos, and offline code. 一種電子裝置,包括: 一儲存電路; 一網路模組;以及 一處理器,耦接至該儲存電路及該網路模組,其中該處理器用以:   當該網路模組連接至一網路時,由一網路伺服器取得一服務代理元件以及離線執行資料;   安裝並運行該服務代理元件,並儲存該離線執行資料;   當該網路模組未連接至該網路時,透過一應用程式的內嵌瀏覽器來觸發該服務代理元件存取該離線執行資料而獲取一離線執行結果;以及   透過該應用程式依據該離線執行結果執行一操作。An electronic device includes: a storage circuit; a network module; and a processor coupled to the storage circuit and the network module, wherein the processor is used to: when the network module is connected to a network A network server obtains a service agent component and offline execution data; installs and runs the service agent component and stores the offline execution data; when the network module is not connected to the network, The embedded browser of the application program triggers the service agent component to access the offline execution data to obtain an offline execution result; and the application executes an operation according to the offline execution result. 如申請專利範圍第6項所述的電子裝置,其中對應至一特定網站的該服務代理元件在一獨立瀏覽器或該內嵌瀏覽器的背後運行,而該處理器更用以: 將該獨立瀏覽器的瀏覽器元件的相關設定同步至該內嵌瀏覽器,其中該瀏覽器元件包括該服務代理元件。The electronic device according to item 6 of the scope of patent application, wherein the service proxy element corresponding to a specific website runs behind a stand-alone browser or the embedded browser, and the processor is further configured to: The related settings of the browser component of the browser are synchronized to the embedded browser, wherein the browser component includes the service proxy component. 如申請專利範圍第6項所述的電子裝置,其中該處理器更用以: 利用該應用程式依據該離線執行結果來提供離線服務。The electronic device according to item 6 of the patent application scope, wherein the processor is further configured to: use the application program to provide an offline service according to the offline execution result. 如申請專利範圍第8項所述的電子裝置,其中該處理器更用以: 響應於一服務請求,利用該應用程式經由一軟件通訊介面從該內嵌瀏覽器取得該離線執行結果;以及 利用該應用程式依據對應於該服務請求的該離線執行結果來提供該離線服務。The electronic device according to item 8 of the patent application scope, wherein the processor is further configured to: in response to a service request, use the application program to obtain the offline execution result from the embedded browser via a software communication interface; and use the The application program provides the offline service according to the offline execution result corresponding to the service request. 如申請專利範圍第6項所述的電子裝置,其中該處理器更用以: 當該網路模組恢復連接至該網路時,更新該服務代理元件以及一瀏覽儲存器內的該離線執行資料,其中該離線執行資料包括圖片、影片,以及離線程式碼。The electronic device according to item 6 of the patent application scope, wherein the processor is further configured to: when the network module resumes connection to the network, update the service agent element and the offline execution in a browsing memory Data, where offline execution data includes images, videos, and offline code.
TW107107768A 2018-03-07 2018-03-07 Electronic device and method for offline updating application program thereof TWI669614B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW107107768A TWI669614B (en) 2018-03-07 2018-03-07 Electronic device and method for offline updating application program thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW107107768A TWI669614B (en) 2018-03-07 2018-03-07 Electronic device and method for offline updating application program thereof

Publications (2)

Publication Number Publication Date
TWI669614B TWI669614B (en) 2019-08-21
TW201939304A true TW201939304A (en) 2019-10-01

Family

ID=68316314

Family Applications (1)

Application Number Title Priority Date Filing Date
TW107107768A TWI669614B (en) 2018-03-07 2018-03-07 Electronic device and method for offline updating application program thereof

Country Status (1)

Country Link
TW (1) TWI669614B (en)

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7590981B2 (en) * 2004-10-12 2009-09-15 Microsoft Corporation Update package for offline synchronization of software updates
TW200933381A (en) * 2007-07-31 2009-08-01 Etelos Inc System and method for running a web-based application while offline
TWI384378B (en) * 2008-12-29 2013-02-01 Ind Tech Res Inst Web application execution method
TWI505109B (en) * 2011-04-20 2015-10-21 Inventec Corp Offline browsing system and method thereof
US20140040195A1 (en) * 2012-07-31 2014-02-06 Integrity Digital Solutions, Llc Offline Web Application System
CN104317556B (en) * 2014-10-22 2018-03-16 华为技术有限公司 A kind of streaming application upgrade method, main controlled node and stream calculation system
EP3214558B1 (en) * 2014-10-28 2021-05-19 Sony Corporation Reception device, transmission device, and data processing method

Also Published As

Publication number Publication date
TWI669614B (en) 2019-08-21

Similar Documents

Publication Publication Date Title
US11153226B2 (en) Incorporating web applications into web pages at the network level
TWI619025B (en) Method, medium, system, and device for continuing an application session on a different device
JP6318266B2 (en) System for managing extension changes to web pages
US9942299B2 (en) System and method for managing multiple variants of an HTTP object
US10185704B2 (en) Webpage browsing method, webapp framework, method and device for executing javascript and mobile terminal
CN100535900C (en) Method and system for rendering asynchronous portal page
CN104704468B (en) The cross-system installation of WEB application program
US20170371974A1 (en) Method for loading webpage, client and programmable device
US20160364498A1 (en) Unique identifiers for browsers
US8983935B2 (en) Methods for utilizing a javascript emulator in a web content proxy server and devices thereof
CN110321177B (en) Mobile application localized loading method and device and electronic equipment
JP2017532621A (en) Fast rendering of websites containing dynamic content and old content
CN104106048A (en) Using application cache to update resources of installed applications
US11537760B2 (en) Web application execution with secure elements
US8516041B1 (en) Pre-fetching asynchronously requested content
CN110825990A (en) Page access method, client, server and system
JP2014021975A (en) Method and server for managing domain-specific toolbar button
US20230195999A1 (en) Cross-domain storage for browsers
CN107918552B (en) Light application calling method and device, client device and electronic equipment
US9734160B1 (en) Virtual file system for hosted network sites
TWI669614B (en) Electronic device and method for offline updating application program thereof
CN110362322B (en) Electronic device and method for updating program offline
US10416855B2 (en) Integrating remote assets from content management service with content developed by content creation applications
JP4921570B2 (en) Blog service providing system, method and program
TW201917568A (en) Electronic device and offline operation of Web application program interface method thereof