WO2020147448A1 - Picture cleaning method and apparatus based on data update, and terminal device - Google Patents

Picture cleaning method and apparatus based on data update, and terminal device Download PDF

Info

Publication number
WO2020147448A1
WO2020147448A1 PCT/CN2019/122881 CN2019122881W WO2020147448A1 WO 2020147448 A1 WO2020147448 A1 WO 2020147448A1 CN 2019122881 W CN2019122881 W CN 2019122881W WO 2020147448 A1 WO2020147448 A1 WO 2020147448A1
Authority
WO
WIPO (PCT)
Prior art keywords
pictures
picture
processed
preset
capacity
Prior art date
Application number
PCT/CN2019/122881
Other languages
French (fr)
Chinese (zh)
Inventor
胡甜敏
Original Assignee
深圳壹账通智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳壹账通智能科技有限公司 filed Critical 深圳壹账通智能科技有限公司
Publication of WO2020147448A1 publication Critical patent/WO2020147448A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/53Querying
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/55Clustering; Classification

Definitions

  • This application belongs to the field of data processing technology, and in particular relates to image cleaning methods, devices, terminal equipment, and computer-readable storage media based on data updates.
  • Terminal devices are usually used to store pictures, such as a smart phone with a camera function. After the user activates the camera function to take a picture, the generated picture is stored locally on the phone.
  • the embodiments of the present application provide an image cleaning method, device, terminal device, and computer-readable storage medium based on data update, so as to solve the problem that the mistaken photos cannot be accurately identified when cleaning images in the prior art. Poorly targeted issues.
  • the first aspect of the embodiments of the present application provides a method for image cleaning based on data update, including:
  • the filling duration is less than the preset duration threshold, all album pictures are acquired, and the album pictures meeting the preset conditions are classified into the cleaning group, and at least two of the album pictures in the cleaning group are browsed according to Sort by frequency;
  • a second aspect of the embodiments of the present application provides a picture cleaning device based on data update, including:
  • the acquiring unit is configured to acquire the current remaining capacity of the terminal device and the used capacity growth rate of the terminal device within a preset time period, and calculate the filling time according to the current remaining capacity and the used capacity growth rate, so The filling time length indicates the time length during which the current remaining capacity is reduced to zero;
  • the sorting unit is configured to, if the filling duration is less than a preset duration threshold, obtain all album pictures, and classify the album pictures that meet the preset conditions into a cleaning group, and check for at least two photos in the cleaning group
  • the album pictures are sorted according to the number of views
  • the selecting unit is configured to select at least two of the album pictures after sorting according to a first preset number, determine the selected album pictures as target pictures, and remove the target pictures from the cleaning group The pictures outside are determined to be processed pictures;
  • the cleaning unit is configured to calculate the sub-similarity between the picture to be processed and each of the target pictures, and calculate the comprehensive similarity of the picture to be processed according to all the sub-similarity.
  • the picture to be processed corresponding to the comprehensive similarity of the similarity threshold is cleaned up, and the comprehensive similarity indicates the overall similarity between the picture to be processed and all the target pictures.
  • a third aspect of the embodiments of the present application provides a terminal device.
  • the terminal device includes a memory, a processor, and computer-readable instructions that are stored in the memory and run on the processor.
  • the processor When the computer-readable instruction is executed, the steps of the image cleaning method based on data update provided in the first aspect of the present application are implemented.
  • the fourth aspect of the embodiments of the present application provides a computer-readable storage medium, the computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the first aspect of the present application Provide the steps of the image cleaning method based on data update.
  • the current remaining capacity of the terminal device when the current remaining capacity of the terminal device is about to be zero, all album pictures stored on the terminal device are obtained, and at least two album pictures that meet the preset conditions are sorted according to the number of views, and are sorted according to the first preset Select at least two album pictures after sorting, determine the selected album pictures as the target pictures, determine the remaining pictures as the pictures to be processed, and then calculate the comprehensive similarity between the pictures to be processed and the at least two target pictures If the comprehensive similarity is less than the preset similarity threshold, the corresponding to-be-processed pictures are cleaned up.
  • the embodiment of this application analyzes the user’s picture browsing habits based on the number of views, and uses the pictures to be processed with the comprehensive similarity value less than the similarity threshold as The pictures that are inconsistent with picture browsing habits are cleaned up, which improves the pertinence of picture cleanup.
  • FIG. 1 is an implementation flowchart of a method for image cleaning based on data update provided in Embodiment 1 of the present application;
  • FIG. 2 is an implementation flow chart of the image cleaning method based on data update provided in the second embodiment of the present application
  • FIG. 3 is an implementation flowchart of the image cleaning method based on data update provided in the third embodiment of the present application
  • Embodiment 4 is an implementation flowchart of a method for cleaning up pictures based on data update provided in Embodiment 4 of the present application;
  • FIG. 5 is an implementation flowchart of a method for cleaning up pictures based on data update provided in Embodiment 5 of the present application;
  • FIG. 6 is a structural block diagram of a picture cleaning device based on data update provided in the sixth embodiment of the present application.
  • FIG. 7 is a schematic diagram of a terminal device provided in Embodiment 7 of the present application.
  • FIG. 1 shows the implementation process of the image cleaning method based on data update provided by an embodiment of the present application, which is detailed as follows:
  • the current remaining capacity of the terminal device and the used capacity growth rate of the terminal device within a preset time period are obtained, and the filling time is calculated according to the current remaining capacity and the used capacity growth rate, the The filling time length indicates the time length during which the current remaining capacity is reduced to zero.
  • the current remaining capacity of the terminal device and the used capacity growth rate of the terminal device within a preset time period, where the current remaining capacity refers to the terminal device
  • the amount of memory available (the current remaining capacity can also be customized)
  • the used capacity growth rate can be the growth rate of the terminal device’s memory used in the preset time period, the calculation formula is as follows:
  • Raterise is the used capacity growth rate
  • Periodpreset is the preset time period
  • Capacityperiod-end is the memory used by the terminal device at the end of the preset time period
  • Capacityperiod-start is the terminal device at the preset time
  • the memory used at the start time point of the segment, and the value of the used capacity growth rate can be positive, negative or zero.
  • the preset time period can be set according to actual application scenarios, and the end time point of the preset time period can be the current time, of course, can also be any time before the current time.
  • the calculated growth rate of the used capacity can be used to predict the subsequent increase in the amount of memory used by the terminal device. Therefore, in this embodiment of the application, the filling time is calculated according to the obtained current remaining capacity and the used capacity growth rate, and the filling time refers to the expected The time it takes for the current remaining capacity to decrease to zero. For example, if the current remaining capacity is 1 gigabyte and the used capacity growth rate is 0.5 gigabytes/day, the filling time can be calculated to be 2 days. It is worth mentioning that if the used capacity growth rate is negative or zero, which proves that there is no increasing trend in the memory usage of the terminal device, the filling time is not calculated and the picture cleaning is not performed.
  • the picture growth rate in a preset time period obtains the picture growth rate in a preset time period, and calculate the filling time according to the current remaining capacity and the picture growth rate.
  • the capacity change is mainly caused by the change in the number of photos in the album
  • the image growth rate within a preset time period is obtained, and the filling time is calculated according to the current remaining capacity and the image growth rate, where the image growth rate is equivalent It is a special form of used capacity growth rate.
  • the average capacity of the picture on the terminal device such as 1 megabyte (MB) is also obtained.
  • the average capacity can be customized, or the terminal can be set at the end of the preset time period.
  • the terminal device After getting the filling duration, compare the filling duration with a preset duration threshold (such as 1 day). If the filling duration is greater than or equal to the duration threshold, no picture cleaning is performed; if the filling duration is less than the duration threshold, the terminal device is acquired Upload all album pictures, and group the album pictures that meet the preset conditions into the cleaning group, and then sort at least two album pictures in the cleaning group according to the number of views. Wherein, the number of views refers to the number of times the album picture is opened.
  • the preset condition can be set according to actual application scenarios. The embodiment of this application does not limit this. For example, the preset condition may be the creation time of the album picture at a preset time point Previously, it was also possible to include special preset logos for album pictures.
  • the cleaning group in the embodiment of the present application does not specify a specific storage format, but instructs to separately classify at least two album pictures that meet preset conditions.
  • At least two sorted album pictures are selected according to a first preset number, the selected album pictures are determined as target pictures, and the cleaning group except for the target pictures The picture of is determined to be a pending picture.
  • the pictures can be sorted in the order of the number of views from most to less, or they can be sorted in the order of the number of views from less to most, in order to facilitate the description of the embodiments of this application.
  • the content will be described in the order of the most browsed times.
  • the sorted album pictures in the cleaning group are "Picture 1, Picture 2, Picture 3, Picture 4, Picture 5", and the first preset number is 3, then select from Picture 1, select The "Picture 1, Picture 2, Picture 3" that is output is the target picture, and the remaining "Picture 4, Picture 5" in the cleaning group are the pictures to be processed.
  • the sub-similarity between the picture to be processed and each target picture is calculated separately, and the comprehensive similarity of the picture to be processed is calculated according to all the sub-similarity.
  • the picture to be processed corresponding to the comprehensive similarity of the degree threshold is cleaned up, and the comprehensive similarity indicates the overall similarity between the picture to be processed and all the target pictures.
  • the embodiment of this application does not limit the calculation method of the sub-similarity.
  • the sub-similarity can be obtained by comparing the gray histogram of the image to be processed with the gray histogram of the target picture.
  • the degree of sub-similarity can be obtained by comparing the color image histogram of the picture to be processed and the color image histogram of the target picture, and the sub-similarity degree can also be calculated by the perceptual hash algorithm.
  • the number of target pictures may be two or more, different target pictures may have different styles, and there may be a high degree of sub-similarity between a picture to be processed and one target picture, but with another target picture.
  • the comprehensive similarity is calculated according to the obtained multiple sub-similarity. The calculation formula is as follows:
  • Similarityphotos is the comprehensive similarity
  • Numberaim-photos is the first preset number
  • Numberaim-photoi-views is the number of views of the i-th target picture
  • Numberviews is the number of preset weighted views (for example, it can be set to 15 times)
  • Similarityaim-photoi is the calculated sub-similarity between the picture to be processed and the i-th target picture.
  • the comprehensive similarity is the overall similarity between the picture to be processed and all target pictures. After the comprehensive similarity is calculated, the comprehensive similarity is compared with the preset similarity threshold.
  • the to-be-processed picture corresponding to the comprehensive similarity is cleaned up.
  • the similarity threshold can be customized or generated based on the target pictures in the cleaning group. For example, set the weighted number of views to the total number of views of all target pictures, and set the sub-similarity corresponding to a target picture to 70%. The sub-similarity corresponding to other target pictures is 10%, so the comprehensive similarity calculated according to the above calculation formula is determined as the similarity threshold.
  • the specific parameters can be adjusted according to actual application scenarios and are not limited to the above examples.
  • the filling time is calculated based on the current remaining capacity of the terminal device and the used capacity growth rate. If the filling time is less than the preset duration threshold, the terminal device will meet the preset Set conditional album pictures into the cleanup group, sort at least two album pictures in the cleanup group, select at least two album pictures after sorting according to the first preset number, and determine the selected album pictures as the target Picture, and determine the pictures in the cleaning group except the target picture as the picture to be processed, calculate the sub-similarity between the picture to be processed and each target picture, and calculate the comprehensive similarity of the picture to be processed based on all the sub-similarity , To clean up the to-be-processed pictures corresponding to the comprehensive similarity that is less than the preset similarity threshold, which realizes the effective identification of mistaken pictures and improves the pertinence of picture cleaning.
  • FIG. 2 shows a method obtained by refining the process of cleaning up the pictures to be processed corresponding to the comprehensive similarity that is less than the preset similarity threshold on the basis of the first embodiment of the present application.
  • the embodiment of the present application provides an implementation flow chart of a picture cleaning method based on data update. As shown in FIG. 2, the picture cleaning method may include the following steps:
  • At least two pictures to be processed corresponding to the at least two comprehensive similarities less than the similarity threshold are first selected to facilitate subsequent follow-up Clean up.
  • At least two pictures to be processed are sorted according to the number of times of browsing, and at least two pictures to be processed after sorting are selected according to a second preset number.
  • the at least two pictures to be processed are sorted according to the number of views, and the at least two pictures to be processed after sorting are selected according to the second preset number, where the second preset
  • the quantity can be customized and can also be obtained by analyzing the capacity of the terminal device. It is worth mentioning that the selection operation in this step is different from the selection operation in S103, that is, the pictures to be processed with the least number of views are selected first. Specifically, if the selected images are selected in the order of the most viewed If at least two pictures to be processed are sorted, the selection is performed starting from the last picture to be processed after sorting.
  • the selected picture to be processed is moved to a directory to be deleted, and a deletion prompt is output based on the picture to be processed in the directory to be deleted.
  • the delete prompt can be set to directly display the pending pictures in the to-be-deleted directory when output.
  • the output deletion prompt also includes two optional results of confirmation and denial. If the user's confirmation result about the deletion prompt is received, the deletion operation is performed on the pending pictures in the directory to be deleted, and the picture cleaning is completed.
  • the to-be-processed picture in the to-be-deleted directory is moved to the original directory of the to-be-processed picture. It is worth mentioning that since there may be at least two pictures to be processed in the directory to be deleted, a deletion prompt can be generated based on each picture to be processed, or a deletion prompt can be generated directly based on all the pictures to be processed in the directory to be deleted , And set the delete prompt to include two optional results corresponding to each picture to be processed.
  • the picture to be processed in the directory to be deleted is uploaded to the cloud space, and the picture to be processed is To delete.
  • the deletion time period can be preset, such as 10 minutes. If the user's response to the deletion prompt (confirmation result or denial result) is not received within the deletion time period after the deletion prompt is output, the The pictures to be processed in the directory to be deleted are uploaded to the cloud space, and the pictures to be processed are deleted.
  • the above method increases the available memory of the terminal device on the one hand, and on the other hand deletes the pictures to be processed by mistake without the user’s permission. In this case, users can also access to-be-processed pictures through the cloud space, which improves the applicability of picture cleaning.
  • Sort and select at least two pictures to be processed after sorting according to the second preset number, move the selected pictures to be processed to the directory to be deleted, and output a deletion prompt based on the pictures to be processed in the directory to be deleted, If a confirmation result about the deletion prompt is received, the to-be-processed picture in the directory to be deleted is deleted; if a denial result about the deletion prompt is received, the to-be-processed picture in the to-be-deleted directory is moved to the original directory of the to-be-processed picture.
  • at least two pictures to be processed are sorted according to the number of browsing times, which improves the order in cleaning the pictures to be processed whose comprehensive similarity is less than the similarity threshold.
  • the second preset number is a method obtained by expanding the process before selecting at least two of the pictures to be processed after sorting.
  • the embodiment of the present application provides an implementation flow chart of a picture cleaning method based on data update. As shown in FIG. 3, the picture cleaning method may include the following steps:
  • the number of recorded deleted pictures is obtained, the number of pictures corresponding to the preset identifier is identified therefrom, and the ratio between the number of pictures corresponding to the preset identifier and the number of deleted pictures is determined Is the percentage of deletions corresponding to the cleaning group.
  • each album picture stored in the terminal device is set to correspond to a picture identifier, which is manually set by the user or automatically generated according to a specific analysis algorithm when the album picture is stored in the terminal device.
  • the picture logo can be a portrait, landscape, or dynamic picture.
  • each picture ID is used as the preset ID in turn, and the corresponding relationship between the album picture and the preset ID is used as the preset condition, that is, at least two cleaning groups are generated in sequence, and each cleaning group is associated with a picture ID correspond.
  • the following description will be described by performing picture cleanup on the pictures in the corresponding cleanup group according to a certain preset identifier.
  • setting the terminal device includes a recording mechanism, that is, the terminal device records the number of deleted pictures and the picture identifier corresponding to each deleted picture (the deleted pictures can be deleted automatically or manually by the user). Delete).
  • the number of pictures corresponding to the preset logo is identified from the number of deleted pictures recorded, the ratio between the number of pictures corresponding to the preset logo and the number of deleted pictures is obtained, and the ratio is determined
  • the proportion corresponding to the cleaning group generated according to the preset mark for example, the number of deleted pictures is 100, including 50 landscape pictures, and the current preset mark is a landscape, the deletion proportion is determined to be 50%.
  • the capacity to be deleted is calculated according to the current remaining capacity, and the deletion capacity corresponding to the preset identifier is calculated according to the percentage of deletion and the capacity to be deleted.
  • One calculation method is to obtain the preset safe remaining capacity and determine the difference between the safe remaining capacity and the current remaining capacity as the capacity to be deleted. For example, the safe remaining capacity is 1 gigabyte, the current remaining capacity is 0.5 gigabytes, and the capacity to be deleted is 0.5 gigabytes. Then, multiply the percentage of deletions and the capacity to be deleted to obtain the deletion capacity corresponding to the preset logo. For example, if the percentage of deletion is 50% and the capacity to be deleted is 0.5 gigabytes, the deletion capacity corresponding to the preset logo is 0.25 Gigabytes.
  • the average capacity of all the pictures to be processed filtered out in the cleaning group is calculated, and the second preset number is calculated according to the average capacity and the deletion capacity corresponding to the preset identifier.
  • the cleaning group corresponding to the preset identifier For the cleaning group corresponding to the preset identifier, at least two pictures to be processed corresponding to at least two comprehensive similarities less than the similarity threshold are first screened out, and then the average capacity of all the pictures to be screened out is calculated, and the preset The deletion capacity corresponding to the identifier is divided by the average capacity to obtain the second preset number. In the subsequent step, at least two pictures to be processed after sorting are selected according to the second preset number. For example, the deletion capacity is 100 megabytes, and the average If the capacity is 5 megabytes, the second preset number can be calculated as 20 sheets.
  • the overall similarity can be in the order of ascending, and the overall similarity is greater than or equal to similarity.
  • the selection of pictures to be processed with a degree threshold is continued until the number of selected pictures to be processed reaches the second preset number.
  • the number of recorded deleted pictures is obtained, the number of pictures corresponding to the preset identifier is identified therefrom, and the number of pictures corresponding to the preset identifier is compared with the number of deleted pictures
  • the ratio between is determined as the proportion of deletions corresponding to the cleaning group, and the capacity to be deleted is calculated according to the current remaining capacity, the deletion capacity corresponding to the preset flag is calculated according to the proportion of deletions and the capacity to be deleted, and all the filtered out in the cleaning group are calculated
  • the average capacity of the pictures to be processed is calculated, and the second preset quantity is calculated according to the average capacity and the deleted capacity corresponding to the preset identifier.
  • the embodiment of the present application calculates the percentage of deletions based on the preset identification, thereby calculating the second preset number corresponding to the cleaning group obtained according to the preset identification, so that the image cleaning process is closer to the user's deletion habits of different types of images, and the image is improved Applicability and user experience of cleanup.
  • the picture cleaning method may include the following steps:
  • the to-be-processed picture whose browsing count is zero is determined as a priority-processed picture
  • at least two of the priority-processed pictures are sorted according to creation time, and at least two other than the priority-processed picture are sorted.
  • the pictures to be processed are sorted according to the number of views.
  • the pictures to be processed with zero browsing times are determined as priority pictures, and the at least two pictures are processed first
  • the pictures are sorted according to the creation time, and at least two pictures to be processed except the priority pictures are sorted according to the number of views.
  • the embodiment of the present application can be sorted in the order of creation time from early to late, or according to the creation time. The time is sorted from late to early.
  • the sequence of pictures generated after sorting according to the creation time is determined as the first picture sequence
  • the sequence of pictures generated after sorting according to the number of views is determined as the second picture sequence
  • the sequence is determined according to the second picture sequence.
  • the preset number of pictures is selected from the first picture sequence and the second picture sequence.
  • a first picture sequence is generated; after the at least two to-be-processed pictures except the prioritized pictures are sorted according to the number of views, a second picture sequence is generated. After the second preset number is obtained, the pictures in the first picture sequence and the second picture sequence are selected according to the second preset number, wherein the pictures in the first picture sequence are selected first, and the specific content is later The text is elaborated.
  • the picture to be processed with zero browsing times is determined as the priority picture, and at least two priority pictures are sorted according to the creation time to generate the first picture sequence, and At least two pictures to be processed except the priority pictures are sorted according to the number of views to generate a second picture sequence, and the pictures in the first picture sequence and the second picture sequence are selected according to the second preset number.
  • the creation time is used as the condition of picture cleaning, so that two picture sequences are generated respectively, which further improves the order of picture cleaning.
  • the picture cleaning method may include the following steps:
  • the number of preferentially processed pictures in the first picture sequence is first obtained as the first picture quantity.
  • the priority processed picture is selected from the first picture sequence according to the second preset number.
  • the first picture quantity is compared with the second preset quantity. If the second preset quantity does not exceed the first picture quantity, the first picture sequence is selected according to the second preset quantity and the picture is selected for priority processing. Select the pictures with the earlier creation time for priority processing, that is, if they are sorted in the order of creation time from morning to night, they are selected from the beginning of the first picture sequence; if they are sorted in the order of creation time from morning to morning, The selection starts from the end of the first picture sequence.
  • the second preset number exceeds the first picture quantity, firstly select all the priority pictures in the first picture sequence, and then select the pictures to be processed in the second picture sequence according to the second picture quantity, where the second picture quantity is The difference between the second preset number and the first number of pictures, and when the pictures to be processed are selected in the second picture sequence according to the second number of pictures, the pictures to be processed with less browsing times are preferentially selected.
  • the first picture quantity of the first picture sequence is acquired. If the second preset quantity does not exceed the first picture quantity, the second preset quantity is The first picture sequence is selected for priority processing pictures; if the second preset number exceeds the first picture number, all priority processing pictures in the first picture sequence are selected, and the second picture sequence is selected for processing according to the second picture number Pictures, where the second picture quantity is the difference between the second preset quantity and the first picture quantity.
  • different selection methods are performed when the results of numerical comparison between the second preset number and the first picture number are different, which further improves the accuracy and order of picture cleaning.
  • FIG. 6 shows a structural block diagram of the image cleaning device based on data update provided in an embodiment of the present application.
  • the image cleaning device includes:
  • the acquiring unit 61 is configured to acquire the current remaining capacity of the terminal device and the used capacity growth rate of the terminal device within a preset time period, and calculate the filling time according to the current remaining capacity and the used capacity growth rate, The filling time length indicates the time length during which the current remaining capacity is reduced to zero;
  • the sorting unit 62 is configured to, if the filling duration is less than a preset duration threshold, obtain all album pictures, and classify the album pictures that meet the preset conditions into a cleaning group, and check for at least two of the cleaning groups The pictures of the album are sorted according to the number of views;
  • the selecting unit 63 is configured to select at least two of the album pictures after sorting according to a first preset number, determine the selected album pictures as target pictures, and remove the targets from the cleaning group The picture outside the picture is determined to be the picture to be processed;
  • the cleaning unit 64 is configured to calculate the sub-similarity between the picture to be processed and each of the target pictures, and calculate the comprehensive similarity of the picture to be processed according to all the sub-similarity.
  • the picture to be processed corresponding to the comprehensive similarity of the similarity threshold of, and the comprehensive similarity indicates the overall similarity between the picture to be processed and all the target pictures.
  • Fig. 7 is a schematic diagram of a terminal device provided by an embodiment of the present application.
  • the terminal device 7 of this embodiment includes: a processor 70, a memory 71, and computer-readable instructions 72 stored in the memory 71 and running on the processor 70, for example, based on data update The picture cleaner program.
  • the processor 70 executes the computer-readable instructions 72, the steps in the above embodiments of the image cleaning method based on data update are implemented, such as steps S101 to S104 shown in FIG. 1.
  • the processor 70 executes the computer-readable instructions 72
  • the functions of the units in the foregoing terminal device embodiments such as the functions of the units 61 to 64 shown in FIG. 6, are implemented.
  • the computer-readable instructions 72 may be divided into one or more units, and the one or more units are stored in the memory 71 and executed by the processor 70 to complete the application .
  • the one or more units may be a series of computer-readable instructions capable of completing specific functions, and the instruction segment is used to describe the execution process of the computer-readable instructions 72 in the terminal device 7.
  • the computer-readable instructions 72 can be divided into an acquisition unit, a sorting unit, a selection unit, and a cleaning unit, and the specific functions of each unit are as follows:
  • the acquiring unit is used to acquire the current remaining capacity of the terminal device and the used capacity growth rate of the terminal device within a preset time period, and calculate the filling time according to the current remaining capacity and the used capacity growth rate, so The filling time length indicates the time length during which the current remaining capacity is reduced to zero;
  • the sorting unit is configured to, if the filling duration is less than a preset duration threshold, obtain all album pictures, and classify the album pictures that meet the preset conditions into a cleaning group, and check for at least two photos in the cleaning group
  • the album pictures are sorted according to the number of views
  • the selecting unit is configured to select at least two of the album pictures after sorting according to a first preset number, determine the selected album pictures as target pictures, and remove the target pictures from the cleaning group The pictures outside are determined to be processed pictures;
  • the cleaning unit is configured to calculate the sub-similarity between the picture to be processed and each of the target pictures, and calculate the comprehensive similarity of the picture to be processed according to all the sub-similarity.
  • the picture to be processed corresponding to the comprehensive similarity of the similarity threshold is cleaned up, and the comprehensive similarity indicates the overall similarity between the picture to be processed and all the target pictures.
  • the terminal device 7 may be a computing device such as a desktop computer, a notebook, a palmtop computer and a cloud server.
  • the terminal device may include, but is not limited to, a processor 70 and a memory 71.
  • FIG. 7 is only an example of the terminal device 7 and does not constitute a limitation on the terminal device 7, and may include more or fewer components than those illustrated, or a combination of certain components, or different components.
  • the terminal device may further include an input and output device, a network access device, a bus, and the like.
  • the so-called processor 70 may be a central processing unit (Central Processing Unit, CPU), or other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), Ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the memory 71 may be an internal storage unit of the terminal device 7, such as a hard disk or a memory of the terminal device 7.
  • the memory 71 may also be an external storage device of the terminal device 7, such as a plug-in hard disk equipped on the terminal device 7, a smart memory card (Smart, Media, Card, SMC), and a secure digital (SD) Cards, flash cards, etc.
  • the memory 71 may include both an internal storage unit of the terminal device 7 and an external storage device.
  • the memory 71 is used to store the computer-readable instructions and other programs and data required by the terminal device.
  • the memory 71 can also be used to temporarily store data that has been or will be output.
  • the above function can be allocated by different functional units as required, namely The internal structure of the terminal device is divided into different functional units to complete all or part of the functions described above.
  • the functional units in the embodiments can be integrated in one processing unit, or each unit can exist alone physically, or two or more units can be integrated in one unit.
  • the above integrated units can be implemented in the form of hardware. It can also be implemented in the form of software functional units.
  • the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the present application. For the specific working process of the units in the foregoing system, reference may be made to the corresponding process in the foregoing method embodiment, which is not repeated here.
  • the disclosed terminal device and method may be implemented in other ways.
  • the terminal device embodiments described above are only illustrative.
  • the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined. Or it can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or software function unit.
  • Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM) or external cache memory.
  • RAM random access memory
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDRSDRAM double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM synchronous chain (Synchlink) DRAM
  • RDRAM direct RAM
  • DRAM direct memory bus dynamic RAM
  • RDRAM memory bus dynamic RAM

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The present application is applicable to the technical field of data processing, and provides a picture cleaning method and apparatus based on data update, and a terminal device and a computer readable storage medium. The method comprises: calculating a filling duration of the terminal device; if the filling duration is less than a preset duration threshold, obtaining all album pictures, classifying the album pictures satisfying a preset condition into a cleaning group, and sorting at least two album pictures in the cleaning group; selecting at least two sorted album pictures according to a first preset number, determining the selected album pictures as target pictures, and determining pictures except the target pictures as pictures to be processed; and calculating the comprehensive similarity between said pictures and all the target pictures, and cleaning said pictures corresponding to the comprehensive similarity smaller than a preset similarity threshold. According to the present application, the picture browsing habit of a user is analyzed, and the pictures which do not accord with the browsing habit are cleaned, so that the picture cleaning pertinence is improved.

Description

基于数据更新的图片清理方法、装置及终端设备Image cleaning method, device and terminal equipment based on data update
本申请要求于2019年01月16日在中国专利局提交的、申请号为201910039140.2、发明名称为“基于数据更新的图片清理方法、装置及终端设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed at the Chinese Patent Office on January 16, 2019, with the application number 201910039140.2, and the title of the invention "Image cleaning method, device and terminal equipment based on data update", and its entire contents Incorporated in this application by reference.
技术领域Technical field
本申请属于数据处理技术领域,尤其涉及基于数据更新的图片清理方法、装置、终端设备以及计算机可读存储介质。This application belongs to the field of data processing technology, and in particular relates to image cleaning methods, devices, terminal equipment, and computer-readable storage media based on data updates.
背景技术Background technique
随着信息技术的发展,终端设备已深入至千家万户,成为人们日常生活中不可或缺的物品。终端设备通常会用于存储图片,比如拥有拍照功能的智能手机,在用户启动拍照功能进行拍照后,会将生成的图片存储在手机本地。With the development of information technology, terminal equipment has penetrated into thousands of households and has become an indispensable item in people's daily lives. Terminal devices are usually used to store pictures, such as a smart phone with a camera function. After the user activates the camera function to take a picture, the generated picture is stored locally on the phone.
技术问题technical problem
由于终端设备的存储容量有限,故需要对终端设备存储的图片进行清理,在现有技术中,通常是根据某个单一的删除条件(如拍摄时间)对多个图片进行批量清理,而无法实现对真正需要清理的图片(如误拍图片)的针对性识别并清理,容易导致误删用户欲保留的图片。综上,现有技术中图片清理的针对性差。Due to the limited storage capacity of the terminal device, it is necessary to clean up the pictures stored in the terminal device. In the prior art, it is usually impossible to clean up multiple pictures in batches based on a single deletion condition (such as shooting time). The targeted identification and cleaning of pictures that really need to be cleaned up (such as pictures taken by mistake) can easily lead to accidental deletion of pictures that users want to keep. In summary, in the prior art, picture cleaning is poorly targeted.
技术解决方案Technical solution
有鉴于此,本申请实施例提供了基于数据更新的图片清理方法、装置、终端设备以及计算机可读存储介质,以解决现有技术中进行图片清理时无法精确识别误拍的照片,图片清理的针对性差的问题。In view of this, the embodiments of the present application provide an image cleaning method, device, terminal device, and computer-readable storage medium based on data update, so as to solve the problem that the mistaken photos cannot be accurately identified when cleaning images in the prior art. Poorly targeted issues.
本申请实施例的第一方面提供了一种基于数据更新的图片清理方法,包括:The first aspect of the embodiments of the present application provides a method for image cleaning based on data update, including:
获取终端设备的当前剩余容量以及所述终端设备在预设时间段内的已用容量增长率,并根据所述当前剩余容量和所述已用容量增长率计算填充时长,所述填充时长指示所述当前剩余容量减少至零的时长;Obtain the current remaining capacity of the terminal device and the used capacity growth rate of the terminal device within a preset time period, and calculate the filling time based on the current remaining capacity and the used capacity growth rate, and the filling time length indicates State the length of time the current remaining capacity is reduced to zero;
若所述填充时长小于预设的时长阈值,则获取所有相册图片,并将满足预设条件的所述相册图片归入清理组,对所述清理组内的至少两个所述相册图片按照浏览次数进行排序;If the filling duration is less than the preset duration threshold, all album pictures are acquired, and the album pictures meeting the preset conditions are classified into the cleaning group, and at least two of the album pictures in the cleaning group are browsed according to Sort by frequency;
按照第一预设数量对排序后的至少两个所述相册图片进行选取,将选取出的所述相册图片确定为目标图片,并将所述清理组内除所述目标图片外的图片确定为待处理图片;Select at least two of the album pictures after sorting according to a first preset number, determine the selected album pictures as target pictures, and determine pictures in the cleaning group other than the target pictures as Pending picture
分别计算所述待处理图片与每个所述目标图片之间的子相似度,并根据所有所述子相似度计算所述待处理图片的综合相似度,对小于预设的相似度阈值的所述综合相似度所对应的所述待处理图片进行清理,所述综合相似度指示所述待处理图片与所有所述目标图片之间的总体相似程度。Calculate the sub-similarity between the picture to be processed and each of the target pictures respectively, and calculate the comprehensive similarity of the picture to be processed according to all the sub-similarity, and for all the similarities less than the preset similarity threshold The picture to be processed corresponding to the comprehensive similarity is cleaned up, and the comprehensive similarity indicates the overall similarity between the picture to be processed and all the target pictures.
本申请实施例的第二方面提供了一种基于数据更新的图片清理装置,包括:A second aspect of the embodiments of the present application provides a picture cleaning device based on data update, including:
获取单元,用于获取终端设备的当前剩余容量以及所述终端设备在预设时间段内的已用容量增长率,并根据所述当前剩余容量和所述已用容量增长率计算填充时长,所述填充时长指示所述当前剩余容量减少至零的时长;The acquiring unit is configured to acquire the current remaining capacity of the terminal device and the used capacity growth rate of the terminal device within a preset time period, and calculate the filling time according to the current remaining capacity and the used capacity growth rate, so The filling time length indicates the time length during which the current remaining capacity is reduced to zero;
排序单元,用于若所述填充时长小于预设的时长阈值,则获取所有相册图片,并将满足预设条件的所述相册图片归入清理组,对所述清理组内的至少两个所述相册图片按照浏览次数进行排序;The sorting unit is configured to, if the filling duration is less than a preset duration threshold, obtain all album pictures, and classify the album pictures that meet the preset conditions into a cleaning group, and check for at least two photos in the cleaning group The album pictures are sorted according to the number of views;
选取单元,用于按照第一预设数量对排序后的至少两个所述相册图片进行选取,将选取出的所述相册图片确定为目标图片,并将所述清理组内除所述目标图片外的图片确定为待处理图片;The selecting unit is configured to select at least two of the album pictures after sorting according to a first preset number, determine the selected album pictures as target pictures, and remove the target pictures from the cleaning group The pictures outside are determined to be processed pictures;
清理单元,用于分别计算所述待处理图片与每个所述目标图片之间的子相似度,并根据所有所述子相似度计算所述待处理图片的综合相似度,对小于预设的相似度阈值的所述综合相似度所对应的所述待处理图片进行清理,所述综合相似度指示所述待处理图片与所有所述目标图片之间的总体相似程度。The cleaning unit is configured to calculate the sub-similarity between the picture to be processed and each of the target pictures, and calculate the comprehensive similarity of the picture to be processed according to all the sub-similarity. The picture to be processed corresponding to the comprehensive similarity of the similarity threshold is cleaned up, and the comprehensive similarity indicates the overall similarity between the picture to be processed and all the target pictures.
本申请实施例的第三方面提供了一种终端设备,所述终端设备包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如本申请第一方面提供的基于数据更新的图片清理方法的步骤。A third aspect of the embodiments of the present application provides a terminal device. The terminal device includes a memory, a processor, and computer-readable instructions that are stored in the memory and run on the processor. The processor When the computer-readable instruction is executed, the steps of the image cleaning method based on data update provided in the first aspect of the present application are implemented.
本申请实施例的第四方面提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,所述计算机可读指令被处理器执行时实现如本申请第一方面提供的基于数据更新的图片清理方法的步骤。The fourth aspect of the embodiments of the present application provides a computer-readable storage medium, the computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the first aspect of the present application Provide the steps of the image cleaning method based on data update.
有益效果Beneficial effect
本申请实施例在终端设备的当前剩余容量即将为零时获取终端设备上已存储的所有相册图片,按照浏览次数对其中满足预设条件的至少两个相册图片进行排序,并按照第一预设数量对排序后的至少两个相册图片进行选取,将选取出的相册图片确定为目标图片,将剩余的图片确定为待处理图片,然后计算待处理图片与至少两个目标图片之间的综合相似度,若综合相似度小于预设的相似度阈值,则清理对应的待处理图片,本申请实施例基于浏览次数分析用户的图片浏览习惯,并将综合相似值小于相似度阈值的待处理图片作为与图片浏览习惯不符的图片进行清理,提升了图片清理的针对性。In the embodiment of the application, when the current remaining capacity of the terminal device is about to be zero, all album pictures stored on the terminal device are obtained, and at least two album pictures that meet the preset conditions are sorted according to the number of views, and are sorted according to the first preset Select at least two album pictures after sorting, determine the selected album pictures as the target pictures, determine the remaining pictures as the pictures to be processed, and then calculate the comprehensive similarity between the pictures to be processed and the at least two target pictures If the comprehensive similarity is less than the preset similarity threshold, the corresponding to-be-processed pictures are cleaned up. The embodiment of this application analyzes the user’s picture browsing habits based on the number of views, and uses the pictures to be processed with the comprehensive similarity value less than the similarity threshold as The pictures that are inconsistent with picture browsing habits are cleaned up, which improves the pertinence of picture cleanup.
附图说明BRIEF DESCRIPTION
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly explain the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required in the embodiments or the description of the prior art. Obviously, the drawings in the following description are only for the application For some embodiments, those of ordinary skill in the art can obtain other drawings based on these drawings without creative labor.
图1是本申请实施例一提供的基于数据更新的图片清理方法的实现流程图;FIG. 1 is an implementation flowchart of a method for image cleaning based on data update provided in Embodiment 1 of the present application;
图2是本申请实施例二提供的基于数据更新的图片清理方法的实现流程图;FIG. 2 is an implementation flow chart of the image cleaning method based on data update provided in the second embodiment of the present application;
图3是本申请实施例三提供的基于数据更新的图片清理方法的实现流程图;FIG. 3 is an implementation flowchart of the image cleaning method based on data update provided in the third embodiment of the present application;
图4是本申请实施例四提供的基于数据更新的图片清理方法的实现流程图;4 is an implementation flowchart of a method for cleaning up pictures based on data update provided in Embodiment 4 of the present application;
图5是本申请实施例五提供的基于数据更新的图片清理方法的实现流程图;FIG. 5 is an implementation flowchart of a method for cleaning up pictures based on data update provided in Embodiment 5 of the present application;
图6是本申请实施例六提供的基于数据更新的图片清理装置的结构框图;6 is a structural block diagram of a picture cleaning device based on data update provided in the sixth embodiment of the present application;
图7是本申请实施例七提供的终端设备的示意图。FIG. 7 is a schematic diagram of a terminal device provided in Embodiment 7 of the present application.
本发明的实施方式Embodiments of the invention
以下描述中,为了说明而不是为了限定,提出了诸如特定***结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的***、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, for the purpose of illustration rather than limitation, specific details such as specific system structures and technologies are proposed to thoroughly understand the embodiments of the present application. However, those skilled in the art should understand that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details hindering the description of the present application.
为了说明本申请所述的技术方案,下面通过具体实施例来进行说明。In order to explain the technical solutions described in the present application, the following will be described with specific embodiments.
图1示出了本申请实施例提供的基于数据更新的图片清理方法的实现流程,详述如下:FIG. 1 shows the implementation process of the image cleaning method based on data update provided by an embodiment of the present application, which is detailed as follows:
在S101中,获取终端设备的当前剩余容量以及所述终端设备在预设时间段内的已用容量增长率,并根据所述当前剩余容量和所述已用容量增长率计算填充时长,所述填充时长指示所述当前剩余容量减少至零的时长。In S101, the current remaining capacity of the terminal device and the used capacity growth rate of the terminal device within a preset time period are obtained, and the filling time is calculated according to the current remaining capacity and the used capacity growth rate, the The filling time length indicates the time length during which the current remaining capacity is reduced to zero.
在本申请实施例中,为了减少图片清理的次数以节省资源,首先获取终端设备的当前剩余容量以及终端设备在预设时间段内的已用容量增长率,其中,当前剩余容量是指终端设备的内存可用量(当前剩余容量也可自定义设置),已用容量增长率可为终端设备的内存已用量在预设时间段的增长率,计算公式如下:In this embodiment of the application, in order to reduce the number of times of picture cleaning to save resources, first obtain the current remaining capacity of the terminal device and the used capacity growth rate of the terminal device within a preset time period, where the current remaining capacity refers to the terminal device The amount of memory available (the current remaining capacity can also be customized), the used capacity growth rate can be the growth rate of the terminal device’s memory used in the preset time period, the calculation formula is as follows:
Figure PCTCN2019122881-appb-000001
Figure PCTCN2019122881-appb-000001
上述计算公式中,Raterise为已用容量增长率,Periodpreset为预设时间段,Capacityperiod-end为终端设备在预设时间段的末尾时间点的内存已用量,Capacityperiod-start为终端设备在预设时间段的起始时间点的内存已用量,已用容量增长率的数值可为正、负或零。预设时间段可根据实际应用场景进行设置,预设时间段的末尾时间点可为当前时间,当然也可为当前时间之前的任一时刻。举例来说,若预设时间段的末尾时间点为当前时间,预 设时间段为7天,则获取终端设备当前的内存已用量,如4吉字节(GB),并获取终端设备在7天前的内存已用量,如3吉字节,则可计算出已用容量增长率为(4-3)/7=0.14,该已用容量增长率的单位为吉字节/天。值得一提的是,为了便于获取终端设备在不同时刻的内存已用量,可将内存已用量实时保存在终端设备的日志文件中,在计算已用容量增长率时,将预设时间段对应的时刻作为搜索条件,在日志文件中查找对应的内存已用量即可。In the above calculation formula, Raterise is the used capacity growth rate, Periodpreset is the preset time period, Capacityperiod-end is the memory used by the terminal device at the end of the preset time period, and Capacityperiod-start is the terminal device at the preset time The memory used at the start time point of the segment, and the value of the used capacity growth rate can be positive, negative or zero. The preset time period can be set according to actual application scenarios, and the end time point of the preset time period can be the current time, of course, can also be any time before the current time. For example, if the end time point of the preset time period is the current time and the preset time period is 7 days, the current memory usage of the terminal device is obtained, such as 4 gigabytes (GB), and the terminal device is The memory used a day ago, for example, 3 gigabytes, the used capacity growth rate can be calculated as (4-3)/7=0.14, and the unit of the used capacity growth rate is gigabytes/day. It is worth mentioning that, in order to facilitate the acquisition of the memory usage of the terminal device at different times, the memory usage can be saved in the log file of the terminal device in real time. When calculating the growth rate of the used capacity, the preset time period corresponds to Time is used as the search condition, just find the corresponding memory usage in the log file.
计算出的已用容量增长率可用于预测终端设备后续的内存已用量增长情况,故在本申请实施例中,根据得到的当前剩余容量和已用容量增长率计算填充时长,填充时长指预期的当前剩余容量减少至零所花费的时长,比如当前剩余容量为1吉字节,已用容量增长率为0.5吉字节/天,则可计算出填充时长为2天。值得一提的是,若已用容量增长率为负或为零,证明终端设备的内存已用量不存在增长趋势,则不计算填充时长,并且不进行图片清理。The calculated growth rate of the used capacity can be used to predict the subsequent increase in the amount of memory used by the terminal device. Therefore, in this embodiment of the application, the filling time is calculated according to the obtained current remaining capacity and the used capacity growth rate, and the filling time refers to the expected The time it takes for the current remaining capacity to decrease to zero. For example, if the current remaining capacity is 1 gigabyte and the used capacity growth rate is 0.5 gigabytes/day, the filling time can be calculated to be 2 days. It is worth mentioning that if the used capacity growth rate is negative or zero, which proves that there is no increasing trend in the memory usage of the terminal device, the filling time is not calculated and the picture cleaning is not performed.
可选地,获取预设时间段内的图片增长率,并根据当前剩余容量和图片增长率计算填充时长。在本申请实施例中,针对容量变化主要是由相册图片数量变化引起的场景,获取预设时间段内的图片增长率,并根据当前剩余容量和图片增长率计算填充时长,其中图片增长率相当于已用容量增长率的一种特殊形式。在根据图片增长率计算填充时长时,还获取终端设备上图片的平均容量,如1兆字节(MB),该平均容量可自定义设置,也可在预设时间段的末尾时间点对终端设备上所有图片的容量进行均值计算得到平均容量。举例来说,在预设时间点的起始时间点,终端设备上相册图片的数量为100张,在预设时间点的末尾时间点,终端设备上相册图片的数量为200张,预设时间段为10天,则可计算出图片增长率为(200-100)/10=10张/天,若当前剩余容量为100兆字节,平均容量为1兆字节,则可计算出填充时长为100/(10*1)=10天。通过上述方法可单独针对相册图片的变化情况,从而控制是否进行图片清理,用户也可针对图片自定义设置当前剩余容量,以根据实际需求限制图片容量,提升了图片清理的针对性和准确性。Optionally, obtain the picture growth rate in a preset time period, and calculate the filling time according to the current remaining capacity and the picture growth rate. In the embodiment of this application, for the scenario where the capacity change is mainly caused by the change in the number of photos in the album, the image growth rate within a preset time period is obtained, and the filling time is calculated according to the current remaining capacity and the image growth rate, where the image growth rate is equivalent It is a special form of used capacity growth rate. When calculating the filling time according to the picture growth rate, the average capacity of the picture on the terminal device, such as 1 megabyte (MB), is also obtained. The average capacity can be customized, or the terminal can be set at the end of the preset time period. The average capacity of all pictures on the device is calculated to obtain the average capacity. For example, at the starting time of the preset time, the number of album pictures on the terminal device is 100, and at the end of the preset time, the number of album pictures on the terminal device is 200, and the preset time If the segment is 10 days, the image growth rate can be calculated as (200-100)/10=10 sheets/day. If the current remaining capacity is 100 megabytes and the average capacity is 1 megabyte, the filling time can be calculated It is 100/(10*1)=10 days. Through the above method, it is possible to control whether to clean up the pictures separately according to the changes of the pictures in the album. Users can also customize the current remaining capacity for pictures to limit the picture capacity according to actual needs, which improves the pertinence and accuracy of picture cleanup.
在S102中,若所述填充时长小于预设的时长阈值,则获取所有相册图片,并将满足预设条件的所述相册图片归入清理组,对所述清理组内的至少两个所述相册图片按照浏览次数进行排序。In S102, if the filling duration is less than a preset duration threshold, all album pictures are acquired, and the album pictures meeting the preset conditions are classified into a cleaning group, and at least two of the cleaning groups are Album pictures are sorted according to the number of views.
在得到填充时长后,将填充时长与预设的时长阈值(如1天)进行数值比较,若填充时长大于或等于时长阈值,则不进行图片清理;若填充时长小于时长阈值,则获取终端设备上所有相册图片,并将其中满足预设条件的相册图片归入清理组,然后对清理组内的至少两个相册图片按照浏览次数进行排序。其中,浏览次数是指相册图片被打开的次数,预设条件可根据实际应用场景进行设置,本申请实施例对此不做限定,比如预设条件可为相册图片的创建时间在预设时间点之前,还可为相册图片包含特殊的预设标识等。另外,本申请实施例中的清理组并不指定某种具体的存储格式,而是指示对满足预设条件的至少两个相册图片进行单独分类。After getting the filling duration, compare the filling duration with a preset duration threshold (such as 1 day). If the filling duration is greater than or equal to the duration threshold, no picture cleaning is performed; if the filling duration is less than the duration threshold, the terminal device is acquired Upload all album pictures, and group the album pictures that meet the preset conditions into the cleaning group, and then sort at least two album pictures in the cleaning group according to the number of views. Wherein, the number of views refers to the number of times the album picture is opened. The preset condition can be set according to actual application scenarios. The embodiment of this application does not limit this. For example, the preset condition may be the creation time of the album picture at a preset time point Previously, it was also possible to include special preset logos for album pictures. In addition, the cleaning group in the embodiment of the present application does not specify a specific storage format, but instructs to separately classify at least two album pictures that meet preset conditions.
在S103中,按照第一预设数量对排序后的至少两个所述相册图片进行选取,将选取出 的所述相册图片确定为目标图片,并将所述清理组内除所述目标图片外的图片确定为待处理图片。In S103, at least two sorted album pictures are selected according to a first preset number, the selected album pictures are determined as target pictures, and the cleaning group except for the target pictures The picture of is determined to be a pending picture.
在对清理组内的至少两个相册图片进行排序时,可按照浏览次数从多到少的顺序进行排序,也可按照浏览次数从少到多的顺序进行排序,为了便于阐述本申请实施例的内容,后文以按照浏览次数从多到少的顺序进行排序进行说明。排序完成后,按照第一预设数量对排序后的至少两个相册图片进行图片选取,将选取出的相册图片确定为目标图片,并将清理组内除目标图片外的图片确定为待处理图片。其中,选取操作是从排序后的至少两个相册图片的起始开始。举例来说,清理组内排序后的相册图片依次为“图片1、图片2、图片3、图片4、图片5……”,第一预设数量为3个,则从图片1开始选取,选取出的“图片1、图片2、图片3”为目标图片,清理组内剩余的“图片4、图片5……”为待处理图片。When sorting at least two album pictures in the cleaning group, the pictures can be sorted in the order of the number of views from most to less, or they can be sorted in the order of the number of views from less to most, in order to facilitate the description of the embodiments of this application. The content will be described in the order of the most browsed times. After the sorting is completed, select at least two album pictures after sorting according to the first preset number, determine the selected album pictures as the target pictures, and determine the pictures in the cleaning group except the target pictures as the pictures to be processed . Wherein, the selection operation starts from the beginning of at least two album pictures after sorting. For example, the sorted album pictures in the cleaning group are "Picture 1, Picture 2, Picture 3, Picture 4, Picture 5...", and the first preset number is 3, then select from Picture 1, select The "Picture 1, Picture 2, Picture 3" that is output is the target picture, and the remaining "Picture 4, Picture 5..." in the cleaning group are the pictures to be processed.
在S104中,分别计算所述待处理图片与每个所述目标图片之间的子相似度,并根据所有所述子相似度计算所述待处理图片的综合相似度,对小于预设的相似度阈值的所述综合相似度所对应的所述待处理图片进行清理,所述综合相似度指示所述待处理图片与所有所述目标图片之间的总体相似程度。In S104, the sub-similarity between the picture to be processed and each target picture is calculated separately, and the comprehensive similarity of the picture to be processed is calculated according to all the sub-similarity. The picture to be processed corresponding to the comprehensive similarity of the degree threshold is cleaned up, and the comprehensive similarity indicates the overall similarity between the picture to be processed and all the target pictures.
由于目标图片的浏览次数较多,故目标图片与用户的浏览习惯较为贴合,故将目标图片作为图片清理的参照对象,具体地,对于一个待处理图片,首先分别计算出该待处理图片与每个目标图片之间的子相似度,本申请实施例对子相似度的计算方式不做限定,比如可通过对待处理图片的灰度直方图和目标图片的灰度直方图进行比较得到子相似度,可通过对待处理图片的彩色图像直方图和目标图片的彩色图像直方图进行比较得到子相似度,也可通过感知哈希算法计算子相似度。而由于目标图片的数量可能为两个或两个以上,不同的目标图片可能存在不同的风格,可能存在某个待处理图片与一个目标图片之间的子相似度较高,而与另一个目标图片之间的子相似度较低的情况,故根据得到的多个子相似度计算综合相似度,计算公式如下:Since the target picture has been viewed more frequently, the target picture is more closely related to the user’s browsing habits, so the target picture is taken as the reference object for picture cleaning. Specifically, for a picture to be processed, first calculate the picture to be processed and For the sub-similarity between each target picture, the embodiment of this application does not limit the calculation method of the sub-similarity. For example, the sub-similarity can be obtained by comparing the gray histogram of the image to be processed with the gray histogram of the target picture. The degree of sub-similarity can be obtained by comparing the color image histogram of the picture to be processed and the color image histogram of the target picture, and the sub-similarity degree can also be calculated by the perceptual hash algorithm. Since the number of target pictures may be two or more, different target pictures may have different styles, and there may be a high degree of sub-similarity between a picture to be processed and one target picture, but with another target picture. When the sub-similarity between pictures is low, the comprehensive similarity is calculated according to the obtained multiple sub-similarity. The calculation formula is as follows:
Figure PCTCN2019122881-appb-000002
Figure PCTCN2019122881-appb-000002
在上述计算公式中,Similarityphotos为综合相似度,Numberaim-photos为第一预设数量,Numberaim-photoi-views为第i个目标图片的浏览次数,Numberviews为预设的权重浏览次数(比如可设置为15次),Similarityaim-photoi为计算出的待处理图片与第i个目标图片之间的子相似度。综合相似度即为待处理图片与所有目标图片之间的总体相似程度,在计算出综合相似度后,将综合相似度与预设的相似度阈值进行比较,若综合相似度大于或等于相似度阈值,则继续保留综合相似度对应的待处理图片;若综合相似度小于相似度阈值,则对该综合相似度对应的待处理图片进行清理。相似度阈值可以自定义设置,也可以根据清理组内的 目标图片生成,比如设置权重浏览次数Numberviews为所有目标图片的总浏览次数,并设置某一个目标图片对应的子相似度为70%,设置其他的目标图片对应的子相似度为10%,从而将根据上述计算公式计算出的综合相似度确定为相似度阈值,当然,具体的参数可根据实际应用场景进行调整,并不限于上述例子。In the above calculation formula, Similarityphotos is the comprehensive similarity, Numberaim-photos is the first preset number, Numberaim-photoi-views is the number of views of the i-th target picture, Numberviews is the number of preset weighted views (for example, it can be set to 15 times), Similarityaim-photoi is the calculated sub-similarity between the picture to be processed and the i-th target picture. The comprehensive similarity is the overall similarity between the picture to be processed and all target pictures. After the comprehensive similarity is calculated, the comprehensive similarity is compared with the preset similarity threshold. If the comprehensive similarity is greater than or equal to the similarity If the comprehensive similarity is smaller than the similarity threshold, then the to-be-processed picture corresponding to the comprehensive similarity is cleaned up. The similarity threshold can be customized or generated based on the target pictures in the cleaning group. For example, set the weighted number of views to the total number of views of all target pictures, and set the sub-similarity corresponding to a target picture to 70%. The sub-similarity corresponding to other target pictures is 10%, so the comprehensive similarity calculated according to the above calculation formula is determined as the similarity threshold. Of course, the specific parameters can be adjusted according to actual application scenarios and are not limited to the above examples.
通过图1所示实施例可知,在本申请实施例中,通过终端设备的当前剩余容量以及已用容量增长率计算填充时长,若填充时长小于预设的时长阈值,则将终端设备中满足预设条件的相册图片归入清理组,对清理组内的至少两个相册图片进行排序,按照第一预设数量对排序后的至少两个相册图片进行选取,将选取出的相册图片确定为目标图片,并将清理组内除目标图片外的图片确定为待处理图片,分别计算待处理图片与每个目标图片之间的子相似度,并根据所有子相似度计算待处理图片的综合相似度,对小于预设的相似度阈值的综合相似度所对应的待处理图片进行清理,实现了对误拍图片的有效识别,提升了图片清理的针对性。It can be seen from the embodiment shown in FIG. 1 that, in the embodiment of the present application, the filling time is calculated based on the current remaining capacity of the terminal device and the used capacity growth rate. If the filling time is less than the preset duration threshold, the terminal device will meet the preset Set conditional album pictures into the cleanup group, sort at least two album pictures in the cleanup group, select at least two album pictures after sorting according to the first preset number, and determine the selected album pictures as the target Picture, and determine the pictures in the cleaning group except the target picture as the picture to be processed, calculate the sub-similarity between the picture to be processed and each target picture, and calculate the comprehensive similarity of the picture to be processed based on all the sub-similarity , To clean up the to-be-processed pictures corresponding to the comprehensive similarity that is less than the preset similarity threshold, which realizes the effective identification of mistaken pictures and improves the pertinence of picture cleaning.
图2所示,是在本申请实施例一的基础上,将对小于预设的相似度阈值的综合相似度所对应的待处理图片进行清理的过程进行细化后得到的一种方法。本申请实施例提供了基于数据更新的图片清理方法的实现流程图,如图2所示,该图片清理方法可以包括以下步骤:FIG. 2 shows a method obtained by refining the process of cleaning up the pictures to be processed corresponding to the comprehensive similarity that is less than the preset similarity threshold on the basis of the first embodiment of the present application. The embodiment of the present application provides an implementation flow chart of a picture cleaning method based on data update. As shown in FIG. 2, the picture cleaning method may include the following steps:
在S201中,筛选出小于所述相似度阈值的至少两个所述综合相似度所对应的至少两个所述待处理图片。In S201, at least two pictures to be processed corresponding to at least two comprehensive similarities that are smaller than the similarity threshold are filtered out.
在本申请实施例中,针对小于相似度阈值的综合相似度至少存在两个的情况,首先筛选出小于相似度阈值的至少两个综合相似度所对应的至少两个待处理图片,便于进行后续清理。In the embodiment of the present application, for the situation where there are at least two comprehensive similarities less than the similarity threshold, at least two pictures to be processed corresponding to the at least two comprehensive similarities less than the similarity threshold are first selected to facilitate subsequent follow-up Clean up.
在S202中,按照所述浏览次数对至少两个所述待处理图片进行排序,并按照第二预设数量对排序后的至少两个所述待处理图片进行选取。In S202, at least two pictures to be processed are sorted according to the number of times of browsing, and at least two pictures to be processed after sorting are selected according to a second preset number.
在筛选出至少两个待处理图片后,按照浏览次数对至少两个待处理图片进行排序,并按照第二预设数量对排序后的至少两个待处理图片进行选取,其中,第二预设数量可自定义设置,也可通过对终端设备的容量进行分析得到。值得一提的是,本步骤中的选取操作与S103中的选取操作不同,即优先从浏览次数最少的待处理图片开始选取,具体地,若是按照浏览次数从多到少的顺序对筛选出的至少两个待处理图片进行排序,则从排序后的最末尾的待处理图片开始执行选取。After screening at least two pictures to be processed, the at least two pictures to be processed are sorted according to the number of views, and the at least two pictures to be processed after sorting are selected according to the second preset number, where the second preset The quantity can be customized and can also be obtained by analyzing the capacity of the terminal device. It is worth mentioning that the selection operation in this step is different from the selection operation in S103, that is, the pictures to be processed with the least number of views are selected first. Specifically, if the selected images are selected in the order of the most viewed If at least two pictures to be processed are sorted, the selection is performed starting from the last picture to be processed after sorting.
在S203中,将选取出的所述待处理图片移动至待删除目录下,并基于所述待删除目录内的所述待处理图片输出删除提示。In S203, the selected picture to be processed is moved to a directory to be deleted, and a deletion prompt is output based on the picture to be processed in the directory to be deleted.
选取完成后,将选取出的待处理图片从其原目录移动至待删除目录下,并基于待删除目录内的待处理图片输出删除提示,用于指示用户对删除待处理图片的操作进行确认,防止误删,其中,可设置删除提示在被输出时直接显示待删除目录内的待处理图片。After the selection is completed, move the selected picture to be processed from its original directory to the directory to be deleted, and output a delete prompt based on the picture to be processed in the directory to be deleted, which is used to instruct the user to confirm the operation of deleting the picture to be processed. To prevent accidental deletion, the delete prompt can be set to directly display the pending pictures in the to-be-deleted directory when output.
在S204中,若接收到关于所述删除提示的确认结果,则删除所述待删除目录下的所述待处理图片。In S204, if a confirmation result regarding the deletion prompt is received, the to-be-processed picture in the to-be-deleted directory is deleted.
在本申请实施例中,输出的删除提示还包括确认和否认两个可选结果。若接收到用户关 于删除提示的确认结果,则对待删除目录下的待处理图片执行删除操作,完成图片清理工作。In the embodiment of the present application, the output deletion prompt also includes two optional results of confirmation and denial. If the user's confirmation result about the deletion prompt is received, the deletion operation is performed on the pending pictures in the directory to be deleted, and the picture cleaning is completed.
在S205中,若接收到关于所述删除提示的否认结果,则将所述待删除目录下的所述待处理图片移动至所述待处理图片的原目录。In S205, if a denial result regarding the deletion prompt is received, the to-be-processed picture in the to-be-deleted directory is moved to the original directory of the to-be-processed picture.
若接收到关于删除提示的否认结果,则将待删除目录下的待处理图片移动至待处理图片的原目录。值得一提的是,由于待删除目录下可能存在至少两个待处理图片,则可基于每个待处理图片都生成一个删除提示,或者直接基于待删除目录下的所有待处理图片生成一个删除提示,并设置该删除提示包含每个待处理图片对应的两个可选结果。If a denial result regarding the deletion prompt is received, the to-be-processed picture in the to-be-deleted directory is moved to the original directory of the to-be-processed picture. It is worth mentioning that since there may be at least two pictures to be processed in the directory to be deleted, a deletion prompt can be generated based on each picture to be processed, or a deletion prompt can be generated directly based on all the pictures to be processed in the directory to be deleted , And set the delete prompt to include two optional results corresponding to each picture to be processed.
可选地,若在输出删除提示后的删除时间段内并未接收到关于删除提示的确认结果或否认结果,则将待删除目录下的待处理图片上传至云空间,并对该待处理图片进行删除。在本申请实施例中,可预先设置删除时间段,如10分钟,若在输出删除提示后的删除时间段内并未接收到用户关于删除提示的回应结果(确认结果或否认结果),则将待删除目录下的待处理图片上传至云空间,并对该待处理图片进行删除,通过上述方法一方面增加了终端设备的内存可用量,另一方面在未经用户允许误删待处理图片的情况下,用户也可通过云空间访问待处理图片,提升了图片清理的适用性。Optionally, if the confirmation result or denial result of the deletion prompt is not received within the deletion time period after the deletion prompt is output, the picture to be processed in the directory to be deleted is uploaded to the cloud space, and the picture to be processed is To delete. In the embodiment of this application, the deletion time period can be preset, such as 10 minutes. If the user's response to the deletion prompt (confirmation result or denial result) is not received within the deletion time period after the deletion prompt is output, the The pictures to be processed in the directory to be deleted are uploaded to the cloud space, and the pictures to be processed are deleted. The above method increases the available memory of the terminal device on the one hand, and on the other hand deletes the pictures to be processed by mistake without the user’s permission. In this case, users can also access to-be-processed pictures through the cloud space, which improves the applicability of picture cleaning.
通过图2所示实施例可知,在本申请实施例中,筛选出小于相似度阈值的至少两个综合相似度所对应的至少两个待处理图片,按照浏览次数对至少两个待处理图片进行排序,并按照第二预设数量对排序后的至少两个待处理图片进行选取,将选取出的待处理图片移动至待删除目录下,并基于待删除目录内的待处理图片输出删除提示,若接收到关于删除提示的确认结果,则删除待删除目录下的待处理图片;若接收到关于删除提示的否认结果,则将待删除目录下的待处理图片移动至待处理图片的原目录。本申请实施例根据浏览次数对至少两个待处理图片进行排序,提升了对综合相似度小于相似度阈值的待处理图片进行清理的有序性。It can be seen from the embodiment shown in FIG. 2 that, in the embodiment of the present application, at least two pictures to be processed corresponding to at least two comprehensive similarities less than the similarity threshold are selected, and the at least two pictures to be processed are performed according to the number of views. Sort, and select at least two pictures to be processed after sorting according to the second preset number, move the selected pictures to be processed to the directory to be deleted, and output a deletion prompt based on the pictures to be processed in the directory to be deleted, If a confirmation result about the deletion prompt is received, the to-be-processed picture in the directory to be deleted is deleted; if a denial result about the deletion prompt is received, the to-be-processed picture in the to-be-deleted directory is moved to the original directory of the to-be-processed picture. In the embodiment of the present application, at least two pictures to be processed are sorted according to the number of browsing times, which improves the order in cleaning the pictures to be processed whose comprehensive similarity is less than the similarity threshold.
图3所示,是在本申请实施例二的基础上,并在预设条件为相册图片与预设标识存在对应关系,预设标识为至少两个图片标识中的一个的基础上,对按照第二预设数量对排序后的至少两个所述待处理图片进行选取之前的过程进行扩展后得到的一种方法。本申请实施例提供了基于数据更新的图片清理方法的实现流程图,如图3所示,该图片清理方法可以包括以下步骤:As shown in Figure 3, it is based on the second embodiment of the present application, and on the basis of the preset condition that the album picture has a corresponding relationship with the preset logo, and the preset logo is one of at least two image logos, The second preset number is a method obtained by expanding the process before selecting at least two of the pictures to be processed after sorting. The embodiment of the present application provides an implementation flow chart of a picture cleaning method based on data update. As shown in FIG. 3, the picture cleaning method may include the following steps:
在S301中,获取记录的已删除图片数量,并从中识别出与所述预设标识对应的图片数量,将与所述预设标识对应的图片数量与所述已删除图片数量之间的比值确定为所述清理组对应的删除占比。In S301, the number of recorded deleted pictures is obtained, the number of pictures corresponding to the preset identifier is identified therefrom, and the ratio between the number of pictures corresponding to the preset identifier and the number of deleted pictures is determined Is the percentage of deletions corresponding to the cleaning group.
在本申请实施例中,设置终端设备中存储的每个相册图片都对应一个图片标识,该图片标识是在将该相册图片存入终端设备时由用户手动设置或根据特定的分析算法自动生成,举例来说,图片标识可为人像、风景或动态图等。在进行图片清理时,将各个图片标识依次作为预设标识,并将相册图片与预设标识存在对应关系作为预设条件,即依次生成至少两个清理组,每个清理组都与一个图片标识对应。为了便于阐述本申请实施例的内容,后文以根据 某个预设标识对对应的清理组内的图片进行图片清理进行说明。除此之外,在本申请实施例中,设置终端设备包括记录机制,即终端设备对已删除图片数量以及每个已删除图片对应的图片标识进行记录(已删除图片可以是自动删除或用户手动删除),在本步骤中,从记录的已删除图片数量中识别出与预设标识对应的图片数量,获取预设标识对应的图片数量与已删除图片数量之间的比值,并将该比值确定为根据预设标识生成的清理组对应的删除占比,比如已删除图片数量为100张,其中包含50张风景图,而当前的预设标识为风景,则确定出删除占比为50%。In the embodiment of the application, each album picture stored in the terminal device is set to correspond to a picture identifier, which is manually set by the user or automatically generated according to a specific analysis algorithm when the album picture is stored in the terminal device. For example, the picture logo can be a portrait, landscape, or dynamic picture. When cleaning up pictures, each picture ID is used as the preset ID in turn, and the corresponding relationship between the album picture and the preset ID is used as the preset condition, that is, at least two cleaning groups are generated in sequence, and each cleaning group is associated with a picture ID correspond. In order to facilitate the elaboration of the content of the embodiments of the present application, the following description will be described by performing picture cleanup on the pictures in the corresponding cleanup group according to a certain preset identifier. In addition, in the embodiment of this application, setting the terminal device includes a recording mechanism, that is, the terminal device records the number of deleted pictures and the picture identifier corresponding to each deleted picture (the deleted pictures can be deleted automatically or manually by the user). Delete). In this step, the number of pictures corresponding to the preset logo is identified from the number of deleted pictures recorded, the ratio between the number of pictures corresponding to the preset logo and the number of deleted pictures is obtained, and the ratio is determined In order to delete the proportion corresponding to the cleaning group generated according to the preset mark, for example, the number of deleted pictures is 100, including 50 landscape pictures, and the current preset mark is a landscape, the deletion proportion is determined to be 50%.
在S302中,根据所述当前剩余容量计算出待删除容量,并根据所述删除占比和所述待删除容量计算所述预设标识对应的删除容量。In S302, the capacity to be deleted is calculated according to the current remaining capacity, and the deletion capacity corresponding to the preset identifier is calculated according to the percentage of deletion and the capacity to be deleted.
根据已获取的当前剩余容量计算待删除容量,一种计算方式是获取预设的安全剩余容量,并将安全剩余容量与当前剩余容量之间的差值确定为待删除容量,比如安全剩余容量为1吉字节,当前剩余容量为0.5吉字节,则待删除容量为0.5吉字节。然后,对删除占比和待删除容量进行乘积运算,得到预设标识对应的删除容量,比如删除占比为50%,待删除容量为0.5吉字节,则预设标识对应的删除容量为0.25吉字节。Calculate the capacity to be deleted according to the current remaining capacity that has been obtained. One calculation method is to obtain the preset safe remaining capacity and determine the difference between the safe remaining capacity and the current remaining capacity as the capacity to be deleted. For example, the safe remaining capacity is 1 gigabyte, the current remaining capacity is 0.5 gigabytes, and the capacity to be deleted is 0.5 gigabytes. Then, multiply the percentage of deletions and the capacity to be deleted to obtain the deletion capacity corresponding to the preset logo. For example, if the percentage of deletion is 50% and the capacity to be deleted is 0.5 gigabytes, the deletion capacity corresponding to the preset logo is 0.25 Gigabytes.
在S303中,计算所述清理组内筛选出的所有所述待处理图片的平均容量,并根据所述平均容量和所述预设标识对应的删除容量计算所述第二预设数量。In S303, the average capacity of all the pictures to be processed filtered out in the cleaning group is calculated, and the second preset number is calculated according to the average capacity and the deletion capacity corresponding to the preset identifier.
对于预设标识对应的清理组,首先筛选出小于相似度阈值的至少两个综合相似度所对应的至少两个待处理图片,再计算筛选出的所有待处理图片的平均容量,并将预设标识对应的删除容量除以平均容量,得到第二预设数量,在后续步骤中根据第二预设数量对排序后的至少两个待处理图片进行选取,比如删除容量为100兆字节,平均容量为5兆字节,则可计算出第二预设数量为20张。值得一提的是,若清理组内根据相似度阈值筛选出的待处理图片的数量少于第二预设数量,则可按照综合相似度从小到大的顺序,对综合相似度大于或等于相似度阈值的待处理图片进行继续选取,直到选取出的待处理图片的数量达到第二预设数量为止。For the cleaning group corresponding to the preset identifier, at least two pictures to be processed corresponding to at least two comprehensive similarities less than the similarity threshold are first screened out, and then the average capacity of all the pictures to be screened out is calculated, and the preset The deletion capacity corresponding to the identifier is divided by the average capacity to obtain the second preset number. In the subsequent step, at least two pictures to be processed after sorting are selected according to the second preset number. For example, the deletion capacity is 100 megabytes, and the average If the capacity is 5 megabytes, the second preset number can be calculated as 20 sheets. It is worth mentioning that if the number of pictures to be processed filtered according to the similarity threshold in the cleaning group is less than the second preset number, the overall similarity can be in the order of ascending, and the overall similarity is greater than or equal to similarity. The selection of pictures to be processed with a degree threshold is continued until the number of selected pictures to be processed reaches the second preset number.
通过图3所示实施例可知,在本申请实施例中,获取记录的已删除图片数量,从中识别出与预设标识对应的图片数量,将与预设标识对应的图片数量与已删除图片数量之间的比值确定为清理组对应的删除占比,并根据当前剩余容量计算出待删除容量,根据删除占比和待删除容量计算预设标识对应的删除容量,计算清理组内筛选出的所有待处理图片的平均容量,并根据平均容量和预设标识对应的删除容量计算第二预设数量。本申请实施例根据预设标识计算删除占比,从而计算根据该预设标识得到的清理组对应的第二预设数量,使得图片清理过程更贴近用户对不同类型图片的删除习惯,提升了图片清理的适用性和用户体验。It can be seen from the embodiment shown in FIG. 3 that, in the embodiment of the present application, the number of recorded deleted pictures is obtained, the number of pictures corresponding to the preset identifier is identified therefrom, and the number of pictures corresponding to the preset identifier is compared with the number of deleted pictures The ratio between is determined as the proportion of deletions corresponding to the cleaning group, and the capacity to be deleted is calculated according to the current remaining capacity, the deletion capacity corresponding to the preset flag is calculated according to the proportion of deletions and the capacity to be deleted, and all the filtered out in the cleaning group are calculated The average capacity of the pictures to be processed is calculated, and the second preset quantity is calculated according to the average capacity and the deleted capacity corresponding to the preset identifier. The embodiment of the present application calculates the percentage of deletions based on the preset identification, thereby calculating the second preset number corresponding to the cleaning group obtained according to the preset identification, so that the image cleaning process is closer to the user's deletion habits of different types of images, and the image is improved Applicability and user experience of cleanup.
图4所示,是在本申请实施例二的基础上,对按照所述浏览次数对至少两个所述待处理图片进行排序,并按照第二预设数量对排序后的至少两个所述待处理图片进行选取的过程进行细化后得到的一种方法。本申请实施例提供了基于数据更新的图片清理方法的实现流程图, 如图4所示,该图片清理方法可以包括以下步骤:As shown in Figure 4, on the basis of the second embodiment of the present application, at least two of the pictures to be processed are sorted according to the number of views, and at least two of the pictures are sorted according to a second preset number. A method obtained after the process of selecting pictures to be processed is refined. The embodiment of the present application provides an implementation flow chart of a picture cleaning method based on data update. As shown in FIG. 4, the picture cleaning method may include the following steps:
在S401中,将所述浏览次数为零的所述待处理图片确定为优先处理图片,对至少两个所述优先处理图片按照创建时间进行排序,并对除所述优先处理图片外的至少两个所述待处理图片按照所述浏览次数进行排序。In S401, the to-be-processed picture whose browsing count is zero is determined as a priority-processed picture, at least two of the priority-processed pictures are sorted according to creation time, and at least two other than the priority-processed picture are sorted. The pictures to be processed are sorted according to the number of views.
在清理组内筛选出小于相似度阈值的至少两个综合相似度所对应的至少两个待处理图片后,将其中浏览次数为零的待处理图片确定为优先处理图片,对至少两个优先处理图片按照创建时间进行排序,并对除优先处理图片外的至少两个待处理图片按照浏览次数进行排序,其中,本申请实施例可按照创建时间从早到晚的顺序进行排序,也可按照创建时间从晚到早的顺序进行排序。After filtering out at least two pictures to be processed corresponding to at least two comprehensive similarities less than the similarity threshold in the cleaning group, the pictures to be processed with zero browsing times are determined as priority pictures, and the at least two pictures are processed first The pictures are sorted according to the creation time, and at least two pictures to be processed except the priority pictures are sorted according to the number of views. The embodiment of the present application can be sorted in the order of creation time from early to late, or according to the creation time. The time is sorted from late to early.
在S402中,将按照所述创建时间进行排序后生成的图片序列确定为第一图片序列,将按照所述浏览次数进行排序后生成的图片序列确定为第二图片序列,并按照所述第二预设数量对所述第一图片序列和第二图片序列中的图片进行选取。In S402, the sequence of pictures generated after sorting according to the creation time is determined as the first picture sequence, the sequence of pictures generated after sorting according to the number of views is determined as the second picture sequence, and the sequence is determined according to the second picture sequence. The preset number of pictures is selected from the first picture sequence and the second picture sequence.
对至少两个优先处理图片按照创建时间进行排序后,生成第一图片序列;对除优先处理图片外的至少两个待处理图片按照浏览次数进行排序后,生成第二图片序列。在获取到第二预设数量后,按照所述第二预设数量对第一图片序列和第二图片序列中的图片进行选取,其中,优先选取第一图片序列中的图片,具体内容在后文进行阐述。After the at least two prioritized pictures are sorted according to the creation time, a first picture sequence is generated; after the at least two to-be-processed pictures except the prioritized pictures are sorted according to the number of views, a second picture sequence is generated. After the second preset number is obtained, the pictures in the first picture sequence and the second picture sequence are selected according to the second preset number, wherein the pictures in the first picture sequence are selected first, and the specific content is later The text is elaborated.
通过图4所示实施例可知,在本申请实施例中,将浏览次数为零的待处理图片确定为优先处理图片,对至少两个优先处理图片按照创建时间进行排序生成第一图片序列,并对除优先处理图片外的至少两个待处理图片按照浏览次数进行排序生成第二图片序列,按照第二预设数量对第一图片序列和第二图片序列中的图片进行选取。本申请实施例针对筛选出的待处理图片的浏览次数可能为零的情况,将创建时间作为图片清理的条件,从而分别生成两个图片序列,进一步提升了图片清理的有序性。It can be seen from the embodiment shown in FIG. 4 that in the embodiment of the application, the picture to be processed with zero browsing times is determined as the priority picture, and at least two priority pictures are sorted according to the creation time to generate the first picture sequence, and At least two pictures to be processed except the priority pictures are sorted according to the number of views to generate a second picture sequence, and the pictures in the first picture sequence and the second picture sequence are selected according to the second preset number. In the embodiment of the present application, in view of the situation that the number of times of browsing of the filtered pictures to be processed may be zero, the creation time is used as the condition of picture cleaning, so that two picture sequences are generated respectively, which further improves the order of picture cleaning.
图5所示,是在本申请实施例四的基础上,对按照第二预设数量对第一图片序列和第二图片序列中的图片进行选取的过程进行细化后得到的一种方法。本申请实施例提供了基于数据更新的图片清理方法的实现流程图,如图5所示,该图片清理方法可以包括以下步骤:As shown in FIG. 5, on the basis of the fourth embodiment of the present application, a method obtained by refining the process of selecting pictures in the first picture sequence and the second picture sequence according to the second preset number. The embodiment of the present application provides an implementation flow chart of a picture cleaning method based on data update. As shown in FIG. 5, the picture cleaning method may include the following steps:
在S501中,获取所述第一图片序列的第一图片数量。In S501, the first picture quantity of the first picture sequence is acquired.
在本申请实施例中,在存在第一图片序列和第二图片序列时,首先获取第一图片序列中优先处理图片的数量,作为第一图片数量。In this embodiment of the present application, when there are a first picture sequence and a second picture sequence, the number of preferentially processed pictures in the first picture sequence is first obtained as the first picture quantity.
在S502中,若所述第二预设数量不超过所述第一图片数量,则按照所述第二预设数量在所述第一图片序列中选取所述优先处理图片。In S502, if the second preset number does not exceed the first picture number, the priority processed picture is selected from the first picture sequence according to the second preset number.
将第一图片数量与第二预设数量进行数值比对,若第二预设数量不超过第一图片数量,则按照第二预设数量在第一图片序列中选取优先处理图片,其中,优先选取创建时间较早的优先处理图片,即若按照创建时间从早到晚的顺序进行排序,则从第一图片序列的起始开始进行选取;若按照创建时间从晚到早的顺序进行排序,则从第一图片序列的末尾开始进行选 取。The first picture quantity is compared with the second preset quantity. If the second preset quantity does not exceed the first picture quantity, the first picture sequence is selected according to the second preset quantity and the picture is selected for priority processing. Select the pictures with the earlier creation time for priority processing, that is, if they are sorted in the order of creation time from morning to night, they are selected from the beginning of the first picture sequence; if they are sorted in the order of creation time from morning to morning, The selection starts from the end of the first picture sequence.
在S503中,若所述第二预设数量超过所述第一图片数量,则选取所述第一图片序列中的全部所述优先处理图片,并按照第二图片数量在所述第二图片序列中选取所述待处理图片,其中,所述第二图片数量为所述第二预设数量与所述第一图片数量之间的差值。In S503, if the second preset number exceeds the number of the first pictures, all the priority pictures in the first picture sequence are selected, and in the second picture sequence according to the second picture number The picture to be processed is selected in, wherein the second picture quantity is the difference between the second preset quantity and the first picture quantity.
若第二预设数量超过第一图片数量,则首先选取第一图片序列中的全部优先处理图片,再按照第二图片数量在第二图片序列中选取待处理图片,其中,第二图片数量为第二预设数量与第一图片数量之间的差值,并且按照第二图片数量在第二图片序列中选取待处理图片时,优先选取浏览次数较少的待处理图片。If the second preset number exceeds the first picture quantity, firstly select all the priority pictures in the first picture sequence, and then select the pictures to be processed in the second picture sequence according to the second picture quantity, where the second picture quantity is The difference between the second preset number and the first number of pictures, and when the pictures to be processed are selected in the second picture sequence according to the second number of pictures, the pictures to be processed with less browsing times are preferentially selected.
通过图5所示实施例可知,在本申请实施例中,获取所述第一图片序列的第一图片数量,若第二预设数量不超过第一图片数量,则按照第二预设数量在第一图片序列中选取优先处理图片;若第二预设数量超过第一图片数量,则选取第一图片序列中的全部优先处理图片,并按照第二图片数量在第二图片序列中选取待处理图片,其中第二图片数量为第二预设数量与第一图片数量之间的差值。本申请实施例在将第二预设数量与第一图片数量进行数值比较的结果不同时执行不同的选取方式,进一步提升了图片清理的准确性和有序性。It can be seen from the embodiment shown in FIG. 5 that, in the embodiment of the present application, the first picture quantity of the first picture sequence is acquired. If the second preset quantity does not exceed the first picture quantity, the second preset quantity is The first picture sequence is selected for priority processing pictures; if the second preset number exceeds the first picture number, all priority processing pictures in the first picture sequence are selected, and the second picture sequence is selected for processing according to the second picture number Pictures, where the second picture quantity is the difference between the second preset quantity and the first picture quantity. In the embodiment of the present application, different selection methods are performed when the results of numerical comparison between the second preset number and the first picture number are different, which further improves the accuracy and order of picture cleaning.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the sequence numbers of the steps in the above embodiments does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
对应于上文实施例所述的基于数据更新的图片清理方法,图6示出了本申请实施例提供的基于数据更新的图片清理装置的结构框图,参照图6,该图片清理装置包括:Corresponding to the image cleaning method based on data update described in the above embodiment, FIG. 6 shows a structural block diagram of the image cleaning device based on data update provided in an embodiment of the present application. Referring to FIG. 6, the image cleaning device includes:
获取单元61,用于获取终端设备的当前剩余容量以及所述终端设备在预设时间段内的已用容量增长率,并根据所述当前剩余容量和所述已用容量增长率计算填充时长,所述填充时长指示所述当前剩余容量减少至零的时长;The acquiring unit 61 is configured to acquire the current remaining capacity of the terminal device and the used capacity growth rate of the terminal device within a preset time period, and calculate the filling time according to the current remaining capacity and the used capacity growth rate, The filling time length indicates the time length during which the current remaining capacity is reduced to zero;
排序单元62,用于若所述填充时长小于预设的时长阈值,则获取所有相册图片,并将满足预设条件的所述相册图片归入清理组,对所述清理组内的至少两个所述相册图片按照浏览次数进行排序;The sorting unit 62 is configured to, if the filling duration is less than a preset duration threshold, obtain all album pictures, and classify the album pictures that meet the preset conditions into a cleaning group, and check for at least two of the cleaning groups The pictures of the album are sorted according to the number of views;
选取单元63,用于按照第一预设数量对排序后的至少两个所述相册图片进行选取,将选取出的所述相册图片确定为目标图片,并将所述清理组内除所述目标图片外的图片确定为待处理图片;The selecting unit 63 is configured to select at least two of the album pictures after sorting according to a first preset number, determine the selected album pictures as target pictures, and remove the targets from the cleaning group The picture outside the picture is determined to be the picture to be processed;
清理单元64,用于分别计算所述待处理图片与每个所述目标图片之间的子相似度,并根据所有所述子相似度计算所述待处理图片的综合相似度,对小于预设的相似度阈值的所述综合相似度所对应的所述待处理图片进行清理,所述综合相似度指示所述待处理图片与所有所述目标图片之间的总体相似程度。The cleaning unit 64 is configured to calculate the sub-similarity between the picture to be processed and each of the target pictures, and calculate the comprehensive similarity of the picture to be processed according to all the sub-similarity. The picture to be processed corresponding to the comprehensive similarity of the similarity threshold of, and the comprehensive similarity indicates the overall similarity between the picture to be processed and all the target pictures.
需要说明的是,所属领域的技术人员可以清楚地了解到,上述图片清理装置和各单元的具体实现过程,可以参考前述方法实施例中的相应描述,为了描述的方便和简洁,在此不再赘述。It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned picture cleaning device and each unit can refer to the corresponding description in the foregoing method embodiment. For the convenience and brevity of the description, it will not be omitted here. Repeat.
图7是本申请实施例提供的终端设备的示意图。如图7所示,该实施例的终端设备7包括:处理器70、存储器71以及存储在所述存储器71中并可在所述处理器70上运行的计算机可读指令72,例如基于数据更新的图片清理程序。所述处理器70执行所述计算机可读指令72时实现上述各个基于数据更新的图片清理方法实施例中的步骤,例如图1所示的步骤S101至S104。或者,所述处理器70执行所述计算机可读指令72时实现上述各终端设备实施例中各单元的功能,例如图6所示单元61至64的功能。Fig. 7 is a schematic diagram of a terminal device provided by an embodiment of the present application. As shown in FIG. 7, the terminal device 7 of this embodiment includes: a processor 70, a memory 71, and computer-readable instructions 72 stored in the memory 71 and running on the processor 70, for example, based on data update The picture cleaner program. When the processor 70 executes the computer-readable instructions 72, the steps in the above embodiments of the image cleaning method based on data update are implemented, such as steps S101 to S104 shown in FIG. 1. Alternatively, when the processor 70 executes the computer-readable instructions 72, the functions of the units in the foregoing terminal device embodiments, such as the functions of the units 61 to 64 shown in FIG. 6, are implemented.
示例性的,所述计算机可读指令72可以被分割成一个或多个单元,所述一个或者多个单元被存储在所述存储器71中,并由所述处理器70执行,以完成本申请。所述一个或多个单元可以是能够完成特定功能的一系列计算机可读指令,该指令段用于描述所述计算机可读指令72在所述终端设备7中的执行过程。例如,所述计算机可读指令72可以被分割成获取单元、排序单元、选取单元以及清理单元,各单元具体功能如下:Exemplarily, the computer-readable instructions 72 may be divided into one or more units, and the one or more units are stored in the memory 71 and executed by the processor 70 to complete the application . The one or more units may be a series of computer-readable instructions capable of completing specific functions, and the instruction segment is used to describe the execution process of the computer-readable instructions 72 in the terminal device 7. For example, the computer-readable instructions 72 can be divided into an acquisition unit, a sorting unit, a selection unit, and a cleaning unit, and the specific functions of each unit are as follows:
获取单元,用于获取终端设备的当前剩余容量以及所述终端设备在预设时间段内的已用容量增长率,并根据所述当前剩余容量和所述已用容量增长率计算填充时长,所述填充时长指示所述当前剩余容量减少至零的时长;The acquiring unit is used to acquire the current remaining capacity of the terminal device and the used capacity growth rate of the terminal device within a preset time period, and calculate the filling time according to the current remaining capacity and the used capacity growth rate, so The filling time length indicates the time length during which the current remaining capacity is reduced to zero;
排序单元,用于若所述填充时长小于预设的时长阈值,则获取所有相册图片,并将满足预设条件的所述相册图片归入清理组,对所述清理组内的至少两个所述相册图片按照浏览次数进行排序;The sorting unit is configured to, if the filling duration is less than a preset duration threshold, obtain all album pictures, and classify the album pictures that meet the preset conditions into a cleaning group, and check for at least two photos in the cleaning group The album pictures are sorted according to the number of views;
选取单元,用于按照第一预设数量对排序后的至少两个所述相册图片进行选取,将选取出的所述相册图片确定为目标图片,并将所述清理组内除所述目标图片外的图片确定为待处理图片;The selecting unit is configured to select at least two of the album pictures after sorting according to a first preset number, determine the selected album pictures as target pictures, and remove the target pictures from the cleaning group The pictures outside are determined to be processed pictures;
清理单元,用于分别计算所述待处理图片与每个所述目标图片之间的子相似度,并根据所有所述子相似度计算所述待处理图片的综合相似度,对小于预设的相似度阈值的所述综合相似度所对应的所述待处理图片进行清理,所述综合相似度指示所述待处理图片与所有所述目标图片之间的总体相似程度。The cleaning unit is configured to calculate the sub-similarity between the picture to be processed and each of the target pictures, and calculate the comprehensive similarity of the picture to be processed according to all the sub-similarity. The picture to be processed corresponding to the comprehensive similarity of the similarity threshold is cleaned up, and the comprehensive similarity indicates the overall similarity between the picture to be processed and all the target pictures.
所述终端设备7可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述终端设备可包括,但不仅限于,处理器70、存储器71。本领域技术人员可以理解,图7仅仅是终端设备7的示例,并不构成对终端设备7的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述终端设备还可以包括输入输出设备、网络接入设备、总线等。The terminal device 7 may be a computing device such as a desktop computer, a notebook, a palmtop computer and a cloud server. The terminal device may include, but is not limited to, a processor 70 and a memory 71. Those skilled in the art may understand that FIG. 7 is only an example of the terminal device 7 and does not constitute a limitation on the terminal device 7, and may include more or fewer components than those illustrated, or a combination of certain components, or different components. For example, the terminal device may further include an input and output device, a network access device, a bus, and the like.
所称处理器70可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The so-called processor 70 may be a central processing unit (Central Processing Unit, CPU), or other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), Ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
所述存储器71可以是所述终端设备7的内部存储单元,例如终端设备7的硬盘或内存。所述存储器71也可以是所述终端设备7的外部存储设备,例如所述终端设备7上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器71还可以既包括所述终端设备7的内部存储单元也包括外部存储设备。所述存储器71用于存储所述计算机可读指令以及所述终端设备所需的其他程序和数据。所述存储器71还可以用于暂时地存储已经输出或者将要输出的数据。The memory 71 may be an internal storage unit of the terminal device 7, such as a hard disk or a memory of the terminal device 7. The memory 71 may also be an external storage device of the terminal device 7, such as a plug-in hard disk equipped on the terminal device 7, a smart memory card (Smart, Media, Card, SMC), and a secure digital (SD) Cards, flash cards, etc. Further, the memory 71 may include both an internal storage unit of the terminal device 7 and an external storage device. The memory 71 is used to store the computer-readable instructions and other programs and data required by the terminal device. The memory 71 can also be used to temporarily store data that has been or will be output.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元完成,即将所述终端设备的内部结构划分成不同的功能单元,以完成以上描述的全部或者部分功能。实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述***中单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and conciseness of the description, only the division of the above functional units is used as an example. In practical applications, the above function can be allocated by different functional units as required, namely The internal structure of the terminal device is divided into different functional units to complete all or part of the functions described above. The functional units in the embodiments can be integrated in one processing unit, or each unit can exist alone physically, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware. It can also be implemented in the form of software functional units. In addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the present application. For the specific working process of the units in the foregoing system, reference may be made to the corresponding process in the foregoing method embodiment, which is not repeated here.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above embodiments, the description of each embodiment has its own emphasis. For a part that is not detailed or recorded in an embodiment, you can refer to the related descriptions of other embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art may realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in hardware or software depends on the specific application of the technical solution and design constraints. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
在本申请所提供的实施例中,应该理解到,所揭露的终端设备和方法,可以通过其它的方式实现。例如,以上所描述的终端设备实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个***,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided in this application, it should be understood that the disclosed terminal device and method may be implemented in other ways. For example, the terminal device embodiments described above are only illustrative. For example, the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined. Or it can be integrated into another system, or some features can be ignored or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or software function unit.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing relevant hardware through computer-readable instructions. The computer-readable instructions can be stored in a computer-readable storage. In the medium, when the computer-readable instructions are executed, they may include the processes of the above-mentioned method embodiments. Wherein, any reference to the memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and/or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, persons of ordinary skill in the art should understand that they can still implement the foregoing The technical solutions described in the examples are modified, or some of the technical features are equivalently replaced; and these modifications or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present application. Within the scope of protection of this application.

