Resource caching method and electronic device supporting the same

An electronic device is disclosed that includes a display, a communication circuitry, a first memory storing a native web application including a first resource, a second memory loaded with instructions included in the native web application, and a processor operatively connected with the display, the communication circuitry, the first memory, and the second memory. The processor is configured to transmit a request to identify whether the first resource is changed to an external electronic device, via the communication circuitry, when a specified condition is met, use the first resource in response to receiving a response that the first resource is not changed from the external electronic device or not responding to a connection to the external electronic device, receive a second resource replacing the first resource from the external electronic device, via the communication circuitry, in response to receiving a response that the first resource is changed from the external electronic device, and use the second resource. In addition, various embodiments recognized through the specification are possible.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a National Phase Entry of PCT International Application No. PCT/KR2019/006421, which was filed on May 29, 2019, and claims a priority to Korean Patent Application No. 10-2018-0069214, which was filed on Jun. 15, 2018, the contents of which are incorporated herein by reference.

TECHNICAL FIELD

Embodiments disclosed in the disclosure relate to a resource caching technology.

BACKGROUND ART

Recently, with the rapid development of the communication technology of networks including the Internet, a web service of providing multimedia content such as texts and images has been developed in various forms. A user who wants to receive the web service may access a web server over the Internet using a web browser, and the web server may provide a web page written using a web language such as a hypertext markup language (HTML).

DISCLOSURE

Technical Problem

A web browser may output a web page provided by a web server on a screen, but there may occur various problems in a process of customizing the web page and a resource associated with the web page to suit a characteristic of an electronic device or a request of a user.

Embodiments disclosed in the disclosure may provide an electronic device including a native web application for customizing a resource associated with a web page and providing a user with the customized resource.

Furthermore, embodiments disclosed in the disclosure may provide a resource caching method for caching a resource associated with a web page and allowing a native web application to use the cached resource and an electronic device supporting the same.

Technical Solution

In accordance with an aspect of the disclosure, an electronic device is provided. The electronic device may include a communication circuitry, a memory, and a processor. The processor may be configured to receive a request to run a specific application stored in the memory, first run the application depending on the request, and then update a resource necessary for operation of the application through background processing.

Alternatively, the processor may be configured to, when access to a resource which is not cached according to the running of the application is requested, access an external electronic device (or an external server device) which provides the resource which is not cached, download and cache the resource from the external electronic device, and transmit the cached resource to the application.

In accordance with another aspect of the disclosure, an electronic device is provided. The electronic device may include a display, a communication circuitry, a first memory storing a native web application including a first resource, a second memory loaded with instructions included in the native web application, and a processor operatively connected with the display, the communication circuitry, the first memory, and the second memory. The processor may be configured to transmit a request to identify whether the first resource is changed to an external electronic device, via the communication circuitry, when a specified condition is met, use the first resource in response to receiving a response that the first resource is not changed from the external electronic device or that the external electronic device does not respond to a connection to the request, receive a second resource replacing the first resource from the external electronic device, via the communication circuitry, in response to receiving a response that the first resource is changed from the external electronic device, and use the second resource.

Furthermore, in accordance with another aspect of the disclosure, a method for caching a resource in an electronic device is provided. The method may include transmitting, by a processor of the electronic device. a request to identify whether a first resource included in a native web application stored in a first memory is changed to an external electronic device, via a communication circuitry, when a specified condition is met, using the first resource in response to receiving a response that the first resource is not changed from the external electronic device or that the external electronic device does not respond to a connection, and receiving a second resource replacing the first resource from the external electronic device, via the communication circuitry, in response to receiving a response that the first resource is changed from the external electronic device, and using the second resource.

Advantageous Effects

According to embodiments disclosed in the disclosure, multimedia content provided by a web server may be customized and provided to suit a characteristic of an electronic device or a request of a user.

Furthermore, according to embodiments disclosed in the disclosure, as the native web application uses the cached resource, a user experience environment similar to a native application may be provided.

Furthermore, according to technologies disclosed in the disclosure, a resource associated with a function frequently used by the user may be cached to efficiently use a system resource.

In addition, various effects ascertained directly or indirectly through the disclosure may be provided.

With regard to description of drawings, the same or similar denotations may be used for the same or similar components.

MODE FOR INVENTION

FIG.1is a block diagram of an electronic device according to an embodiment.

According to an embodiment, an electronic device100may customize multimedia content provided by a web server (or an external electronic device) to suit a characteristic of the electronic device100or a request of a user. For example, the electronic device100may receive a resource associated with a web page provided by the web server from the web server and may arrange (or output or display) a web page corresponding to the resource in a screen where an application is running, as it is (without change) or with change in the received resource. In other words, the electronic device100may provide a web page in the form of being embedded in the application. Herein, the application in which the web page is embedded may referred to as a native web application.

Because it is possible for the native web application to include the web page and directly access an internal component of an electronic device100(e.g., an input device, an output device, a camera, a sensor, a communication circuitry, or the like of the electronic device100), the native web application may provide a user with various types of user interfaces. For example, the native web application may differently define a function of processing a touch input generated on a web page screen in an existing web page and may provide a separate function together with a web page output function.

Furthermore, the electronic device100may caches a resource to be used by the native web application under a specified condition. In this case, the native web application may configure a web page screen using the cached resource without a process of connecting to a web server. Thus, the electronic device100may provide the native web application in a user experience (UX) environment similar to a native application. For example, the electronic device100may enhance a running speed of the native web application to the level of the native application.

Referring toFIG.1, the electronic device100for performing the above-mentioned function may include a first memory110, a second memory130, a processor150, a display170, and a communication circuitry190. However, the configuration of the electronic device100is not limited thereto. According to various embodiments, the electronic device100may further include at least one component other than the above-mentioned components.

The first memory110may store various data used by at least one component (e.g., the processor150) of the electronic device100, for example, an application (e.g., a native web application111) and input data or output data for a command associated with it. According to an embodiment, at least a part of the first memory110may include a non-volatile memory.

The native web application111may be a kind of a native application installed in the electronic device100, which may provide a web function. For example, the native web application111may configure a web page provided by the web server on an execution screen as it is or as processed. According to an embodiment, the native web application111may be installed in the first memory110in the form of a package including a resource associated with a web page.

The second memory130may store a command or data received from at least one component (e.g., the processor150) of the electronic device100. For example, in a process where the native web application111stored in the first memory110is running, the second memory130may store a command or data (or a resource) included in the native web application111. In other words, the command or the data (or the resource) included in the native web application111may be loaded into the second memory130. According to an embodiment, at least a part of the second memory130may include a volatile memory.

The processor150may control at least one other component (e.g., a hardware or software component) of the electronic device100and may perform a variety of data processing and calculation. The processor150may load a command or data received from another component (e.g., the communication circuitry190) into the second memory130to process the command or data and may store result data in the first memory110. For example, the processor150may load the command or the data (or the resource) included in the native web application111installed in the first memory110into the second memory130to process the command or the data (or the resource).

The processor150may include an application manager151, a web view153, a cache manager155, and a resource manager157. The application manager151may manage a life cycle of an application (e.g., the native web application111) installed in the first memory110. For example, the application manager151may process installation, update, deletion, or the like of an application. According to an embodiment, the application manager151may copy and store (or cache) a resource included in the native web application111into a specified region (e.g., a cache area) of the first memory110. For example, the application manager151may receive a resource associated with a web page included in the native web application111installed in the form of the package from the web server and may store the resource in the first memory110in advance. According to various embodiments, at least a part of the application manager151may be implemented as at least one software module or at least one hardware module (e.g., at least one processor). When the application manager151is implemented as the at least one software module, it may be uploaded to a memory (e.g., the second memory130) to perform an operation set by the at least one processor.

The web view153may configure a UI screen of the native web application111. According to an embodiment, the web view153may configure a web page screen using the resource cached in the first memory110. The web view153may configure a web page screen using an image resource or the like associated with html defining a structure of a document object model (DOM), cascading style sheets (css) defining a displayed shape of each object, or javascript taking charge of an operation part. According to various embodiments, at least a part of the web view153may be implemented as at least one software module (e.g., including instructions which are uploaded to the memory and perform an operation specified by at least one processor) or at least one hardware module (e.g., the at least one processor).

The cache manager155may manage a specified area (e.g., a cache area) of the first memory110. For example, the cache manager155may process update or deletion of a resource stored in the specified area of the first memory110. According to an embodiment, the cache manager155may manage a resource included in the native web application110and a resource cached in the specified area of the first memory110using a resource list. For example, the cache manager155may record information, such as an identifier (ID) of the resource, a URL of the resource, a type (or format) of the resource, a created date of the resource, a cached date of the resource, a last date of use of the resource, the number of uses of the resource, a priority of the resource, or whether the resource is cached, in the resource list. According to various embodiments, at least a part of the cache manager155may be implemented as at least one software module (e.g., including instructions which are uploaded to the memory and perform an operation specified by at least one processor) or at least one hardware module (e.g., the at least one processor).

According to an embodiment, the cache manager155may update a resource associated with the web page previously stored in the first memory110. As an example, the cache manager155may access the web server to identify whether the resource is changed, via the communication circuitry190depending on a specified condition. When the resource is changed, the cache manager155may receive the changed resource from the web server and may update the resource stored in the first memory110. In other words, the cache manager155may update the resource cached in the first memory110to the latest version. In this regard, the specified condition may be a condition of connecting to the web server based on setting information. For example, when a connection condition such as a time of access to the web server or the number of times of accessing the web server is set, the cache manager155may access the web server depending on the set information to update the cached resource. Thus, the web server does not one-sidedly transmit a resource associated with the web page to the electronic device100. The electronic device100may receive the resource from the web server when necessary, thus overcoming disadvantages such as a delay generated in the process of connecting to the web server.

