CN109522282A - Picture management method, device, computer installation and storage medium - Google Patents
Picture management method, device, computer installation and storage medium Download PDFInfo
- Publication number
- CN109522282A CN109522282A CN201811151261.8A CN201811151261A CN109522282A CN 109522282 A CN109522282 A CN 109522282A CN 201811151261 A CN201811151261 A CN 201811151261A CN 109522282 A CN109522282 A CN 109522282A
- Authority
- CN
- China
- Prior art keywords
- picture
- saved
- source code
- module
- code
- 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.)
- Granted
Links
- 238000007726 management method Methods 0.000 title claims abstract description 89
- 238000009434 installation Methods 0.000 title claims abstract description 18
- 238000000034 method Methods 0.000 claims abstract description 38
- 238000012217 deletion Methods 0.000 claims description 18
- 230000037430 deletion Effects 0.000 claims description 18
- 230000004048 modification Effects 0.000 claims description 14
- 238000012986 modification Methods 0.000 claims description 14
- 238000004321 preservation Methods 0.000 abstract description 19
- 230000008569 process Effects 0.000 abstract description 7
- 230000006870 function Effects 0.000 description 12
- 238000011161 development Methods 0.000 description 8
- 238000012545 processing Methods 0.000 description 8
- 230000006835 compression Effects 0.000 description 6
- 238000007906 compression Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 230000008859 change Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000009467 reduction Effects 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 239000006185 dispersion Substances 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
- 238000012806 monitoring device Methods 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 238000000926 separation method Methods 0.000 description 1
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention provides a kind of picture management method, comprising: scanning source code obtains the picture of the source code reference, obtains picture to be saved;Obtain the module title of the source code said code module;Under the picture to be saved is saved to pictures management catalogue in Target Photo file corresponding with the module title.The invention also discloses a kind of pictures management device, computer installation and computer readable storage mediums.Picture used in software development process is carried out classification preservation by the present invention, is conducive to the speed for improving picture searching.
Description
Technical field
The present invention relates to field of computer technology more particularly to a kind of picture management method, device, computer installation and deposit
Storage media.
Background technique
Currently, usually carrying out co-development by more people when carrying out software development, in co-development, everyone can be incited somebody to action
The picture for needing to use is placed in a file, or by the arbitrarily storage of respectively habit.However it is this so that development process
The picture dispersion confusion of middle preservation, not manageability, when needing to search certain pictures, it may be necessary to when expending longer
Between can just get required picture.
Summary of the invention
In view of the foregoing, it is necessary to which a kind of picture management method, device, computer installation and storage medium, energy are provided
It is enough that picture is subjected to classification preservation, be conducive to the speed for improving picture searching.
The present invention provides a kind of picture management method, which comprises
Source code is scanned, the picture of the source code reference is obtained, obtains picture to be saved;
Obtain the module title of the source code said code module;
Target Photo file corresponding with the module title under the picture to be saved is saved to pictures management catalogue
In folder.
In the optional implementation of the present invention, it is described the picture to be saved is saved to pictures management catalogue under with the module
In the corresponding Target Photo file of title, comprising:
Whether the size for judging the picture to be saved is more than default size;
If the size of the picture to be saved is more than default size, the picture to be saved is compressed;
Target corresponding with the module title under the compressed picture to be saved is saved to pictures management catalogue
In Photo folder.
In alternative embodiment of the present invention, the method also includes:
If detecting there is modification in the source code, judge in the source code with the presence or absence of newly-increased reference picture;
If there is newly-increased reference picture in the source code, saved there is newly-increased reference picture in the source code
To in the destination folder.
In the optional implementation of the present invention, the method also includes:
Judge whether there is reference picture deletion event;
Picture deletion event is quoted if it exists, obtains the reference picture deleted from the source code;
It will be removed from the destination folder from the reference picture deleted in the source code.
In the optional implementation of the present invention, the method also includes:
If detecting there is modification in the source code, judge in the source code with the presence or absence of the reference picture updated;
Reference figure if there is the reference picture updated in the source code, before obtaining updated reference picture and updating
Piece;
The updated reference picture is saved into the destination folder, by the reference picture before the update from
It is deleted in the destination folder.
In alternative embodiment of the present invention, it is described the picture to be saved is saved to pictures management catalogue under with the mould
Before in the corresponding Target Photo file of block title, the method also includes:
Judge whether other code modules other than the source code said code module quote the picture to be saved;
If so, saving the picture to be saved into the public Photo folder under the pictures management catalogue.
In alternative embodiment of the present invention, it is described the picture to be saved is saved to pictures management catalogue under with the mould
In the corresponding Target Photo file of block title, comprising:
Judge under the pictures management catalogue with the presence or absence of Target Photo file corresponding with the module title;
If Target Photo file corresponding with the module title is not present under the pictures management catalogue, in the figure
Target Photo file corresponding with the module title is created under piece administrative directory, and the picture to be saved is saved to described
In destination folder;
If there is Target Photo file corresponding with the module title under the pictures management catalogue, by described wait protect
Picture is deposited to save into the destination folder.
The present invention provides also a kind of pictures management device, and described device includes:
First obtains module, for scanning source code, obtains the picture of the source code reference, obtains picture to be saved;
Second obtains module, for obtaining the module title of the source code said code module;
Preserving module, for corresponding with the module title under saving the picture to be saved to pictures management catalogue
In Target Photo file.
In alternative embodiment of the present invention, the preserving module saves the picture to be saved to pictures management catalogue
Include: in Target Photo file corresponding with the module title
Whether the size for judging the picture to be saved is more than default size;
If the size of the picture to be saved is more than default size, the picture to be saved is compressed;
Target corresponding with the module title under the compressed picture to be saved is saved to pictures management catalogue
In Photo folder.
In alternative embodiment of the present invention, the preserving module is also used to:
If detecting there is modification in the source code, judge in the source code with the presence or absence of newly-increased reference picture;
If there is newly-increased reference picture in the source code, saved there is newly-increased reference picture in the source code
To in the destination folder.
In alternative embodiment of the present invention, described device module further includes removing module, and the removing module is used for:
Judge whether there is reference picture deletion event;
Picture deletion event is quoted if it exists, obtains the reference picture deleted from the source code;
It will be removed from the destination folder from the reference picture deleted in the source code.
In alternative embodiment of the present invention, described device further includes update module, and the update module is used for:
If detecting there is modification in the source code, judge in the source code with the presence or absence of the reference picture updated;
Reference figure if there is the reference picture updated in the source code, before obtaining updated reference picture and updating
Piece;
The updated reference picture is saved into the destination folder, by the reference picture before the update from
It is deleted in the destination folder.
In alternative embodiment of the present invention, the preserving module is also used to:
Target Photo file corresponding with the module title under the picture to be saved is saved to pictures management catalogue
Before in folder, judge whether other code modules other than the source code said code module quote the picture to be saved;
Other code modules other than the source code said code module quote the picture to be saved if it exists, by institute
Picture to be saved is stated to save into the public Photo folder under the pictures management catalogue.
In alternative embodiment of the present invention, the preserving module saves the picture to be saved to pictures management catalogue
It is also used in Target Photo file corresponding with the module title:
Judge under the pictures management catalogue with the presence or absence of Target Photo file corresponding with the module title;
If Target Photo file corresponding with the module title is not present under the pictures management catalogue, in the figure
Target Photo file corresponding with the module title is created under piece administrative directory, and the picture to be saved is saved to described
In destination folder;
If there is Target Photo file corresponding with the module title under the pictures management catalogue, by described wait protect
Picture is deposited to save into the destination folder.
The present invention also provides a kind of computer installation, the computer installation includes memory and processor, the storage
Device is for storing at least one instruction, and the processor is for executing at least one described instruction to realize institute in any embodiment
The picture management method stated.
The present invention also provides a kind of computer readable storage mediums, which is characterized in that the computer readable storage medium
It is stored at least one instruction, at least one described instruction realizes picture pipe described in any embodiment when being executed by processor
Reason method.
Found out by above technical scheme, the present invention is obtained the picture of the source code reference, obtained by scanning source code
Picture to be saved;Obtain the module title of the source code said code module;The picture to be saved is saved to picture pipe
It manages under catalogue in Target Photo file corresponding with the module title.Therefore, by the invention it is possible to by making in source code
The picture used is saved in different files by module, realizes the purpose for carrying out picture to sort out preservation, but also
It when searching picture, can be searched with sub-module, due to reducing the range of picture searching, therefore can faster be found
Required picture.Meanwhile through the invention, it is saved manually without user, without user's manual classification, so that it may will be in source code
Using to picture saved, improve picture preservation efficiency.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
The embodiment of invention for those of ordinary skill in the art without creative efforts, can also basis
The attached drawing of offer obtains other attached drawings.
Fig. 1 is a kind of flow chart of picture management method provided in an embodiment of the present invention;
Fig. 2 is the functional block diagram of pictures management device provided in an embodiment of the present invention;
Fig. 3 is the structural schematic diagram of the computer installation for the preferred embodiment that the present invention realizes picture management method.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
In order to make the foregoing objectives, features and advantages of the present invention clearer and more comprehensible, with reference to the accompanying drawing and specific real
Applying mode, the present invention is described in further detail.
As shown in FIG. 1, FIG. 1 is a kind of flow charts of picture management method provided in an embodiment of the present invention.According to different
Demand, the sequence of step can change in the flow chart, and certain steps can be omitted.
S11 scans source code, obtains the picture of the source code reference, obtains picture to be saved.
Picture management method described in this programme is used for during code development, is carried out to the picture used in code
Automatic classification saves.
Above-mentioned source code is the program in machine code that developer is write in R & D of complex.
The picture of above-mentioned source code reference, the as picture used in source code.Specifically, available source code
Used in picture title and picture used in source code address, then the figure of the source code reference got
Piece is picture to be saved.
When it is implemented, picture used in source code can be obtained by keyword lookup.For example, when finding
When image_name, the picture for being assigned a value of quoting in source code to the image_name is determined.
Alternatively, can also be by the address of keyword (such as url) and keyword reference in scanning source code, to obtain source
The title of picture used in code and the address of the picture.
In other embodiments of the present invention, the quantity for the picture quoted in the source code can also be obtained.Acquisition source generation
The quantity for the picture quoted in code, so that can synchronize carry out quantity statistics when being saved to picture, be conducive to picture
It is rapidly proofreaded after carrying out classification preservation by the quantity statistics.
S12: the module title of the source code said code module is obtained.
In general, meeting sub-module is developed in software development process.For example, different developers develop it is different
Functional module, each specific function of Implement of Function Module.
Therefore, source code can be in one or more snippets code for developing some module.
When it is implemented, can be obtained by the engineering name of catalogue or the affiliated engineering of source code where source code
The module title of source code said code module.
S13: Target Photo corresponding with the module title under the picture to be saved is saved to pictures management catalogue
In file.
Wherein, above-mentioned pictures management catalogue is for the unified storage address for carrying out picture preservation.Specifically, pictures management
Catalogue can be preset.For example, pictures management catalogue be " E: ", alternatively, pictures management catalogue is " E: pic ".
Meanwhile Target Photo file corresponding with module title can be folder name there are corresponding with module title
The file of relationship can be preset specific corresponding to relationship.For example, Target Photo file corresponding with module title
Folder, is folder name file identical with module title.
For example, pictures management catalogue be " E: ", include four files under pictures management catalogue, four files
Title is respectively: login, shopping, logout, searching, if scanning the picture cited into source code is picture
A, and the name of code of source code said code module is login, then saves picture A to the login under pictures management catalogue
In file.
Specifically, the S13 is corresponding with the module title under saving the picture to be saved to pictures management catalogue
Target Photo file in, it may include:
Judge under the pictures management catalogue with the presence or absence of Target Photo file corresponding with the module title;
If Target Photo file corresponding with the module title is not present under the pictures management catalogue, in the figure
Target Photo file corresponding with the module title is created under piece administrative directory, and the picture to be saved is saved to described
In destination folder;
If there is Target Photo file corresponding with the module title under the pictures management catalogue, by described wait protect
Picture is deposited to save into the destination folder.
In the specific implementation, Target Photo file corresponding with module title can first be judged whether there is, and if it exists,
Then directly picture to be saved is saved, if it does not exist, can first create the file for storing picture to be saved, then
Picture to be saved is saved again.
Meanwhile when carrying out picture preservation, the picture to be saved can be downloaded according to the reference address of picture to be saved, so
The preservation picture is saved into destination folder afterwards.
Therefore, in the process of development, picture is saved manually without developer, the work of developer can be improved
The problem of making efficiency, also avoid each developer and arbitrarily add, leading to picture confusion bad management.
Optionally, in other embodiments of the present invention, the S13 saves the picture to be saved to pictures management catalogue
In lower Target Photo file corresponding with the module title, can also include:
Whether the size for judging the picture to be saved is more than default size;
If the size of the picture to be saved is more than default size, the picture to be saved is compressed;
Target corresponding with the module title under the compressed picture to be saved is saved to pictures management catalogue
In Photo folder.
The occurrence of above-mentioned default size can be preset.For example, the value of default size is 5M.
Whether the above-mentioned size for judging picture to be saved is more than default size for judging whether picture to be saved is excessive.
If the size of picture to be saved is more than default size, picture is compressed, specific picture compression method can
To choose from existing picture compression method, details are not described herein again.
In the present embodiment, first the size of picture to be saved is judged, when the big size of picture is more than default size
When, picture to be saved save again after compression processing, the space of picture storage can be saved, to save more figures
Piece.
Optionally, in other embodiments of the present invention, the method also includes:
If detecting there is modification in the source code, judge in the source code with the presence or absence of newly-increased reference picture;
If there is newly-increased reference picture in the source code, saved there is newly-increased reference picture in the source code
To in the destination folder.
Change if it exists when it is implemented, the quantity for quoting picture in source code can be scanned with the presence or absence of variation, and number
It is increased for measuring, can be by the picture name quoted in the source code before modification (or picture reference address) and modified source
The picture name (or picture reference address) quoted in code compares, to determine newly-increased reference picture.
In the present embodiment, it is possible to when picture used in source code is increased newly, directly by newly-increased reference picture
It is added.
Optionally, in other embodiments of the present invention, the method also includes:
Judge whether there is reference picture deletion event;
Picture deletion event is quoted if it exists, obtains the reference picture deleted from the source code;
It will be removed from the destination folder from the reference picture deleted in the source code.
Wherein, above-mentioned reference picture deletion event is the event that picture is deleted from code.It can be by source code
Operation note carries out being analyzed to determine whether to exist reference picture deletion event.
When there is reference picture deletion event, the reference that delete from source code can be obtained according to picture deletion event
Picture, and then will be removed from destination folder from the reference picture deleted in source code.
Through this embodiment, when the picture that can be quoted in source code is reduced, directly by the picture of reduction from original
Memory space is removed, and former memory space is avoided picture redundancy occur.
Optionally, in other embodiments of the present invention, the method also includes:
If detecting there is modification in the source code, judge in the source code with the presence or absence of the reference picture updated;
Reference figure if there is the reference picture updated in the source code, before obtaining updated reference picture and updating
Piece;
The updated reference picture is saved into the destination folder, by the reference picture before the update from
It is deleted in the destination folder.
Specifically, quoting picture if it exists before source code modification is a certain picture in source code, modified in source code
After become another picture, then can determine the reference picture be update reference picture.
When it is implemented, can be come the picture for judging the reference by the reference address of picture cited in source code
It is no to update.For example, there is variation in the reference address of picture login_a, it is determined that picture login_a is deposited in source code
It is updated in picture.
When there is the reference picture updated in source code, updated reference picture is saved into destination folder,
Reference picture before update is deleted from destination folder, can be to avoid picture redundancy in destination folder, and can make
It is consistent with picture used in source code always to obtain the picture saved in destination folder.
Optionally, in other embodiments of the present invention, described to save the picture to be saved to pictures management catalogue
Before in Target Photo file corresponding with the module title, the method also includes:
Judge whether other code modules other than the source code said code module quote the picture to be saved;
If so, saving the picture to be saved into the public Photo folder under the pictures management catalogue.
Wherein above-mentioned public Photo folder is the picture all used for saving at least two modules.
Specifically, public Photo folder can be the file being pre-created, it is also possible to detecting the presence of at least
When two modules all use picture to be saved, the file that is created under pictures management catalogue.
In the specific implementation, the method method of the present invention can be used to several source codes through the invention
It carries out picture and sorts out preservation, then it, at this time through this embodiment, will there may be same picture is all quoted in multiple modules
The picture that multiple modules are all quoted is saved into public Photo folder, can save memory space to avoid picture redundancy.And
And when needing to modify to picture, after modifying to the picture, in the code module of all references picture
In, all quoting is modified picture, and in code operation, can be shown with modified pattern, without to every
Each picture is modified in a file.
Picture management method provided by the invention scans source code, obtains the picture of the source code reference, obtains wait protect
Deposit picture;Obtain the module title of the source code said code module;The picture to be saved is saved to pictures management mesh
It records in lower Target Photo file corresponding with the module title.Therefore, by the invention it is possible to which use in source code is arrived
Picture be saved in by module in different files, realize by picture used in development process carry out sort out preservation mesh
, but also can be searched when searching picture with sub-module, due to reducing the range of picture searching, therefore can be more
Quickly find required picture.Meanwhile through the invention, it is saved manually without user, without user's manual classification, so that it may
With by source code using to picture save, improve picture preservation efficiency.
As shown in Fig. 2, Fig. 2 is the functional block diagram of pictures management device provided in an embodiment of the present invention.The picture pipe
Managing device includes that the first acquisition module 210, second obtains module 220 and preserving module 230.The so-called module of the present invention refers to one
Kind performed by the processor by computer installation and the series of computation machine program segment of fixed function can be completed, deposited
Storage is in the memory of computer installation.In the present embodiment, it will be described in detail in subsequent embodiment about the function of each module.
First obtains module 210, for scanning source code, obtains the picture of the source code reference, obtains figure to be saved
Piece.
Pictures management device described in this programme is used for during code development, is carried out to the picture used in code
Automatic classification saves.
Above-mentioned source code is the program in machine code that developer is write in R & D of complex.
The picture of above-mentioned source code reference, the as picture used in source code.Specifically, available source code
Used in picture title and picture used in source code address, then the figure of the source code reference got
Piece is picture to be saved.
When it is implemented, picture used in source code can be obtained by keyword lookup.For example, when finding
When image_name, the picture for being assigned a value of quoting in source code to the image_name is determined.
Alternatively, can also be by the address of keyword (such as url) and keyword reference in scanning source code, to obtain source
The title of picture used in code and the address of the picture.
In other embodiments of the present invention, the quantity for the picture quoted in the source code can also be obtained.Acquisition source generation
The quantity for the picture quoted in code, so that can synchronize carry out quantity statistics when being saved to picture, be conducive to picture
It is rapidly proofreaded after carrying out classification preservation by the quantity statistics.
Second obtains module 220, for obtaining the module title of the source code said code module.
In general, meeting sub-module is developed in software development process.For example, different developers develop it is different
Functional module, each specific function of Implement of Function Module.
Therefore, source code can be in one or more snippets code for developing some module.
When it is implemented, can be obtained by the engineering name of catalogue or the affiliated engineering of source code where source code
The module title of source code said code module.
Preserving module 230, under the picture to be saved is saved to pictures management catalogue with the module title pair
In the Target Photo file answered.
Wherein, above-mentioned pictures management catalogue is for the unified storage address for carrying out picture preservation.Specifically, pictures management
Catalogue can be preset.For example, pictures management catalogue be " E: ", alternatively, pictures management catalogue is " E: pic ".
Meanwhile Target Photo file corresponding with module title can be folder name there are corresponding with module title
The file of relationship can be preset specific corresponding to relationship.For example, Target Photo file corresponding with module title
Folder, is folder name file identical with module title.
For example, pictures management catalogue be " E: ", include four files under pictures management catalogue, four files
Title is respectively: login, shopping, logout, searching, if scanning the picture cited into source code is picture
A, and the name of code of source code said code module is login, then saves picture A to the login under pictures management catalogue
In file.
Specifically, the preserving module 230 picture to be saved is saved to pictures management catalogue under with the module
Include: in the corresponding Target Photo file of title
Judge under the pictures management catalogue with the presence or absence of Target Photo file corresponding with the module title;
If Target Photo file corresponding with the module title is not present under the pictures management catalogue, in the figure
Target Photo file corresponding with the module title is created under piece administrative directory, and the picture to be saved is saved to described
In destination folder;
If there is Target Photo file corresponding with the module title under the pictures management catalogue, by described wait protect
Picture is deposited to save into the destination folder.
In the specific implementation, Target Photo file corresponding with module title can first be judged whether there is, and if it exists,
Then directly picture to be saved is saved, if it does not exist, can first create the file for storing picture to be saved, then
Picture to be saved is saved again.
Meanwhile when carrying out picture preservation, the picture to be saved can be downloaded according to the reference address of picture to be saved, so
The preservation picture is saved into destination folder afterwards.
Therefore, in the process of development, picture is saved manually without developer, the work of developer can be improved
The problem of making efficiency, also avoid each developer and arbitrarily add, leading to picture confusion bad management.
Optionally, in other embodiments of the present invention, the preserving module 230 saves the picture to be saved to picture
Under administrative directory in Target Photo file corresponding with the module title, can also include:
Whether the size for judging the picture to be saved is more than default size;
If the size of the picture to be saved is more than default size, the picture to be saved is compressed;
Target corresponding with the module title under the compressed picture to be saved is saved to pictures management catalogue
In Photo folder.
The occurrence of above-mentioned default size can be preset.For example, the value of default size is 5M.
Whether the above-mentioned size for judging picture to be saved is more than default size for judging whether picture to be saved is excessive.
If the size of picture to be saved is more than default size, picture is compressed, specific picture compression method can
To choose from existing picture compression method, details are not described herein again.
In the present embodiment, first the size of picture to be saved is judged, when the big size of picture is more than default size
When, picture to be saved save again after compression processing, the space of picture storage can be saved, to save more figures
Piece.
Optionally, in other embodiments of the present invention, the preserving module 230 is also used to:
If detecting there is modification in the source code, judge in the source code with the presence or absence of newly-increased reference picture;
If there is newly-increased reference picture in the source code, saved there is newly-increased reference picture in the source code
To in the destination folder.
Change if it exists when it is implemented, the quantity for quoting picture in source code can be scanned with the presence or absence of variation, and number
It is increased for measuring, can be by the picture name quoted in the source code before modification (or picture reference address) and modified source
The picture name (or picture reference address) quoted in code compares, to determine newly-increased reference picture.
In the present embodiment, it is possible to when picture used in source code is increased newly, directly by newly-increased reference picture
It is added.
Optionally, in other embodiments of the present invention, described device further includes removing module, and the removing module is used for:
Judge whether there is reference picture deletion event;
Picture deletion event is quoted if it exists, obtains the reference picture deleted from the source code;
It will be removed from the destination folder from the reference picture deleted in the source code.
Wherein, above-mentioned reference picture deletion event is the event that picture is deleted from code.It can be by source code
Operation note carries out being analyzed to determine whether to exist reference picture deletion event.
When there is reference picture deletion event, the reference that delete from source code can be obtained according to picture deletion event
Picture, and then will be removed from destination folder from the reference picture deleted in source code.
Through this embodiment, when the picture that can be quoted in source code is reduced, directly by the picture of reduction from original
Memory space is removed, and former memory space is avoided picture redundancy occur.
Optionally, in other embodiments of the present invention, described device further includes update module, and the update module is used for:
If detecting there is modification in the source code, judge in the source code with the presence or absence of the reference picture updated;
Reference figure if there is the reference picture updated in the source code, before obtaining updated reference picture and updating
Piece;
The updated reference picture is saved into the destination folder, by the reference picture before the update from
It is deleted in the destination folder.
Specifically, quoting picture if it exists before source code modification is a certain picture in source code, modified in source code
After become another picture, then can determine the reference picture be update reference picture.
When it is implemented, can be come the picture for judging the reference by the reference address of picture cited in source code
It is no to update.For example, there is variation in the reference address of picture login_a, it is determined that picture login_a is deposited in source code
It is updated in picture.
When there is the reference picture updated in source code, updated reference picture is saved into destination folder,
Reference picture before update is deleted from destination folder, can be to avoid picture redundancy in destination folder, and can make
It is consistent with picture used in source code always to obtain the picture saved in destination folder.
Optionally, in other embodiments of the present invention, the preserving module further include:
Target Photo file corresponding with the module title under the picture to be saved is saved to pictures management catalogue
Before in folder, judge whether other code modules other than the source code said code module quote the picture to be saved;
Other code modules other than the source code said code module quote the picture to be saved if it exists, by institute
Picture to be saved is stated to save into the public Photo folder under the pictures management catalogue.
Wherein above-mentioned public Photo folder is the picture all used for saving at least two modules.
Specifically, public Photo folder can be the file being pre-created, it is also possible to detecting the presence of at least
When two modules all use picture to be saved, the file that is created under pictures management catalogue.
In the specific implementation, the method method of the present invention can be used to several source codes through the invention
It carries out picture and sorts out preservation, then it, at this time through this embodiment, will there may be same picture is all quoted in multiple modules
The picture that multiple modules are all quoted is saved into public Photo folder, can save memory space to avoid picture redundancy.And
And when needing to modify to picture, after modifying to the picture, in the code module of all references picture
In, all quoting is modified picture, and in code operation, can be shown with modified pattern, without to every
Each picture is modified in a file.
Pictures management device provided by the invention is obtained the picture of the source code reference, is obtained by scanning source code
Picture to be saved;Obtain the module title of the source code said code module;The picture to be saved is saved to picture pipe
It manages under catalogue in Target Photo file corresponding with the module title.Therefore, by the invention it is possible to by making in source code
The picture used is saved in different files by module, realizes the purpose for carrying out picture to sort out preservation, but also
It when searching picture, can be searched with sub-module, due to reducing the range of picture searching, therefore can faster be found
Required picture.Meanwhile through the invention, it is saved manually without user, without user's manual classification, so that it may will be in source code
Using to picture saved, improve picture preservation efficiency.
The above-mentioned integrated unit realized in the form of software function module, can store and computer-readable deposit at one
In storage media.Above-mentioned software function module is stored in a storage medium, including some instructions are used so that a computer
It is each that equipment (can be personal computer, server or the network equipment etc.) or processor (processor) execute the present invention
The part steps of embodiment the method.
As shown in figure 3, the structure that Fig. 3 is the computer installation for the preferred embodiment that the present invention realizes picture management method is shown
It is intended to.The computer installation include at least one sending device 31, at least one processor 32, at least one processor 33,
At least one reception device 34 and at least one communication bus.Wherein, the communication bus is for realizing between these components
Connection communication.
The computer installation be it is a kind of can according to the instruction for being previously set or store, it is automatic carry out numerical value calculate with/
Or the equipment of information processing, hardware include but is not limited to microprocessor, specific integrated circuit (Application Specific
Integrated Circuit, ASIC), programmable gate array (Field-Programmable Gate Array, FPGA), number
Word processing device (Digital Signal Processor, DSP), embedded device etc..The computer installation may also include net
Network equipment and/or user equipment.Wherein, the network equipment includes but is not limited to single network server, multiple network services
The server group of device composition or being made of a large amount of hosts or network server based on cloud computing (Cloud Computing)
Cloud, wherein cloud computing is one kind of distributed computing, a super virtual meter consisting of a loosely coupled set of computers
Calculation machine.
The computer installation may be, but not limited to, any one and can be set with user by keyboard, touch tablet or acoustic control
The modes such as standby carry out the electronic product of human-computer interaction, for example, the terminals such as tablet computer, smart phone, monitoring device.
Network locating for the computer installation includes, but are not limited to internet, wide area network, Metropolitan Area Network (MAN), local area network, virtual
Dedicated network (Virtual Private Network, VPN) etc..
Wherein, the reception device 34 and the sending device 31 can be wired sending port, or wirelessly set
It is standby, for example including antenna assembly, for carrying out data communication with other equipment.
The memory 32 is for storing program code.The memory 32, which can be, does not have physical form in integrated circuit
The circuit with store function, such as RAM (Random-Access Memory, random access memory), FIFO (First In
First Out, push-up storage) etc..Alternatively, the memory 32 is also possible to the memory with physical form, such as
Memory bar, TF card (Trans-flash Card), smart media card (smart media card), safe digital card (secure
Digital card), storage facilities such as flash memory cards (flash card) etc..
The processor 33 may include one or more microprocessor, digital processing unit.The processor 33 is adjustable
With the program code stored in memory 32 to execute relevant function.For example, each unit described in Fig. 3 is stored in institute
The program code in memory 32 is stated, and as performed by the processor 33, to realize a kind of picture management method.The processing
Device 33 is also known as central processing unit (CPU, Central Processing Unit), is one piece of ultra-large integrated circuit, is fortune
Calculate core (Core) and control core (Control Unit).
In several embodiments provided by the present invention, it should be understood that disclosed system, device and method can be with
It realizes by another way.For example, the apparatus embodiments described above are merely exemplary, for example, the module
It divides, only a kind of logical function partition, there may be another division manner in actual implementation.
The module as illustrated by the separation member may or may not be physically separated, aobvious as module
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
In network unit.Some or all of the modules therein can be selected to realize the mesh of this embodiment scheme according to the actual needs
's.
It, can also be in addition, each functional module in each embodiment of the present invention can integrate in one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of hardware adds software function module.
It is obvious to a person skilled in the art that invention is not limited to the details of the above exemplary embodiments, Er Qie
In the case where without departing substantially from spirit or essential attributes of the invention, the present invention can be realized in other specific forms.Therefore, no matter
From the point of view of which point, the present embodiments are to be considered as illustrative and not restrictive, and the scope of the present invention is by appended power
Benefit requires rather than above description limits, it is intended that all by what is fallen within the meaning and scope of the equivalent elements of the claims
Variation is included in the present invention.Any attached associated diagram label in claim should not be considered as right involved in limitation to want
It asks.Furthermore, it is to be understood that one word of " comprising " does not exclude other units or steps, odd number is not excluded for plural number.It is stated in system claims
Multiple units or device can also be implemented through software or hardware by a unit or device.Second equal words are used to table
Show title, and does not indicate any particular order.
Finally it should be noted that the above examples are only used to illustrate the technical scheme of the present invention and are not limiting, although reference
Preferred embodiment describes the invention in detail, those skilled in the art should understand that, it can be to of the invention
Technical solution is modified or equivalent replacement, without departing from the spirit and scope of the technical solution of the present invention.
Claims (10)
1. a kind of picture management method, which is characterized in that the described method includes:
Source code is scanned, the picture of the source code reference is obtained, obtains picture to be saved;
Obtain the module title of the source code said code module;
Under the picture to be saved is saved to pictures management catalogue in Target Photo file corresponding with the module title.
2. the method as described in claim 1, which is characterized in that described to save the picture to be saved to pictures management catalogue
In lower Target Photo file corresponding with the module title, comprising:
Whether the size for judging the picture to be saved is more than default size;
If the size of the picture to be saved is more than default size, the picture to be saved is compressed;
Target Photo corresponding with the module title under the compressed picture to be saved is saved to pictures management catalogue
In file.
3. the method as described in claim 1, which is characterized in that the method also includes:
If detecting there is modification in the source code, judge in the source code with the presence or absence of newly-increased reference picture;
If there is newly-increased reference picture in the source code, save there is newly-increased reference picture in the source code to institute
It states in destination folder.
4. the method as described in claim 1, which is characterized in that the method also includes:
Judge whether there is reference picture deletion event;
Picture deletion event is quoted if it exists, obtains the reference picture deleted from the source code;
It will be removed from the destination folder from the reference picture deleted in the source code.
5. the method as described in claim 1, which is characterized in that the method also includes:
If detecting there is modification in the source code, judge in the source code with the presence or absence of the reference picture updated;
Reference picture if there is the reference picture updated in the source code, before obtaining updated reference picture and updating;
The updated reference picture is saved into the destination folder, by the reference picture before the update from described
It is deleted in destination folder.
6. the method as described in any one of claims 1 to 5, which is characterized in that it is described by the picture to be saved save to
Under pictures management catalogue in Target Photo file corresponding with the module title before, the method also includes:
Judge whether other code modules other than the source code said code module quote the picture to be saved;
If so, saving the picture to be saved into the public Photo folder under the pictures management catalogue.
7. the method as described in claim 1, which is characterized in that described to save the picture to be saved to pictures management catalogue
In lower Target Photo file corresponding with the module title, comprising:
Judge under the pictures management catalogue with the presence or absence of Target Photo file corresponding with the module title;
If Target Photo file corresponding with the module title is not present under the pictures management catalogue, in the picture pipe
Creation Target Photo file corresponding with the module title under catalogue is managed, the picture to be saved is saved to the target
In file;
If there is Target Photo file corresponding with the module title under the pictures management catalogue, by the figure to be saved
Piece is saved into the destination folder.
8. a kind of pictures management device, which is characterized in that described device includes:
First obtains module, for scanning source code, obtains the picture of the source code reference, obtains picture to be saved;
Second obtains module, for obtaining the module title of the source code said code module;
Preserving module, for target corresponding with the module title under saving the picture to be saved to pictures management catalogue
In Photo folder.
9. a kind of computer installation, which is characterized in that the computer installation includes memory and processor, and the memory is used
In storing at least one instruction, the processor is for executing at least one described instruction to realize as appointed in claim 1 to 7
Picture management method described in one.
10. a kind of computer readable storage medium, is stored thereon with computer instruction, it is characterised in that: the computer instruction
The picture management method as described in any one of claims 1 to 7 is realized when being executed by processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811151261.8A CN109522282B (en) | 2018-09-29 | 2018-09-29 | Picture management method, device, computer device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811151261.8A CN109522282B (en) | 2018-09-29 | 2018-09-29 | Picture management method, device, computer device and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109522282A true CN109522282A (en) | 2019-03-26 |
CN109522282B CN109522282B (en) | 2024-02-02 |
Family
ID=65771604
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811151261.8A Active CN109522282B (en) | 2018-09-29 | 2018-09-29 | Picture management method, device, computer device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109522282B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113296715A (en) * | 2021-06-29 | 2021-08-24 | 中国平安人寿保险股份有限公司 | Picture resource processing method and device and computer equipment |
CN113434139A (en) * | 2021-06-23 | 2021-09-24 | 平安普惠企业管理有限公司 | Image packaging processing method and device, server and storage medium |
CN115904166A (en) * | 2022-11-10 | 2023-04-04 | 贝壳找房(北京)科技有限公司 | Project icon management method, electronic device and storage medium |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH05120359A (en) * | 1991-10-30 | 1993-05-18 | Toshiba Corp | Image forming storing and retrieving device |
CN101094135A (en) * | 2006-06-23 | 2007-12-26 | 腾讯科技(深圳)有限公司 | Method and system for extracting information of content in Internet |
CN103390059A (en) * | 2013-07-29 | 2013-11-13 | 广东欧珀移动通信有限公司 | Picture induction processing method and system |
CN104951516A (en) * | 2015-05-29 | 2015-09-30 | 小米科技有限责任公司 | Method and device for storing webpage file |
CN105183829A (en) * | 2015-08-28 | 2015-12-23 | 北京金山安全软件有限公司 | Picture classification method and device |
CN105354229A (en) * | 2015-09-30 | 2016-02-24 | 联想(北京)有限公司 | Information processing method and electronic device |
CN106339400A (en) * | 2015-07-13 | 2017-01-18 | 阿里巴巴集团控股有限公司 | Method, apparatus and device for presenting tree files |
CN107451244A (en) * | 2017-07-27 | 2017-12-08 | 广东欧珀移动通信有限公司 | File naming method, mobile terminal and computer-readable recording medium |
CN108255989A (en) * | 2017-12-28 | 2018-07-06 | 深圳英飞拓科技股份有限公司 | Picture storage method, device, terminal device and computer storage media |
-
2018
- 2018-09-29 CN CN201811151261.8A patent/CN109522282B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH05120359A (en) * | 1991-10-30 | 1993-05-18 | Toshiba Corp | Image forming storing and retrieving device |
CN101094135A (en) * | 2006-06-23 | 2007-12-26 | 腾讯科技(深圳)有限公司 | Method and system for extracting information of content in Internet |
CN103390059A (en) * | 2013-07-29 | 2013-11-13 | 广东欧珀移动通信有限公司 | Picture induction processing method and system |
CN104951516A (en) * | 2015-05-29 | 2015-09-30 | 小米科技有限责任公司 | Method and device for storing webpage file |
CN106339400A (en) * | 2015-07-13 | 2017-01-18 | 阿里巴巴集团控股有限公司 | Method, apparatus and device for presenting tree files |
CN105183829A (en) * | 2015-08-28 | 2015-12-23 | 北京金山安全软件有限公司 | Picture classification method and device |
CN105354229A (en) * | 2015-09-30 | 2016-02-24 | 联想(北京)有限公司 | Information processing method and electronic device |
CN107451244A (en) * | 2017-07-27 | 2017-12-08 | 广东欧珀移动通信有限公司 | File naming method, mobile terminal and computer-readable recording medium |
CN108255989A (en) * | 2017-12-28 | 2018-07-06 | 深圳英飞拓科技股份有限公司 | Picture storage method, device, terminal device and computer storage media |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113434139A (en) * | 2021-06-23 | 2021-09-24 | 平安普惠企业管理有限公司 | Image packaging processing method and device, server and storage medium |
CN113296715A (en) * | 2021-06-29 | 2021-08-24 | 中国平安人寿保险股份有限公司 | Picture resource processing method and device and computer equipment |
CN115904166A (en) * | 2022-11-10 | 2023-04-04 | 贝壳找房(北京)科技有限公司 | Project icon management method, electronic device and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN109522282B (en) | 2024-02-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106886570B (en) | Page processing method and device | |
CN104412249B (en) | File disposal in file system based on cloud | |
RU2608668C2 (en) | System and method for control and organisation of web-browser cache for offline browsing | |
CN105677250B (en) | The update method and updating device of object data in object storage system | |
CN103078945B (en) | To the method and system that browser crash data processes | |
WO2017215175A1 (en) | Page processing method and device, terminal, and server | |
EP3161610B1 (en) | Optimized browser rendering process | |
CN109783757B (en) | Method, device and system for rendering webpage, storage medium and electronic device | |
CN109445861A (en) | System start method, device, computer installation and storage medium | |
CN109522282A (en) | Picture management method, device, computer installation and storage medium | |
US10698863B2 (en) | Method and apparatus for clearing data in cloud storage system | |
CN109408469A (en) | Stale data document handling method, device, electronic device and storage medium | |
CN108595503A (en) | Document handling method and server | |
CN108536467B (en) | Code positioning processing method and device, terminal equipment and storage medium | |
US10783073B2 (en) | Chronologically ordered out-of-place update key-value storage system | |
CN113377289A (en) | Cache management method, system, computing device and readable storage medium | |
JP7369229B2 (en) | How to change the skin of the mini program page, devices and electronic devices | |
CN112559913B (en) | Data processing method, device, computing equipment and readable storage medium | |
CN110119386A (en) | Data processing method, data processing equipment, medium and calculating equipment | |
CN114187300A (en) | Image processing method, system and storage medium | |
US11093566B2 (en) | Router based query results | |
CN108960378B (en) | Data downloading method, system, device and storage medium | |
CN111381812B (en) | Program issuing method, calling method, device, storage medium and computer equipment | |
CN107508705B (en) | Resource tree construction method of HTTP element and computing equipment | |
CN106156273A (en) | Data message methods of exhibiting and client |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |