TWI704783B - Electronic device and resource health management method - Google Patents

Electronic device and resource health management method Download PDF

Info

Publication number
TWI704783B
TWI704783B TW108105854A TW108105854A TWI704783B TW I704783 B TWI704783 B TW I704783B TW 108105854 A TW108105854 A TW 108105854A TW 108105854 A TW108105854 A TW 108105854A TW I704783 B TWI704783 B TW I704783B
Authority
TW
Taiwan
Prior art keywords
resource
target resource
target
health management
timing data
Prior art date
Application number
TW108105854A
Other languages
Chinese (zh)
Other versions
TW202032947A (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 TW108105854A priority Critical patent/TWI704783B/en
Publication of TW202032947A publication Critical patent/TW202032947A/en
Application granted granted Critical
Publication of TWI704783B publication Critical patent/TWI704783B/en

Links

Images

Abstract

A resource health management method is provided. The method includes generating an image element embodiment corresponding to a target resource according to a target resource address, and loading the target resource via an internet connection according to the image element embodiment; in response to determining that an onLoad event corresponding to the target resource is occurred, recoding the target resource as being in a healthy status; in response to determining that an onError event corresponding to the target resource is occurred, determining whether the target resource is healthy or non-healthy according to a resource timing data of the target resource; in response to determining that the target resource is non-healthy, recoding the target resource as being in a non-healthy status; and in response to determining that the target resource is healthy, recoding the target resource as being in the healthy status.

Description

電子裝置與資源健康管理方法Electronic device and resource health management method

本發明是有關於一種管理方法,且特別是有關於一種電子裝置及其所使用的資源健康管理方法。The present invention relates to a management method, and particularly relates to an electronic device and a resource health management method used by it.

傳統上,對於網路的延遲時間的檢測,瀏覽器應用程式僅可對屬於同一網域或通訊協定的目標資源進行延遲時間的檢測。Traditionally, for the detection of network delay time, browser applications can only perform delay time detection on target resources belonging to the same network domain or communication protocol.

隨著科技的進展,目前已經逐漸開始利用HTML的圖片元素來產生對應目標資源的圖片元素實例,以針對不是屬於同一個網域或通訊協定的目標資源來進行延遲時間的檢測。也就是說,利用HTML的圖片元素的方式,可以作到跨網域/跨通訊協定的網路延遲時間檢測操作。With the development of science and technology, HTML image elements have been gradually used to generate image element instances corresponding to target resources to detect the delay time of target resources that do not belong to the same network domain or communication protocol. In other words, by using HTML picture elements, cross-domain/cross-protocol network delay time detection operations can be performed.

然而,當目標資源不為圖片檔案時,載入上述的圖片元素實例會導致錯誤的發生,而使得網路延遲時間檢測操作失敗。However, when the target resource is not a picture file, loading the above-mentioned picture element instance will cause an error to occur, and the network delay time detection operation will fail.

基此,要如何有效地利用對應目標資源的圖片元素實例來作到跨網域/跨通訊協定的網路延遲時間檢測操作且可有效且精確地辨識目標資源的健康狀態,為本領域人員致力發展的目標之一。Based on this, how to effectively use the image element instance corresponding to the target resource to perform the cross-domain/cross-protocol network delay time detection operation and to effectively and accurately identify the health status of the target resource is dedicated to those in the field One of the goals of development.

“先前技術”段落只是用來幫助了解本發明內容,因此在“先前技術”段落所揭露的內容可能包含一些沒有構成所屬技術領域中具有通常知識者所知道的習知技術。在“先前技術”段落所揭露的內容,不代表該內容或者本發明一個或多個實施例所要解決的問題,在本發明申請前已被所屬技術領域中具有通常知識者所知曉或認知。The "prior art" paragraph is only used to help understand the content of the present invention. Therefore, the content disclosed in the "prior art" paragraph may contain some conventional technologies that do not constitute the common knowledge in the technical field. The content disclosed in the "prior art" paragraph does not represent the content or the problem to be solved by one or more embodiments of the present invention, and has been known or recognized by those with ordinary knowledge in the technical field before the application of the present invention.

本發明提供一種電子裝置與其所使用的資源健康管理方法,可有效地檢測目標資源是否健康,以對健康或不健康的資源進行後續的操作。The present invention provides an electronic device and a resource health management method used by it, which can effectively detect whether a target resource is healthy, so as to perform follow-up operations on healthy or unhealthy resources.

本發明的一實施例提供一種電子裝置。所述電子裝置包括儲存單元、通訊單元以及處理器。所述儲存單元用以儲存資料。所述通訊單元用以建立網路連線。所述處理器耦接至所述儲存單元與所述通訊單元。所述處理器用以載入且執行一瀏覽器應用程式,並且更用以載入且執行一資源健康管理模組,以實現一資源健康管理方法。其中,所述資源健康管理模組用以根據一目標資源位址產生對應一目標資源的一圖片元素實例,並且根據所述圖片元素實例來經由所述網路連線載入所述目標資源。所述資源健康管理模組更用以判斷是否發生對應所述目標資源的onLoad事件或onError事件。反應於判定發生對應所述目標資源的所述onLoad事件,所述資源健康管理模組更用以記錄所述目標資源為一健康狀態。此外,反應於判定發生對應所述目標資源的所述onError事件,所述資源健康管理模組更用以根據所述目標資源的所述資源計時資料判斷所述目標資源為健康或不健康。其中,反應於判定所述目標資源為不健康,所述資源健康管理模組更用以記錄所述目標資源為一不健康狀態。反應於判定所述目標資源為健康,所述資源健康管理模組更用以記錄所述目標資源為所述健康狀態。An embodiment of the present invention provides an electronic device. The electronic device includes a storage unit, a communication unit and a processor. The storage unit is used for storing data. The communication unit is used to establish a network connection. The processor is coupled to the storage unit and the communication unit. The processor is used to load and execute a browser application program, and is further used to load and execute a resource health management module to implement a resource health management method. The resource health management module is used to generate a picture element instance corresponding to a target resource according to a target resource address, and load the target resource via the network connection according to the picture element instance. The resource health management module is further used to determine whether an onLoad event or an onError event corresponding to the target resource occurs. In response to determining that the onLoad event corresponding to the target resource occurs, the resource health management module is further configured to record that the target resource is in a health state. In addition, in response to determining that the onError event corresponding to the target resource occurs, the resource health management module is further configured to determine whether the target resource is healthy or unhealthy according to the resource timing data of the target resource. Wherein, in response to determining that the target resource is unhealthy, the resource health management module is further configured to record that the target resource is in an unhealthy state. In response to determining that the target resource is healthy, the resource health management module is further configured to record that the target resource is in the health state.

本發明的一實施例一種資源健康管理方法,適用於一電子裝置,其中所述電子裝置已建立一網路連線,並且已執行一瀏覽器應用程式。所述方法包括:根據一目標資源位址產生對應一目標資源的一圖片元素實例,並且根據所述圖片元素實例來經由所述網路連線載入所述目標資源;判斷是否發生對應所述目標資源的onLoad事件或onError事件;反應於判定發生對應所述目標資源的所述onLoad事件,記錄所述目標資源為一健康狀態;反應於判定發生對應所述目標資源的所述onError事件,根據所述目標資源的所述資源計時資料判斷所述目標資源為健康或不健康;反應於判定所述目標資源為不健康,記錄所述目標資源為一不健康狀態;以及反應於判定所述目標資源為健康,記錄所述目標資源為所述健康狀態。An embodiment of the present invention is a resource health management method, which is applicable to an electronic device, wherein the electronic device has established a network connection and has executed a browser application. The method includes: generating a picture element instance corresponding to a target resource according to a target resource address, and loading the target resource via the network connection according to the picture element instance; determining whether the corresponding The onLoad event or onError event of the target resource; in response to determining that the onLoad event corresponding to the target resource occurs, recording the target resource as a healthy state; in response to determining that the onError event corresponding to the target resource occurs, according to The resource timing data of the target resource determines whether the target resource is healthy or unhealthy; in response to determining that the target resource is unhealthy, recording the target resource as an unhealthy state; and in response to determining that the target resource is healthy To record the target resource as the health state.

基於上述,本發明的實施例所提供的電子裝置與資源健康管理方法,可經由跨網域及跨通訊協定的對應目標資源的圖片元素實例來載入所述目標資源,並且對應所載入的所述目標事件的onLoad事件、onError事件及資源計時資料來判斷所述目標資源是否健康,以對健康或不健康的所述目標資源進行對應的後續處理,進而可拓展且有效率地處理跨網域與跨通訊協定的所述目標資源的健康狀態的判斷。Based on the above, the electronic device and resource health management method provided by the embodiments of the present invention can load the target resource through the image element instance corresponding to the target resource across network domains and cross communication protocols, and correspond to the loaded The onLoad event, onError event, and resource timing data of the target event are used to determine whether the target resource is healthy, so as to perform corresponding follow-up processing on the healthy or unhealthy target resource, which can expand and efficiently process cross-domain Judging the health status of the target resource with the cross-communication protocol.

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

有關本發明之前述及其他技術內容、特點與功效,在以下配合參考圖式之一較佳實施例的詳細說明中,將可清楚的呈現。以下實施例中所提到的方向用語,例如:上、下、左、右、前或後等,僅是參考附加圖式的方向。因此,使用的方向用語是用來說明並非用來限制本發明。The foregoing and other technical content, features and effects of the present invention will be clearly presented in the following detailed description of a preferred embodiment with reference to the drawings. The directional terms mentioned in the following embodiments, for example: up, down, left, right, front or back, etc., are only directions for referring to the attached drawings. Therefore, the directional terms used are used to illustrate but not to limit the present invention.

圖1A是根據本發明的一實施例所繪示的電子裝置的方塊示意圖。請參照圖1A,在本實施例中,電子裝置10包括處理器110、輸入/輸出單元120、主記憶體130、儲存單元140及通訊單元150。處理單元110耦接至輸入/輸出單元120、主記憶體130、儲存單元140及通訊單元150。FIG. 1A is a schematic block diagram of an electronic device according to an embodiment of the invention. 1A, in this embodiment, the electronic device 10 includes a processor 110, an input/output unit 120, a main memory 130, a storage unit 140, and a communication unit 150. The processing unit 110 is coupled to the input/output unit 120, the main memory 130, the storage unit 140, and the communication unit 150.

處理器110為具備運算能力的硬體(例如晶片組、處理器等),用以管理電子裝置10的整體運作。在本實施例中,處理器110,例如是一核心或多核心的中央處理單元(Central Processing Unit,CPU)、微處理器(micro-processor)、或是其他可程式化之處理單元(Programmable processor)、數位訊號處理器(Digital Signal Processor,DSP)、可程式化控制器、特殊應用積體電路(Application Specific Integrated Circuits,ASIC)、可程式化邏輯裝置(Programmable Logic Device,PLD)或其他類似裝置。The processor 110 is a hardware (such as a chipset, a processor, etc.) with computing capabilities, and is used to manage the overall operation of the electronic device 10. In this embodiment, the processor 110 is, for example, a central processing unit (CPU), a microprocessor (micro-processor), or other programmable processing unit (Programmable processor) with one core or multiple cores. ), Digital Signal Processor (DSP), Programmable Controller, Application Specific Integrated Circuits (ASIC), Programmable Logic Device (PLD) or other similar devices .

