Media item cleaning method and device, storage medium and electronic equipment

By scanning and cacheing media item information in electronic devices in advance, the problem of low efficiency in media item cleaning of electronic devices is solved, and faster media item cleaning and more efficient storage space management is achieved.

CN119149760APending Publication Date: 2024-12-17GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202310709807.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-14
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

Existing electronic devices are inefficient when cleaning media items, take a long time, and cannot effectively save storage space.

Method used

Before cleaning up media items, scan the media items in advance and add the scanned media item information to the cache. When the user starts the media item cleaning function, he directly reads the media item information in the cache for classification and outputs cleanable media items. , avoid repeated scans.

Benefits of technology

It reduces the time spent on media item cleaning, improves the efficiency of media item cleaning, saves system resources, and optimizes the utilization of storage space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149760A_ABST
    Figure CN119149760A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a media item cleaning method and device, a storage medium and electronic equipment, and the method comprises the steps: scanning at least one to-be-scanned media item, and obtaining the media item information of the media item; adding the media item information to a cache; in response to the media item cleaning request, reading media item information in a cache and classifying media items according to the media item information to obtain a classification result; and outputting cleanable media items according to a classification result. According to the media item cleaning method provided by the embodiment of the invention, the media item can be scanned in advance and the scanned media item information is added to the cache before the media item is cleaned, and when the media item is cleaned, the media item information in the cache is directly read and classified and the cleanable media item is output; therefore, the media item does not need to be scanned again when the media item is cleaned, so that the time consumed for cleaning the media item can be shortened, and the efficiency of cleaning the media item is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of electronic devices, and in particular to a media item cleaning method, device, storage medium and electronic device. Background Art

[0002] Electronic devices such as smart phones and tablet computers usually have functions such as taking photos and recording videos, so the electronic devices often store a large number of media items such as photos and videos. In order to save storage space of the electronic devices, it is necessary to clean up the media items stored in the electronic devices regularly or irregularly.

[0003] In the related art, when an electronic device cleans up media items, it takes a long time and the cleaning efficiency is low. Summary of the invention

[0004] The embodiments of the present application provide a media item cleaning method, device, storage medium and electronic device, which can reduce the time consumed in media item cleaning and improve the efficiency of media item cleaning.

[0005] The present application embodiment provides a media item cleaning method, including:

[0006] Scanning at least one media item to be scanned to obtain media item information of the media item, where the media item information is used to indicate a type of the media item;

[0007] adding the media item information to a cache;

[0008] In response to a media item cleanup request, read media item information in a cache and classify the media item according to the media item information to obtain a classification result;

[0009] Outputting media items that can be cleaned according to the classification results.

[0010] The present application also provides a media item cleaning device, including:

[0011] A loading module, configured to scan at least one media item to be scanned, and obtain media item information of the media item, wherein the media item information is used to indicate a type of the media item;

[0012] A cache module, used for adding the media item information to a cache;

[0013] The cleaning module is used to respond to a media item cleaning request, read the media item information in the cache, classify the media items according to the media item information, obtain classification results, and output cleanable media items according to the classification results.

[0014] An embodiment of the present application further provides a storage medium, wherein a computer program is stored in the storage medium. When the computer program is executed on a computer, the computer is enabled to execute the above-mentioned media item cleaning method.

[0015] An embodiment of the present application further provides an electronic device, which includes a processor and a memory, wherein a computer program is stored in the memory, and the processor is used to execute the above-mentioned media item cleaning method by calling the computer program stored in the memory.

[0016] The media item cleaning method of the embodiment of the present application can scan the media items in advance and add the scanned media item information to the cache before performing the media item cleaning. When performing the media item cleaning, for example, when the user starts the media item cleaning function, the media item information in the cache is directly read to classify and output the cleanable media items. Therefore, when performing the media item cleaning, there is no need to scan the media items again, thereby reducing the time consumed in the media item cleaning and improving the efficiency of the media item cleaning. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application, and those skilled in the art can obtain other drawings based on these drawings without creative work.

[0018] Figure 1 This is a schematic diagram of an application scenario of the media item cleaning method according to an embodiment of the present application.

[0019] Figure 2 This is a schematic diagram of a first flow chart of a media item cleaning method according to an embodiment of the present application.

[0020] Figure 3 This is a first schematic diagram of adding media item information to the cache in batches in an embodiment of the present application.

[0021] Figure 4 This is a second schematic diagram of adding media item information to the cache in batches in an embodiment of the present application.

[0022] Figure 5 This is a third schematic diagram of adding media item information to the cache in batches in an embodiment of the present application.

[0023] Figure 6 This is a second flow chart of the media item cleaning method according to an embodiment of the present application.

[0024] Figure 7 This is a schematic diagram of a first structure of a media item cleaning device according to an embodiment of the present application.

[0025] Figure 8 This is a second structural schematic diagram of the media item cleaning device according to an embodiment of the present application.

[0026] Fig. 9 A schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0027] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0028] The embodiment of the present application provides a method for cleaning up media items, which can be applied to electronic devices. The electronic devices can be smart phones, tablet computers, gaming devices, AR (Augmented Reality) devices, data storage devices, video playback devices, laptop computers, desktop computing devices, etc.

[0029] refer to Figure 1 , Figure 1 Schematic diagram of the application scenario of the media item cleaning method of the embodiment of the present application. The media item cleaning method is applied to an electronic device, in which a large number of media items are stored, for example, multiple media items such as media item a to media item i are stored. Among them, media item a to media item i may include one or more of photos, QR codes, screenshots, emoticons, dynamic pictures, and videos. In order to save the storage space of the electronic device, it is necessary to clean up the media items stored in the electronic device regularly or irregularly.

[0030] In an example of practical application, the media item cleaning method can be integrated into a media item cleaning tool (SDK), or some implementation steps of the media item cleaning method can be integrated into a media item cleaning tool (SDK). The media item cleaning tool (SDK) can be, for example, a mobile phone manager, or a module in a mobile phone manager. After a user uses an electronic device for a long time, more and more media items will be stored in the electronic device, such as photos, QR codes, screenshots, emoticons, dynamic pictures, videos, etc. In order to reduce the storage space occupied by a large number of media items, a media item cleaning tool (SDK) can be used to clean up media items.

[0031] refer to Figure 2 , Figure 2 This is a first flow chart of a media item cleaning method according to an embodiment of the present application. The media item cleaning method includes the following steps 110 to 140:

[0032] 110 , scan at least one media item to be scanned to obtain media item information of the media item.

[0033] When cleaning up media items, firstly, the media items to be scanned need to be scanned. The media items to be scanned may be one or more. The media items to be scanned may include, for example, photos, QR codes, screenshots, emoticons, dynamic pictures, videos, etc.

[0034] The electronic device can obtain the media item information of the media item by scanning the media item. The media item information is used to indicate the type of the media item. The type of the media item can reflect the cleaning tendency of the user, and the type of the media item can be set based on experience. Therefore, the type of the media item can be used to indicate whether the media item is cleanable.

[0035] For example, the types of media items may include landscape photos, portrait photos, ID photos, QR codes, game screenshots, blurred images, emoticons, dynamic images, short videos (e.g., videos with a duration of less than 1 minute), long videos (e.g., videos with a duration of more than 1 minute), etc. According to experience, in the cleaning tendency of users, media items such as QR codes, game screenshots, blurred images, emoticons, dynamic images, and short videos are usually cleaned up by users; while media items such as landscape photos, portrait photos, ID photos, and long videos are not usually cleaned up by users.

[0036] In practical applications, electronic devices may store a large number of media items, such as a large number of photos, emoticons, videos, and the like. Among these media items, there may be some similar content, for example, there may be multiple photos that are similar, or multiple emoticons that are similar. When processing these media items, such as cleaning them, in order to reduce the occupation of cache space by a large number of media items, one of the multiple similar media items may be set as a root media item, and the remaining similar media items may be set to point to the root media item.

[0037] For example, the photos stored in the electronic device include 3 groups of similar photos, each group of similar photos includes multiple photos. Among them, similar photo group A is landscape photos, photo group B is person photos, and photo group C is ID photos. The electronic device can set one photo in photo group A as root media item A, and set the remaining photos in photo group A to point to root media item A; set one photo in photo group B as root media item B, and set the remaining photos in photo group B to point to root media item B; set one photo in photo group C as root media item C, and set the remaining photos in photo group C to point to root media item C.

[0038] In some embodiments, when the electronic device scans at least one media item to be scanned and obtains media item information of the media item, the electronic device may perform the following steps:

[0039] Determining whether at least one media item to be scanned has a corresponding root media item;

[0040] If the media item has a corresponding root media item, then obtaining the media item information of the root media item, and using the media item information of the root media item as the media item information of the media item;

[0041] If the media item does not have a corresponding root media item, the media item is scanned to obtain media item information of the media item.

[0042] For each media item to be scanned, the electronic device may first determine whether there is a corresponding root media item. If there is a corresponding root media item, the media item information of the root media item is obtained, for example, the root media item may be scanned to obtain the media item information of the root media item, and the media item information of the root media item is used as the media item information of the media item. If there is no corresponding root media item, the media item is scanned to obtain the media item information of the media item.

[0043] 120, adding media item information to the cache.

[0044] After the electronic device scans the media item and obtains the media item information, the media item information can be added to the cache. It can be understood that the electronic device can quickly read the media item information loaded in the cache at any time.

[0045] In actual applications, the media items to be scanned may include multiple media items, for example, hundreds of pictures, emoticons, screenshots, videos, etc. When an electronic device scans a media item, the scanning process may be interrupted due to various reasons. If the scanned media item information is not cached in time, the scanning process needs to be re-scanned after the interruption, resulting in a waste of time. If caching is performed once each media item is scanned, system resources will be frequently called to write to the cache, resulting in a waste of system resources.

[0046] Therefore, in an embodiment of the present application, the media item information obtained by scanning multiple media items can be added to the cache in batches, which can not only cache the media item information in a timely manner to avoid wasting time due to interruptions in the scanning process, but also avoid frequently calling system resources to write to the cache, thereby saving system resources.

[0047] In practical applications, media item information can be added to the cache in batches in a variety of ways.

[0048] In an application example, the media item information may be cached in batches according to the data size. Specifically, a preset data size may be set, and the preset data size is a data size, such as 3MB, 5MB, 10MB, etc. When scanning multiple media items, when the data size of the scanned media item information reaches the preset data size, the scanned media item information is added to the cache as a batch.

[0049] refer to Figure 3 , Figure 3 This is a first schematic diagram of adding media item information to the cache in batches in an embodiment of the present application. For example, after scanning media item a, media item b, and media item c, the data volume of the media item information obtained reaches a preset data volume, and the scanned media item information is added to the cache as a batch; after scanning media item d, media item e, and media item f, the data volume of the media item information obtained reaches a preset data volume, and the scanned media item information is added to the cache as a batch; and this process continues until the scanning of the multiple media items is completed.

[0050] In addition, it is understandable that if the number of media items is small, or after multiple batches of media item information have been cached, the number of remaining media items is small, then the data volume of the scanned media item information may not reach the preset data volume, and the media item information also needs to be cached. Therefore, when the multiple media items have been scanned and the data volume of the scanned media item information has not reached the preset data volume, the scanned media item information can also be added to the cache as a batch. Therefore, no matter how many media items are to be scanned, the scanning of all media items can be completed and the media item information can be cached.

[0051] In another application example, batch caching can be performed according to the scanning duration. Specifically, a preset duration can be set, such as 3 seconds, 5 seconds, 10 seconds, etc. When scanning multiple media items, when the scanning duration reaches the preset duration, the scanned media item information is added to the cache as a batch.

[0052] refer to Figure 4 , Figure 4 This is a second schematic diagram of adding media item information to the cache in batches in an embodiment of the present application. For example, after scanning media item a, media item b, and media item c, the scanning time reaches a preset time, and the scanned media item information is added to the cache as a batch; after scanning media item d, media item e, and media item f, the scanning time reaches a preset time, and the scanned media item information is added to the cache as a batch; and this process continues until the scanning of the multiple media items is completed.

[0053] In addition, it is understandable that if the number of media items is small, or after multiple batches of media item information have been cached, the number of remaining media items is small, then the scanning time for scanning the remaining media items may not reach the preset time, and the media item information also needs to be cached. Therefore, when the multiple media items have been scanned and the scanning time has not reached the preset time, the scanned media item information can also be added to the cache as a batch. Therefore, no matter how many media items are to be scanned, the scanning of all media items can be completed and the media item information can be cached.

[0054] In another application example, the media items may be cached in batches according to the number of scanned media items. Specifically, a preset number may be set, such as 3, 5, 10, etc. When scanning multiple media items, when scanning of the preset number of media items among the multiple media items is completed, the scanned media item information is added to the cache as a batch.

[0055] refer to Figure 5 , Figure 5 This is a third schematic diagram of adding media item information to the cache in batches in an embodiment of the present application. For example, the preset number is 3, then after scanning the three media items of media item a, media item b, and media item c, the scanned media item information is added to the cache as a batch; after scanning the three media items of media item d, media item e, and media item f, the scanned media item information is added to the cache as a batch; and this process is continued until the scanning of the multiple media items is completed.

[0056] In addition, it is understandable that if the number of media items is small, or after multiple batches of media item information have been cached, the number of remaining media items is small, then the number of remaining media items may not reach the preset number, and the media item information also needs to be cached. Therefore, when the multiple media items have been scanned and the number of media items corresponding to the scanned media item information has not reached the preset number, the scanned media item information is added to the cache as a batch. Therefore, no matter how many media items are to be scanned, the scanning of all media items can be completed and the media item information can be cached.

[0057] 130 , in response to the media item cleanup request, read the media item information in the cache and classify the media item according to the media item information to obtain a classification result.

[0058] In actual applications, when a user wants to clean up media items stored on an electronic device, the user can start the media item cleaning function, for example, the media item cleaning can be started from a media item cleaning tool (sdk). When the user starts the media item cleaning function, the electronic device generates a media item cleaning request and responds to the media item cleaning request. Specifically, the electronic device can read the media item information in the cache and classify the media items according to the media item information to obtain a classification result.

[0059] For example, media item information may include multiple types such as landscape photos, portrait photos, ID photos, QR codes, game screenshots, blurred images, emoticons, dynamic images, short videos, long videos, etc. Then the electronic device can obtain multiple classification results such as landscape photos, portrait photos, ID photos, QR codes, game screenshots, blurred images, emoticons, dynamic images, short videos, long videos, etc. based on the media item information.

[0060] It should be noted that when the electronic device performs media item cleaning is determined by the time when the user starts the media item cleaning function. The electronic device can continuously scan the media items and add the media item information to the cache. When the electronic device responds to the media item cleaning request, the media item information read from the cache may include many caches, and it is not necessarily scanned and cached only once. Therefore, the media item corresponding to the media item information read from the cache may be different from the media item to be scanned in step 110, and the media item corresponding to the media item information read from the cache at least includes the media item to be scanned in step 110.

[0061] 140 , outputting cleanable media items according to the classification results.

[0062] After the electronic device obtains the classification results, it can output the media items that can be cleaned according to the classification results. For example, the classification results obtained by the electronic device include multiple categories such as landscape photos, portrait photos, ID photos, QR codes, game screenshots, blurred images, emoticons, dynamic pictures, short videos, and long videos. According to the user's usual cleaning habits, it can be considered that media items such as QR codes, game screenshots, blurred images, emoticons, dynamic pictures, and short videos are what the user tends to clean up, so media items such as QR codes, game screenshots, blurred images, emoticons, dynamic pictures, and short videos can be output as cleanable media items. When the user confirms the cleanup, the electronic device can delete these cleanable media items, thereby freeing up the storage space occupied by these media items.

[0063] The media item cleaning method of the embodiment of the present application can scan the media items in advance and add the scanned media item information to the cache before performing the media item cleaning. When performing the media item cleaning, for example, when the user starts the media item cleaning function, the media item information in the cache is directly read to classify and output the cleanable media items. Therefore, when performing the media item cleaning, there is no need to scan the media items again, thereby reducing the time consumed in the media item cleaning and improving the efficiency of the media item cleaning.

[0064] In some embodiments, reference Figure 6 , Figure 6 This is a second flow chart of the media item cleaning method according to an embodiment of the present application. Step 110, scanning at least one media item to be scanned, before obtaining the media item information of the media item, further includes the following steps:

[0065] 150, determining the media item to be scanned.

[0066] In actual applications, the media items to be scanned may be specified by the user, for example, the user may specify the storage path or folder of the media items, or the user may directly select the media items; the media items to be scanned may also be determined by the electronic device itself according to set rules.

[0067] For example, the user may specify which folders need to be cleaned when cleaning up media items, and then each time the electronic device scans media items, it may directly determine the media items in the folders specified by the user as media items to be scanned.

[0068] For another example, in actual applications, media items on an electronic device can be stored in a media library. In one application example, when a new media item is added to the media library, for example, when a user takes a photo or downloads a picture and stores it in the media library, the electronic device can determine the new media item as a media item to be scanned. In another application example, a preset space threshold can be set for the storage space occupied by the media items, for example, the preset space threshold can be 5GB, 30%, etc. When the storage space occupied by the media items in the media library reaches the preset space threshold, the electronic device can determine all media items in the media library as media items to be scanned.

[0069] It should be noted that the above examples are only examples, and in actual applications, other methods may be used to determine the media items to be scanned.

[0070] In some embodiments, continue to refer to Figure 6 Step 110, before scanning at least one media item to be scanned and obtaining media item information of the media item, further comprising the following steps:

[0071] 160, determining whether the media item information of the media item to be scanned is loaded in the cache;

[0072] If the media item information of the media item to be scanned is not loaded in the cache, step 110 is executed to scan the media item to be scanned to obtain the media item information of the media item to be scanned;

[0073] If the media item information of the media item to be scanned is loaded in the cache, step 130 is executed to respond to the media item cleanup request, read the media item information in the cache and classify the media item according to the media item information to obtain a classification result.

[0074] It is understandable that in actual applications, the process of the electronic device scanning the media items and adding the scanned media item information to the cache may be continuous. Before the electronic device scans the media items to be scanned, some media item information may have been loaded into the cache.

[0075] Before scanning the media item to be scanned, the electronic device may first determine whether the media item information of the media item to be scanned is loaded in the cache. If the media item information of the media item to be scanned is not loaded in the cache, step 110 is executed to scan the media item to be scanned to obtain the media item information of the media item to be scanned. If the media item information of the media item to be scanned is loaded in the cache, step 110 is not executed, but step 130 is directly executed.

[0076] Therefore, when the media item information of the media item to be scanned has been loaded into the cache, the media item to be scanned is no longer scanned repeatedly, thereby avoiding repeated scanning of the same media item, which can save system resources and reduce the time consumed for the overall media item scanning.

[0077] It should be noted that, when there are multiple media items to be scanned, the electronic device may perform the determination in step 160 before scanning each media item to be scanned.

[0078] In some embodiments, continue to refer to Figure 6 Step 110, scanning at least one media item to be scanned to obtain media item information of the media item, includes the following steps:

[0079] 111, obtaining a bitmap of a media item to be scanned;

[0080] 112 , input the bitmap into a deep learning model for deep learning to obtain media item information of the media item.

[0081] In practical applications, deep learning models can be integrated into electronic devices. For example, deep learning models can be integrated into media item cleaning tools (sdk), and the deep learning models can also be continuously updated.

[0082] When the electronic device scans the media item to be scanned, it obtains a bitmap of the media item to be scanned. It should be noted that for media items such as dynamic pictures and videos, since dynamic pictures and videos are formed by multiple frames of images, the bitmap of each frame of the image can be obtained as the bitmap of the media item. For example, the bitmap of each frame of a dynamic picture can be obtained as the bitmap of the dynamic picture, and the bitmap of each frame of the video can be obtained as the bitmap of the video. Subsequently, the bitmap is input into a deep learning model for deep learning to obtain media item information of the media item. Therefore, media item information such as the type of the media item can be obtained through the deep learning model.

[0083] It should be noted that, when there are multiple media items to be scanned, the electronic device can obtain a bitmap of each media item when scanning the media item to be scanned, and input the bitmap into the deep learning model for deep learning.

[0084] In specific implementation, the present application is not limited by the execution order of the various steps described. If no conflict occurs, some steps can be performed in other orders or simultaneously.

[0085] As can be seen from the above, the media item cleaning method provided in the embodiment of the present application includes: scanning at least one media item to be scanned to obtain media item information of the media item; adding the media item information to a cache; in response to a media item cleaning request, reading the media item information in the cache and classifying the media item according to the media item information to obtain a classification result; and outputting the cleanable media item according to the classification result. The media item cleaning method of the embodiment of the present application can scan the media item in advance before cleaning the media item and add the scanned media item information to the cache. When cleaning the media item, for example, when the user starts the media item cleaning function, the media item information in the cache is directly read to classify and output the cleanable media item. Therefore, when cleaning the media item, there is no need to scan the media item again, thereby reducing the time consumed in cleaning the media item and improving the efficiency of cleaning the media item.

[0086] The embodiment of the present application also provides a media item cleaning device, which can be integrated in an electronic device. The electronic device can be a smart phone, a tablet computer, a gaming device, an AR (Augmented Reality) device, a data storage device, a video playback device, a laptop computer, a desktop computing device, etc.

[0087] refer to Figure 7 , Figure 7 1 is a schematic diagram of a first structure of a media item cleaning device 200 according to an embodiment of the present application, wherein the media item cleaning device 200 comprises a loading module 210 , a cache module 220 , and a cleaning module 230 .

[0088] A loading module 210, configured to scan at least one media item to be scanned and obtain media item information of the media item;

[0089] A cache module 220, configured to add media item information to a cache;

[0090] The cleaning module 230 is used to respond to a media item cleaning request, read the media item information in the cache, classify the media items according to the media item information, obtain classification results, and output cleanable media items according to the classification results.

[0091] In some embodiments, before scanning at least one media item to be scanned and obtaining the media item information of the media item, the loading module 210 is further used to: determine the media item to be scanned.

[0092] In some embodiments, before scanning at least one media item to be scanned and obtaining media item information of the media item, the loading module 210 is further configured to:

[0093] Determine whether the media item information of the media item to be scanned is loaded in the cache;

[0094] If the media item information of the media item to be scanned is not loaded in the cache, the media item to be scanned is scanned to obtain the media item information of the media item to be scanned.

[0095] In some embodiments, when scanning at least one media item to be scanned and obtaining media item information of the media item, the loading module 210 is specifically used to:

[0096] Get the bitmap of the media item to be scanned;

[0097] The bitmap is input into a deep learning model for deep learning to obtain media item information of the media item.

[0098] In some embodiments, the cache module 220 can add the media item information obtained by scanning multiple media items to the cache in batches. For example, the cache can be performed in batches according to the data size of the media item information, or according to the scanning time, or according to the number of scanned media items.

[0099] In some embodiments, reference Figure 8 , Figure 8 This is a second structural diagram of the media item cleaning device 200 according to an embodiment of the present application.

[0100] The media item cleaning device 200 further includes a data processing module 240. The data processing module 240 can be used for logic control, for example, it can be used for controlling the loading process of the loading module 210, it can be used for controlling the cache logic of the cache module 220, and it can also be used for controlling the cleaning of media items by the cleaning module 230.

[0101] It can be understood that the specific implementation of each of the above modules can refer to the description of each embodiment of the above media item cleaning method, which will not be repeated here.

[0102] In specific implementation, the above modules can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same entity or several entities.

[0103] As can be seen from the above, the media item cleaning device 200 provided in the embodiment of the present application scans at least one media item to be scanned through the loading module 210 to obtain the media item information of the media item; the cache module 220 adds the media item information to the cache; the cleaning module 230 responds to the media item cleaning request, reads the media item information in the cache and classifies the media item according to the media item information to obtain the classification result, and outputs the media item that can be cleaned according to the classification result. The media item cleaning device 200 of the embodiment of the present application can scan the media item in advance before cleaning the media item and add the scanned media item information to the cache. When cleaning the media item, for example, when the user starts the media item cleaning function, the media item information in the cache is directly read to classify and output the media item that can be cleaned. Therefore, when cleaning the media item, there is no need to scan the media item again, thereby reducing the time consumed by cleaning the media item and improving the efficiency of cleaning the media item.

