CN109614511A - A kind of delet method and device, electronic equipment of discarded picture - Google Patents
A kind of delet method and device, electronic equipment of discarded picture Download PDFInfo
- Publication number
- CN109614511A CN109614511A CN201811419313.5A CN201811419313A CN109614511A CN 109614511 A CN109614511 A CN 109614511A CN 201811419313 A CN201811419313 A CN 201811419313A CN 109614511 A CN109614511 A CN 109614511A
- Authority
- CN
- China
- Prior art keywords
- picture
- character string
- processed
- pictures
- item file
- Prior art date
- Legal status (The legal status 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 status listed.)
- Pending
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention relates to research and development administrative skill fields, disclose the delet method and device, electronic equipment of a kind of discarded picture.The described method includes: all pictures in scanning destination item file, determine the corresponding character string of each picture, wherein character string includes picture path and picture name;The corresponding character string of unreferenced picture is obtained from determining character string, as character string to be processed;Record the character string to be processed and using the corresponding picture of the character string to be processed as picture to be processed;Delete the picture to be processed.In research and development management process, discarded picture deletion is carried out by developing auxiliary tool, inefficiency caused by manual cleaning and the halfway traditional technology of cleaning is abandoned, fast and effeciently clears up discarded picture, and cleaning is more thorough, solves the problems, such as that the APP volume due to caused by discarded picture is larger.
Description
Technical field
The present invention relates to research and development administrative skill field, the in particular to delet methods and device, electronics of a kind of discarded picture
Equipment.
Background technique
During development of projects, with the continuous renewal iteration of Item version, for the application program of project development
(Application, abbreviation APP) will appear much discarded picture, such as unreferenced picture or duplicate picture, these
Discarded picture occupies most of volume of APP.Since the volume that these discard picture occupancy is larger, need to discard these
Picture is deleted to reduce the volume of APP.
Currently, deleting these discarded pictures in the prior art still needs to manual cleaning, method are as follows: by picture with thumbnail
Form is shown that user checks the picture of display one by one and will not need the discarded picture used deletion.Using the method into
Row deletes discarded picture, needs user to check all pictures, increases the workload of user, cleaning efficiency is low;In addition, because of people
Work cleaning is too troublesome, and discarded picture cleaning is be easy to cause to be not thorough, and leads to project residual much discarded pictures, so that developing
The APP volume come is especially big.
Summary of the invention
It is low in order to solve discarded picture cleaning efficiency present in the relevant technologies, and discarded picture is be easy to cause to clear up
It is not thorough, leads to project residual much discarded pictures, so that the king-sized problem of APP volume that developed, the present invention is provided
The delet method and device, electronic equipment of a kind of discarded picture.
First aspect of the embodiment of the present invention discloses a kind of delet method of discarded picture, which comprises
All pictures in destination item file are scanned, determine the corresponding character string of each picture, the character string
Including picture path and picture name;
The corresponding character string of unreferenced picture is obtained from determining character string, as character string to be processed;
Record the character string to be processed and using the corresponding picture of the character string to be processed as picture to be processed;
Delete the picture to be processed.
As an alternative embodiment, in first aspect of the embodiment of the present invention, in the scanning destination item text
All pictures in part, before determining the corresponding character string of each picture, the method also includes:
Detect whether to receive the scan instruction of user, the scan instruction is used to indicate the scanning destination item file
All pictures;
When receiving the scan instruction, judge whether current item file to be detected is destination item file;
If so, executing all pictures in the scanning destination item file, the corresponding word of each picture is determined
The step of symbol string;
If not, output prompt information, the prompt information is for prompting user's change current project text to be detected
Part is the destination item file;It is the destination item file when detecting that user changes the current item file to be detected
When, the step of executing all pictures in the scanning destination item file, determine each picture corresponding character string.
As an alternative embodiment, in first aspect of the embodiment of the present invention, it is described from determining character string
The corresponding character string of unreferenced picture is obtained, as character string to be processed, comprising:
The corresponding character string of the picture being cited is filtered out from determining character string;
The character string of the determination and the corresponding character string of picture being cited are compared, acquisition is described not
The corresponding character string of the picture being cited is as character string to be processed.
As an alternative embodiment, in first aspect of the embodiment of the present invention, it is described record it is described to be processed
Character string and using the corresponding picture of the character string to be processed as picture to be processed after, and wait locate described in the deletion
Before managing picture, the method also includes:
Inquiry message is exported, the inquiry message is for inquiring whether the user needs to back up the picture to be processed;
When detecting that user needs to back up the picture to be processed, the picture to be processed is backed up into preset path pair
The target position answered.
As an alternative embodiment, in first aspect of the embodiment of the present invention, it is described to be processed in the deletion
After picture, the method also includes:
Detecting in remaining character string whether there is duplicate character string;Wherein, the remaining character string is the determination
Character string of the character string in addition to the character string to be processed;
If so, display confirms pop-up and shows the corresponding picture of the duplicate character string in the confirmation pop-up,
The confirmation pop-up for ask the user whether confirmation delete in the corresponding picture of the duplicate character string except Target Photo it
Outer other pictures, the Target Photo are any in the corresponding picture of the duplicate character string;
Instruction is deleted in confirmation in response to user, delete in the corresponding picture of the duplicate character string except Target Photo it
Outer other pictures.
As an alternative embodiment, detecting the remaining character in first aspect of the embodiment of the present invention
There are after the duplicate character string in string, the method also includes:
Judge its in Target Photo picture corresponding with the duplicate character string in addition to the Target Photo
Whether the similarity of its picture is greater than preset threshold;
If so, executing the display confirmation pop-up and showing that the duplicate character string is corresponding in the confirmation pop-up
Picture the step of.
As an alternative embodiment, in first aspect of the embodiment of the present invention, the judgement Target Photo and institute
Whether the similarity for stating other pictures in the corresponding picture of duplicate character string in addition to Target Photo is greater than preset threshold, packet
It includes:
Calculate the other pictures and the target figure in the corresponding picture of the duplicate character string in addition to Target Photo
The Hamming distance of piece;
The similarity of other pictures and the Target Photo is calculated according to the Hamming distance;
Judge whether the similarity is greater than preset threshold.
Second aspect of the embodiment of the present invention discloses a kind of deletion device of discarded picture, and described device includes:
Determination unit determines the corresponding character of each picture for scanning all pictures in destination item file
String, the character string includes picture path and picture name;
Acquiring unit, for obtaining the corresponding character string of unreferenced picture from determining character string, as wait locate
Manage character string;
Recording unit, for record the character string to be processed and using the corresponding picture of the character string to be processed as to
Handle picture;
Unit is deleted, for deleting the picture to be processed.
The third aspect of the embodiment of the present invention discloses a kind of electronic equipment, and the electronic equipment includes:
Processor;
Memory is stored with computer-readable instruction on the memory, and the computer-readable instruction is by the processing
When device executes, a kind of delet method of discarded picture disclosed in first aspect of the embodiment of the present invention is realized.
Fourth aspect of the embodiment of the present invention discloses a kind of computer readable storage medium, stores computer program, institute
Stating computer program makes computer execute a kind of delet method of discarded picture disclosed in first aspect of the embodiment of the present invention.
The technical solution that the embodiment of the present invention provides can include the following benefits:
A kind of delet method of discarded picture provided by the present invention includes the following steps: to scan in destination item file
All pictures determine the corresponding character string of each picture, wherein character string includes picture path and picture name;From determining
The corresponding character string of unreferenced picture is obtained in character string, as character string to be processed;Record the character string to be processed
And using the corresponding picture of the character string to be processed as picture to be processed;Delete the picture to be processed.
Under the method, by scanning all pictures of destination item file, the corresponding character string of all pictures is obtained, then
Character string corresponding to the picture not being referred in Project Process is found out, the as discarded corresponding character string of picture, finally
Discarded picture is subjected to delete processing, abandons inefficiency caused by manual cleaning and the halfway traditional technology of cleaning, quickly
Discarded picture is effectively cleared up, and cleaning is more thorough, solves the problems, such as that the APP volume due to caused by discarded picture is larger.
It should be understood that the above general description and the following detailed description are merely exemplary, this can not be limited
Invention.
Detailed description of the invention
The drawings herein are incorporated into the specification and forms part of this specification, and shows and meets implementation of the invention
Example, and in specification together principle for explaining the present invention.
Fig. 1 is a kind of structural schematic diagram of device disclosed by the embodiments of the present invention;
Fig. 2 is a kind of flow chart of the delet method of discarded picture disclosed by the embodiments of the present invention;
Fig. 3 is the flow chart of the delet method of another discarded picture disclosed by the embodiments of the present invention;
Fig. 4 is the flow chart of the delet method of another discarded picture disclosed by the embodiments of the present invention;
Fig. 5 is a kind of structural schematic diagram of the deletion device of discarded picture disclosed by the embodiments of the present invention;
Fig. 6 is the structural schematic diagram of the deletion device of another discarded picture disclosed by the embodiments of the present invention;
Fig. 7 is the structural schematic diagram of the deletion device of another discarded picture disclosed by the embodiments of the present invention.
Specific embodiment
Here will the description is performed on the exemplary embodiment in detail, the example is illustrated in the accompanying drawings.Following description is related to
When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment
Described in embodiment do not represent all embodiments consistented with the present invention.On the contrary, they be only with it is such as appended
The example of device and method being described in detail in claims, some aspects of the invention are consistent.
Embodiment one
Implementation environment of the invention can be electronic equipment, such as smart phone, tablet computer, desktop computer.Electronics is set
Standby middle stored picture may is that the picture from the Internet download;Pass through wireless connection or the received picture of wired connection;It is logical
Cross the picture that itself institute's built-in camera is shot.
Fig. 1 is a kind of structural schematic diagram of device disclosed by the embodiments of the present invention.Device 100 can be above-mentioned electronics and set
It is standby.As shown in Figure 1, device 100 may include following one or more components: processing component 102, memory 104, power supply module
106, multimedia component 108, audio component 110, sensor module 114 and communication component 116.
The integrated operation of the usual control device 100 of processing component 102, such as with display, telephone call, data communication, phase
Machine operation and the associated operation of record operation etc..Processing component 102 may include one or more processors 118 to execute
Instruction, to complete all or part of the steps of following methods.In addition, processing component 102 may include one or more modules,
For convenient for the interaction between processing component 102 and other assemblies.For example, processing component 102 may include multi-media module, use
In to facilitate the interaction between multimedia component 108 and processing component 102.
Memory 104 is configured as storing various types of data to support the operation in device 100.These data are shown
Example includes the instruction of any application or method for operating on the device 100.Memory 104 can be by any kind of
Volatibility or non-volatile memory device or their combination are realized, such as static random access memory (Static Random
Access Memory, abbreviation SRAM), electrically erasable programmable read-only memory (Electrically Erasable
Programmable Read-Only Memory, abbreviation EEPROM), Erasable Programmable Read Only Memory EPROM (Erasable
Programmable Read Only Memory, abbreviation EPROM), programmable read only memory (Programmable Red-
Only Memory, abbreviation PROM), read-only memory (Read-Only Memory, abbreviation ROM), magnetic memory, flash
Device, disk or CD.It is also stored with one or more modules in memory 104, is configured to for the one or more module
It is executed by the one or more processors 118, to complete all or part of step in method as follows.
Power supply module 106 provides electric power for the various assemblies of device 100.Power supply module 106 may include power management system
System, one or more power supplys and other with for device 100 generate, manage, and distribute the associated component of electric power.
Multimedia component 108 includes the screen of one output interface of offer between device 100 and user.In some realities
It applies in example, screen may include liquid crystal display (Liquid Crystal Display, abbreviation LCD) and touch panel.If
Screen includes touch panel, and screen may be implemented as touch screen, to receive input signal from the user.Touch panel includes
One or more touch sensors are to sense the gesture on touch, slide, and touch panel.Touch sensor can be sensed not only
The boundary of a touch or slide action, but also detect duration and pressure relevant to touch or slide.Screen may be used also
To include display of organic electroluminescence (Organic Light Emitting Display, abbreviation OLED).
Audio component 110 is configured as output and/or input audio signal.For example, audio component 110 includes a Mike
Wind (Microphone, abbreviation MIC), when device 100 is in operation mode, such as call model, logging mode and speech recognition mould
When formula, microphone is configured as receiving external audio signal.The received audio signal can be further stored in memory
104 or via communication component 116 send.In some embodiments, audio component 110 further includes a loudspeaker, for exporting
Audio signal.
Sensor module 114 includes one or more sensors, and the state for providing various aspects for device 100 is commented
Estimate.For example, sensor module 114 can detecte the state that opens/closes of device 100, the relative positioning of component, sensor group
Part 114 can be with the position change of 100 1 components of detection device 100 or device and the temperature change of device 100.Some
In embodiment, which can also include Magnetic Sensor, pressure sensor or temperature sensor.
Communication component 116 is configured to facilitate the communication of wired or wireless way between device 100 and other equipment.Device
100 can access the wireless network based on communication standard, such as WiFi (Wireless-Fidelity, Wireless Fidelity).In the present invention
In embodiment, communication component 116 receives broadcast singal or broadcast correlation from external broadcasting management system via broadcast channel
Information.In embodiments of the present invention, communication component 116 further includes near-field communication (Near Field Communication, abbreviation
NFC) module, for promote short range communication.For example, radio frequency identification (Radio Frequency can be based in NFC module
Identification, abbreviation RFID) technology, Infrared Data Association (Infrared Data Association, abbreviation IrDA)
Technology, ultra wide band (Ultra Wideband, abbreviation UWB) technology, Bluetooth technology and other technologies are realized.
In the embodiment of the present invention, the applicable operating system (Operating System, OS) of this method may include but unlimited
In Windows operating system, Mac operating system, UNIX operating system, (SuSE) Linux OS etc., the embodiment of the present invention is not made
It limits.
In the exemplary embodiment, device 100 can be by one or more application specific integrated circuit (Application
Specific Integrated Circuit, abbreviation ASIC), it is digital signal processor, digital signal processing appts, programmable
Logical device, field programmable gate array, controller, microcontroller, microprocessor or other electronic components are realized, for executing
Following methods.
Embodiment two
Referring to Fig. 2, Fig. 2 is a kind of flow diagram of the delet method of discarded picture disclosed by the embodiments of the present invention.
As shown in Fig. 2, this method may comprise steps of:
201, all pictures in destination item file are scanned, determine the corresponding character string of each picture, the character string packet
Include picture path and picture name.
It is appreciated that in project development process many APP can be developed, and constantly update iteration to APP, herein mistake
It will appear much discarded pictures in journey, and the volume that excessive discarded picture will lead to APP is excessive, the embodiment of the present invention can have
Effect and the cleaning for rapidly carrying out these discarded pictures.Wherein, item file include at least Resources file,
APPDelegate file and Views file, wherein Resources file is mainly used for storing some moneys that APP can be used
Source, mainly picture.There can be many pictures under each item file, picture has its corresponding picture name and picture path.
As an alternative embodiment, the mode of all pictures in above-mentioned scanning destination item file specifically:
It by Shell command interpreter, sends and requests to operating system, the scanning function of call operation internal system is swept
All pictures in destination item file are retouched, and then determine the corresponding character string of each picture.Implement the optional embodiment,
Quickly all pictures in destination item file can be scanned, improve scan efficiency.
In the embodiment of the present invention, Shell command interpreter can call a large amount of internal systems by write-in Shell script
Function execute program, creation document and coordinate the operation of each program in a parallel fashion, wherein Shell script can be with
Say be number order set, the embodiment of the present invention is not construed as limiting.
In the embodiment of the present invention, the corresponding character string of the above-mentioned each picture of determination can be by base64 transcoding, by picture
It is converted to corresponding character string, wherein character string carries the information including picture name and picture path, the embodiment of the present invention
It is not construed as limiting.
202, the corresponding character string of unreferenced picture is obtained from determining character string, as character string to be processed.
Wherein, because Item version will appear new function after updating, some old functions are caused to be capped, so project is literary
Belong to the picture that the old function being capped is used in the picture of part, will not be cited use in the updated;There are also old function
Can will not be updated covering, so belong in the picture of item file the picture that the old function not being capped is used will continue to by
Reference uses, and in step 202, these unreferenced picture searchings is come out, and using its corresponding character string as wait locate
Manage character string.
203, character string to be processed is recorded and using the corresponding picture of the character string to be processed as picture to be processed.
204, picture to be processed is deleted.
As an alternative embodiment, following steps can also be performed before executing step 204:
Password window is opened, which is used to receive the password of user's input;
Receive the password of user's input;
Judge whether the password of user's input is consistent with preset password;
If so, executing step 204, picture to be processed is deleted;
If not, prompt user re-enters password.
Implement the optional embodiment, step 204 can be encrypted, improve project update safety and
Reliability.
In the above-described embodiment, password format can be numerical ciphers, or letter code, or it is close for number
Code is combined with letter code, and the embodiment of the present invention is not construed as limiting.Further, Password Length need to be arranged in advance, can be for greater than 0
Random length, it is preferred that 6 passwords can be chosen or 8 passwords, the embodiment of the present invention are not construed as limiting.
As it can be seen that implementing method described in Fig. 2, by scanning all pictures of destination item file, all pictures are obtained
Then corresponding character string finds out character string corresponding to the picture not being referred in Project Process as character to be processed
String, records character string to be processed and using the corresponding picture of the character string to be processed as picture to be processed, finally deletes to be processed
Picture.Inefficiency caused by manual cleaning and the halfway traditional technology of cleaning are abandoned, discarded picture is fast and effeciently cleared up,
And cleaning is more thorough, solves the problems, such as that the APP volume due to caused by discarded picture is larger.In addition, by deletion step
It is encrypted, the safety and reliability of project update can be improved.
Embodiment three
Referring to Fig. 3, Fig. 3 is the process signal of the delet method of another discarded picture disclosed by the embodiments of the present invention
Figure.As shown in figure 3, this method may comprise steps of:
301, detect whether to receive the scan instruction of user, which is used to indicate scanning destination item file
All pictures, if so, executing step 302;Conversely, terminating this process.
As an alternative embodiment, scan button can be set, the button is pressed as unlatching scanning target
The scan instruction of all pictures of item file, after detecting that user presses the scan button, scanning destination item file
All pictures.
As another optional embodiment, above-mentioned scan instruction can be a Shell script, by that will carry
Shell command interpreter, Shell order is written in the Shell script of the function of all pictures of starting scanning destination item file
The scanning function of interpreter call operation internal system scans all pictures in destination item file.
Implement above-mentioned optional embodiment, can quick start scanning function, to all figures in destination item file
Piece is scanned, and improves scan efficiency.
302, judge whether current item file to be detected is destination item file, if so, executing step 303;If
It is no, execute step 304-305.
303, all pictures in destination item file are scanned, determine the corresponding character string of each picture, the character string packet
Include picture path and picture name.
It should be noted that executing step 306 after executing step 303.
304, prompt information is exported, which is target item for prompting user to change current item file to be detected
Mesh file.
305, when detecting the current item file to be detected of user's change is destination item file, scanning destination item text
All pictures in part determine that the corresponding character string of each picture, the character string include picture path and picture name.
It should be noted that executing step 306 after executing step 305.
In the embodiment of the present invention, after detection receives the scan instruction of user, current project to be detected is further judged
Whether file is the destination item file for preserving the discarded picture for needing to delete in the update of this project, if current to be detected
Item file is destination item file, shows that the object of follow up scan preserves the discarded figure for needing to delete in the update of this project
Piece executes step 303, scans all pictures in destination item file, determines the corresponding character string of each picture;If current
Item file to be detected is not destination item file, shows that the object of follow up scan is not present in the update of this project and needs to delete
Discarded picture, execute step 304, output prompt information is to prompt user to change current item file to be detected as destination item
File continues to scan on all pictures in destination item file, determines the corresponding character of each picture after waiting users to change
String.
306, the corresponding character string of the picture being cited is filtered out from determining character string.
307, determining character string and the corresponding character string of the picture being cited are compared, is obtained unreferenced
The corresponding character string of picture is as character string to be processed.
In the embodiment of the present invention, after picture was cited, character string can generate a degree of variation, carry
The mark being cited can filter out the corresponding character string of the picture being cited according to mark from determining character string,
Then the character string being cited is removed from determining character string, remaining character string is that unreferenced picture is corresponding
Character string, that is, required character string to be processed.
308, character string to be processed is recorded and using the corresponding picture of the character string to be processed as picture to be processed.
309, inquiry message is exported, the inquiry message is for inquiring whether the user needs to back up picture to be processed.
310, when detecting that user needs to back up picture to be processed, it is corresponding that picture to be processed is backed up into preset path
Target position.
Illustratively, target position is present in outside the APP memory space of this project update, can be and the deletion device
The terminal device being connected, or virtual memory space, the embodiment of the present invention are not construed as limiting.
Further, target position is stored picture time to be processed and be can be set, when the resting period reaching preset duration,
Target position is formatted removing, avoids storing discarded picture for a long time and occupying big quantity space.
As an alternative embodiment, mistake can be given for change from target position when user has found to delete wrong picture
The picture of deletion.Implement the optional embodiment, can give the picture accidentally deleted for change in the case where occurring accidentally to delete, keep away
Exempt to update because deleting wrong picture and influencing project.
311, picture to be processed is deleted.
As an alternative embodiment, following steps can also be performed after executing step 311:
It in response to the importing instruction of user, opens and receives window, which is used to receive the new picture for importing;
Receive the new picture that user imports;
New picture is directed into the corresponding position of specified path.
Implement the optional embodiment, can be imported in project renewal process this project update need use it is new
Picture, convenient for reference of the new function to new picture in project renewal process.
As it can be seen that method described in implementing Fig. 3 obtains all pictures by scanning all pictures of destination item file
Then corresponding character string finds out character string corresponding to the picture not being referred in Project Process as character to be processed
String, records character string to be processed and using the corresponding picture of the character string to be processed as picture to be processed, finally deletes to be processed
Picture.Inefficiency caused by manual cleaning and the halfway traditional technology of cleaning are abandoned, discarded picture is fast and effeciently cleared up,
And cleaning is more thorough, solves the problems, such as that the APP volume due to caused by discarded picture is larger.Furthermore, it is possible to back up deleted
Picture to be processed to target position, can be given for change from target position when accidentally delete operation occurs and accidentally delete picture, avoid by
Project update is influenced in accidentally deleting picture.Furthermore, it is possible to new picture be imported in project renewal process, convenient for new function to new figure
The reference of piece.
Example IV
Referring to Fig. 4, Fig. 4 is the process signal of the delet method of another discarded picture disclosed by the embodiments of the present invention
Figure.As shown in figure 4, this method may comprise steps of:
401-411;Wherein, step 401- step 411 is identical as the step 301- step 311 in embodiment three, herein not
It repeats again.
412, detecting whether there is duplicate character string in remaining character string, which is that determining character string is removed
Character string except character string to be processed, if so, executing step 413;Conversely, terminating this process.
413, judge other pictures in Target Photo picture corresponding with duplicate character string in addition to Target Photo
Whether similarity is greater than preset threshold, if so, executing step 414;Conversely, terminating this process.
In the embodiment of the present invention, Target Photo is any in the corresponding picture of duplicate character string, and the present invention is implemented
Example is not construed as limiting.Other pictures are all pictures in the corresponding picture of duplicate character string in addition to Target Photo, other pictures
Quantity be greater than or equal to 2.
414, display confirms pop-up and shows the corresponding picture of duplicate character string, the confirmation pop-up in the confirmation pop-up
For asking the user whether that other pictures in the corresponding picture of duplicate character string in addition to Target Photo are deleted in confirmation.
415, in response to user confirmation delete instruction, delete in the corresponding picture of duplicate character string except Target Photo it
Outer other pictures.
As an alternative embodiment, step 413 judges in Target Photo picture corresponding with duplicate character string
Whether the similarity of other pictures in addition to Target Photo is greater than preset threshold, comprising:
Calculate the Hamming of the other pictures and Target Photo in the corresponding picture of duplicate character string in addition to Target Photo
Distance;
The similarity of other pictures and Target Photo is calculated according to Hamming distance;
Judge whether similarity is greater than preset threshold.
In above embodiment, mean value hash algorithm can be used and calculate the corresponding picture of all duplicate character strings
Cryptographic Hash, further according to the cryptographic Hash and target of other pictures in the corresponding picture of duplicate character string in addition to Target Photo
The cryptographic Hash of picture calculates separately out the Hamming distance of other pictures and Target Photo, indicated with Hamming distance other pictures with
The similarity of Target Photo, the embodiment of the present invention are not construed as limiting.
For example, 1011101 A, B 1011100, C 1000001, then, A is 1, A with C with the Hamming distance of B
Hamming distance be 3, Hamming distance is smaller, and similarity is bigger;Hamming distance is bigger, and similarity is smaller, so, it can be deduced that A
Similarity ratio A with B is big with the similarity of C.
Implement the optional embodiment, by calculating other pictures and mesh in duplicate picture in addition to Target Photo
It marks on a map the Hamming distance of piece, calculates similarity then according to Hamming distance, it is default further to judge whether similarity is greater than
Threshold value shows to execute step 414 there are duplicate picture if it is greater than preset threshold;If it is less than or be equal to preset threshold,
Show that there is no duplicate pictures, terminates this process.So, it can select to save a picture in duplicate picture
And other pictures are deleted, picture occupied space can be reduced, and then improve the speed of download of the corresponding application program of item file
And save the memory space of disk.
As it can be seen that implementing method described in Fig. 4, by scanning all pictures of destination item file, all pictures are obtained
Then corresponding character string finds out character string corresponding to the picture not being referred in Project Process as character to be processed
String, records character string to be processed and using the corresponding picture of the character string to be processed as picture to be processed, finally deletes to be processed
Picture.Inefficiency caused by manual cleaning and the halfway traditional technology of cleaning are abandoned, discarded picture is fast and effeciently cleared up,
And cleaning is more thorough, solves the problems, such as that the APP volume due to caused by discarded picture is larger.In addition, in duplicate picture
Selection saves a picture and simultaneously deletes other pictures, can reduce picture occupied space, and then improves that item file is corresponding to answer
With the speed of download of program and the memory space of saving disk.
Embodiment five
Referring to Fig. 5, Fig. 5 is a kind of structural schematic diagram of the deletion device of discarded picture disclosed by the embodiments of the present invention.
As shown in figure 5, the apparatus may include: determination unit 501, acquiring unit 502, recording unit 503 and deletion unit 504,
Wherein,
Determination unit 501 determines the corresponding character of each picture for scanning all pictures in destination item file
String, which includes picture path and picture name.
As an alternative embodiment, determination unit 501 is used to scan all pictures in destination item file, really
Determine the mode of the corresponding character string of each picture specifically:
It by Shell command interpreter, sends and requests to operating system, the scanning function of call operation internal system is swept
All pictures in destination item file are retouched, and then determine the corresponding character string of each picture.Implement the optional embodiment,
Quickly all pictures in destination item file can be scanned, improve scan efficiency.
In the embodiment of the present invention, determination unit 501, by write-in Shell script, can be adjusted by Shell command interpreter
Program, creation document and the operation for coordinating each program in a parallel fashion are executed with the function of a large amount of internal systems, wherein
Shell script can be described as the set of number order, and the embodiment of the present invention is not construed as limiting.
In the embodiment of the present invention, determination unit 501 determine the corresponding character string of each picture can by base64 transcoding,
Picture is converted to corresponding character string, wherein character string carries the information including picture name and picture path, the present invention
Embodiment is not construed as limiting.
Acquiring unit 502, for obtaining the corresponding word of unreferenced picture from the character string that determination unit 501 determines
Symbol string, as character string to be processed.
Recording unit 503, for recording character string to be processed and using the corresponding picture of the character string to be processed as wait locate
Manage picture.
Unit 504 is deleted, for deleting picture to be processed.
As an alternative embodiment, delete unit 504 for before deleting picture to be processed, can also be performed with
Lower step:
Password window is opened, which is used to receive the password of user's input;
Receive the password of user's input;
Judge whether the password of user's input is consistent with preset password;
If so, executing step 204, picture to be processed is deleted;
If not, prompt user re-enters password.
Implement the optional embodiment, step 204 can be encrypted, improve project update safety and
Reliability.
As it can be seen that implementing device described in Fig. 5, by scanning all pictures of destination item file, all pictures are obtained
Then corresponding character string finds out character string corresponding to the picture not being referred in Project Process as character to be processed
String, records character string to be processed and using the corresponding picture of the character string to be processed as picture to be processed, finally deletes to be processed
Picture.Inefficiency caused by manual cleaning and the halfway traditional technology of cleaning are abandoned, discarded picture is fast and effeciently cleared up,
And cleaning is more thorough, solves the problems, such as that the APP volume due to caused by discarded picture is larger.In addition, by deletion step
It is encrypted, the safety and reliability of project update can be improved.
Embodiment six
Referring to Fig. 6, Fig. 6 is the structural representation of the deletion device of another discarded picture disclosed by the embodiments of the present invention
Figure.Device shown in fig. 6 is that device as shown in Figure 5 optimizes.Compared with device shown in fig. 5, shown in Fig. 6
Device can also include: first detection unit 505, the first judging unit 506, prompt unit 507, inquiry unit 508 and
Backup units 509, wherein
First detection unit 505 determines every for scanning all pictures in destination item file in determination unit 501
Before the corresponding character string of a picture, the scan instruction for receiving user is detected whether, which is used to indicate scanning mesh
Mark all pictures of item file.
As an alternative embodiment, scan button has can be set in first detection unit 505, button work is pressed
The scan instruction that all pictures of destination item file are scanned for unlatching, when first detection unit 505 detects that user presses this
After scan button, all pictures of destination item file are scanned.
As another optional embodiment, the function of all pictures of starting scanning destination item file is carried
Shell script can be used as scan instruction write-in Shell command interpreter, when first detection unit 505 detects that the scanning refers to
When enabling, the scanning function of Shell command interpreter call operation internal system scans all pictures in destination item file.
Implement above-mentioned optional embodiment, can quick start scanning function, to all figures in destination item file
Piece is scanned, and improves scan efficiency.
First judging unit 506, for judging when the detection of first detection unit 505 receives the scan instruction of user
Whether current item file to be detected is destination item file.
Determination unit 501 is also used to judge current item file to be detected as destination item text when the first judging unit 506
When part, all pictures in destination item file are scanned, determine the corresponding character string of each picture.
It should be noted that being used to judge current item file to be detected when the first judging unit 506 in determination unit 501
When for destination item file, all pictures in destination item file are scanned, after determining the corresponding character string of each picture, touching
Hair screening subelement 5021 starts.
Prompt unit 507, for judging that current item file to be detected is not destination item text when the first judging unit 506
When part, prompt information is exported, which is destination item file for prompting user to change current item file to be detected.
Determination unit 501 is also used to when detecting the current item file to be detected of user's change is destination item file,
All pictures in destination item file are scanned, determine the corresponding character string of each picture.
It should be noted that being used to judge current item file to be detected when the first judging unit 506 in determination unit 501
When not being destination item file, prompt unit 507 exports prompt information and determination unit 501 detects that user's change is current
Item file to be detected is destination item file, scans all pictures in destination item file, determines that each picture is corresponding
After character string, triggering screening subelement 5021 starts.
Acquiring unit 502 includes:
Subelement 5021 is screened, for filtering out the picture pair being cited from the character string that determination unit 501 determines
The character string answered.
Subelement 5022 is obtained, the picture being cited for screening the character string determined and screening subelement 5021
Corresponding character string compares, and obtains the corresponding character string of unreferenced picture as character string to be processed.
Inquiry unit 508, for recording unit 503 record character string to be processed and by the character string to be processed it is corresponding
After picture is as picture to be processed, and before deleting unit 504 and deleting picture to be processed, export inquiry message, the inquiry
Ask information for inquiring whether the user needs to back up picture to be processed.
Backup units 509, for picture to be processed being backed up to pre- when detecting that user needs to back up picture to be processed
If the corresponding target position in path.
In the embodiment of the present invention, picture to be processed is backed up to the corresponding target position of preset path, mesh by backup units 509
The time that cursor position stores picture to be processed can be set, and when the resting period reaching preset duration, target position is carried out lattice
Formulaization is removed, and avoids storing discarded picture for a long time and occupying big quantity space.Further, when picture to be processed is stored in target position
Between can be set, when the resting period reaching preset duration, target position is formatted removing, avoids storing for a long time discarded
Picture and occupy big quantity space.
As an alternative embodiment, backup units 509 can be from target position when user has found to delete wrong picture
Give the picture accidentally deleted in setting for change.Implement the optional embodiment, can give for change and accidentally delete in the case where occurring accidentally to delete
Picture, avoid updating because deleting wrong picture and influencing project.
As an alternative embodiment, delete unit 504 for after deleting picture to be processed, can also be performed with
Lower step:
It in response to the importing instruction of user, opens and receives window, which is used to receive the new picture for importing;
Receive the new picture that user imports;
New picture is directed into the corresponding position of specified path.
Implement the optional embodiment, can be imported in project renewal process this project update need use it is new
Picture, convenient for reference of the new function to new picture in project renewal process.
As it can be seen that implementing device described in Fig. 6, by scanning all pictures of destination item file, all pictures are obtained
Then corresponding character string finds out character string corresponding to the picture not being referred in Project Process as character to be processed
String, records character string to be processed and using the corresponding picture of the character string to be processed as picture to be processed, finally deletes to be processed
Picture.Inefficiency caused by manual cleaning and the halfway traditional technology of cleaning are abandoned, discarded picture is fast and effeciently cleared up,
And cleaning is more thorough, solves the problems, such as that the APP volume due to caused by discarded picture is larger.Furthermore, it is possible to back up deleted
Picture to be processed to target position, can be given for change from target position when accidentally delete operation occurs and accidentally delete picture, avoid by
Project update is influenced in accidentally deleting picture.Furthermore, it is possible to new picture be imported in project renewal process, convenient for new function to new figure
The reference of piece.
Embodiment seven
Referring to Fig. 7, Fig. 7 is the structural representation of the deletion device of another discarded picture disclosed by the embodiments of the present invention
Figure.Device shown in Fig. 7 is that device as shown in Figure 6 optimizes.Compared with device shown in fig. 6, shown in Fig. 7
Device can also include: second detection unit 510, display unit 511 and second judgment unit 512, wherein
Second detection unit 510, for detecting in remaining character string after deleting unit 504 and deleting picture to be processed
With the presence or absence of duplicate character string, which is character string of the determining character string in addition to character string to be processed.
Second judgment unit 512, for detecting that there are duplicate characters in remaining character string in second detection unit 510
After string, the similarity of other pictures in Target Photo picture corresponding with duplicate character string in addition to Target Photo is judged
Whether preset threshold is greater than.
In the embodiment of the present invention, Target Photo is any in the corresponding picture of duplicate character string, and the present invention is implemented
Example is not construed as limiting.Other pictures are all pictures in the corresponding picture of duplicate character string in addition to Target Photo, other pictures
Quantity be greater than or equal to 2.
Display unit 511, for judging Target Photo picture corresponding with duplicate character string when second judgment unit 512
In the similarity of other pictures in addition to Target Photo when being greater than preset threshold, display confirmation pop-up and in the confirmation pop-up
Show the corresponding picture of duplicate character string.
It should be noted that showing confirmation pop-up in display unit 511 and showing duplicate character in the confirmation pop-up
It goes here and there after corresponding picture, triggering is deleted unit 504 and started.
Unit 504 is deleted, is also used to delete instruction in response to the confirmation of user, deletes the corresponding picture of duplicate character string
In other pictures in addition to Target Photo.
As an alternative embodiment, second judgment unit 512 includes:
First computation subunit 5121, for calculating its in the corresponding picture of duplicate character string in addition to Target Photo
The Hamming distance of its picture and Target Photo.
Second computation subunit 5122, for calculating the similarity of other pictures and Target Photo according to Hamming distance.
Judgment sub-unit 5123, for judging whether similarity is greater than preset threshold.
In above embodiment, the first computation subunit 5121 can be used mean value hash algorithm calculate it is all duplicate
The cryptographic Hash of the corresponding picture of character string, further according to other figures in the corresponding picture of duplicate character string in addition to Target Photo
The cryptographic Hash of piece and the cryptographic Hash of Target Photo calculate separately out the Hamming distance of other pictures and Target Photo, use Hamming distance
From come the similarity that indicates other pictures and Target Photo, the embodiment of the present invention is not construed as limiting.
For example, 1011101 A, B 1011100, C 1000001, then, A is 1, A with C with the Hamming distance of B
Hamming distance be 3, Hamming distance is smaller, and similarity is bigger;Hamming distance is bigger, and similarity is smaller, so, it can be deduced that A
Similarity ratio A with B is big with the similarity of C.
Implement the optional embodiment, by calculating other pictures and mesh in duplicate picture in addition to Target Photo
It marks on a map the Hamming distance of piece, calculates similarity then according to Hamming distance, it is default further to judge whether similarity is greater than
Threshold value shows to trigger display unit 511 there are duplicate picture and start if it is greater than preset threshold;If it is less than or equal in advance
If threshold value, shows that there is no duplicate pictures, terminate this process.So, it can select to save one in duplicate picture
Picture simultaneously deletes other pictures, can reduce picture occupied space, and then improves under the corresponding application program of item file
It carries speed and saves the memory space of disk.
As it can be seen that implementing device described in Fig. 7, by scanning all pictures of destination item file, all pictures are obtained
Then corresponding character string finds out character string corresponding to the picture not being referred in Project Process as character to be processed
String, records character string to be processed and using the corresponding picture of the character string to be processed as picture to be processed, finally deletes to be processed
Picture.Inefficiency caused by manual cleaning and the halfway traditional technology of cleaning are abandoned, discarded picture is fast and effeciently cleared up,
And cleaning is more thorough, solves the problems, such as that the APP volume due to caused by discarded picture is larger.In addition, in duplicate picture
Selection saves a picture and simultaneously deletes other pictures, can reduce picture occupied space, and then improves that item file is corresponding to answer
With the speed of download of program and the memory space of saving disk.
The present invention also provides a kind of electronic equipment, which includes:
Processor;
Memory is stored with computer-readable instruction on the memory, when which is executed by processor,
Realize a kind of delet method of discarded picture as previously shown.
The electronic equipment can be Fig. 1 shown device 100.
In one exemplary embodiment, the present invention also provides a kind of computer readable storage mediums, are stored thereon with calculating
Machine program when the computer program is executed by processor, realizes a kind of delet method of discarded picture as previously shown.
It should be understood that the present invention is not limited to the precise structure already described above and shown in the accompanying drawings, and
And various modifications and change can executed without departing from the scope.The scope of the present invention is limited only by the attached claims.
Claims (10)
1. a kind of delet method of discarded picture, which is characterized in that the described method includes:
All pictures in destination item file are scanned, determine that the corresponding character string of each picture, the character string include
Picture path and picture name;
The corresponding character string of unreferenced picture is obtained from determining character string, as character string to be processed;
Record the character string to be processed and using the corresponding picture of the character string to be processed as picture to be processed;
Delete the picture to be processed.
2. the method according to claim 1, wherein it is described scanning destination item file in all pictures,
Before determining the corresponding character string of each picture, the method also includes:
Detect whether to receive the scan instruction of user, the scan instruction is used to indicate the institute for scanning the destination item file
There is picture;
When receiving the scan instruction, judge whether current item file to be detected is destination item file;
If so, executing all pictures in the scanning destination item file, the corresponding character string of each picture is determined
The step of;
If not, output prompt information, the prompt information are for prompting user's change current item file to be detected
The destination item file;When detecting user's change current item file to be detected is the destination item file,
The step of executing all pictures in the scanning destination item file, determining each picture corresponding character string.
3. method according to claim 1 or 2, which is characterized in that it is described obtained from determining character string it is unreferenced
The corresponding character string of picture, as character string to be processed, comprising:
The corresponding character string of the picture being cited is filtered out from determining character string;
The character string of the determination and the corresponding character string of picture being cited are compared, acquisition is described not to be drawn
The corresponding character string of the picture used is as character string to be processed.
4. method according to claim 1 or 2, which is characterized in that record the character string to be processed and by institute described
After the corresponding picture of character string to be processed is stated as picture to be processed, and before the deletion picture to be processed,
The method also includes:
Inquiry message is exported, the inquiry message is for inquiring whether the user needs to back up the picture to be processed;
When detecting that user needs to back up the picture to be processed, it is corresponding that the picture to be processed is backed up into preset path
Target position.
5. method according to claim 1 or 2, which is characterized in that described after the deletion picture to be processed
Method further include:
Detecting in remaining character string whether there is duplicate character string;Wherein, the remaining character string is the character of the determination
The character string gone here and there in addition to the character string to be processed;
If so, display confirms pop-up and shows the corresponding picture of the duplicate character string in the confirmation pop-up, it is described
Confirmation pop-up is for asking the user whether that confirmation is deleted in the corresponding picture of the duplicate character string in addition to Target Photo
Other pictures, the Target Photo are any in the corresponding picture of the duplicate character string;
Instruction is deleted in confirmation in response to user, is deleted in the corresponding picture of the duplicate character string in addition to Target Photo
Other pictures.
6. according to the method described in claim 5, it is characterized in that, there are the repetitions in detecting the remaining character string
Character string after, the method also includes:
Judge other figures in Target Photo picture corresponding with the duplicate character string in addition to the Target Photo
Whether the similarity of piece is greater than preset threshold;
If so, executing the display confirmation pop-up and showing the corresponding figure of the duplicate character string in the confirmation pop-up
The step of piece.
7. according to the method described in claim 6, it is characterized in that, the judgement Target Photo and the duplicate character string pair
Whether the similarity of other pictures in the picture answered in addition to Target Photo is greater than preset threshold, comprising:
Calculate the other pictures and the Target Photo in the corresponding picture of the duplicate character string in addition to Target Photo
Hamming distance;
The similarity of other pictures and the Target Photo is calculated according to the Hamming distance;
Judge whether the similarity is greater than preset threshold.
8. a kind of deletion device of discarded picture, which is characterized in that described device includes:
Determination unit determines the corresponding character string of each picture, institute for scanning all pictures in destination item file
Stating character string includes picture path and picture name;
Acquiring unit, for obtaining the corresponding character string of unreferenced picture from determining character string, as word to be processed
Symbol string;
Recording unit, for recording the character string to be processed and using the corresponding picture of the character string to be processed as to be processed
Picture;
Unit is deleted, for deleting the picture to be processed.
9. a kind of electronic equipment, including memory and processor, the memory are stored with computer program, which is characterized in that
The processor realizes the deletion side of discarded picture according to any one of claims 1 to 7 when executing the computer program
The step of method.
10. a kind of computer readable storage medium, which is characterized in that it stores computer program, and the computer program makes
Computer perform claim requires the delet method of 1~7 described in any item discarded pictures.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811419313.5A CN109614511A (en) | 2018-11-26 | 2018-11-26 | A kind of delet method and device, electronic equipment of discarded picture |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811419313.5A CN109614511A (en) | 2018-11-26 | 2018-11-26 | A kind of delet method and device, electronic equipment of discarded picture |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109614511A true CN109614511A (en) | 2019-04-12 |
Family
ID=66005152
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811419313.5A Pending CN109614511A (en) | 2018-11-26 | 2018-11-26 | A kind of delet method and device, electronic equipment of discarded picture |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109614511A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110099170A (en) * | 2019-04-26 | 2019-08-06 | 维沃移动通信有限公司 | Image deletion method and mobile terminal |
CN110489576A (en) * | 2019-07-18 | 2019-11-22 | 五八有限公司 | Picture resource processing method and system, client, server, processor and medium |
CN113110804A (en) * | 2021-04-30 | 2021-07-13 | 平安普惠企业管理有限公司 | Duplicate picture deleting method, device, equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104809198A (en) * | 2015-04-23 | 2015-07-29 | 北京奇虎科技有限公司 | Picture cleanup method, picture cleanup device and terminal device |
CN104881496A (en) * | 2015-06-15 | 2015-09-02 | 北京金山安全软件有限公司 | File name identification and file cleaning method and device |
CN105760458A (en) * | 2016-02-04 | 2016-07-13 | 广东欧珀移动通信有限公司 | Picture processing method and electronic equipment |
CN106599151A (en) * | 2016-12-07 | 2017-04-26 | Tcl集团股份有限公司 | Method and system for parallel cleaning of Android engineering useless resources |
-
2018
- 2018-11-26 CN CN201811419313.5A patent/CN109614511A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104809198A (en) * | 2015-04-23 | 2015-07-29 | 北京奇虎科技有限公司 | Picture cleanup method, picture cleanup device and terminal device |
CN104881496A (en) * | 2015-06-15 | 2015-09-02 | 北京金山安全软件有限公司 | File name identification and file cleaning method and device |
CN105760458A (en) * | 2016-02-04 | 2016-07-13 | 广东欧珀移动通信有限公司 | Picture processing method and electronic equipment |
CN106599151A (en) * | 2016-12-07 | 2017-04-26 | Tcl集团股份有限公司 | Method and system for parallel cleaning of Android engineering useless resources |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110099170A (en) * | 2019-04-26 | 2019-08-06 | 维沃移动通信有限公司 | Image deletion method and mobile terminal |
CN110099170B (en) * | 2019-04-26 | 2021-01-08 | 维沃移动通信有限公司 | Picture deleting method and mobile terminal |
CN110489576A (en) * | 2019-07-18 | 2019-11-22 | 五八有限公司 | Picture resource processing method and system, client, server, processor and medium |
CN110489576B (en) * | 2019-07-18 | 2022-07-08 | 五八有限公司 | Picture resource processing method and system, client, server, processor and medium |
CN113110804A (en) * | 2021-04-30 | 2021-07-13 | 平安普惠企业管理有限公司 | Duplicate picture deleting method, device, equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104992091B (en) | Access the method, apparatus and storage medium of terminal | |
WO2018010512A1 (en) | Method and device for uploading phtograph file | |
KR102266810B1 (en) | Authentication methods and electronic devices | |
CN109583356B (en) | Fingerprint identification method and related product | |
CN105845124A (en) | Audio processing method and device | |
CN110515533B (en) | Electronic equipment shortcut operation method and device, electronic equipment and storage medium | |
CN107784089B (en) | Multimedia data storage method, processing method and mobile terminal | |
CN109614511A (en) | A kind of delet method and device, electronic equipment of discarded picture | |
US20170242832A1 (en) | Character editing method and device for screen display device | |
CN105407098A (en) | Identity verification method and device | |
CN105335062B (en) | Information editing's operation processing method and device | |
CN105608462A (en) | Character similarity judgment method and device | |
CN110347548A (en) | A kind of method for detecting abnormality and device, storage medium, electronic equipment | |
CN106844104B (en) | A kind of terminal data processing method, device and mobile terminal | |
CN108052819A (en) | A kind of face identification method, mobile terminal and computer readable storage medium | |
CN104318185A (en) | Application control method, application control equipment and mobile terminal | |
CN107169060A (en) | Image processing method, device and terminal in terminal | |
CN106845199A (en) | Object authentication method and device | |
CN112287317B (en) | User information input method and electronic equipment | |
CN107239771A (en) | Fingerprint calibration method and device | |
CN108989554B (en) | Information processing method and terminal | |
WO2023030116A1 (en) | Display method and apparatus | |
CN106774977A (en) | Punctuation mark automatic matching method, device and terminal device | |
CN105446521B (en) | Touch control operation setting method and device | |
CN106778125A (en) | unlocking method, device and equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190412 |