Picture processing method, intelligent magic mirror and storage medium

CN115758009BActive Publication Date: 2026-08-11GUANGDONG LEHUA HOME FURNISHING CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-24
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

智能魔镜中一般会安装有应用软件,应用软件启动时所需显示的界面图像每次均在启动时从网络拉取图片显示,然而,网络环境不佳时,容易出现图片长时间无法显示,影响用户体验

Benefits of technology

[0043]本发明提出的一种应用于智能魔镜的图片处理方法,该方法在存在目标应用对应的网络图片请求时,在活动缓存中查询不到对应的目标图片数据时,进一步查询应用的内存缓存和应用所在系统的硬盘缓存中是否存在目标图像数据,在内存缓存和硬盘缓存中之一存在目标图片数据时,将数据缓存至活动缓存中进行显示,基于此,智能魔镜基于活动缓存、内存缓存和硬盘缓存三级缓存来查询图片数据,在活动缓存、内存缓存和硬盘缓存中任一位置缓存有智能魔镜所需显示的图像数据时,智能魔镜均可从活动缓存中进行加载和显示,而无需向网络请求图片,智能魔镜显示图片过程所收到的网络环境的影响可显著降低,从而有效提高智能魔镜显示图片的效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115758009B_ABST
    Figure CN115758009B_ABST
Patent Text Reader

Abstract

This invention discloses an image processing method, a smart mirror, and a storage medium. The method includes: when a network image request corresponding to a target application exists, querying the corresponding active cache to see if the target image data corresponding to the network image request exists; if the active cache does not contain the target image data, querying the memory cache of the target application and the hard disk cache of the system where the target application resides to see if the target image data exists; if the memory cache or the hard disk cache contains the target image data, caching the target image data in the active cache; and if the active cache contains the target image data, displaying the target image data; wherein the active cache, the memory cache, and the hard disk cache all cache data based on the LRU caching mechanism. This invention aims to improve the efficiency of image display in a smart mirror.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of smart home technology, and in particular to image processing methods, smart mirrors, and storage media. Background Technology

[0002] As living standards continue to improve, smart mirrors are becoming increasingly widely used. Smart mirrors typically have application software installed. The interface images displayed when the application starts are retrieved from the network each time it launches. However, in poor network conditions, images may fail to display for extended periods, negatively impacting the user experience. Summary of the Invention

[0003] The main objective of this invention is to provide an image processing method, a smart mirror, and a storage medium, aiming to improve the efficiency of the smart mirror in displaying images.

[0004] To achieve the above objectives, the present invention provides an image processing method applied to a smart mirror, the image processing method comprising the following steps:

[0005] When a network image request corresponding to the target application exists, query the corresponding activity cache to see if the target image data corresponding to the network image request exists.

[0006] If the target image data does not exist in the active cache, the system queries the memory cache of the target application and the hard disk cache of the system where the target application is located to see if the target image data exists. If the target image data exists in the memory cache or the hard disk cache, the target image data is cached in the active cache.

[0007] When the target image data exists in the activity cache, the target image data is displayed;

[0008] The active cache, the memory cache, and the hard disk cache all cache data based on the LRU caching mechanism.

[0009] Optionally, the step of querying whether the target image data exists in the memory cache of the target application and the disk cache of the system where the target application resides, and caching the target image data to the active cache when the target image data exists in the memory cache or the disk cache, includes:

[0010] Check if the target image data exists in the memory cache;

[0011] When the target image data exists in the memory cache, the target image data in the memory cache is returned to the active cache;

[0012] If the target image data does not exist in the memory cache, query the disk cache to see if the target image data exists.

[0013] When the target image data exists in the disk cache, the target image data in the disk cache is returned to the active cache.

[0014] Optionally, after the step of querying whether the corresponding activity cache contains the target image data corresponding to the network image request, the method further includes:

[0015] When the target image data is not present in the active cache, the memory cache, and the disk cache, the target image data is downloaded from the network and cached in the active cache.

[0016] Display the target image data.

[0017] Optionally, the step of downloading the target image data from the network includes:

[0018] Obtain the status information of the network;

[0019] The target number of download threads is determined based on the status information;

[0020] The download thread corresponding to the target quantity downloads the target image data from the network.

[0021] Optionally, after the step of querying whether the corresponding activity cache contains the target image data corresponding to the network image request, the method further includes:

[0022] When the target image data is not present in the activity cache, the memory cache, and the disk cache, obtain the target cache capacity required to obtain the target image data;

[0023] When the target cache capacity is greater than or equal to the cache capacity allowed by the active cache, the data that has not been used for the longest time in the active cache is transferred to the disk cache, and the process returns to the step of obtaining the target cache capacity required for the target image data;

[0024] When the target cache capacity is less than the cache capacity allowed by the active cache, the step of downloading the target image data from the network and caching the target image data to the active cache is executed.

[0025] Optionally, the step of caching the target image data to the active cache includes:

[0026] The target image data and its corresponding write time information are cached in the active cache.

[0027] Optionally, after the steps of downloading the target image data from the network and caching the target image data to the active cache, the method further includes:

[0028] When the application page corresponding to the network image request is closed, the data in the activity cache is deleted and transferred to the hard disk cache; and / or,

[0029] When the active cache contains first target data that meets preset conditions, the first target data in the active cache is deleted and transferred to the memory cache or the hard disk cache;

[0030] The preset condition is that the interval between the data writing time and the current time is greater than or equal to a first preset duration.

[0031] Optionally, after the steps of downloading the target image data from the network and caching the target image data to the active cache, the method further includes:

[0032] When the data capacity in the memory cache is greater than or equal to the first maximum capacity, the data that has not been used for the longest time in the memory cache is deleted and transferred to the hard disk cache; and / or,

[0033] When the memory cache contains second target data that meets preset conditions, the second target data in the memory cache is deleted and transferred to the hard disk cache; and / or,

[0034] When the amount of data in the memory cache is greater than or equal to a first preset amount, the data that has not been used for the longest time in the memory cache is deleted and transferred to the hard disk cache;

[0035] The preset condition is that the interval between the data writing time and the current time is greater than or equal to a second preset duration.

[0036] Optionally, after the steps of downloading the target image data from the network and caching the target image data to the active cache, the method further includes:

[0037] When the data capacity in the hard disk cache is greater than or equal to the second maximum capacity, delete the data that has not been used for the longest time in the hard disk cache; and / or,

[0038] When third target data that meets preset conditions exists in the hard disk cache, the third target data in the hard disk cache is deleted; and / or,

[0039] When the amount of data in the hard disk cache is greater than or equal to the second preset amount, the data that has not been used for the longest time in the hard disk cache will be deleted;

[0040] The preset condition is that the interval between the data writing time and the current time is greater than or equal to a third preset duration.

[0041] In addition, to achieve the above objectives, this application also proposes a smart mirror, which includes: a memory, a processor, and an image processing program stored in the memory and executable on the processor. When the image processing program is executed by the processor, it implements the steps of the image processing method described in any of the preceding claims.

[0042] In addition, to achieve the above objectives, this application also proposes a storage medium storing an image processing program, which, when executed by a processor, implements the steps of the image processing method as described in any of the preceding claims.

[0043] This invention proposes an image processing method for smart mirrors. When a network image request corresponding to a target application exists, and the corresponding target image data cannot be found in the active cache, the method further queries the application's memory cache and the system's hard disk cache to see if the target image data exists. If the target image data exists in either the memory cache or the hard disk cache, the data is cached in the active cache for display. Based on this, the smart mirror queries image data using a three-level cache system: active cache, memory cache, and hard disk cache. If the image data required by the smart mirror is cached in any of these three locations, the smart mirror can load and display it from the active cache without requesting the image from the network. The impact of the network environment on the smart mirror's image display process can be significantly reduced, thereby effectively improving the efficiency of the smart mirror's image display. Attached Figure Description

[0044] Figure 1 This is a schematic diagram of the hardware structure involved in the operation of an embodiment of the smart mirror of the present invention;

[0045] Figure 2 This is a flowchart illustrating an embodiment of the image processing method of the present invention;

[0046] Figure 3 This is a flowchart illustrating another embodiment of the image processing method of the present invention;