輸入/輸出單元120用以接收使用者的輸入操作,以及輸出影像。輸入/輸出單元120例如是觸控螢幕。The input/output unit 120 is used for receiving user input operations and outputting images. The input/output unit 120 is, for example, a touch screen.

主記憶體130用以接收處理器110的指示來暫存資料。主記憶體130例如是任意形式的固定式或可移動式隨機存取記憶體(random access memory,RAM)或其他類似裝置、積體電路及其組合。The main memory 130 is used to receive instructions from the processor 110 to temporarily store data. The main memory 130 is, for example, any form of fixed or removable random access memory (RAM) or other similar devices, integrated circuits, and combinations thereof.

儲存單元140耦接至處理器110。儲存單元140可記錄一些需要長時間儲存的資料。例如,用以運行電子裝置的韌體、作業系統或多種應用程式(如,瀏覽器應用程式)。儲存單元140例如是任何形式的非揮發性記憶體(如,硬碟、固態硬碟、快閃記憶體模組)或其他類似的裝置、積體電路及其組合。The storage unit 140 is coupled to the processor 110. The storage unit 140 can record some data that needs to be stored for a long time. For example, it is used to run the firmware of the electronic device, the operating system, or various applications (eg, browser applications). The storage unit 140 is, for example, any form of non-volatile memory (for example, a hard disk, a solid state drive, a flash memory module) or other similar devices, integrated circuits, and combinations thereof.

通訊單元150用以透過無線通訊的方式來傳輸或是接收資料。在本實施例中,通訊單元150可具有一無線通訊模組(未繪示),並支援全球行動通信(Global System for Mobile Communication,GSM)系統、個人手持式電話系統(Personal Handy-phone System,PHS)、碼多重擷取(Code Division Multiple Access,CDMA)系統、無線相容認證(Wireless Fidelity,WiFi)系統、全球互通微波存取(Worldwide Interoperability for Microwave Access,WiMAX)系統、第三代無線通信技術(3G)、第四代無線通信技術(4G)、第五代無線通信技術(5G)、長期演進技術(Long Term Evolution, LTE)、藍芽(bluetooth)通訊技術的其中之一或其組合,且不限於此。The communication unit 150 is used to transmit or receive data through wireless communication. In this embodiment, the communication unit 150 may have a wireless communication module (not shown), and supports the Global System for Mobile Communication (GSM) system and the Personal Handy-phone System (Personal Handy-phone System, PHS), Code Division Multiple Access (CDMA) system, Wireless Fidelity (WiFi) system, Worldwide Interoperability for Microwave Access (WiMAX) system, third-generation wireless communication One or a combination of technology (3G), fourth-generation wireless communication technology (4G), fifth-generation wireless communication technology (5G), Long Term Evolution (LTE), and bluetooth communication technology , And not limited to this.

除此之外,通訊單元150也可具有一有線通訊模組(如,網路介面卡),並透過有線通訊的方式來傳輸或是接收資料。另外,在本實施例中,通訊單元150亦可建立網路連線,以使所述電子裝置10可連接至網際網路或區域網路。應注意的是,在本實施例中,通訊單元150可根據處理器110的指示建立網路連線至伺服器,從所述伺服器下載資源管理模組,並且將所述資源管理模組儲存至所述儲存單元140中。所述資源管理模組為一種程式碼模組。在本實施例中,處理器110用以存取且執行所述作業系統、瀏覽器應用程式於主記憶體130中,以運行對應所述作業系統、瀏覽器應用程式的功能。此外,所述處理器110更用以存取且執行所述資源管理模組於所述主記憶體130中,以實現本實施例所提供的資源管理方法,其中所述資源管理模組更被載入至執行中的所述瀏覽器應用程式中。以下利用多個圖式來說明。In addition, the communication unit 150 may also have a wired communication module (for example, a network interface card), and transmit or receive data through wired communication. In addition, in this embodiment, the communication unit 150 can also establish a network connection, so that the electronic device 10 can be connected to the Internet or a local area network. It should be noted that in this embodiment, the communication unit 150 can establish a network connection to the server according to the instructions of the processor 110, download the resource management module from the server, and store the resource management module To the storage unit 140. The resource management module is a code module. In this embodiment, the processor 110 is used to access and execute the operating system and the browser application in the main memory 130 to run functions corresponding to the operating system and the browser application. In addition, the processor 110 is further used to access and execute the resource management module in the main memory 130 to implement the resource management method provided in this embodiment, wherein the resource management module is further Load into the running browser application. The following uses multiple figures to illustrate.

圖1B是根據本發明的一實施例所繪示的瀏覽器應用程式與資源健康管理模組的方塊示意圖。FIG. 1B is a block diagram of a browser application and a resource health management module according to an embodiment of the invention.

請先參照圖1B,再本實施例中,瀏覽器應用程式20包括多個程式碼模組,如,超文本標記語言(HyperText Markup Language,HTML)元素模組210(亦稱,HTML元素模組)、資源計時(Performance Resource Timing)模組220與資源計時應用編程介面(Performance Resource Timing API)230、瀏覽器資料庫250。在圖1B中,所述瀏覽器應用程式20已經載入且運行資源健康管理模組240。Please refer to FIG. 1B. In this embodiment, the browser application 20 includes a plurality of code modules, such as HyperText Markup Language (HyperText Markup Language, HTML) element module 210 (also known as HTML element module) ), resource timing (Performance Resource Timing) module 220 and resource timing application programming interface (Performance Resource Timing API) 230, browser database 250. In FIG. 1B, the browser application 20 has been loaded and the resource health management module 240 is running.

所述HTML元素模組210用以管理且執行多種HTML元素(如,圖片元素 “<img />”、段落元素 “<p> </p>”等等…)的規範與功能。所述多種HTML元素的具體細節並非本實施例所專注的技術方案,不贅述於此。The HTML element module 210 is used to manage and execute the specifications and functions of various HTML elements (for example, picture element "<img />", paragraph element "<p> </p>", etc...). The specific details of the various HTML elements are not the technical solution focused in this embodiment, and will not be repeated here.

資源計時模組220用以產生且記錄對應所運行的HTML元素的程序的資源計時資料(亦稱,資源計時物件)。The resource timing module 220 is used to generate and record resource timing data (also known as resource timing objects) corresponding to the running HTML element program.

資源計時應用編程介面(Performance Resource Timing API)230為全球資訊網協會(World Wide Web Consortium,W3C)所規範的面向網頁應用程式的介面,可實施於現代的瀏覽器應用程式(如,Chrome、FireFox、Edge等..)中。可透過所述資源計時應用編程介面230來查詢瀏覽器應用程式已經處理/加載的資源的資源計時資料。The Performance Resource Timing API 230 is a web application-oriented interface specified by the World Wide Web Consortium (W3C). It can be implemented in modern browser applications (such as Chrome, FireFox). , Edge, etc...). The resource timing data of the resources processed/loaded by the browser application can be queried through the resource timing application programming interface 230.

瀏覽器資料庫250用以記錄瀏覽器應用程式的管理資訊(如,對應所載入目標資源的資源計時資料或健康狀態)或記錄檔(Log)。The browser database 250 is used to record management information of the browser application (for example, resource timing data or health status corresponding to the loaded target resource) or a log file (Log).

另一方面,資源健康管理模組240包括HTML圖片元素實例產生模組241、onLoad事件傾聽模組242、onError事件傾聽模組243、資源健康判斷模組244、健康資源管理模組246、不健康資源管理模組247。以下會進一步利用圖2、圖3來說明資源健康管理模組240及資源健康管理模組240各部件的互動。應注意的是,資源健康管理模組240的各部件的運作亦可視為資源健康管理模組240的整體運作。On the other hand, the resource health management module 240 includes an HTML picture element instance generation module 241, an onLoad event listening module 242, an onError event listening module 243, a resource health judgment module 244, a healthy resource management module 246, and an unhealthy resource Management module 247. The following will further use FIG. 2 and FIG. 3 to illustrate the interaction of the components of the resource health management module 240 and the resource health management module 240. It should be noted that the operation of the components of the resource health management module 240 can also be regarded as the overall operation of the resource health management module 240.

圖2是根據本發明的一實施例所繪示的資源健康管理方法的流程圖。Fig. 2 is a flowchart of a resource health management method according to an embodiment of the present invention.

請參照圖2,在步驟S21中,HTML圖片元素實例產生模組241根據一目標資源位址產生對應一目標資源的圖片元素實例,並且根據所述圖片元素實例來經由網路連線載入所述目標資源。所述目標資源位址可預先被設定於HTML圖片元素實例產生模組241中或是瀏覽器資料庫250中。所述目標資源位址例如是所述資源的網路位址,並且所述瀏覽器應用程式20可根據目標資源位址下載所述目標資源。目前電子裝置10所連接之網路的網域可不相同於所述目標資源的網域;瀏覽器應用程式20所使用的通訊協定可不相同於所述目標資源位址的通訊協定。在此,所述通訊協定包括超文本傳輸安全協定(Hypertext Transfer Protocol Secure,HTTPS)與超文本傳輸協定(HyperText Transfer Protocol,HTTP)。Referring to FIG. 2, in step S21, the HTML picture element instance generation module 241 generates a picture element instance corresponding to a target resource according to a target resource address, and loads the picture element instance through a network connection according to the picture element instance The target resource. The target resource address can be preset in the HTML image element instance generation module 241 or the browser database 250. The target resource address is, for example, the network address of the resource, and the browser application 20 can download the target resource according to the target resource address. The current domain of the network to which the electronic device 10 is connected may be different from the domain of the target resource; the communication protocol used by the browser application 20 may be different from the communication protocol of the target resource address. Here, the communication protocol includes Hypertext Transfer Protocol Secure (HTTPS) and HyperText Transfer Protocol (HTTP).

更具體來說,HTML圖片元素實例產生模組241可在辨識目標資源位址後,經由HTML元素模組,使用HTML圖片元素(即,“<img />”)來包裝所述目標資源位址,以成為包含目標資源位址的一個HTML圖片元素實例(Embodiment or Instance)。接著,瀏覽器應用程式20(如,HTML元素模組210)可根據所述HTML圖片元素實例於對應的目標資源位址去加載所述目標資源,並且回傳對應的結果給HTML圖片元素實例產生模組241。所述結果包括onLoad事件或onError事件。More specifically, the HTML picture element instance generation module 241 can use the HTML picture element (ie, "<img />") to package the target resource address through the HTML element module after identifying the target resource address , To become an HTML image element instance (Embodiment or Instance) containing the address of the target resource. Then, the browser application 20 (eg, HTML element module 210) can load the target resource according to the HTML picture element instance at the corresponding target resource address, and return the corresponding result to the HTML picture element instance to generate Module 241. The result includes an onLoad event or an onError event.

接著,在步驟S22中,資源健康管理模組240判斷是否發生對應所述目標資源的onLoad事件或onError事件。Next, in step S22, the resource health management module 240 determines whether an onLoad event or an onError event corresponding to the target resource occurs.

具體來說,資源健康管理模組240的onLoad事件傾聽模組242用以傾聽經由加載所述目標資源的程序而發生的onLoad事件;資源健康管理模組240的onError事件傾聽模組243用以傾聽經由加載所述目標資源的程序而發生的onError事件。Specifically, the onLoad event listening module 242 of the resource health management module 240 is used to listen to onLoad events that occur through the program loading the target resource; the onError event listening module 243 of the resource health management module 240 is used to listen The onError event occurs via the program loading the target resource.

換言之,若經由加載所述目標資源的程序發生了onLoad事件,onLoad事件傾聽模組242可傾聽到所述onLoad事件,並且呼叫資源健康判斷模組244,以使資源健康判斷模組244判定發生所述onLoad事件;若經由加載所述目標資源的程序發生了onError事件,onError事件傾聽模組243可傾聽到所述onError事件,並且呼叫資源健康判斷模組244,以使資源健康判斷模組244判定發生所述onError事件。In other words, if an onLoad event occurs through the program that loads the target resource, the onLoad event listening module 242 can listen to the onLoad event and call the resource health judgment module 244 so that the resource health judgment module 244 can determine the occurrence The onLoad event; if an onError event occurs through the program that loads the target resource, the onError event listening module 243 can listen to the onError event, and call the resource health judgment module 244 to make the resource health judgment module 244 determine The onError event occurred.

反應於判定發生所述onLoad事件,執行步驟S26;反應於判定發生所述onError事件,執行步驟S23。In response to determining that the onLoad event occurs, step S26 is executed; in response to determining that the onError event occurs, step S23 is executed.

在本實施例中,若所述目標資源為圖片檔案,則在預定時間內下載所述圖片檔案後,所述瀏覽器應用程式20會回傳用以表示onLoad事件的結果給資源健康管理模組240。此外,在下列條件下,所述瀏覽器應用程式20會回傳用以表示onError事件的結果給資源健康管理模組240:(1) 所述目標資源並非圖片檔案;(2) 無法在所述預定時間內下載所述目標資源;(3)所述目標資源不存在。In this embodiment, if the target resource is a picture file, after downloading the picture file within a predetermined time, the browser application 20 will return the result of the onLoad event to the resource health management module 240. In addition, under the following conditions, the browser application 20 will return the result of the onError event to the resource health management module 240: (1) the target resource is not a picture file; (2) it cannot be displayed in the Download the target resource within a predetermined time; (3) The target resource does not exist.

應注意的是,有關onLoad事件與onError事件的發生條件為本領域人員熟知之技術,不贅述於此。It should be noted that the occurrence conditions of the onLoad event and the onError event are technologies well known to those skilled in the art and will not be repeated here.

在步驟S23中,資源健康判斷模組244經由資源計時應用編程介面230查找所述目標資源的資源計時資料。具體來說,為了更明確地辨識發生onError事件的條件為上述三個條件的其中之一,資源健康判斷模組244會發送對應所述目標資源的查詢請求給資源計時應用編程介面230,以嘗試查詢對應所述目標資源的資源計時資料。資源計時應用編程介面230接收到所述查詢請求後,資源計時應用編程介面230會利用資源計時模組220來查找是否存在有對應所述目標資源的資源計時資料。In step S23, the resource health judgment module 244 searches for the resource timing data of the target resource via the resource timing application programming interface 230. Specifically, in order to more clearly identify that the onError event occurs as one of the above three conditions, the resource health judgment module 244 will send a query request corresponding to the target resource to the resource timing application programming interface 230 to try Query resource timing data corresponding to the target resource. After the resource timing application programming interface 230 receives the query request, the resource timing application programming interface 230 uses the resource timing module 220 to find whether there is resource timing data corresponding to the target resource.

此外,資源健康判斷模組244更可經由資源計時應用編程介面230來辨識所述目標資源的所述資源計時資料的多個屬性所對應的多個值。In addition, the resource health judgment module 244 can further identify multiple values corresponding to multiple attributes of the resource timing data of the target resource through the resource timing application programming interface 230.

圖4是根據本發明的一實施例所繪示的資源計時應用編程介面的多個屬性的示意圖。FIG. 4 is a schematic diagram of multiple attributes of a resource timing application programming interface according to an embodiment of the present invention.

請參照圖4,在本實施例中,經由W3C所規範的所述資源計時應用編程介面230的多個屬性如元件C400所示。所述多個屬性的多個值用以記錄在加載所述目標資源的過程中的多個時間點。舉例來說,當利用包含所述目標資源的HTML圖片元素實例來加載所述目標資源後,資源計時模組220可產生對應所述目標資源的資源計時資料245(亦稱,資源計時物件)。所述資源計時資料可包括所述目標資源位址、請求起始時間以及回傳結束時間等資料。此時,所述資源計時應用編程介面230可將所查找到的所述資源計時資料245回傳給資源健康判斷模組244,以回應所述資源健康判斷模組244的查詢請求。Referring to FIG. 4, in this embodiment, the multiple attributes of the resource timing application programming interface 230 specified by W3C are shown in element C400. The multiple values of the multiple attributes are used to record multiple time points in the process of loading the target resource. For example, after loading the target resource by using the HTML picture element instance including the target resource, the resource timing module 220 may generate resource timing data 245 (also referred to as a resource timing object) corresponding to the target resource. The resource timing data may include data such as the target resource address, request start time, and return end time. At this time, the resource timing application programming interface 230 can return the found resource timing data 245 to the resource health judgment module 244 to respond to the query request of the resource health judgment module 244.