According to an embodiment, the cache manager155may delete the resource cached in the first memory110. The cache manager155may delete the cached resource to ensure a space for the specified area (e.g., the cache area) of the first memory110. As an example, the cache manager155may select a target to be deleted in an order of resources with low priorities, in priorities set on the basis of the number of uses of the cached resource, a last date of use of the cached resource, or the like. The cache manager155may select a target to be deleted, until a space for the specified area of the first memory110meets a specified level (or size). Furthermore, when a resource which is not recorded in the resource list is cached in the specified area of the first memory110, the cache manager155may select the corresponding resource as the target to be deleted. Thereafter, the cache manager155may delete resource information selected as the target to be deleted from the resource list and may also delete the resource information from the specified area of the first memory110.

The resource manager157may manage a resource included in an application (e.g., the native web application111). According to various embodiments, at least a part of the resource manager157may be implemented as at least one software module (e.g., including instructions which are uploaded to the memory and perform an operation specified by at least one processor) or at least one hardware module (e.g., the at least one processor).

The display170may visually provide a user of the electronic device100with information. For example, the display170may display a variety of content (e.g., a text, an image, a video, an icon, a symbol, or the like) to the user. The display170may include a control circuitry. According to an embodiment, the display170may include a touch circuitry or a pressure sensor capable of measuring intensity of pressure to a touch.

The communication circuitry190may establish a wired or wireless communication channel between the electronic device100and an external electronic device (e.g., a web server) and may support to communicate over the established communication channel. For example, the communication circuitry190may be connected to a network through wired or wireless communication to communicate with the external electronic device.

As described above, according to various embodiments, an electronic device (e.g., the electronic device100) may include a display (e.g., the display170), a communication circuitry (e.g., the communication circuitry190), a first memory (e.g., the first memory110) storing a native web application (e.g., the native web application111) including a first resource, a second memory (e.g., the second memory130) loaded with instructions included in the native web application, and a processor (e.g., the processor150) operatively connected with the display, the communication circuitry, the first memory, and the second memory. The processor may be configured to transmit a request to identify whether the first resource is changed to an external electronic device, via the communication circuitry, when a specified condition is met, use the first resource in response to receiving a response that the first resource is not changed from the external electronic device or that the external electronic device does not respond to a connection to the request, receive a second resource replacing the first resource from the external electronic device, via the communication circuitry, in response to receiving a response that the first resource is changed from the external electronic device, and use the second resource.

According to various embodiments, the first memory may include a non-volatile memory and the second memory may include a volatile memory.

According to various embodiments, the specified condition may include at least one of a condition where a time of access to the external electronic device is greater than a specified time and a condition where the number of times of accessing the external electronic device is greater than a specified number of times.

According to various embodiments, the processor may be configured to store information about the first resource or the second resource in the first memory.

According to various embodiments, the information may include at least one of an identifier of the first resource or the second resource, a URL of the first resource or the second resource, a type of the first resource or the second resource, a created date of the first resource or the second resource, a cached date of the first resource or the second resource, a last date of use of the first resource or the second resource, the number of uses of the first resource or the second resource, a priority of the first resource or the second resource, or whether the first resource or the second resource is cached.

According to various embodiments, the processor may be configured to identify an expiration date of the first resource or the second resource stored in the first memory, download the second resource from the second external electronic device, via the communication circuitry, when it is determined that the expiration date elapses, and store the downloaded second resource in the first memory.

According to various embodiments, the processor may be configured to, when a space of the first memory is less than or equal to a specified level (or a specified size), determine whether to delete the first resource or the second resource based on a priority of the first resource or the second resource stored in the first memory and, when the first resource or the second resource is a target to be deleted, delete the first resource or the second resource from the first memory.

According to various embodiments, the processor may be configured to assign the priority based on at least one of the number of uses of the first resource or the second resource and a last date of use of the first resource or the second resource.

According to various embodiments, the processor may be configured to transmit a request to identify whether the first resource is changed to the external electronic device through a thread, store the first resource in the first memory, and receive the second resource and store the second resource in the first memory.

FIG.2is a drawing illustrating an operation method200of an electronic device associated with caching a resource according to an embodiment.

Referring toFIG.2, in conjunction with the operation method200of the electronic device associated with caching the resource, in operation210, a processor (e.g., a processor150ofFIG.1) of the electronic device (e.g., an electronic device100) may transmit a request to identify whether a first resource included in a native web application (e.g., a native web application111ofFIG.1) is changed to an external electronic device (e.g., a web server), via communication circuitry (e.g., a communication circuitry190). For example, the processor may transmit an identification request to the external electronic device to identify whether the first resource has the latest version. According to an embodiment, only when the specified condition is met, the processor may perform operation210. The specified condition may include, for example, a condition of connection to the external electronic device based on setting information.