[0047] Figure 4 This is a flowchart illustrating another embodiment of the image processing method of the present invention;

[0048] Figure 5 This is a flowchart illustrating another embodiment of the image processing method of the present invention;

[0049] Figure 6 This is a flowchart illustrating another embodiment of the image processing method of the present invention.

[0050] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0051] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0052] This invention proposes a smart mirror.

[0053] In this embodiment, the smart mirror is equipped with an Android system, and the Android system has one or more application software installed.

[0054] In this embodiment of the invention, reference is made to Figure 1 The smart mirror includes a processor 1001 (e.g., CPU), a memory 1002, a timer 1003, etc. The components in the control device are connected via a communication bus. The memory 1002 can be high-speed RAM or stable memory (non-volatile memory), such as disk storage. Optionally, the memory 1002 can also be a storage device independent of the aforementioned processor 1001.

[0055] Those skilled in the art will understand that Figure 1 The device structure shown does not constitute a limitation on the device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0056] like Figure 1 As shown, the memory 1002, which serves as a storage medium, may include an image processing program. Figure 1 In the device shown, the processor 1001 can be used to call the image processing program stored in the memory 1002 and execute the relevant steps of the image processing method in the following embodiments.

[0057] This invention also provides an image processing method applied to the aforementioned smart mirror.

[0058] Reference Figure 2 This application proposes an embodiment of an image processing method. In this embodiment, the image processing method includes:

[0059] Step S10: When there is a network image request corresponding to the target application, query the corresponding activity cache to see if there is target image data corresponding to the network image request;

[0060] The target application is the application software installed on the smart mirror. In this embodiment, the network image request is generated when the target application starts, specifically to request the image required to be displayed on the interface when the target application starts. In other embodiments, the network image request may also be generated when the target application receives a preset instruction during its continuous operation after startup.

[0061] Activity caching is specifically a cache space triggered by the page that generates the network image request, used to complete page events for that page. In particular, it's a cache used within the scope of the Activity corresponding to the network image request; the cache disappears when the page exits.

[0062] Specifically, during the process of caching image data to the active cache before the current moment, the corresponding memory address and image feature value can be associated and stored. Based on this, the target image feature value corresponding to the network image request is determined. Then, the active cache is queried to see if the associated memory address exists based on the target image feature value. If it exists, it can be determined that the target image data exists in the active cache; otherwise, it can be determined that the target image data does not exist in the active cache.

[0063] Specifically, the network image request refers to the network address of the requested network image, and the target image feature value can be obtained by calculating the network address according to the rules.

[0064] Step S20: When the target image data does not exist in the active cache, query the memory cache of the target application and the hard disk cache of the system where the target application is located to see if the target image data exists. When the target image data exists in the memory cache or the hard disk cache, cache the target image data to the active cache.

[0065] The memory cache is a cache used within the scope of the target application; if the target application completely exits, the cache will no longer exist. Specifically, during the process of caching image data to the memory cache before the current moment, the corresponding memory address and image feature value can be associated and stored. Based on this, the target image feature value corresponding to the network image request is determined. The memory cache is then queried to see if an associated memory address exists. If it does, it can be determined that the target image data exists in the memory cache; if it does not, it can be determined that the target image data does not exist in the memory cache.

[0066] The disk cache is a system cache installed by the target application; it exists indefinitely unless the data is deleted. Specifically, during the process of caching image data to the disk cache up to the current moment, the corresponding memory address and image feature value can be associated and stored. Based on this, the target image feature value corresponding to the network image request is determined. The disk cache memory address is then checked for the existence of the associated feature value. If it exists, it can be determined that the target image data exists in the disk cache; otherwise, it can be determined that the target image data does not exist in the disk cache.

[0067] The size of the active cache is smaller than the size of the memory cache, and the size of the memory cache is smaller than the size of the disk cache.

[0068] Specifically, you can query the memory cache first and then the disk cache, or vice versa. Alternatively, you can determine the remaining cache capacity of the active cache and use that capacity to determine the query order between the memory and disk caches, thus improving the efficiency of retrieving the target image data.