另一方面,當所述目標資源位址並不存在所述目標資源(如,HTTP狀態碼為4XX)或所述目標資源發生錯誤(如,HTTP狀態碼為5XX),資源計時模組220便不會產生對應所述目標資源的資源計時資料,並且所述資源計時應用編程介面230不會回傳所述資源計時資料245(例如,Google Chrome瀏覽器)。On the other hand, when the target resource does not exist at the target resource address (for example, the HTTP status code is 4XX) or the target resource has an error (for example, the HTTP status code is 5XX), the resource timing module 220 No resource timing data corresponding to the target resource will be generated, and the resource timing application programming interface 230 will not return the resource timing data 245 (for example, Google Chrome browser).

然而,在另一實施例中,所述目標資源位址並不存在所述目標資源(如,HTTP狀態碼為4XX)或所述目標資源發生錯誤(如,HTTP狀態碼為5XX),資源計時模組220仍然會產生對應所述目標資源的資源計時資料,並且所述資源計時應用編程介面230可回傳所述資源計時資料245(例如,FireFox瀏覽器與Edge瀏覽器)。但,在此另一實施例中,對應HTTP狀態碼為4XX或所HTTP狀態碼為5XX的資源計時資料的目標屬性的值並非正常值(如,所述目標屬性的值為空(NULL))。However, in another embodiment, the target resource does not exist at the target resource address (for example, the HTTP status code is 4XX) or an error occurs in the target resource (for example, the HTTP status code is 5XX), resource timing The module 220 still generates resource timing data corresponding to the target resource, and the resource timing application programming interface 230 can return the resource timing data 245 (for example, FireFox browser and Edge browser). However, in this other embodiment, the value of the target attribute of the resource timing data corresponding to the HTTP status code of 4XX or the HTTP status code of 5XX is not a normal value (for example, the value of the target attribute is NULL) .

在步驟S24中,資源健康管理模組240根據所述目標資源的所述資源計時資料判斷所述目標資源為健康或不健康。以下利用圖3來說明。In step S24, the resource health management module 240 determines whether the target resource is healthy or unhealthy according to the resource timing data of the target resource. The following description will be made using FIG. 3.

圖3是根據本發明的一實施例所繪示的圖2的步驟S24的流程圖。請參照圖3,在步驟S241中,資源健康管理模組240判斷所述目標資源的所述資源計時資料是否存在。反應於判定所述目標資源的所述資源計時資料存在(S241à是),執行步驟S242;反應於判定所述目標資源的所述資源計時資料不存在(S241à否),執行步驟S244。FIG. 3 is a flowchart of step S24 in FIG. 2 according to an embodiment of the present invention. Referring to FIG. 3, in step S241, the resource health management module 240 determines whether the resource timing data of the target resource exists. In response to determining that the resource timing data of the target resource exists (S241→Yes), step S242 is performed; in response to determining that the resource timing data of the target resource does not exist (S241→No), step S244 is performed.

如上述,若判定存在所述資源計時資料,資源健康管理模組240會判斷所述目標資源的所述資源計時資料中對應目標屬性的值是否等於正常值(是否為正常值)。其中所述資源計時資料的所述目標屬性包括“nextHopProtocol”屬性或“ResponseCode”屬性。此外,對應所述“nextHopProtocol”屬性的正常值例如是“h2” 或是“http/1.1”等等;對應所述“ResponseCode”屬性的正常值例如是“2XX”(X為正整數或零)。即,對應所述“ResponseCode”屬性的正常值可具有一個範圍,如,“200~299”。例如,假設對應所述“nextHopProtocol”屬性的值為空,資源健康管理模組240會判定對應所述“nextHopProtocol”屬性的值不等於對應的正常值,並且接續至步驟S244,資源健康管理模組240會判定所述目標資源為不健康(Not healthy)。又例如,在所述目標資源並非圖片檔案而發生onError事件,但對應的資源計時資料具有為正常值的所述“nextHopProtocol”屬性的情況下,資源健康管理模組240會判定所述目標資源為健康(S243)。As described above, if it is determined that the resource timing data exists, the resource health management module 240 will determine whether the value of the target attribute in the resource timing data of the target resource is equal to a normal value (whether it is a normal value). The target attribute of the resource timing data includes a "nextHopProtocol" attribute or a "ResponseCode" attribute. In addition, the normal value corresponding to the "nextHopProtocol" attribute is, for example, "h2" or "http/1.1", etc.; the normal value corresponding to the "ResponseCode" attribute is, for example, "2XX" (X is a positive integer or zero) . That is, the normal value corresponding to the "ResponseCode" attribute may have a range, such as "200-299". For example, assuming that the value corresponding to the "nextHopProtocol" attribute is empty, the resource health management module 240 will determine that the value corresponding to the "nextHopProtocol" attribute is not equal to the corresponding normal value, and proceeds to step S244, the resource health management module 240 will determine that the target resource is not healthy. For another example, when the target resource is not a picture file and an onError event occurs, but the corresponding resource timing data has the "nextHopProtocol" attribute that is a normal value, the resource health management module 240 will determine that the target resource is Health (S243).

又例如,假設對應所述“ResponseCode”屬性的值為“2XX”,資源健康管理模組240會判定對應所述“ResponseCode”屬性的值為正常值,並且接續至步驟S243,資源健康管理模組240會判定所述目標資源為健康(healthy)。For another example, assuming that the value corresponding to the "ResponseCode" attribute is "2XX", the resource health management module 240 will determine that the value corresponding to the "ResponseCode" attribute is a normal value, and proceed to step S243, the resource health management module 240 will determine that the target resource is healthy.

此外,若判定不存在所述資源計時資料,資源健康管理模組240可直接判定所述目標資源為不健康(步驟S244)。In addition, if it is determined that the resource timing data does not exist, the resource health management module 240 can directly determine that the target resource is unhealthy (step S244).

請再回到圖2,在本實施例中,反應於判定所述目標資源為健康(S24à健康),執行步驟S26;反應於判定所述目標資源為不健康(S24à不健康),執行步驟S25。Please return to FIG. 2. In this embodiment, in response to determining that the target resource is healthy (S24→healthy), step S26 is performed; in response to determining that the target resource is unhealthy (S24→unhealthy), step S25 is performed.