Claims (20)

  1. 一种基于数据更新的图片清理方法,其特征在于,包括:A picture cleaning method based on data update, characterized in that it comprises:
    获取终端设备的当前剩余容量以及所述终端设备在预设时间段内的已用容量增长率,并根据所述当前剩余容量和所述已用容量增长率计算填充时长,所述填充时长指示所述当前剩余容量减少至零的时长;Obtain the current remaining capacity of the terminal device and the used capacity growth rate of the terminal device within a preset time period, and calculate the filling time based on the current remaining capacity and the used capacity growth rate, and the filling time length indicates State the length of time the current remaining capacity is reduced to zero;
    若所述填充时长小于预设的时长阈值,则获取所有相册图片,并将满足预设条件的所述相册图片归入清理组,对所述清理组内的至少两个所述相册图片按照浏览次数进行排序;If the filling duration is less than the preset duration threshold, all album pictures are acquired, and the album pictures meeting the preset conditions are classified into the cleaning group, and at least two of the album pictures in the cleaning group are browsed according to Sort by frequency;
    按照第一预设数量对排序后的至少两个所述相册图片进行选取,将选取出的所述相册图片确定为目标图片,并将所述清理组内除所述目标图片外的图片确定为待处理图片;Select at least two of the album pictures after sorting according to a first preset number, determine the selected album pictures as target pictures, and determine pictures in the cleaning group other than the target pictures as Pending picture
    分别计算所述待处理图片与每个所述目标图片之间的子相似度,并根据所有所述子相似度计算所述待处理图片的综合相似度,对小于预设的相似度阈值的所述综合相似度所对应的所述待处理图片进行清理,所述综合相似度指示所述待处理图片与所有所述目标图片之间的总体相似程度。Calculate the sub-similarity between the picture to be processed and each of the target pictures respectively, and calculate the comprehensive similarity of the picture to be processed according to all the sub-similarity, and for all the similarities less than the preset similarity threshold The picture to be processed corresponding to the comprehensive similarity is cleaned up, and the comprehensive similarity indicates the overall similarity between the picture to be processed and all the target pictures.
  2. 如权利要求1所述的图片清理方法,其特征在于,所述对小于预设的相似度阈值的所述综合相似度所对应的所述待处理图片进行清理,包括:5. The picture cleaning method according to claim 1, wherein the cleaning the pictures to be processed corresponding to the comprehensive similarity that is less than a preset similarity threshold comprises:
    筛选出小于所述相似度阈值的至少两个所述综合相似度所对应的至少两个所述待处理图片;Screening out at least two pictures to be processed corresponding to at least two comprehensive similarities that are less than the similarity threshold;
    按照所述浏览次数对至少两个所述待处理图片进行排序,并按照第二预设数量对排序后的至少两个所述待处理图片进行选取;Sort at least two pictures to be processed according to the number of times of browsing, and select at least two pictures to be processed after sorting according to a second preset number;
    将选取出的所述待处理图片移动至待删除目录下,并基于所述待删除目录内的所述待处理图片输出删除提示;Move the selected picture to be processed to a directory to be deleted, and output a deletion prompt based on the picture to be processed in the to-be-deleted directory;
    若接收到关于所述删除提示的确认结果,则删除所述待删除目录下的所述待处理图片;If a confirmation result regarding the deletion prompt is received, delete the to-be-processed picture in the to-be-deleted directory;
    若接收到关于所述删除提示的否认结果,则将所述待删除目录下的所述待处理图片移动至所述待处理图片的原目录。If a denial result regarding the deletion prompt is received, the to-be-processed picture in the to-be-deleted directory is moved to the original directory of the to-be-processed picture.
  3. 如权利要求2所述的图片清理方法,其特征在于,所述预设条件为所述相册图片与预设标识存在对应关系,所述按照第二预设数量对排序后的至少两个所述待处理图片进行选取之前,还包括:The picture cleaning method according to claim 2, wherein the preset condition is that there is a corresponding relationship between the album pictures and the preset identifiers, and the at least two sorted pictures are sorted according to a second preset number. Before selecting the picture to be processed, it also includes:
    获取记录的已删除图片数量,并从中识别出与所述预设标识对应的图片数量,将与所述预设标识对应的图片数量与所述已删除图片数量之间的比值确定为所述清理组对应的删除占比;Obtain the number of recorded deleted pictures, identify the number of pictures corresponding to the preset identifier, and determine the ratio between the number of pictures corresponding to the preset identifier and the number of deleted pictures as the cleaning The percentage of deletions corresponding to the group;
    根据所述当前剩余容量计算出待删除容量,并根据所述删除占比和所述待删除容量计算所述预设标识对应的删除容量;Calculating the capacity to be deleted according to the current remaining capacity, and calculating the deletion capacity corresponding to the preset identifier according to the percentage of deletion and the capacity to be deleted;
    计算所述清理组内筛选出的所有所述待处理图片的平均容量,并根据所述平均容量和所 述预设标识对应的删除容量计算所述第二预设数量。Calculate the average capacity of all the pictures to be processed selected in the cleaning group, and calculate the second preset number according to the average capacity and the deletion capacity corresponding to the preset identifier.
  4. 如权利要求2所述的图片清理方法,其特征在于,所述按照所述浏览次数对至少两个所述待处理图片进行排序,并按照第二预设数量对排序后的至少两个所述待处理图片进行选取,包括:3. The picture cleaning method according to claim 2, wherein the at least two pictures to be processed are sorted according to the number of views, and the at least two pictures after sorting are sorted according to a second preset number. Select the pictures to be processed, including:
    将所述浏览次数为零的所述待处理图片确定为优先处理图片,对至少两个所述优先处理图片按照创建时间进行排序,并对除所述优先处理图片外的至少两个所述待处理图片按照所述浏览次数进行排序;The picture to be processed with the number of browsing times of zero is determined as a picture for priority processing, at least two pictures to be processed for priority are sorted according to the creation time, and at least two pictures to be processed except for the picture for priority processing are sorted The processed pictures are sorted according to the number of views;
    将按照所述创建时间进行排序后生成的图片序列确定为第一图片序列,将按照所述浏览次数进行排序后生成的图片序列确定为第二图片序列,并按照所述第二预设数量对所述第一图片序列和所述第二图片序列中的图片进行选取。Determine the picture sequence generated after sorting according to the creation time as the first picture sequence, determine the picture sequence generated after sorting according to the number of views as the second picture sequence, and pair according to the second preset number The pictures in the first picture sequence and the second picture sequence are selected.
  5. 如权利要求4所述的图片清理方法,其特征在于,所述按照所述第二预设数量对所述第一图片序列和所述第二图片序列中的图片进行选取,包括:The picture cleaning method according to claim 4, wherein said selecting pictures in said first picture sequence and said second picture sequence according to said second preset number comprises:
    获取所述第一图片序列的第一图片数量;Acquiring the first picture quantity of the first picture sequence;
    若所述第二预设数量不超过所述第一图片数量,则按照所述第二预设数量在所述第一图片序列中选取所述优先处理图片;If the second preset number does not exceed the first picture quantity, selecting the priority processing picture from the first picture sequence according to the second preset number;
    若所述第二预设数量超过所述第一图片数量,则选取所述第一图片序列中的全部所述优先处理图片,并按照第二图片数量在所述第二图片序列中选取所述待处理图片,其中,所述第二图片数量为所述第二预设数量与所述第一图片数量之间的差值。If the second preset number exceeds the number of first pictures, select all the priority pictures in the first picture sequence, and select the second picture sequence according to the second number of pictures The picture to be processed, wherein the second picture quantity is the difference between the second preset quantity and the first picture quantity.
  6. 一种基于数据更新的图片清理装置,其特征在于,包括:A picture cleaning device based on data update, characterized in that it comprises:
    获取单元,用于获取终端设备的当前剩余容量以及所述终端设备在预设时间段内的已用容量增长率,并根据所述当前剩余容量和所述已用容量增长率计算填充时长,所述填充时长指示所述当前剩余容量减少至零的时长;The acquiring unit is used to acquire the current remaining capacity of the terminal device and the used capacity growth rate of the terminal device within a preset time period, and calculate the filling time according to the current remaining capacity and the used capacity growth rate, so The filling time length indicates the time length during which the current remaining capacity is reduced to zero;
    排序单元,用于若所述填充时长小于预设的时长阈值,则获取所有相册图片,并将满足预设条件的所述相册图片归入清理组,对所述清理组内的至少两个所述相册图片按照浏览次数进行排序;The sorting unit is configured to, if the filling duration is less than a preset duration threshold, obtain all album pictures, and classify the album pictures that meet the preset conditions into a cleaning group, and check for at least two photos in the cleaning group The album pictures are sorted according to the number of views;
    选取单元,用于按照第一预设数量对排序后的至少两个所述相册图片进行选取,将选取出的所述相册图片确定为目标图片,并将所述清理组内除所述目标图片外的图片确定为待处理图片;The selecting unit is configured to select at least two of the album pictures after sorting according to a first preset number, determine the selected album pictures as target pictures, and remove the target pictures from the cleaning group The pictures outside are determined to be processed pictures;
    清理单元,用于分别计算所述待处理图片与每个所述目标图片之间的子相似度,并根据所有所述子相似度计算所述待处理图片的综合相似度,对小于预设的相似度阈值的所述综合相似度所对应的所述待处理图片进行清理,所述综合相似度指示所述待处理图片与所有所述目标图片之间的总体相似程度。The cleaning unit is configured to calculate the sub-similarity between the picture to be processed and each of the target pictures, and calculate the comprehensive similarity of the picture to be processed according to all the sub-similarity. The picture to be processed corresponding to the comprehensive similarity of the similarity threshold is cleaned up, and the comprehensive similarity indicates the overall similarity between the picture to be processed and all the target pictures.
  7. 如权利要求6所述的基于数据更新的图片清理装置,其特征在于,所述清理单元包括:7. The image cleaning device based on data update according to claim 6, wherein the cleaning unit comprises:
    筛选单元,用于筛选出小于所述相似度阈值的至少两个所述综合相似度所对应的至少两 个所述待处理图片;A screening unit, configured to screen out at least two pictures to be processed corresponding to at least two comprehensive similarities that are less than the similarity threshold;
    排序单元,用于按照所述浏览次数对至少两个所述待处理图片进行排序,并按照第二预设数量对排序后的至少两个所述待处理图片进行选取;A sorting unit, configured to sort at least two pictures to be processed according to the number of times of browsing, and select at least two pictures to be processed after sorting according to a second preset number;
    移动单元,用于将选取出的所述待处理图片移动至待删除目录下,并基于所述待删除目录内的所述待处理图片输出删除提示;A moving unit, configured to move the selected picture to be processed to a directory to be deleted, and output a deletion prompt based on the picture to be processed in the to-be-deleted directory;
    删除单元,用于若接收到关于所述删除提示的确认结果,则删除所述待删除目录下的所述待处理图片;A deleting unit, configured to delete the to-be-processed picture in the to-be-deleted directory if a confirmation result regarding the deletion prompt is received;
    返回单元,用于若接收到关于所述删除提示的否认结果,则将所述待删除目录下的所述待处理图片移动至所述待处理图片的原目录。The returning unit is configured to move the to-be-processed picture in the to-be-deleted directory to the original directory of the to-be-processed picture if a denial result regarding the deletion prompt is received.
  8. 如权利要求7所述的基于数据更新的图片清理装置,其特征在于,预设条件为相册图片与预设标识存在对应关系,所述排序单元还包括:The device for cleaning pictures based on data update according to claim 7, wherein the preset condition is that there is a corresponding relationship between the album pictures and the preset identifiers, and the sorting unit further comprises:
    识别单元,用于获取记录的已删除图片数量,并从中识别出与所述预设标识对应的图片数量,将与所述预设标识对应的图片数量与所述已删除图片数量之间的比值确定为所述清理组对应的删除占比;The identification unit is used to obtain the number of recorded deleted pictures, identify the number of pictures corresponding to the preset identifier, and determine the ratio between the number of pictures corresponding to the preset identifier and the number of deleted pictures Determine the percentage of deletions corresponding to the cleaning group;
    第一计算单元,用于根据所述当前剩余容量计算出待删除容量,并根据所述删除占比和所述待删除容量计算所述预设标识对应的删除容量;The first calculation unit is configured to calculate the capacity to be deleted according to the current remaining capacity, and calculate the deletion capacity corresponding to the preset identifier according to the percentage of deletion and the capacity to be deleted;
    第二计算单元,用于计算所述清理组内筛选出的所有所述待处理图片的平均容量,并根据所述平均容量和所述预设标识对应的删除容量计算所述第二预设数量。The second calculation unit is configured to calculate the average capacity of all the pictures to be processed selected in the cleaning group, and calculate the second preset number according to the average capacity and the deletion capacity corresponding to the preset identifier .
  9. 如权利要求7所述的基于数据更新的图片清理装置,其特征在于,所述排序单元包括:8. The image cleaning device based on data update of claim 7, wherein the sorting unit comprises:
    排序子单元,用于将所述浏览次数为零的所述待处理图片确定为优先处理图片,对至少两个所述优先处理图片按照创建时间进行排序,并对除所述优先处理图片外的至少两个所述待处理图片按照所述浏览次数进行排序;A sorting subunit, configured to determine the picture to be processed with the number of browsing times of zero as the priority picture, sort at least two of the priority pictures according to the creation time, and sort the pictures except the priority picture At least two of the pictures to be processed are sorted according to the number of views;
    序列选取单元,用于将按照所述创建时间进行排序后生成的图片序列确定为第一图片序列,将按照所述浏览次数进行排序后生成的图片序列确定为第二图片序列,并按照所述第二预设数量对所述第一图片序列和第二图片序列中的图片进行选取。The sequence selection unit is configured to determine the sequence of pictures generated after sorting according to the creation time as the first picture sequence, and determine the sequence of pictures generated after sorting according to the number of views as the second picture sequence, and according to the The second preset number selects pictures in the first picture sequence and the second picture sequence.
  10. 如权利要求9所述的基于数据更新的图片清理装置,其特征在于,所述序列选取单元包括:9. The image cleaning device based on data update according to claim 9, wherein the sequence selection unit comprises:
    数量获取单元,用于获取所述第一图片序列的第一图片数量。The quantity obtaining unit is configured to obtain the first picture quantity of the first picture sequence.
    第一选取单元,用于若所述第二预设数量不超过所述第一图片数量,则按照所述第二预设数量在所述第一图片序列中选取所述优先处理图片。The first selection unit is configured to, if the second preset number does not exceed the number of the first pictures, select the preferentially processed pictures from the first picture sequence according to the second preset number.
    第二选取单元,用于若所述第二预设数量超过所述第一图片数量,则选取所述第一图片序列中的全部所述优先处理图片,并按照第二图片数量在所述第二图片序列中选取所述待处理图片,其中,所述第二图片数量为所述第二预设数量与所述第一图片数量之间的差值。The second selection unit is configured to select all the priority pictures in the first picture sequence if the second preset number exceeds the first picture quantity, and the second picture quantity is in the first picture according to the second picture quantity. The picture to be processed is selected from the second picture sequence, wherein the second picture quantity is the difference between the second preset quantity and the first picture quantity.
  11. 一种终端设备,其特征在于,所述终端设备包括存储器、处理器以及存储在所述存 储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:A terminal device, wherein the terminal device includes a memory, a processor, and computer-readable instructions stored in the memory and running on the processor, and the processor executes the computer-readable instructions. Implement the following steps when ordering:
    获取终端设备的当前剩余容量以及所述终端设备在预设时间段内的已用容量增长率,并根据所述当前剩余容量和所述已用容量增长率计算填充时长,所述填充时长指示所述当前剩余容量减少至零的时长;Obtain the current remaining capacity of the terminal device and the used capacity growth rate of the terminal device within a preset time period, and calculate the filling time based on the current remaining capacity and the used capacity growth rate, and the filling time length indicates State the length of time the current remaining capacity is reduced to zero;
    若所述填充时长小于预设的时长阈值,则获取所有相册图片,并将满足预设条件的所述相册图片归入清理组,对所述清理组内的至少两个所述相册图片按照浏览次数进行排序;If the filling duration is less than the preset duration threshold, all album pictures are acquired, and the album pictures meeting the preset conditions are classified into the cleaning group, and at least two of the album pictures in the cleaning group are browsed according to Sort by frequency;
    按照第一预设数量对排序后的至少两个所述相册图片进行选取,将选取出的所述相册图片确定为目标图片,并将所述清理组内除所述目标图片外的图片确定为待处理图片;Select at least two of the album pictures after sorting according to a first preset number, determine the selected album pictures as target pictures, and determine pictures in the cleaning group other than the target pictures as Pending picture
    分别计算所述待处理图片与每个所述目标图片之间的子相似度,并根据所有所述子相似度计算所述待处理图片的综合相似度,对小于预设的相似度阈值的所述综合相似度所对应的所述待处理图片进行清理,所述综合相似度指示所述待处理图片与所有所述目标图片之间的总体相似程度。Calculate the sub-similarity between the picture to be processed and each of the target pictures respectively, and calculate the comprehensive similarity of the picture to be processed according to all the sub-similarity, and for all the similarities less than the preset similarity threshold The picture to be processed corresponding to the comprehensive similarity is cleaned up, and the comprehensive similarity indicates the overall similarity between the picture to be processed and all the target pictures.
  12. 如权利要求11所述的终端设备,其特征在于,所述对小于预设的相似度阈值的所述综合相似度所对应的所述待处理图片进行清理,包括:The terminal device according to claim 11, wherein the cleaning the to-be-processed pictures corresponding to the comprehensive similarity that is less than a preset similarity threshold comprises:
    筛选出小于所述相似度阈值的至少两个所述综合相似度所对应的至少两个所述待处理图片;Screening out at least two pictures to be processed corresponding to at least two comprehensive similarities that are less than the similarity threshold;
    按照所述浏览次数对至少两个所述待处理图片进行排序,并按照第二预设数量对排序后的至少两个所述待处理图片进行选取;Sort at least two pictures to be processed according to the number of times of browsing, and select at least two pictures to be processed after sorting according to a second preset number;
    将选取出的所述待处理图片移动至待删除目录下,并基于所述待删除目录内的所述待处理图片输出删除提示;Move the selected picture to be processed to a directory to be deleted, and output a deletion prompt based on the picture to be processed in the to-be-deleted directory;
    若接收到关于所述删除提示的确认结果,则删除所述待删除目录下的所述待处理图片;If a confirmation result regarding the deletion prompt is received, delete the to-be-processed picture in the to-be-deleted directory;
    若接收到关于所述删除提示的否认结果,则将所述待删除目录下的所述待处理图片移动至所述待处理图片的原目录。If a denial result regarding the deletion prompt is received, the to-be-processed picture in the to-be-deleted directory is moved to the original directory of the to-be-processed picture.
  13. 如权利要求12所述的终端设备,其特征在于,所述预设条件为所述相册图片与预设标识存在对应关系,所述按照第二预设数量对排序后的至少两个所述待处理图片进行选取之前,还包括:The terminal device according to claim 12, wherein the preset condition is that there is a corresponding relationship between the album picture and the preset identifier, and the at least two waits are sorted according to a second preset number. Before processing the picture for selection, it also includes:
    获取记录的已删除图片数量,并从中识别出与所述预设标识对应的图片数量,将与所述预设标识对应的图片数量与所述已删除图片数量之间的比值确定为所述清理组对应的删除占比;Obtain the number of recorded deleted pictures, identify the number of pictures corresponding to the preset identifier, and determine the ratio between the number of pictures corresponding to the preset identifier and the number of deleted pictures as the cleaning The percentage of deletions corresponding to the group;
    根据所述当前剩余容量计算出待删除容量,并根据所述删除占比和所述待删除容量计算所述预设标识对应的删除容量;Calculating the capacity to be deleted according to the current remaining capacity, and calculating the deletion capacity corresponding to the preset identifier according to the percentage of deletion and the capacity to be deleted;
    计算所述清理组内筛选出的所有所述待处理图片的平均容量,并根据所述平均容量和所述预设标识对应的删除容量计算所述第二预设数量。Calculate the average capacity of all the to-be-processed pictures selected in the cleaning group, and calculate the second preset number according to the average capacity and the deletion capacity corresponding to the preset identifier.
  14. 如权利要求12所述的终端设备,其特征在于,所述按照所述浏览次数对至少两个所述待处理图片进行排序,并按照第二预设数量对排序后的至少两个所述待处理图片进行选取,包括:The terminal device of claim 12, wherein the at least two pictures to be processed are sorted according to the number of browsing times, and the at least two pictures to be processed are sorted according to a second preset number. Process pictures for selection, including:
    将所述浏览次数为零的所述待处理图片确定为优先处理图片,对至少两个所述优先处理图片按照创建时间进行排序,并对除所述优先处理图片外的至少两个所述待处理图片按照所述浏览次数进行排序;The picture to be processed with the number of browsing times of zero is determined as a picture for priority processing, at least two pictures to be processed for priority are sorted according to the creation time, and at least two pictures to be processed except for the picture for priority processing are sorted The processed pictures are sorted according to the number of views;
    将按照所述创建时间进行排序后生成的图片序列确定为第一图片序列,将按照所述浏览次数进行排序后生成的图片序列确定为第二图片序列,并按照所述第二预设数量对所述第一图片序列和所述第二图片序列中的图片进行选取。Determine the picture sequence generated after sorting according to the creation time as the first picture sequence, determine the picture sequence generated after sorting according to the number of views as the second picture sequence, and pair according to the second preset number The pictures in the first picture sequence and the second picture sequence are selected.
  15. 如权利要求14所述的终端设备,其特征在于,所述按照所述第二预设数量对所述第一图片序列和所述第二图片序列中的图片进行选取,包括:The terminal device according to claim 14, wherein said selecting pictures in said first picture sequence and said second picture sequence according to said second preset number comprises:
    获取所述第一图片序列的第一图片数量;Acquiring the first picture quantity of the first picture sequence;
    若所述第二预设数量不超过所述第一图片数量,则按照所述第二预设数量在所述第一图片序列中选取所述优先处理图片;If the second preset number does not exceed the first picture quantity, selecting the priority processing picture from the first picture sequence according to the second preset number;
    若所述第二预设数量超过所述第一图片数量,则选取所述第一图片序列中的全部所述优先处理图片,并按照第二图片数量在所述第二图片序列中选取所述待处理图片,其中,所述第二图片数量为所述第二预设数量与所述第一图片数量之间的差值。If the second preset number exceeds the number of first pictures, select all the priority pictures in the first picture sequence, and select the second picture sequence according to the second number of pictures The picture to be processed, wherein the second picture quantity is the difference between the second preset quantity and the first picture quantity.
  16. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现如下步骤:A computer-readable storage medium, the computer-readable storage medium stores computer-readable instructions, characterized in that, when the computer-readable instructions are executed by a processor, the following steps are implemented:
    获取终端设备的当前剩余容量以及所述终端设备在预设时间段内的已用容量增长率,并根据所述当前剩余容量和所述已用容量增长率计算填充时长,所述填充时长指示所述当前剩余容量减少至零的时长;Obtain the current remaining capacity of the terminal device and the used capacity growth rate of the terminal device within a preset time period, and calculate the filling time based on the current remaining capacity and the used capacity growth rate, and the filling time length indicates State the length of time the current remaining capacity is reduced to zero;
    若所述填充时长小于预设的时长阈值,则获取所有相册图片,并将满足预设条件的所述相册图片归入清理组,对所述清理组内的至少两个所述相册图片按照浏览次数进行排序;If the filling duration is less than the preset duration threshold, all album pictures are acquired, and the album pictures meeting the preset conditions are classified into the cleaning group, and at least two of the album pictures in the cleaning group are browsed according to Sort by frequency;
    按照第一预设数量对排序后的至少两个所述相册图片进行选取,将选取出的所述相册图片确定为目标图片,并将所述清理组内除所述目标图片外的图片确定为待处理图片;Select at least two of the album pictures after sorting according to a first preset number, determine the selected album pictures as target pictures, and determine pictures in the cleaning group other than the target pictures as Pending picture
    分别计算所述待处理图片与每个所述目标图片之间的子相似度,并根据所有所述子相似度计算所述待处理图片的综合相似度,对小于预设的相似度阈值的所述综合相似度所对应的所述待处理图片进行清理,所述综合相似度指示所述待处理图片与所有所述目标图片之间的总体相似程度。Calculate the sub-similarity between the picture to be processed and each of the target pictures respectively, and calculate the comprehensive similarity of the picture to be processed according to all the sub-similarity, and for all the similarities less than the preset similarity threshold The picture to be processed corresponding to the comprehensive similarity is cleaned up, and the comprehensive similarity indicates the overall similarity between the picture to be processed and all the target pictures.
  17. 如权利要求16所述的计算机可读存储介质,其特征在于,所述对小于预设的相似度阈值的所述综合相似度所对应的所述待处理图片进行清理,包括:15. The computer-readable storage medium according to claim 16, wherein the cleaning the to-be-processed pictures corresponding to the comprehensive similarity that is less than a preset similarity threshold comprises:
    筛选出小于所述相似度阈值的至少两个所述综合相似度所对应的至少两个所述待处理图片;Screening out at least two pictures to be processed corresponding to at least two comprehensive similarities that are less than the similarity threshold;
    按照所述浏览次数对至少两个所述待处理图片进行排序,并按照第二预设数量对排序后的至少两个所述待处理图片进行选取;Sort at least two pictures to be processed according to the number of times of browsing, and select at least two pictures to be processed after sorting according to a second preset number;
    将选取出的所述待处理图片移动至待删除目录下,并基于所述待删除目录内的所述待处理图片输出删除提示;Move the selected picture to be processed to a directory to be deleted, and output a deletion prompt based on the picture to be processed in the to-be-deleted directory;
    若接收到关于所述删除提示的确认结果,则删除所述待删除目录下的所述待处理图片;If a confirmation result regarding the deletion prompt is received, delete the to-be-processed picture in the to-be-deleted directory;
    若接收到关于所述删除提示的否认结果,则将所述待删除目录下的所述待处理图片移动至所述待处理图片的原目录。If a denial result regarding the deletion prompt is received, the to-be-processed picture in the to-be-deleted directory is moved to the original directory of the to-be-processed picture.
  18. 如权利要求17所述的计算机可读存储介质,其特征在于,所述预设条件为所述相册图片与预设标识存在对应关系,所述按照第二预设数量对排序后的至少两个所述待处理图片进行选取之前,还包括:The computer-readable storage medium according to claim 17, wherein the preset condition is that there is a corresponding relationship between the album pictures and a preset identifier, and the at least two sorted images are sorted according to a second preset number. Before selecting the picture to be processed, it also includes:
    获取记录的已删除图片数量,并从中识别出与所述预设标识对应的图片数量,将与所述预设标识对应的图片数量与所述已删除图片数量之间的比值确定为所述清理组对应的删除占比;Obtain the number of recorded deleted pictures, identify the number of pictures corresponding to the preset identifier, and determine the ratio between the number of pictures corresponding to the preset identifier and the number of deleted pictures as the cleaning The percentage of deletions corresponding to the group;
    根据所述当前剩余容量计算出待删除容量,并根据所述删除占比和所述待删除容量计算所述预设标识对应的删除容量;Calculating the capacity to be deleted according to the current remaining capacity, and calculating the deletion capacity corresponding to the preset identifier according to the percentage of deletion and the capacity to be deleted;
    计算所述清理组内筛选出的所有所述待处理图片的平均容量,并根据所述平均容量和所述预设标识对应的删除容量计算所述第二预设数量。Calculate the average capacity of all the to-be-processed pictures selected in the cleaning group, and calculate the second preset number according to the average capacity and the deletion capacity corresponding to the preset identifier.
  19. 如权利要求17所述的计算机可读存储介质,其特征在于,所述按照所述浏览次数对至少两个所述待处理图片进行排序,并按照第二预设数量对排序后的至少两个所述待处理图片进行选取,包括:17. The computer-readable storage medium of claim 17, wherein the at least two pictures to be processed are sorted according to the number of views, and the at least two pictures are sorted according to a second preset number. The selection of the picture to be processed includes:
    将所述浏览次数为零的所述待处理图片确定为优先处理图片,对至少两个所述优先处理图片按照创建时间进行排序,并对除所述优先处理图片外的至少两个所述待处理图片按照所述浏览次数进行排序;The picture to be processed with the number of browsing times of zero is determined as a picture for priority processing, at least two pictures to be processed for priority are sorted according to the creation time, and at least two pictures to be processed except for the picture for priority processing are sorted The processed pictures are sorted according to the number of views;
    将按照所述创建时间进行排序后生成的图片序列确定为第一图片序列,将按照所述浏览次数进行排序后生成的图片序列确定为第二图片序列,并按照所述第二预设数量对所述第一图片序列和所述第二图片序列中的图片进行选取。Determine the picture sequence generated after sorting according to the creation time as the first picture sequence, determine the picture sequence generated after sorting according to the number of views as the second picture sequence, and pair according to the second preset number The pictures in the first picture sequence and the second picture sequence are selected.
  20. 如权利要求19所述的计算机可读存储介质,其特征在于,所述按照所述第二预设数量对所述第一图片序列和所述第二图片序列中的图片进行选取,包括:19. The computer-readable storage medium according to claim 19, wherein said selecting pictures in said first picture sequence and said second picture sequence according to said second preset number comprises:
    获取所述第一图片序列的第一图片数量;Acquiring the first picture quantity of the first picture sequence;
    若所述第二预设数量不超过所述第一图片数量,则按照所述第二预设数量在所述第一图片序列中选取所述优先处理图片;If the second preset number does not exceed the first picture quantity, selecting the priority processing picture from the first picture sequence according to the second preset number;
    若所述第二预设数量超过所述第一图片数量,则选取所述第一图片序列中的全部所述优先处理图片,并按照第二图片数量在所述第二图片序列中选取所述待处理图片,其中,所述第二图片数量为所述第二预设数量与所述第一图片数量之间的差值。If the second preset number exceeds the number of first pictures, select all the priority pictures in the first picture sequence, and select the second picture sequence according to the second number of pictures The picture to be processed, wherein the second picture quantity is the difference between the second preset quantity and the first picture quantity.
PCT/CN2019/122881 2019-01-16 2019-12-04 Picture cleaning method and apparatus based on data update, and terminal device WO2020147448A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910039140.2A CN109857706A (en) 2019-01-16 2019-01-16 Picture method for cleaning, device and the terminal device updated based on data
CN201910039140.2 2019-01-16

Publications (1)

Publication Number Publication Date
WO2020147448A1 true WO2020147448A1 (en) 2020-07-23

Family

ID=66894833

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/122881 WO2020147448A1 (en) 2019-01-16 2019-12-04 Picture cleaning method and apparatus based on data update, and terminal device

Country Status (2)

Country Link
CN (1) CN109857706A (en)
WO (1) WO2020147448A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109857706A (en) * 2019-01-16 2019-06-07 深圳壹账通智能科技有限公司 Picture method for cleaning, device and the terminal device updated based on data
CN112115285A (en) * 2019-06-21 2020-12-22 杭州海康威视数字技术股份有限公司 Picture cleaning method and device
CN112395447A (en) * 2020-11-27 2021-02-23 北京有竹居网络技术有限公司 Label system updating method, device and equipment based on picture and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105589926A (en) * 2015-11-27 2016-05-18 深圳市美贝壳科技有限公司 Method for clearing cache files of mobile terminal in real time
CN105868353A (en) * 2016-03-29 2016-08-17 努比亚技术有限公司 Photograph clearing method and terminal
WO2016130853A1 (en) * 2015-02-11 2016-08-18 AVG Netherlands B.V. Systems and methods for identifying unwanted photos stored on a device
CN106155592A (en) * 2016-07-26 2016-11-23 深圳天珑无线科技有限公司 A kind of photo processing method and terminal
CN107480176A (en) * 2017-07-01 2017-12-15 珠海格力电器股份有限公司 Picture management method and device and terminal equipment
CN108959505A (en) * 2018-06-27 2018-12-07 平安科技(深圳)有限公司 A kind of method and terminal device of management caching picture
CN109857706A (en) * 2019-01-16 2019-06-07 深圳壹账通智能科技有限公司 Picture method for cleaning, device and the terminal device updated based on data

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109101363B (en) * 2017-06-21 2023-09-22 中兴通讯股份有限公司 Exception recovery method and device based on Android system, intelligent equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016130853A1 (en) * 2015-02-11 2016-08-18 AVG Netherlands B.V. Systems and methods for identifying unwanted photos stored on a device
CN105589926A (en) * 2015-11-27 2016-05-18 深圳市美贝壳科技有限公司 Method for clearing cache files of mobile terminal in real time
CN105868353A (en) * 2016-03-29 2016-08-17 努比亚技术有限公司 Photograph clearing method and terminal
CN106155592A (en) * 2016-07-26 2016-11-23 深圳天珑无线科技有限公司 A kind of photo processing method and terminal
CN107480176A (en) * 2017-07-01 2017-12-15 珠海格力电器股份有限公司 Picture management method and device and terminal equipment
CN108959505A (en) * 2018-06-27 2018-12-07 平安科技(深圳)有限公司 A kind of method and terminal device of management caching picture
CN109857706A (en) * 2019-01-16 2019-06-07 深圳壹账通智能科技有限公司 Picture method for cleaning, device and the terminal device updated based on data

Also Published As

Publication number Publication date
CN109857706A (en) 2019-06-07

Similar Documents

Publication Publication Date Title
WO2020147448A1 (en) Picture cleaning method and apparatus based on data update, and terminal device
US20240236206A1 (en) Systems and methods for managing content items having multiple resolutions
WO2016101757A1 (en) Image processing method and device based on mobile device
US10275355B2 (en) Method and apparatus for cleaning files in a mobile terminal and associated mobile terminal
US11449542B2 (en) Systems and methods for identifying unwanted photos stored on a device
US8634603B2 (en) Automatic media sharing via shutter click
US20200279427A1 (en) Apparatus, method and storage medium
US20200334261A1 (en) Search ranking method and apparatus, electronic device and storage medium
US20150248465A1 (en) Method and apparatus for processing history operation records of electronic terminal, and storage medium
WO2021012790A1 (en) Page data generation method and apparatus, computer device, and storage medium
CN107622025B (en) Data transmission method and equipment
US20200279423A1 (en) Apparatus, method and medium
WO2018000643A1 (en) Method and device for sorting photographs
US20140229485A1 (en) Content control method, content control apparatus, and program
WO2019218459A1 (en) Photo storage method, storage medium, server, and apparatus
JP6068357B2 (en) Content display processing device, content display processing method, program, and integrated circuit
WO2019161645A1 (en) Shell-based data table extraction method, terminal, device, and storage medium
US20210365490A1 (en) Method for ranking and selecting events in media collections
WO2021169217A1 (en) Abstract extraction method and apparatus, device, and computer-readable storage medium
TWI769665B (en) Target data updating method, electronic equipment and computer readable storage medium
US20150006545A1 (en) System for ranking and selecting events in media collections
WO2020253369A1 (en) Method and device for generating interest tag, computer equipment and storage medium
US11120537B2 (en) Cognitive object emotional analysis based on image quality determination
JP2008090698A (en) Apparatus, method and program of image classification
CN106933702A (en) A kind of method of intelligent terminal storage space management, device and intelligent terminal

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19909797

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 03/11/2021)

122 Ep: pct application non-entry in european phase

Ref document number: 19909797

Country of ref document: EP

Kind code of ref document: A1