[0069] Step S30: When the target image data exists in the active cache, the target image data is displayed; wherein, the active cache, the memory cache, and the disk cache all cache data based on the LRU caching mechanism.

[0070] Specifically, after the target image data is found to exist in the active cache, or after the target image data is not found in the active cache but is cached in the memory cache or disk cache to the active cache, the target image data in the active cache can be loaded to display the target image data.

[0071] The LRU caching mechanism is a strategy that uses the LRU algorithm for data caching and eviction. Specifically, when the storage space is insufficient to accommodate new data, the LRU algorithm evicts the longest-unused data to make room for new data. The LRU caching mechanism supports both data retrieval and data writing operations.

[0072] Specifically, during the process of image data entering and leaving the cache based on the LRU caching mechanism, each cache in the active cache, memory cache, and disk cache is configured with a doubly linked circular list, a hash table, and a node reuse pool, respectively. The node reuse pool is used to store doubly linked circular list nodes created before the current time that do not yet have cached data. The doubly linked circular list consists of multiple nodes arranged in chronological order of usage time. The head node stores the data whose usage time is closest to the current time, and the tail node stores the data whose usage time is furthest from the current time. Each node in the doubly linked circular list includes the memory address of the cached data and a bidirectional pointer.

[0073] The cache size and the name of the storage folder can be preset. Specifically, taking the active cache as an example, the image data caching process is explained as follows: When image data needs to be cached in the active cache, the node reuse pool is first traversed. If a doubly linked circular list node corresponding to the active cache exists in the node reuse pool, it is retrieved as the target node. If no doubly linked circular list node corresponding to the active cache exists in the node reuse pool, a new doubly linked circular list node is created as the target node, and the image data is cached in the target node. Then, the pointers of each node in the doubly linked circular list are reset, adding the target node to the head node of the doubly linked circular list. Finally, the image feature value corresponding to the cached image data is used as the key, and the memory address corresponding to the image data is used as the value. The key and value are then associated and stored in a hash table to complete the image data caching in the active cache. Furthermore, the caching process for memory cache and disk cache can be analogous to the active cache when image data needs to be cached, and will not be elaborated upon here.

[0074] Furthermore, when hash tables are set for the active cache, memory cache, and disk cache respectively, each hash table is used to store the association information between the image feature values ​​and memory addresses of the image data cached in the cache space before the current time. Based on this, the first hash table corresponding to the active cache can be queried according to the target image feature value. If the memory address associated with the target image feature value exists in the first hash table, the data at that memory address will be loaded to complete the display of the target image data. If the memory address associated with the target image feature value exists in the first hash table, the second hash table corresponding to the memory cache and the third hash table corresponding to the disk cache can be queried according to the target image feature value. If the memory address associated with the target image feature value exists in the second hash table or the third hash table, the data at that memory address will be cached in the active cache, and the data at the corresponding position in the active cache will be loaded to complete the display of the target image data.

[0075] This invention proposes an image processing method. When a network image request corresponding to a target application exists, and the corresponding target image data cannot be found in the active cache, the method further queries the application's memory cache and the system's disk cache to see if the target image data exists. If the target image data exists in either the memory cache or the disk cache, the data is cached in the active cache for display. Based on this, the smart mirror queries image data using a three-level cache system: active cache, memory cache, and disk cache. If the image data required by the smart mirror is cached in any of these three locations, the smart mirror can load and display it from the active cache without requesting the image from the network. This significantly reduces the impact of the network environment on the smart mirror's image display process, thereby effectively improving the efficiency of the smart mirror's image display.

[0076] Furthermore, based on the above embodiments, another embodiment of the image processing method of this application is proposed. In this embodiment, reference is made to... Figure 3 The step of querying the memory cache of the target application and the disk cache of the system where the target application resides to see if the target image data exists, and caching the target image data to the active cache when the target image data exists in the memory cache or the disk cache, includes:

[0077] Step S21: Query whether the target image data exists in the memory cache;

[0078] Step S22: When the target image data exists in the memory cache, the target image data is cached in the active cache;

[0079] Step S23: When the target image data does not exist in the memory cache, query the disk cache to see if the target image data exists.