在步驟S25中,資源健康管理模組240記錄所述目標資源為不健康狀態。具體來說,反應於判定所述目標資源為不健康,資源健康判斷模組244會呼叫不健康資源管理模組246,並且不健康資源管理模組246可記錄所述目標資源為不健康狀態。此外,所述不健康資源管理模組246更可記錄所述目標資源位址、當前的系統時間、用戶地理位置等其他適合的資訊,以使資源健康管理模組240或瀏覽器應用程式20可進行對應的後續的處理。例如,瀏覽器應用程式20或不健康資源管理模組246可回報一錯誤訊息,以表示所述目標資源為不健康狀態。此外,在一實施例中,資源健康管理模組240更可根據被辨識為不健康狀態的目標資源的位址與用戶地理位置,來統計各個用戶地理位置所使用的服務的穩定性。In step S25, the resource health management module 240 records that the target resource is in an unhealthy state. Specifically, in response to determining that the target resource is unhealthy, the resource health determination module 244 calls the unhealthy resource management module 246, and the unhealthy resource management module 246 can record that the target resource is unhealthy. In addition, the unhealthy resource management module 246 can also record the target resource address, current system time, user geographic location and other suitable information, so that the resource health management module 240 or the browser application 20 can perform Corresponding subsequent processing. For example, the browser application 20 or the unhealthy resource management module 246 may report an error message to indicate that the target resource is unhealthy. In addition, in one embodiment, the resource health management module 240 may further calculate the stability of the service used by the geographic location of each user based on the address of the target resource identified as unhealthy and the geographic location of the user.

此外,在步驟S26中,資源健康管理模組240記錄所述目標資源為健康狀態。更具體來說,反應於判定所述目標資源為健康,資源健康判斷模組244會呼叫健康資源管理模組245,並且健康資源管理模組245可記錄所述目標資源為健康狀態。此外,所述健康資源管理模組246更可記錄所述目標資源位址、當前的系統時間等其他適合的資訊。特別是,所述健康資源管理模組246可利用為健康狀態的所述目標資源的所述資源計時資料來計算用以下載所述目標資源的延遲時間。例如,所述健康資源管理模組246可利用為健康狀態的所述目標資源的所述資源計時資料中的請求起始時間以及回傳結束時間來計算所述請求起始時間以及所述回傳結束時間之間的差值,以作為所述延遲時間。In addition, in step S26, the resource health management module 240 records that the target resource is in a healthy state. More specifically, in response to determining that the target resource is healthy, the resource health determination module 244 calls the health resource management module 245, and the health resource management module 245 can record that the target resource is in a healthy state. In addition, the health resource management module 246 can also record the target resource address, current system time and other suitable information. In particular, the health resource management module 246 can use the resource timing data of the target resource in a healthy state to calculate the delay time for downloading the target resource. For example, the health resource management module 246 may use the request start time and the return end time in the resource timing data of the target resource in the health state to calculate the request start time and the return The difference between the end times is used as the delay time.

值得一提的是,如上述,在所述目標資源並非圖片檔案而發生onError事件,一般的傳統作法會直接回應onError事件發生,而導致無法進一步地根據所述目標資源的資源計時資料來計算延遲時間。但,本發明的實施例,可進一步去根據判斷已存在的資源計時資料中的目標屬性是否為(或等於)正常值來判斷所述目標資源是否為健康,進而可利用為健康狀態的目標資源的資源計時資料來計算延遲時間。如此一來,本發明的實施例可明顯地改善利用包含目標資源位址的HTML圖片元素實例來獲得延遲時間所導致的問題,同時又可保留HTML圖片元素的跨網域及跨通訊協定的特性,進而加強了對於目標資源的健康狀態與延遲時間的判斷效率,而增進了整體電子裝置的工作效率。It is worth mentioning that, as mentioned above, when the onError event occurs when the target resource is not a picture file, the general traditional method will directly respond to the occurrence of the onError event, which makes it impossible to further calculate the delay based on the resource timing data of the target resource. time. However, the embodiments of the present invention can further determine whether the target resource is healthy according to whether the target attribute in the existing resource timing data is (or equal to) a normal value, and then can be used as a healthy target resource The resource timing data is used to calculate the delay time. In this way, the embodiments of the present invention can significantly improve the problem caused by the delay time obtained by using the HTML picture element instance containing the target resource address, while retaining the cross-domain and cross-communication characteristics of the HTML picture element. , Thereby enhancing the efficiency of judging the health status and delay time of the target resource, and improving the work efficiency of the overall electronic device.

綜上所述,本發明的實施例所提供的電子裝置與資源健康管理方法,可經由跨網域及跨通訊協定的對應目標資源的圖片元素實例來載入所述目標資源,並且對應所載入的所述目標事件的onLoad事件、onError事件及資源計時資料來判斷所述目標資源是否健康,以對健康或不健康的所述目標資源進行對應的後續處理,進而可拓展且有效率地處理跨網域與跨通訊協定的所述目標資源的健康狀態的判斷。In summary, the electronic device and resource health management method provided by the embodiments of the present invention can load the target resource through the image element instance corresponding to the target resource across network domains and cross communication protocols, and correspond to the loaded target resource. The input onLoad event, onError event and resource timing data of the target event are used to determine whether the target resource is healthy, so as to perform corresponding follow-up processing on the healthy or unhealthy target resource, which can be expanded and efficiently processed across Judgment of the health status of the target resource between the network domain and the cross communication protocol.

雖然本發明已以實施例揭露如上,然其並非用以限定本發明,任何所屬技術領域中具有通常知識者,在不脫離本發明的精神和範圍內,當可作些許的更動與潤飾,故本發明的保護範圍當視後附的申請專利範圍所界定者為準。Although the present invention has been disclosed in the above embodiments, it is not intended to limit the present invention. Anyone with ordinary knowledge in the technical field can make some changes and modifications without departing from the spirit and scope of the present invention. The scope of protection of the present invention shall be determined by the scope of the attached patent application.

10:電子裝置 110:處理器 120:輸入/輸出單元 130:主記憶體 140:儲存單元 150:通訊單元 20:瀏覽器應用程式 210:HTML元素模組 220:資源計時模組 230:資源計時應用編程介面 240:資源健康管理模組 241:HTML圖片元素實例產生模組 242:onLoad事件傾聽模組 243:onError事件傾聽模組 244:資源健康判斷模組 245:健康資源管理模組 246:不健康資源管理模組 250:瀏覽器資料庫 S21、S22、S23、S24、S25、S26:資源健康管理方法的流程步驟 S241、S242、S243、S244:步驟S24的流程步驟 C400:資源計時應用編程介面的多種屬性的示例性程式碼 10: Electronic device 110: Processor 120: input/output unit 130: main memory 140: storage unit 150: Communication unit 20: Browser application 210: HTML element module 220: Resource Timing Module 230: Resource Timing Application Programming Interface 240: Resource Health Management Module 241: HTML picture element instance generation module 242: onLoad event listening module 243: onError event listening module 244: Resource Health Judgment Module 245: Health Resource Management Module 246: Unhealthy Resource Management Module 250: Browser database S21, S22, S23, S24, S25, S26: Process steps of resource health management methods S241, S242, S243, S244: the flow steps of step S24 C400: Exemplary code for various attributes of resource timing application programming interface