In operation215, the processor150may identify whether the first resource is changed. For example, when a condition where a time of access to the external electronic device is greater than a specified time, a condition where the number of times of accessing the external electronic device is greater than a specified number of times, or the like is set, according to the set information, the processor may access the external electronic device to identify whether the first resource is changed.

When receiving a response that the first resource is not changed from the external electronic device in operation215, in operation230, the processor may store (or cache) the first resource included in the native web application in a first memory (e.g., a first memory110ofFIG.1). For example, the processor may store the first resource included in the native web application in a cache area of the first memory. According to various embodiments, although the connection to the external electronic device is not performed during a specified time or although not receiving the response about whether the first resource is changed during the specified time, in operation230, the processor may store the first resource in the first memory. Thus, although the connection to the external electronic device is not performed due to a network connection problem, the processor may output a web page screen of the native web application on a display (e.g., a display170ofFIG.1).

When receiving a response that the first resource is changed from the external electronic device in operation215, in operation250, the processor may receive a second resource replacing the first resource (e.g., the second resource generated as the first resource is changed) from the external electronic device, via the communication circuitry. Furthermore, in operation270, the processor may store (or cache) the received second resource in the first memory. In other words, the processor may store the latest version of resource (the second resource) in a cache area of the first memory.

Thereafter, in the process of running the native web application, when processing an instruction to use the first resource among instructions included in the native web application loaded into a second memory (e.g., a second memory130ofFIG.1), in operation290, the processor may use the first resource or the second resource stored in the first memory. In other words, the processor may configure a web page screen using a resource (e.g., the first resource or the second resource) stored in the cache area of the first memory and may output the configured web page screen on the display.

FIG.3is a drawing illustrating an operation method300of an electronic device associated with using a resource according to an embodiment.

Referring toFIG.3, in conjunction with the operation method300of the electronic device associated with using the resource, in a process of running a native web application (e.g., a native web application111ofFIG.1), when receiving a request to process an instruction to use a resource associated with a web page among instructions included in the native web application loaded into a second memory (e.g., a second memory130ofFIG.1), in operation310, a processor (e.g., a processor150ofFIG.1) of the electronic device (e.g., an electronic device100ofFIG.1) may determine that the resource is cached in a first memory (e.g., a first memory110ofFIG.1). For example, the processor may identify whether the resource is stored in a cache area of the first memory (e.g., a non-volatile memory area).

When the resource is not cached in the first memory, in operation330, the processor may cache a resource included in the native web application in the first memory. For example, the processor may store the resource included in the native web application in the cache area of the first memory. Furthermore, in operation350, the processor may update a resource list. For example, the processor may record an identifier (ID) of the resource, a URL of the resource, a type (or format) of the resource, a created date of the resource, a cached date of the resource, a last date of use of the resource, the number of uses of the resource, a priority of the resource, whether the resource is cached, or the like, in the resource list.

When the resource is cached in the first memory, in operation370, the processor may execute an update of the resource through a thread. For example, the processor may proceed with updating the resource, independently of running the native web application (or as the background), using the thread. As an example, the processor may identify whether the resource is changed by means of a web server and may receive the latest version of resource from the web server to update an existing resource stored in the cache area of the first memory, when the resource is changed.

In operation390, the processor may process an instruction to use a resource associated with a web page, using the resource cached in the first memory. For example, the processor may configure a web page screen using the resource stored in the cache area of the first memory.

According to an embodiment, because the process of updating the resource, which is executed in operation370, is performed independently of processing the instruction to use the resource associated with the web page (or as the background), a previously cached resource may be used for configuring a web page screen. This may lead to an effect of preventing screen blinking due to a change in resource from being generated, because the resource changed in real time is not reflected in the web page screen. The web page screen using the changed resource may be output when the native web application is run again.

According to various embodiments, an electronic device according to an embodiment may include a display, a communication circuitry, a first memory storing a native web application, a second memory loaded with instructions included in the native web application, and a processor operatively connected with the display, the communication circuitry, the first memory, and the second memory. The processor may be configured to receive a request to run the native web application (e.g., a request according to a user input), run the native web application based on a first resource cached in the first memory, and update the first resource through background processing.

The first memory may include a non-volatile memory.

The processor may be configured to establish a communication channel with a web server device associated with the native web application, receive a second resource associated with operating the native web application from the web server device, and cache the second resource in the first memory.

The processor may update a screen output on the display by applying the second resource cached in the first memory to the native web application at a specified scheduling time. Alternatively, when a screen of the display is changed or when a specified user input occurs, the processor may update a screen output on the display by applying the second resource cached in the first memory to the native web application.