[0080] Step S24: When the target image data exists in the hard disk cache, the target image data is cached in the active cache.

[0081] In this embodiment, if the active cache cannot be found, the memory cache is queried first, followed by the disk cache. The memory cache is read faster than the disk cache, which helps to improve the reading efficiency of the target image data.

[0082] Furthermore, based on any of the above embodiments, another embodiment of the image processing method of this application is proposed.

[0083] In this embodiment, refer to Figure 4 After step S10, the method further includes:

[0084] Step S40: When the target image data does not exist in the active cache, the memory cache, and the hard disk cache, download the target image data from the network and cache the target image data in the active cache;

[0085] Specifically, the downloaded target image data can be cached to the hard disk cache first, and then cached from the hard disk cache to the active cache.

[0086] Step S50: Display the target image data.

[0087] Specifically, the target image data is loaded from the activity cache to complete the display of the target image data.

[0088] In this embodiment, if the target image data required by the request cannot be found through the three-level cache query, the target image data is downloaded from the network and displayed, which helps to ensure that the target application can effectively display the required image to meet the usage needs of the target application.

[0089] Furthermore, in this embodiment, the step of caching the target image data to the active cache includes: caching the target image data and the corresponding write time information to the active cache.

[0090] The write time information here specifically refers to the current system time when the target image data is written to the active cache.

[0091] In this embodiment, in addition to caching the target image data in the active cache, the write time information is also cached, thereby ensuring that the target image data can be filtered and processed based on the cached write time information, which helps to improve the efficiency of image data display.

[0092] Furthermore, based on any of the above embodiments, another embodiment of the image processing method of this application is proposed.

[0093] In this embodiment, refer to Figure 5 The step of downloading the target image data from the network includes:

[0094] Step S41: Obtain the status information of the network;

[0095] Specifically, status information may include network type, network speed, network connection status, changes in network type, changes in network speed, and / or changes in network connection status.

[0096] Step S42: Determine the target number of download threads based on the status information;

[0097] Different status information corresponds to different target quantities. Specifically, network speed and target quantity can be negatively correlated; that is, the slower the network speed, the more targets can be, and the faster the network speed, the fewer targets can be.

[0098] Step S43: Download the target image data from the network using the download thread corresponding to the target quantity.

[0099] In this embodiment, setting the number of download threads based on network status information helps ensure that the number of download threads is neither too many nor too few, thereby improving the efficiency and success rate of downloading target image data from the network while saving power consumption of the smart mirror, thus further improving the efficiency and energy efficiency of the smart mirror in displaying image data.

[0100] Furthermore, based on any of the above embodiments, another embodiment of the image processing method of this application is proposed. In this embodiment, reference is made to... Figure 6 After step S10, the following steps are also included:

[0101] Step S60: When the target image data is not present in the active cache, the memory cache, and the disk cache, obtain the target cache capacity required for the target image data;

[0102] Step S70: When the target cache capacity is greater than or equal to the cache capacity allowed by the active cache, delete the data that has not been used for the longest time in the active cache and transfer it to the hard disk cache, and return to the step of obtaining the target cache capacity required for the target image data;

[0103] Step S80: When the target cache capacity is less than the cache capacity allowed by the active cache, the step of downloading the target image data from the network and caching the target image data to the active cache is executed.

[0104] In this embodiment, when the storage capacity of the active cache is insufficient before the target image data is downloaded, the active cache is cleaned up in the manner described above. This helps ensure that there is enough space in the active cache to cache the target image data, avoids memory overflow, and improves the effectiveness of the smart mirror in displaying images. Furthermore, the cleaned image data is not completely deleted, but is transferred to the hard disk cache for permanent storage. This allows the target image data to be read directly from the hard disk cache without having to make another network request when it is requested again, thus improving the efficiency of the smart mirror in displaying the target image data.

[0105] Furthermore, based on any of the above embodiments, yet another embodiment of the image processing method of this application is proposed. In this embodiment, the memory release conditions for the active cache, memory cache, and disk cache are described respectively:

[0106] After step S40 or step S80, the method further includes: when the application page corresponding to the network image request is closed, deleting the data in the activity cache and transferring it to the hard disk cache; and / or, when the activity cache contains first target data that meets a preset condition, deleting the first target data in the activity cache and transferring it to the memory cache or the hard disk cache; wherein, the preset condition is that the interval between the data writing time and the current time is greater than or equal to a first preset duration.

[0107] The write time here is extracted from the write time information of the cached data being synchronized with the cache.

[0108] In this embodiment, when the active cache is cleared upon page closing, the data is not directly deleted but instead transferred to the hard disk cache for permanent storage. This allows subsequent requests for the target image data to be read directly from the hard disk cache without requiring another network request, thus improving the efficiency of the smart mirror in displaying the target image data. Furthermore, even if the memory is not full, the active cache is cleaned up based on the write duration. The cleaned data is not completely deleted but transferred to the memory cache or hard disk cache, ensuring the efficiency of subsequent network image display while simultaneously increasing the space available in the active cache to improve the efficiency of data retrieval from the active cache.

[0109] After step S40 or step S80, the method further includes: when the data capacity in the memory cache is greater than or equal to the first maximum capacity, deleting the data that has not been used for the longest time in the memory cache and transferring it to the hard disk cache; and / or,

[0110] When the memory cache contains second target data that meets preset conditions, the second target data in the memory cache is deleted and transferred to the hard disk cache; and / or,

[0111] When the amount of data in the memory cache is greater than or equal to a first preset amount, the data that has not been used for the longest time in the memory cache is deleted and transferred to the hard disk cache;

[0112] The preset condition is that the interval between the data writing time and the current time is greater than or equal to a second preset duration.

[0113] The write time here is extracted from the write time information synchronized with the cached data. The second preset duration here is longer than the first preset duration mentioned above.

[0114] In this embodiment, the data in the memory cache is cleaned based on three dimensions: data size, data quantity, and write duration. The cleaned data is not completely deleted, but is transferred to the disk cache. This ensures the efficiency of subsequent display of network images while increasing the space of the active cache, thereby improving the efficiency of reading data from the memory cache.

[0115] After step S40 or step S80, the method further includes: when the data capacity in the hard disk cache is greater than or equal to the second maximum capacity, deleting the data that has not been used for the longest time in the hard disk cache; and / or,

[0116] When third target data that meets preset conditions exists in the hard disk cache, the third target data in the hard disk cache is deleted; and / or,

[0117] When the amount of data in the hard disk cache is greater than or equal to the second preset amount, the data that has not been used for the longest time in the hard disk cache will be deleted;

[0118] The preset condition is that the interval between the data writing time and the current time is greater than or equal to a third preset duration.

[0119] The write time here is extracted from the write time information synchronized with the cached data. The third preset duration here is longer than the second preset duration mentioned above.

[0120] In this embodiment, the data in the hard disk cache is cleaned based on three dimensions: data size, data quantity, and write duration, thereby avoiding long-term data redundancy in the hard disk cache and ensuring the data access efficiency of the hard disk cache.

[0121] Furthermore, this embodiment of the invention also proposes a storage medium storing an image processing program, which, when executed by a processor, implements the relevant steps of any of the above-described image processing methods.

[0122] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0123] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0124] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, smart mirror, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0125] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. An image processing method applied to a smart mirror, characterized in that, The image processing method includes the following steps: When a network image request corresponding to a target application exists, the feature value of the target image corresponding to the network image request is determined. Based on the feature value of the target image, the corresponding active cache is queried to see if the target image data corresponding to the network image request exists. The active cache is the cache space triggered by the page that generates the network image request. The network image request includes the network address of the requested network image. The target image feature value is obtained by calculating the network address according to the rules. When the target image data does not exist in the active cache, the target application's memory cache and the system's hard disk cache are queried based on the target image feature value to see if the target image data exists. When the target image data exists in the memory cache or the hard disk cache, the target image data is cached in the active cache. The memory cache is a cache used within the scope corresponding to the target application. When the target image data exists in the activity cache, the target image data is displayed; The active cache, the memory cache, and the disk cache all cache data based on the LRU caching mechanism.