[0104] The embodiment of the present application also provides an electronic device. The electronic device may be a smart phone, a tablet computer, a gaming device, an AR (Augmented Reality) device, a data storage device, a video playback device, a laptop computer, a desktop computing device, etc.

[0105] refer to Fig. 9 , Fig. 9 Schematic diagram of the structure of an electronic device 300 according to an embodiment of the present application.

[0106] The electronic device 300 includes a processor 310 and a memory 320. The processor 310 is electrically connected to the memory 320.

[0107] The processor 310 is the control center of the electronic device 300. It uses various interfaces and lines to connect various parts of the entire electronic device, executes various functions of the electronic device and processes data by running or calling computer programs stored in the memory 320, and calling data stored in the memory 320, thereby monitoring the electronic device as a whole.

[0108] The memory 320 can be used to store computer programs and data. The computer programs stored in the memory 320 contain instructions that can be executed in the processor. The computer programs can form various functional modules. The processor 310 executes various functional applications and data processing by calling the computer programs stored in the memory 320. In addition, the memory 320 can also be used to store media items such as photos, QR codes, screenshots, emoticons, dynamic pictures, videos, etc.

[0109] In this embodiment, the processor 310 in the electronic device 300 loads instructions corresponding to the processes of one or more computer programs into the memory 320 according to the following steps, and the processor 310 runs the computer program stored in the memory 320, thereby performing the following steps:

[0110] Scanning at least one media item to be scanned to obtain media item information of the media item;

[0111] Add media item information to cache;

[0112] In response to a media item cleanup request, read media item information in a cache and classify the media item according to the media item information to obtain a classification result;

[0113] Output cleanable media items based on the classification results.

[0114] In some embodiments, before scanning at least one media item to be scanned and obtaining media item information of the media item, the processor 310 further performs the following steps:

[0115] Identify the media items to scan.

[0116] In some embodiments, before scanning at least one media item to be scanned and obtaining media item information of the media item, the processor 310 further performs the following steps:

[0117] Determine whether the media item information of the media item to be scanned is loaded in the cache;

[0118] If the media item information of the media item to be scanned is not loaded in the cache, the media item to be scanned is scanned to obtain the media item information of the media item to be scanned.

[0119] In some embodiments, when scanning at least one media item to be scanned and obtaining media item information of the media item, the processor 310 performs the following steps:

[0120] Get the bitmap of the media item to be scanned;

[0121] The bitmap is input into a deep learning model for deep learning to obtain media item information of the media item.

[0122] In some embodiments, when adding media item information to the cache, the processor 310 may add the media item information obtained by scanning multiple media items to the cache in batches. For example, the media item information may be cached in batches according to the data volume of the media item information, or in batches according to the scanning time, or in batches according to the number of scanned media items.

[0123] although Fig. 9 Not shown, the electronic device 300 may also include a display screen, a control circuit, an input / output unit, a camera module, etc., which will not be described in detail here.

[0124] As can be seen from the above, an embodiment of the present application provides an electronic device, which performs the following steps: scanning at least one media item to be scanned to obtain media item information of the media item; adding the media item information to a cache; in response to a media item cleaning request, reading the media item information in the cache and classifying the media item according to the media item information to obtain a classification result; and outputting cleanable media items according to the classification result. The electronic device of the embodiment of the present application can scan the media items in advance and add the scanned media item information to the cache before cleaning the media items. When cleaning the media items, for example, when the user starts the media item cleaning function, the media item information in the cache is directly read to classify and output the cleanable media items. Therefore, when cleaning the media items, there is no need to scan the media items again, thereby reducing the time consumed in cleaning the media items and improving the efficiency of cleaning the media items.

[0125] An embodiment of the present application further provides a storage medium, in which a computer program is stored. When the computer program is executed on a computer, the computer executes the media item cleaning method of any of the above embodiments.

[0126] It should be noted that a person skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the storage medium may include but is not limited to: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0127] The above is a detailed introduction to the media item cleaning method, device, storage medium and electronic device provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core ideas of the present application. At the same time, for those skilled in the art, according to the ideas of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present application.