According to various embodiments, an operation method of an electronic device according to an embodiment may receiving a request to run a native web application stored in a non-volatile memory, loading instructions included in the native web application into a volatile memory to run the native web application based on a first resource which is stored in the non-volatile memory is associated with running the native web application, and establishing a communication channel with a web server device through background processing to receive a second resource associated with updating the first resource and store the second resource in the non-volatile memory.

FIG.4is a drawing illustrating an operation method400of an electronic device associated with updating a resource according to an embodiment.

Referring toFIG.4, in conjunction with the operation method400of the electronic device associated with updating the resource, a processor (e.g., a processor150ofFIG.1) of the electronic device (e.g., an electronic device100ofFIG.1) may update a resource cached in a first memory (e.g., a first memory110ofFIG.1). In operation410, the processor may identify whether the resource cached in the first memory is changed. As an example, the processor may transmit a request to identify whether the resource is changed to an external electronic device (e.g., a web server) via communication circuitry (e.g., communication circuitry190), and the external electronic device may transmit a response to whether the resource is changed to the electronic device.

In operation430, the processor may determine whether an expiration date of the resource elapses. For example, the processor may identify whether an expiration date of a resource set through tag information or the like defined in an HTTP header according to the HTTP specification elapses.

When the expiration date of the resource elapses, in operation450, in operation450, the processor may download the resource from the external expiration date, via the communication circuitry.

Furthermore, in operation470, the processor may cache the downloaded resource in the first memory and may update information about the resource to a resource list. For example, the processor may store the downloaded resource in a cache area of the first memory and may record an identifier (ID) of the resource, a URL of the resource, a type (or format) of the resource, a created date of the resource, a cached date of the resource, a last date of use of the resource, the number of uses of the resource, a priority of the resource, whether the resource is cached, or the like, in the resource list.

FIG.5is a drawing illustrating a resource list according to an embodiment.

Referring toFIG.5, a processor (e.g., a processor150ofFIG.1) of an electronic device (e.g., an electronic device100ofFIG.1) may manage a resource included in a native web application (e.g., a native web application111ofFIG.1) or a resource cached in a first memory (e.g., a first memory110ofFIG.1) through the resource list. For example, the processor may record an identifier (ID)510of the resource, a URL520of the resource, a type (or format)530of the resource, a created date540of the resource, a cached date550of the resource, a last date of use560of the resource, the number of uses570of the resource, a priority580of the resource, whether the cache is cached590, or the like in the resource list.

The ID510of the resource may include information for identifying the resource. According to an embodiment, the processor may assign the ID510of the resource in an order where information of the resource is recorded in the resource list. The URL520of the resource may include information indicating a location where the resource is stored. The type530of the resource may include, for example, information indicating whether the resource is a file (e.g., css) defining a style (e.g., layout) of a web page, whether the resource is a file (e.g., jayscript) defining a dynamic portion or the like in the web page, or whether the resource is an image or the like. The created date40of the resource may include date information when the resource is generated. The cached date550of the resource may include date information when the resource is stored in a cache area of the first memory. The last date of use560of the resource may include date information when the resource is used last. The number of uses560of the resource may include the number of times information that the resource is used. The priority580of the resource may be set on the basis of the number of uses560of the resource, the last date of use560, or the like. According to an embodiment, a target deleted from the cache area of the first memory may be selected according to the priority580of the resource. Whether the resource is cached590may include information indicating whether the resource is stored in the cache area of the first memory.

FIG.6is a drawing illustrating an operation method600of an electronic device associated with deleting a resource according to an embodiment.

Referring toFIG.6, in conjunction with the operation method600of the electronic device associated with deleting the resource, a processor (e.g., a processor150ofFIG.1) of the electronic device (e.g., an electronic device100ofFIG.1) may delete a resource cached in a first memory (e.g., a first memory110ofFIG.1). The processor may delete the cached resource to ensure a space for a specified area (e.g., a cache area) of the first memory.

In operation610, the processor may identify a resource list recording information about a resource included in a native web application (e.g., a native web application111ofFIG.1) or a resource cached in the first memory. Furthermore, the processor may select a target to be deleted, based on information about the resource recorded in the resource list. As an example, the processor may select a target to be deleted, in an order of resources with low priorities, in a priority (e.g., a priority580of the resource) set on the basis of the number of uses of the resource (e.g., the number of uses570of the resource), a last date of use of the resource (e.g., a last date of use560of the resource), or the like. As another example, when a resource which is not recorded in the resource list is stored in a cache area of the first memory, the processor may select the corresponding resource as a target to be deleted.

In operation630, the processor may determine whether the resource is valid. As an example, the processor may identify whether the resource is selected as a target to be deleted.

When the resource is not valid (e.g., when the resource is the target to be deleted), in operation650, the processor may delete information about the resource from the resource list. Furthermore, in operation670, the processor may delete the resource from the cache area of the first memory.

According to an embodiment, the processor may repeat the operation of selecting a target to be deleted, deleting information about the resource selected as the target to be deleted, and deleting the resource selected as the target to be deleted, until a space for the cache area of the first memory meets a specified level (or size).

As described above, according to various embodiments, a method for caching a resource in an electronic device (e.g., the electronic device100) may include transmitting, by a processor of the electronic device, a request to identify whether a first resource included in a native web application stored in a first memory is changed to an external electronic device, via a communication circuitry, when a specified condition is met, using the first resource in response to receiving a response that the first resource is not changed from the external electronic device or that the external electronic device does not respond to a connection, and receiving a second resource replacing the first resource from the external electronic device, via the communication circuitry, in response to receiving a response that the first resource is changed from the external electronic device and using the second resource.

According to various embodiments, the specified condition may include at least one of a condition where a time of access to the external electronic device is greater than a specified time and a condition where the number of times of accessing the external electronic device is greater than a specified number of times.

According to various embodiments, the method may further include storing information about the first resource or the second resource in the first memory.

According to various embodiments, the information may include at least one of an identifier of the first resource or the second resource, a URL of the first resource or the second resource, a type of the first resource or the second resource, a created date of the first resource or the second resource, a cached date of the first resource or the second resource, a last date of use of the first resource or the second resource, the number of uses of the first resource or the second resource, a priority of the first resource or the second resource, or whether the first resource or the second resource is cached.

According to various embodiments, the method may further include identifying an expiration date of the first resource or the second resource stored in the first memory, downloading the second resource from the external electronic device, via the communication circuitry, when it is determined that the expiration date elapses, and storing the downloaded second resource in the first memory.

According to various embodiments, the method may further include, when a space of the first memory is less than or equal to a specified level (or size), determining whether to delete the first resource or the second resource based on a priority of the first resource or the second resource stored in the first memory and, when the first resource or the second resource is a target to be deleted, deleting the first resource or the second resource from the first memory.

According to various embodiments, the method may further include assigning the priority based on at least one of the number of uses of the first resource or the second resource and a last date of use of the first resource or the second resource.

According to various embodiments, transmitting a request to identify whether the first resource is changed to the external electronic device through a thread, storing the first resource in the first memory, and receiving the second resource and storing the second resource in the first memory may be performed.

FIG.7is a drawing illustrating a screen describing use of a resource according to an embodiment.

Referring toFIG.7, a processor (e.g., a processor150) of an electronic device (e.g., an electronic device100) may provide a web function of a native web application (e.g., a native web application111) using a first resource711cached in a first memory (e.g., a first memory110). For example, in state701, the processor may output a first web page screen710of the native web application on a display (e.g., a display170).

According to an embodiment, the processor may update the cached first resource711by means of a web server. Because the process of updating the first resource711is performed independently of processing an instruction to use a resource associated with a web page (as the background), the previously cached first resource711may be used to configure the first web page screen710. This may lead to an effect of preventing screen blinking due to a change in resource from being generated, because a second resource731to which the first resource is changed in real time is not reflected in the first web page screen710. Furthermore, in state703, a second web page screen730using the changed second resource731may be output when the native web application is run again.

FIG.8is a block diagram of an electronic device801in a network environment800according to various embodiments.

Referring toFIG.8, the electronic device801(e.g., the electronic device100ofFIG.1) may communicate with an electronic device802through a first network898(e.g., a short-range wireless communication) or may communicate with an electronic device804or a server808through a second network899(e.g., a long-distance wireless communication) in the network environment800. According to an embodiment, the electronic device801may communicate with the electronic device804through the server808. According to an embodiment, the electronic device801may include a processor820(e.g., the processor150ofFIG.1), a memory830(e.g., the first memory110and the second memory130ofFIG.1), an input device850, a sound output device855, a display device860(e.g., the display170ofFIG.1), an audio module870, a sensor module876, an interface877, a haptic module879, a camera module880, a power management module888, a battery889, a communication module890(e.g., the communication circuit190ofFIG.1), a subscriber identification module896, and an antenna module897. According to some embodiments, at least one (e.g., the display device860or the camera module880) among components of the electronic device801may be omitted or other components may be added to the electronic device801. According to some embodiments, some components may be integrated and implemented as in the case of the sensor module876(e.g., a fingerprint sensor, an iris sensor, or an illuminance sensor) embedded in the display device860(e.g., a display).

The processor820may operate, for example, software (e.g., a program840) to control at least one of other components (e.g., a hardware or software component) of the electronic device801connected to the processor820and may process and compute a variety of data. The processor820may load a command set or data, which is received from other components (e.g., the sensor module876or the communication module890), into a volatile memory832, may process the loaded command or data, and may store result data into a nonvolatile memory834. According to an embodiment, the processor820may include a main processor821(e.g., a central processing unit or an application processor) and an auxiliary processor823(e.g., a graphic processing device, an image signal processor, a sensor hub processor, or a communication processor), which operates independently from the main processor821, additionally or alternatively uses less power than the main processor821, or is specified to a designated function. In this case, the auxiliary processor823may operate separately from the main processor821or embedded.