圖1A是根據本發明的一實施例所繪示的電子裝置的方塊示意圖。 圖1B是根據本發明的一實施例所繪示的瀏覽器應用程式與資源健康管理模組的方塊示意圖。 圖2是根據本發明的一實施例所繪示的資源健康管理方法的流程圖。 圖3是根據本發明的一實施例所繪示的圖2的步驟S24的流程圖。 圖4是根據本發明的一實施例所繪示的資源計時應用編程介面的多個屬性的示意圖。 FIG. 1A is a schematic block diagram of an electronic device according to an embodiment of the invention. FIG. 1B is a block diagram of a browser application and a resource health management module according to an embodiment of the invention. Fig. 2 is a flowchart of a resource health management method according to an embodiment of the present invention. FIG. 3 is a flowchart of step S24 in FIG. 2 according to an embodiment of the present invention. FIG. 4 is a schematic diagram of multiple attributes of a resource timing application programming interface according to an embodiment of the present invention.

S21、S22、S23、S24、S25、S26:資源健康管理方法的流程步驟S21, S22, S23, S24, S25, S26: Process steps of resource health management methods

Claims (8)

一種電子裝置,包括:一儲存單元,用以儲存資料;一通訊單元,用以建立網路連線;以及一處理器,耦接至所述儲存單元與所述通訊單元,其中所述處理器用以載入且執行一瀏覽器應用程式,其中所述處理器更用以載入且執行一資源健康管理模組,以實現一資源健康管理方法,其中所述資源健康管理模組用以根據一目標資源位址產生對應一目標資源的一圖片元素實例,並且根據所述圖片元素實例來經由所述網路連線載入所述目標資源,其中所述資源健康管理模組更用以判斷是否發生對應所述目標資源的onLoad事件或onError事件,其中反應於判定發生對應所述目標資源的所述onLoad事件,所述資源健康管理模組更用以記錄所述目標資源為一健康狀態,其中反應於判定發生對應所述目標資源的所述onError事件,所述資源健康管理模組更用以根據所述目標資源的所述資源計時資料判斷所述目標資源為健康或不健康,其中反應於判定所述目標資源為不健康,所述資源健康管理模組更用以記錄所述目標資源為一不健康狀態,其中反應於判定所述目標資源為健康,所述資源健康管理模 組更用以記錄所述目標資源為所述健康狀態,其中在所述根據所述目標資源的所述資源計時資料判斷所述目標資源為健康或不健康的運作中,所述資源健康管理模組判斷所述目標資源的所述資源計時資料是否存在,其中反應於判定所述目標資源的所述資源計時資料不存在,所述資源健康管理模組判定所述目標資源為不健康,其中反應於判定所述目標資源的所述資源計時資料存在,所述資源健康管理模組判斷所述目標資源的所述資源計時資料中對應一目標屬性的值是否等於一正常值,其中反應於判定所述目標資源的所述資源計時資料中對應所述目標屬性的所述值不等於所述正常值,所述資源健康管理模組判定所述目標資源為不健康,其中反應於判定所述目標資源的所述資源計時資料中對應所述目標屬性的所述值等於所述正常值,所述資源健康管理模組判定所述目標資源為健康。 An electronic device comprising: a storage unit for storing data; a communication unit for establishing a network connection; and a processor coupled to the storage unit and the communication unit, wherein the processor is used To load and execute a browser application, the processor is further used to load and execute a resource health management module to implement a resource health management method, wherein the resource health management module is used for The target resource address generates a picture element instance corresponding to a target resource, and loads the target resource via the network connection according to the picture element instance, wherein the resource health management module is further used to determine whether An onLoad event or an onError event corresponding to the target resource occurs, wherein in response to determining that the onLoad event corresponding to the target resource occurs, the resource health management module is further configured to record that the target resource is in a health state, wherein In response to determining that the onError event corresponding to the target resource occurs, the resource health management module is further configured to determine whether the target resource is healthy or unhealthy according to the resource timing data of the target resource, wherein the response is determined The target resource is unhealthy, and the resource health management module is further used to record that the target resource is in an unhealthy state, wherein in response to determining that the target resource is healthy, the resource health management module The group is further used to record that the target resource is the health state, wherein in the operation of judging whether the target resource is healthy or unhealthy according to the resource timing data of the target resource, the resource health management module Determine whether the resource timing data of the target resource exists, wherein in response to determining that the resource timing data of the target resource does not exist, the resource health management module determines that the target resource is unhealthy, which is reflected in the determination The resource timing data of the target resource exists, and the resource health management module determines whether the value corresponding to a target attribute in the resource timing data of the target resource is equal to a normal value, which is reflected in determining the target The value corresponding to the target attribute in the resource timing data of the resource is not equal to the normal value, and the resource health management module determines that the target resource is unhealthy, wherein the response to the determination of the target resource The value corresponding to the target attribute in the resource timing data is equal to the normal value, and the resource health management module determines that the target resource is healthy. 如申請專利範圍第1項所述的電子裝置,其中所述處理器經由所述網路連線從一伺服器下載所述資源健康管理模組,其中所述處理器將所述資源健康管理模組載入至所述瀏覽器應用程式中。 The electronic device described in claim 1, wherein the processor downloads the resource health management module from a server via the network connection, and wherein the processor transfers the resource health management module to The group is loaded into the browser application. 如申請專利範圍第1項所述的電子裝置,其中反應於判定所述目標資源為健康,所述資源健康管理模組根 據所述資源計時資料計算對應所述目標資源的網路延遲時間。 The electronic device described in item 1 of the scope of patent application, wherein in response to determining that the target resource is healthy, the resource health management module is rooted in Calculate the network delay time corresponding to the target resource according to the resource timing data. 如申請專利範圍第1項所述的電子裝置,其中反應於判定發生對應所述目標資源的所述onError事件,在根據所述目標資源的所述資源計時資料判斷所述目標資源為健康或不健康之前,所述資源健康管理模組查詢所述瀏覽器應用程式的一資源計時應用編程介面(Performance Resource Timing API),以查找所述目標資源的所述資源計時資料(Performance Resource Timing Data),其中所述資源計時資料的所述目標屬性包括“nextHopProtocol”屬性或“ResponseCode”屬性。 The electronic device according to claim 1, wherein in response to determining that the onError event corresponding to the target resource has occurred, determining whether the target resource is healthy or unhealthy according to the resource timing data of the target resource Previously, the resource health management module queries a resource timing application programming interface (Performance Resource Timing API) of the browser application to find the resource timing data (Performance Resource Timing Data) of the target resource, where The target attribute of the resource timing data includes a "nextHopProtocol" attribute or a "ResponseCode" attribute. 一種資源健康管理方法,適用於一電子裝置,其中所述電子裝置已建立一網路連線,並且已執行一瀏覽器應用程式,所述方法包括:根據一目標資源位址產生對應一目標資源的一圖片元素實例,並且根據所述圖片元素實例來經由所述網路連線載入所述目標資源;判斷是否發生對應所述目標資源的onLoad事件或onError事件;反應於判定發生對應所述目標資源的所述onLoad事件,記錄所述目標資源為一健康狀態;反應於判定發生對應所述目標資源的所述onError事件,根據所述目標資源的所述資源計時資料判斷所述目標資源為健康或不健康; 反應於判定所述目標資源為不健康,記錄所述目標資源為一不健康狀態;以及反應於判定所述目標資源為健康,記錄所述目標資源為所述健康狀態,其中所述根據所述目標資源的所述資源計時資料判斷所述目標資源為健康或不健康的步驟包括:判斷所述目標資源的所述資源計時資料是否存在;反應於判定所述目標資源的所述資源計時資料不存在,判定所述目標資源為不健康;反應於判定所述目標資源的所述資源計時資料存在,判斷所述目標資源的所述資源計時資料中對應一目標屬性的值是否等於一正常值;反應於判定所述目標資源的所述資源計時資料中對應所述目標屬性的所述值不等於所述正常值,判定所述目標資源為不健康;以及反應於判定所述目標資源的所述資源計時資料中對應所述目標屬性的所述值等於所述正常值,判定所述目標資源為健康。 A resource health management method is suitable for an electronic device, wherein the electronic device has established a network connection and has executed a browser application, the method includes: generating a corresponding target resource according to a target resource address An instance of a picture element in, and load the target resource via the network connection according to the instance of the picture element; determine whether an onLoad event or an onError event corresponding to the target resource occurs; The onLoad event of the target resource records that the target resource is in a healthy state; in response to determining that the onError event corresponding to the target resource occurs, it is determined that the target resource is based on the resource timing data of the target resource Healthy or unhealthy; In response to determining that the target resource is unhealthy, record the target resource as an unhealthy state; and in response to determining that the target resource is healthy, record the target resource as the healthy state, wherein the target resource is recorded according to the healthy state The step of determining whether the target resource is healthy or unhealthy from the resource timing data includes: determining whether the resource timing data of the target resource exists; in response to determining that the resource timing data of the target resource does not exist, determining The target resource is unhealthy; in response to determining that the resource timing data of the target resource exists, it is determined whether the value corresponding to a target attribute in the resource timing data of the target resource is equal to a normal value; If the value corresponding to the target attribute in the resource timing data of the target resource is not equal to the normal value, it is determined that the target resource is unhealthy; and the resource timing data that reflects the determination of the target resource corresponds to If the value of the target attribute is equal to the normal value, it is determined that the target resource is healthy. 如申請專利範圍第5項所述的資源健康管理方法,其中所述電子裝置經由所述網路連線從一伺服器下載所述資源健康管理模組,其中所述電子裝置將所述資源健康管理模組載入至所述瀏覽器應用程式中,以實現資源健康管理方法。 The resource health management method according to claim 5, wherein the electronic device downloads the resource health management module from a server via the network connection, wherein the electronic device updates the resource health The management module is loaded into the browser application to implement the resource health management method. 如申請專利範圍第5項所述的資源健康管理方法,所述資源健康管理方法更包括:反應於判定所述目標資源為健康,根據所述資源計時資料計算對應所述目標資源的一網路延遲時間。 According to the resource health management method described in item 5 of the scope of patent application, the resource health management method further includes: in response to determining that the target resource is healthy, calculating a network corresponding to the target resource based on the resource timing data delay. 如申請專利範圍第5項所述的資源健康管理方法,其中反應於判定發生對應所述目標資源的所述onError事件,在所述根據所述目標資源的所述資源計時資料判斷所述目標資源為健康或不健康的步驟之前,所述方法更包括:查詢所述瀏覽器應用程式的一資源計時應用編程介面(Performance Resource Timing API),以查找所述目標資源的所述資源計時資料(Performance Resource Timing Data),其中所述資源計時資料的所述目標屬性包括“nextHopProtocol”屬性或“ResponseCode”屬性。 The resource health management method according to item 5 of the scope of patent application, wherein in response to determining that the onError event corresponding to the target resource occurs, the target resource is determined according to the resource timing data of the target resource Before the step of being healthy or unhealthy, the method further includes: querying a resource timing application programming interface (Performance Resource Timing API) of the browser application to find the resource timing data (Performance Resource Timing API) of the target resource. Timing Data), wherein the target attribute of the resource timing data includes a "nextHopProtocol" attribute or a "ResponseCode" attribute.
TW108105854A 2019-02-21 2019-02-21 Electronic device and resource health management method TWI704783B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW108105854A TWI704783B (en) 2019-02-21 2019-02-21 Electronic device and resource health management method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW108105854A TWI704783B (en) 2019-02-21 2019-02-21 Electronic device and resource health management method