Claims

1. A media item cleaning method, characterized in that: include: Scanning at least one media item to be scanned to obtain media item information of the media item, where the media item information is used to indicate a type of the media item; adding the media item information to a cache; In response to a media item cleanup request, read media item information in a cache and classify the media item according to the media item information to obtain a classification result; Outputting media items that can be cleaned according to the classification results.

2. The media item cleaning method according to claim 1, characterized in that: The at least one media item to be scanned includes a plurality of media items, and the adding the media item information to a cache includes: The media item information of the plurality of media items is added to the cache in batches.

3. The media item cleaning method according to claim 2, characterized in that: The adding the media item information of the plurality of media items to the cache in batches comprises: When the data amount of the media item information obtained by scanning the multiple media items reaches a preset data amount, adding the scanned media item information as a batch to the cache; or When the plurality of media items have been scanned and the data volume of the scanned media item information does not reach the preset data volume, the scanned media item information is added to the cache as a batch.

4. The media item cleaning method according to claim 2, characterized in that: The adding the media item information of the plurality of media items to the cache in batches comprises: When the scanning time for scanning the plurality of media items reaches a preset time, adding the scanned media item information as a batch to the cache; or When the scanning of the plurality of media items is completed and the scanning time does not reach the preset time, the media item information obtained by scanning is added to the cache as a batch.

5. The media item cleaning method according to claim 2, characterized in that: The adding the media item information of the plurality of media items to the cache in batches comprises: When scanning of a preset number of media items among the plurality of media items is completed, adding the scanned media item information as a batch to the cache; or When the plurality of media items have been scanned and the number of media items corresponding to the scanned media item information does not reach the preset number, the scanned media item information is added to the cache as a batch.

6. The media item cleaning method according to any one of claims 1 to 5, characterized in that: The step of scanning at least one media item to be scanned to obtain media item information of the media item includes: Get the bitmap of the media item to be scanned; The bitmap is input into a deep learning model for deep learning to obtain media item information of the media item.

7. The media item cleaning method according to any one of claims 1 to 5, characterized in that: Before scanning at least one media item to be scanned and obtaining media item information of the media item, the method further includes: When a new media item is added to the media library, the new media item is determined as a media item to be scanned; or When the storage space occupied by the media items in the media library reaches a preset space threshold, all the media items in the media library are determined as media items to be scanned.

8. The media item cleaning method according to any one of claims 1 to 5, characterized in that: Before scanning at least one media item to be scanned and obtaining media item information of the media item, the method further includes: Determine whether the media item information of the media item to be scanned is loaded in the cache; If the media item information of the media item to be scanned is not loaded in the cache, the media item to be scanned is scanned to obtain the media item information of the media item.

9. The media item cleaning method according to any one of claims 1 to 5, characterized in that: The step of scanning at least one media item to be scanned to obtain media item information of the media item includes: Determining whether the at least one media item to be scanned has a corresponding root media item; If the media item has a corresponding root media item, obtaining media item information of the root media item, and using the media item information of the root media item as the media item information of the media item; If the media item does not have a corresponding root media item, the media item is scanned to obtain media item information of the media item.

10. A media item cleaning device, characterized in that: include: A loading module, configured to scan at least one media item to be scanned, and obtain media item information of the media item, wherein the media item information is used to indicate a type of the media item; A cache module, used for adding the media item information to a cache; The cleaning module is used to respond to a media item cleaning request, read the media item information in the cache, classify the media items according to the media item information, obtain classification results, and output cleanable media items according to the classification results.

11. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed on a computer, the computer is enabled to execute the media item cleaning method according to any one of claims 1 to 9.

12. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein a computer program is stored in the memory, and the processor is configured to execute the media item cleaning method according to any one of claims 1 to 9 by running the computer program stored in the memory.

Citation Information

Patent Citations

  • Useless item clearing method and device

    CN103324639A

  • Method and device for cleaning memory space based on prefix database

    CN104317951A

  • Cache garbage collection method, computer readable medium and equipment

    CN107562652A

  • Method of application cache cleaning and mobile terminals

    CN108595263A

  • General webpage theme content extraction method and system

    CN108920434A