In this case, the auxiliary processor823may control, for example, at least some of functions or states associated with at least one component (e.g., the display device860, the sensor module876, or the communication module890) among the components of the electronic device801instead of the main processor821while the main processor821is in an inactive (e.g., sleep) state or together with the main processor821while the main processor821is in an active (e.g., an application execution) state. According to an embodiment, the auxiliary processor823(e.g., the image signal processor or the communication processor) may be implemented as a part of another component (e.g., the camera module880or the communication module890) that is functionally related to the auxiliary processor823.

The memory830may store a variety of data used by at least one component (e.g., the processor820or the sensor module876) of the electronic device801, for example, software (e.g., the program840) and input data or output data with respect to commands associated with the software. The memory830may include the volatile memory832or the nonvolatile memory834.

The program840may be stored in the memory830as software and may include, for example, an operating system842, a middleware844, or an application846.

The input device850may be a device for receiving a command or data, which is used for a component (e.g., the processor820) of the electronic device801, from an outside (e.g., a user) of the electronic device801and may include, for example, a microphone, a mouse, or a keyboard.

The sound output device855may be a device for outputting a sound signal to the outside of the electronic device801and may include, for example, a speaker used for general purposes, such as multimedia play or recordings play, and a receiver used only for receiving calls. According to an embodiment, the receiver and the speaker may be either integrally or separately implemented.

The display device860may be a device for visually presenting information to the user and may include, for example, a display, a hologram device, or a projector and a control circuit for controlling a corresponding device. According to an embodiment, the display device860may include a touch circuitry or a pressure sensor for measuring an intensity of pressure on the touch.

The audio module870may convert a sound and an electrical signal in dual directions. According to an embodiment, the audio module870may obtain the sound through the input device850or may output the sound through an external electronic device (e.g., the electronic device802(e.g., a speaker or a headphone)) wired or wirelessly connected to the sound output device855or the electronic device801.

The sensor module876may generate an electrical signal or a data value corresponding to an operating state (e.g., power or temperature) inside or an environmental state outside the electronic device801. The sensor module876may include, for example, a gesture sensor, a gyro sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a grip sensor, a proximity sensor, a color sensor, an infrared sensor, a biometric sensor, a temperature sensor, a humidity sensor, or an illuminance sensor.

The interface877may support a designated protocol wired or wirelessly connected to the external electronic device (e.g., the electronic device802). According to an embodiment, the interface877may include, for example, an HDMI (high-definition multimedia interface), a USB (universal serial bus) interface, an SD card interface, or an audio interface.

A connecting terminal878may include a connector that physically connects the electronic device801to the external electronic device (e.g., the electronic device802), for example, an HDMI connector, a USB connector, an SD card connector, or an audio connector (e.g., a headphone connector).

The haptic module879may convert an electrical signal to a mechanical stimulation (e.g., vibration or movement) or an electrical stimulation perceived by the user through tactile or kinesthetic sensations. The haptic module879may include, for example, a motor, a piezoelectric element, or an electric stimulator.

The camera module880may shoot a still image or a video image. According to an embodiment, the camera module880may include, for example, at least one lens, an image sensor, an image signal processor, or a flash.

The power management module888may be a module for managing power supplied to the electronic device801and may serve as at least a part of a power management integrated circuit (PMIC).

The battery889may be a device for supplying power to at least one component of the electronic device801and may include, for example, a non-rechargeable (primary) battery, a rechargeable (secondary) battery, or a fuel cell.

The communication module890may establish a wired or wireless communication channel between the electronic device801and the external electronic device (e.g., the electronic device802, the electronic device804, or the server808) and support communication execution through the established communication channel. The communication module890may include at least one communication processor operating independently from the processor820(e.g., the application processor) and supporting the wired communication or the wireless communication. According to an embodiment, the communication module890may include a wireless communication module892(e.g., a cellular communication module, a short-range wireless communication module, or a GNSS (global navigation satellite system) communication module) or a wired communication module894(e.g., an LAN (local area network) communication module or a power line communication module) and may communicate with the external electronic device using a corresponding communication module among them through the first network898(e.g., the short-range communication network such as a Bluetooth, a WiFi direct, or an IrDA (infrared data association)) or the second network899(e.g., the long-distance wireless communication network such as a cellular network, an internet, or a computer network (e.g., LAN or WAN)). The above-mentioned various communication modules890may be implemented into one chip or into separate chips, respectively.

According to an embodiment, the wireless communication module892may identify and authenticate the electronic device801using user information stored in the subscriber identification module896in the communication network.