Publications (2)

Publication Number Publication Date
TW202032947A TW202032947A (en) 2020-09-01
TWI704783B true TWI704783B (en) 2020-09-11

Family

ID=73643769

Family Applications (1)

Application Number Title Priority Date Filing Date
TW108105854A TWI704783B (en) 2019-02-21 2019-02-21 Electronic device and resource health management method

Country Status (1)

Country Link
TW (1) TWI704783B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6438592B1 (en) * 1998-02-25 2002-08-20 Michael G. Killian Systems for monitoring and improving performance on the world wide web

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6438592B1 (en) * 1998-02-25 2002-08-20 Michael G. Killian Systems for monitoring and improving performance on the world wide web

Also Published As

Publication number Publication date
TW202032947A (en) 2020-09-01

Similar Documents

Publication Publication Date Title
WO2017028697A1 (en) Method and device for growing or shrinking computer cluster
JP6876806B2 (en) Blockchain Consensus Formation Methods and Devices
CN108664613B (en) Data query method and device, computer equipment and storage medium
WO2019029457A1 (en) Method and apparatus for updating application program on client, and electronic device
TWI622933B (en) Client update method and device
CN110888889B (en) Data information updating method, device and equipment
TW201711432A (en) Method and equipment making health check of server characterized in that the health check times are reduced and the burden on the server caused by the health check is relieved
US10503613B1 (en) Efficient serving of resources during server unavailability
JP5934445B2 (en) Adaptive service timeout
US10158543B2 (en) Method of estimating round-trip time (RTT) in content-centric network (CCN)
EP3817333B1 (en) Method and system for processing requests in a consortium blockchain
US10831565B2 (en) Fault tolerant adapter system to consume database as a service
CN110162270B (en) Data storage method, storage node and medium based on distributed storage system
CN104239156A (en) External service call method and system
CN111159219B (en) Data management method, device, server and storage medium
CN108089972B (en) Interface test method and device
CN109901991B (en) Method and device for analyzing abnormal call and electronic equipment
WO2016197853A1 (en) Complexity-based service processing method and apparatus
CN108920326B (en) Method and device for determining time-consuming abnormity of system and electronic equipment
TWI704783B (en) Electronic device and resource health management method
CN110955460B (en) Service process starting method and device, electronic equipment and storage medium
US20230327965A1 (en) Computer network architecture mapping using metadata
CN103885877A (en) Method and device for generating simulation browser testing script of HTTP
WO2023134247A1 (en) Container management method and container management system
CN110930253A (en) Intelligent contract internal main key generation method and device, computer equipment and storage medium