2. The image processing method as described in claim 1, characterized in that, The step of querying the memory cache of the target application and the hard disk cache of the system where the target application resides based on the feature value of the target image, and caching the target image data to the active cache when the target image data exists in the memory cache or the hard disk cache, includes: Based on the target image feature value, query the memory cache to see if the target image data exists; When the target image data exists in the memory cache, the target image data in the memory cache is returned to the active cache; When the target image data does not exist in the memory cache, the disk cache is queried based on the target image feature value to determine whether the target image data exists. When the target image data exists in the disk cache, the target image data in the disk cache is returned to the active cache.

3. The image processing method as described in claim 1 or 2, characterized in that, After the step of querying whether the target image data corresponding to the network image request exists in the corresponding active cache based on the target image feature value, the method further includes: When the target image data is not present in the active cache, the memory cache, and the disk cache, the target image data is downloaded from the network and cached in the active cache. Display the target image data.

4. The image processing method as described in claim 3, characterized in that, The step of downloading the target image data from the network includes: Obtain the status information of the network; The target number of download threads is determined based on the status information; The download thread corresponding to the target quantity downloads the target image data from the network.

5. The image processing method as described in claim 3, characterized in that, After the step of querying whether the target image data corresponding to the network image request exists in the corresponding active cache based on the target image feature value, the method further includes: When the target image data is not present in the activity cache, the memory cache, and the disk cache, obtain the target cache capacity required to obtain the target image data; When the target cache capacity is greater than or equal to the cache capacity allowed by the active cache, the data that has not been used for the longest time in the active cache is transferred to the disk cache, and the process returns to the step of obtaining the target cache capacity required for the target image data; When the target cache capacity is less than the cache capacity allowed by the active cache, the step of downloading the target image data from the network and caching the target image data to the active cache is executed.

6. The image processing method as described in claim 3, characterized in that, The step of caching the target image data to the active cache includes: The target image data and its corresponding write time information are cached in the active cache.

7. The image processing method as described in claim 3, characterized in that, After the steps of downloading the target image data from the network and caching the target image data to the active cache, the method further includes: When the application page corresponding to the network image request is closed, the data in the activity cache is deleted and transferred to the hard disk cache; and / or, When the active cache contains first target data that meets preset conditions, the first target data in the active cache is deleted and transferred to the memory cache or the hard disk cache; The preset condition is that the interval between the data writing time and the current time is greater than or equal to a first preset duration.

8. The image processing method as described in claim 3, characterized in that, After the steps of downloading the target image data from the network and caching the target image data to the active cache, the method further includes: When the data capacity in the memory cache is greater than or equal to the first maximum capacity, the data that has not been used for the longest time in the memory cache is deleted and transferred to the hard disk cache; and / or, When the memory cache contains second target data that meets preset conditions, the second target data in the memory cache is deleted and transferred to the hard disk cache; and / or, When the amount of data in the memory cache is greater than or equal to a first preset amount, the data that has not been used for the longest time in the memory cache is deleted and transferred to the hard disk cache; The preset condition is that the interval between the data writing time and the current time is greater than or equal to a second preset duration.

9. The image processing method as described in claim 3, characterized in that, After the steps of downloading the target image data from the network and caching the target image data to the active cache, the method further includes: When the data capacity in the hard disk cache is greater than or equal to the second maximum capacity, delete the data that has not been used for the longest time in the hard disk cache; and / or, When third target data that meets preset conditions exists in the hard disk cache, the third target data in the hard disk cache is deleted; and / or, When the amount of data in the hard disk cache is greater than or equal to the second preset amount, the data that has not been used for the longest time in the hard disk cache will be deleted; The preset condition is that the interval between the data writing time and the current time is greater than or equal to a third preset duration.

10. A smart mirror, characterized in that, The smart mirror includes: a memory, a processor, and an image processing program stored in the memory and executable on the processor. When the image processing program is executed by the processor, it implements the steps of the image processing method as described in any one of claims 1 to 9.

11. A storage medium, characterized in that, The storage medium stores an image processing program, which, when executed by a processor, implements the steps of the image processing method as described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Data cache method and device

    CN108182187A