The antenna module897may include one or more antennas to transmit or receive the signal or power to or from an external source. According to an embodiment, the communication module890(e.g., the wireless communication module892) may transmit or receive the signal to or from the external electronic device through the antenna suitable for the communication method.

Some components among the components may be connected to each other through a communication method (e.g., a bus, a GPIO (general purpose input/output), an SPI (serial peripheral interface), or an MIPI (mobile industry processor interface)) used between peripheral devices to exchange signals (e.g., a command or data) with each other.

According to an embodiment, the command or data may be transmitted or received between the electronic device801and the external electronic device804through the server808connected to the second network899. Each of the electronic devices802and804may be the same or different types as or from the electronic device801. According to an embodiment, all or some of the operations performed by the electronic device801may be performed by another electronic device or a plurality of external electronic devices. When the electronic device801performs some functions or services automatically or by request, the electronic device801may request the external electronic device to perform at least some of the functions related to the functions or services, in addition to or instead of performing the functions or services by itself. The external electronic device receiving the request may carry out the requested function or the additional function and transmit the result to the electronic device801. The electronic device801may provide the requested functions or services based on the received result as is or after additionally processing the received result. To this end, for example, a cloud computing, distributed computing, or client-server computing technology may be used.

The electronic device according to various embodiments disclosed in the disclosure may be various types of devices. The electronic device may include, for example, at least one of a portable communication device (e.g., a smartphone), a computer device, a portable multimedia device, a mobile medical appliance, a camera, a wearable device, or a home appliance. The electronic device according to an embodiment of the disclosure should not be limited to the above-mentioned devices.

It should be understood that various embodiments of the disclosure and terms used in the embodiments do not intend to limit technologies disclosed in the disclosure to the particular forms disclosed herein; rather, the disclosure should be construed to cover various modifications, equivalents, and/or alternatives of embodiments of the disclosure. With regard to description of drawings, similar components may be assigned with similar reference numerals. As used herein, singular forms may include plural forms as well unless the context clearly indicates otherwise. In the disclosure disclosed herein, the expressions “A or B”, “at least one of A or/and B”, “A, B, or C” or “one or more of A, B, or/and C”, and the like used herein may include any and all combinations of one or more of the associated listed items. The expressions “a first”, “a second”, “the first”, or “the second”, used in herein, may refer to various components regardless of the order and/or the importance, but do not limit the corresponding components. The above expressions are used merely for the purpose of distinguishing a component from the other components. It should be understood that when a component (e.g., a first component) is referred to as being (operatively or communicatively) “connected,” or “coupled,” to another component (e.g., a second component), it may be directly connected or coupled directly to the other component or any other component (e.g., a third component) may be interposed between them.

The term “module” used herein may represent, for example, a unit including one or more combinations of hardware, software and firmware. The term “module” may be interchangeably used with the terms “logic”, “logical block”, “part” and “circuit”. The “module” may be a minimum unit of an integrated part or may be a part thereof. The “module” may be a minimum unit for performing one or more functions or a part thereof. For example, the “module” may include an application-specific integrated circuit (ASIC).

Various embodiments of the disclosure may be implemented by software (e.g., the program840) including an instruction stored in a machine-readable storage media (e.g., an internal memory836or an external memory838) readable by a machine (e.g., a computer). The machine may be a device that calls the instruction from the machine-readable storage media and operates depending on the called instruction and may include the electronic device (e.g., the electronic device801). When the instruction is executed by the processor (e.g., the processor820), the processor may perform a function corresponding to the instruction directly or using other components under the control of the processor. The instruction may include a code generated or executed by a compiler or an interpreter. The machine-readable storage media may be provided in the form of non-transitory storage media. Here, the term “non-transitory”, as used herein, is a limitation of the medium itself (i.e., tangible, not a signal) as opposed to a limitation on data storage persistency.

According to an embodiment, the method according to various embodiments disclosed in the disclosure may be provided as a part of a computer program product. The computer program product may be traded between a seller and a buyer as a product. The computer program product may be distributed in the form of machine-readable storage medium (e.g., a compact disc read only memory (CD-ROM)) or may be distributed only through an application store (e.g., a Play Store™). In the case of online distribution, at least a portion of the computer program product may be temporarily stored or generated in a storage medium such as a memory of a manufacturer's server, an application store's server, or a relay server.

Each component (e.g., the module or the program) according to various embodiments may include at least one of the above components, and a portion of the above sub-components may be omitted, or additional other sub-components may be further included. Alternatively or additionally, some components (e.g., the module or the program) may be integrated in one component and may perform the same or similar functions performed by each corresponding components prior to the integration. Operations performed by a module, a programming, or other components according to various embodiments of the disclosure may be executed sequentially, in parallel, repeatedly, or in a heuristic method. Also, at least some operations may be executed in different sequences, omitted, or other operations may be added.