CN109710782A - Bayonet pictures management optimization method - Google Patents
Bayonet pictures management optimization method Download PDFInfo
- Publication number
- CN109710782A CN109710782A CN201811452370.3A CN201811452370A CN109710782A CN 109710782 A CN109710782 A CN 109710782A CN 201811452370 A CN201811452370 A CN 201811452370A CN 109710782 A CN109710782 A CN 109710782A
- Authority
- CN
- China
- Prior art keywords
- picture
- file
- files
- blocks
- picture 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 44
- 238000005457 optimization Methods 0.000 title claims abstract description 21
- 238000012163 sequencing technique Methods 0.000 claims description 3
- 238000012217 deletion Methods 0.000 claims 1
- 230000037430 deletion Effects 0.000 claims 1
- 238000003860 storage Methods 0.000 abstract description 9
- 239000012634 fragment Substances 0.000 description 3
- 238000000151 deposition Methods 0.000 description 2
- 230000007774 longterm Effects 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000003111 delayed effect Effects 0.000 description 1
- 235000013399 edible fruits Nutrition 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention provides a kind of bayonet pictures management optimization methods, comprising the following steps: when receiving picture, according to picture from channel by the buffer zone of image data write-in corresponding channel, and the index information of the picture is recorded in hash table;When the image data of the buffer zone in some channel reaches the file block size of setting, the image data of the buffer zone is merged into a blocks of files, then disk is integrally written into blocks of files, and records the index of blocks of files in the database;After blocks of files is written successfully, the content corresponding with this document block of buffer zone caching is deleted, while deleting index information corresponding with the picture of this document block in hash table.The method that the present invention uses multiple picture files to be merged into a blocks of files, improve the IO utilization rate of file system, so that the storage of file can be executed according to the operation order of magnetic head, and different buffer zones is written in the image data from different channels, facilitates management.
Description
Technical field
The present invention relates to picture field of storage more particularly to a kind of bayonet pictures management optimization methods.
Background technique
With the development of the universal information age of bayonet video, the requirement for the storage system of high concurrent is also more next
Higher, file system causes to write in the presence of concurrently write-in small documents speed is low and long-time service can generate a large amount of disk fragments
Enter the lower and lower drawback of performance, is unfavorable for the long-term storage of extensive picture small documents.And file it is more when, it is difficult to file
It is fast and accurately positioned, the efficiency of file polling and reading is relatively low.
Summary of the invention
The purpose of the present invention is to provide a kind of bayonet pictures management optimization methods, it is intended to for solving existing file system
System has that concurrently write-in small documents speed is low and long-time service can generate a large amount of disk fragments.
The present invention is implemented as follows:
The present invention provides a kind of bayonet pictures management optimization method, comprising the following steps:
Receive picture when, according to picture from channel by image data write-in corresponding channel buffer zone, and will
The index information of the picture is recorded in hash table;
When the image data of the buffer zone in some channel reaches the file block size of setting, by the figure of the buffer zone
Sheet data is merged into a blocks of files, then disk is integrally written in blocks of files, and records the index of blocks of files in the database;
After blocks of files is written successfully, the content corresponding with this document block of buffer zone caching is deleted, while deleting hash
Index information corresponding with the picture of this document block in table.
Further, it sets and corresponding channel is then delayed to the time-out time of file write-in disk once reaching time-out time
The image data for depositing region is merged into blocks of files write-in disk.
Further, when the reception picture, according to picture from channel by image data write-in corresponding channel
Buffer zone, and the index information of the picture is recorded in hash table and is specifically included:
Receive picture when, according to be transmitted through come channel information judge whether picture is the channel for having existed buffer zone
Picture file, if it is by the buffer zone of image data write-in corresponding channel, if not then creating new channel
Buffer zone is stored.
Further, this method further include:
When picture file is inquired, according to the query information of user, judge whether the picture file has been stored in disk;
If the picture file of inquiry is also not stored to arrive disk, the figure for merging big file is found from the hash table of caching
Piece information, the information then recorded again by file header inquire the picture file information of user's needs;If the picture of inquiry
File has been stored in disk, then file block message corresponding with the picture file is searched from database, further according in database
File block message find blocks of files, and combine the file header index information of each picture file in blocks of files, it is accurate to position
To the particular content of each picture file;
The specific information of picture file is sent to user.
Further, this method further include:
When picture file is read, the specific location and letter of picture file are found according to the method that above-mentioned picture file is inquired
Breath judges that the picture file is stored in caching and is also stored in disk according to the specifying information of obtained picture file;
If the picture file is stored in disk, in conjunction with the specifying information of picture file, from specified blocks of files
Designated position read picture file particular content, then by the particular content of picture file by transmission program pass out
It goes;
If the picture file is stored in caching, the particular content of the picture file is read from caching and passes through hair
Program is sent to pass.
Further, this method further include:
When deleting covering to picture file, judge whether the remaining space of disk is less than setting value, if it is less than the setting
Value, then start the cycle over overlay file;
It is ranked up from database according to the sequencing that picture file is stored in, finds the blocks of files conduct being stored in earliest
The blocks of files for needing to delete, and find the specific location for needing to delete blocks of files;
According to the specific location of obtained blocks of files, specified blocks of files is deleted, and deletes this document block in database
Index record.
Compared with prior art, the invention has the following advantages:
This bayonet pictures management optimization method provided by the invention, due to being merged into a text using multiple picture files
The method of part block improves the IO utilization rate of file system, so that the storage of file can be executed according to the operation order of magnetic head, and
Different buffer zones is written in image data from different channels, that is, carries out area according to different front end tollgate devices when caching
Point, facilitate management, the index information for caching picture is recorded in hash table, facilitates user query and read presently written text
Part.Simultaneously when deleting overlay file, since the path of file storage can be quickly found from the hash of memory, and once delete
The blocks of files removed is larger, quickly deleting and re-writing conducive to picture file, meets growing small documents picture write-in
Demand.The disk fragments that this method generates in long-term use are less, improve the utilization rate of disk, and it is small to have reached preferable storage
The effect of picture file.
Detailed description of the invention
Fig. 1 is a kind of method of the picture file write-in of bayonet pictures management optimization method provided in an embodiment of the present invention
Flow chart;
Fig. 2 is a kind of method of the picture file inquiry of bayonet pictures management optimization method provided in an embodiment of the present invention
Flow chart;
Fig. 3 is the method that a kind of picture file of bayonet pictures management optimization method provided in an embodiment of the present invention is read
Flow chart;
Fig. 4 is that a kind of picture file of bayonet pictures management optimization method provided in an embodiment of the present invention deletes the side of covering
The flow chart of 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 all other
Embodiment shall fall within the protection scope of the present invention.
The embodiment of the present invention provides a kind of bayonet pictures management optimization method, the method including picture file write-in, such as Fig. 1
It is shown, picture file write-in method specifically includes the following steps:
S1.1, receive picture when, according to picture from channel by image data write-in corresponding channel buffer zone,
And the index information of the picture is recorded in hash table;
S1.2, when the image data of the buffer zone in some channel reaches the file block size of setting, by the buffer area
The image data in domain is merged into a blocks of files, then disk is integrally written in blocks of files, and records blocks of files in the database
Index;
S1.3 after blocks of files is written successfully, deletes the content corresponding with this document block of buffer zone caching, deletes simultaneously
Index information corresponding with the picture of this document block in hash table.
Above steps is described in detail below.
In the step S1.1, receive picture when, according to be transmitted through come channel information judge whether picture is to have existed
The picture file in the channel of buffer zone if it is the image data is written in the buffer zone of corresponding channel, if not
It is to create new channel buffer zone to be stored.Different channels corresponds to different front end tollgate devices, from same logical
The same buffer zone is written in the image data in road, and different buffer zones is written in the image data from different channels, i.e., slow
It is distinguished when depositing according to different front end tollgate devices, the small documents from identical front end tollgate devices is cached into one
Biggish file.The index information for caching picture is recorded in hash table, user query are facilitated and reads presently written text
Part.
In the step S1.2, the size of blocks of files is set in advance, after receiving picture, according to the file block size of setting
Judge whether the buffer zone of corresponding channel can be inserted received file to caching, if the blocks of files for not reaching setting is big
It is small, then continue to cache received file, if having reached the size of blocks of files, data are recorded in the index information of blocks of files
In library, the image data of the buffer zone is merged into a blocks of files write-in disk.Preferably, it also sets and magnetic is written into file
The time-out time of disk, once reaching time-out time, no matter whether the image data of the buffer zone in the channel reaches the text of setting
The image data of corresponding channel buffer zone is all merged into blocks of files write-in disk, prevents abnormal conditions by part block size
When, the overabundance of data of loss guarantees the safety of write-in data as far as possible, merges the safety level that time-out time can be needed according to system
It is not set.
In the step S1.3, the index information of file in hash table is deleted while deleting the blocks of files content of caching,
The spatial cache used can be discharged.
As shown in Figure 2, it is preferable that a kind of bayonet pictures management optimization method of the present embodiment further includes picture file inquiry
Method, the specific steps are as follows:
S2.1, according to the query information of user, judges whether the picture file has been stored in disk when picture file is inquired,
The standard of judgement is to inquire whether to have the blocks of files for meeting user query condition in the database, if so, then illustrating to be stored in
Disk, if it is not, explanation is not stored in disk;
S2.2 finds the big text of merging if the picture file of inquiry is also not stored to arrive disk from the hash table of caching
The pictorial information of part, the information then recorded again by file header inquire the picture file information of user's needs;If inquiry
Picture file be stored in disk, then file block message corresponding with the picture file is searched from database, further according to number
Blocks of files is found according to the file block message in library, and combines the file header index information of each picture file in blocks of files, accurately
The particular content for navigating to each picture file;
The specific information of picture file is sent to user by S2.3.
As shown in Figure 3, it is preferable that a kind of bayonet pictures management optimization method of the present embodiment further includes that picture file is read
Method, the specific steps are as follows:
When picture file is read, the specific location of picture file is found according to the method that above-mentioned picture file is inquired by S3.1
And information judges that the picture file is stored in caching and is also stored in magnetic according to the specifying information of obtained picture file
In disk;
S3.2, if the picture file is stored in disk, in conjunction with the specifying information of picture file, from specified text
The designated position of part block reads the particular content of picture file, then by the particular content of picture file by sending program transmitting
It goes out;
S3.3 reads the particular content of the picture file simultaneously if the picture file is stored in caching from caching
It is passed by sending program, the data of caching still save.
As shown in Figure 4, it is preferable that a kind of bayonet pictures management optimization method of the present embodiment further includes that picture file is deleted
The method of covering, the specific steps are as follows:
S4.1 judges whether the remaining space of disk is less than setting value, such as 5%, such as when deleting covering to picture file
Fruit is less than the setting value, then starts the cycle over overlay file;
S4.2 is ranked up according to the sequencing that picture file is stored in from database, finds the file being stored in earliest
The blocks of files that block is deleted as needs, and find the specific location for needing to delete blocks of files;
S4.3 deletes specified blocks of files according to the specific location of obtained blocks of files, discharges memory space, and delete
The index record of this document block in database.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of embodiment is can to lead to
Program is crossed to instruct relevant hardware and complete, which can be stored in a computer readable storage medium, storage medium
It may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access
Memory), disk or CD etc..
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all in essence of the invention
Within mind and principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.
Claims (6)
1. a kind of bayonet pictures management optimization method, which comprises the following steps:
When receiving picture, according to picture from channel by the buffer zone of image data write-in corresponding channel, and by the figure
The index information of piece is recorded in hash table;
When the image data of the buffer zone in some channel reaches the file block size of setting, by the picture number of the buffer zone
Disk is integrally written according to being merged into a blocks of files, then by blocks of files, and records the index of blocks of files in the database;
After blocks of files is written successfully, the content corresponding with this document block of buffer zone caching is deleted, while being deleted in hash table
Index information corresponding with the picture of this document block.
2. bayonet pictures management optimization method as described in claim 1, it is characterised in that: setting is super by file write-in disk
When the time, once reach time-out time, then by the image data of corresponding channel buffer zone be merged into blocks of files write-in disk.
3. bayonet pictures management optimization method as described in claim 1, which is characterized in that when the reception picture, according to figure
Piece from channel by the buffer zone of image data write-in corresponding channel, and hash is recorded in the index information of the picture
It is specifically included in table:
Receive picture when, according to be transmitted through come channel information judge whether picture is the picture for having existed the channel of buffer zone
File caches if it is by the buffer zone of image data write-in corresponding channel if not new channel is then created
Region is stored.
4. bayonet pictures management optimization method as described in claim 1, which is characterized in that this method further include:
When picture file is inquired, according to the query information of user, judge whether the picture file has been stored in disk;
If the picture file of inquiry is also not stored to arrive disk, the picture letter for merging big file is found from the hash table of caching
Breath, the information then recorded again by file header inquire the picture file information of user's needs;If the picture file of inquiry
It has been stored in disk, then file block message corresponding with the picture file has been searched from database, further according to the text in database
Part block message finds blocks of files, and combines the file header index information of each picture file in blocks of files, accurately navigates to every
The particular content of a picture file;
The specific information of picture file is sent to user.
5. bayonet pictures management optimization method as claimed in claim 4, which is characterized in that this method further include:
When picture file is read, the specific location and information of picture file, root are found according to the method that above-mentioned picture file is inquired
According to the specifying information of obtained picture file, judges that the picture file is stored in caching and be also stored in disk;
If the picture file is stored in disk, in conjunction with the specifying information of picture file, from the finger of specified blocks of files
The particular content for reading picture file is set in positioning, then passes the particular content of picture file by sending program;
If the picture file is stored in caching, the particular content of the picture file is read from caching and by sending journey
Sequence passes.
6. bayonet pictures management optimization method as described in claim 1, which is characterized in that this method further include:
When deleting covering to picture file, judge whether the remaining space of disk is less than setting value, if it is less than the setting value, then
Start the cycle over overlay file;
It is ranked up from database according to the sequencing that picture file is stored in, finds the blocks of files being stored in earliest and be used as needs
The blocks of files of deletion, and find the specific location for needing to delete blocks of files;
According to the specific location of obtained blocks of files, specified blocks of files is deleted, and deletes the index of this document block in database
Record.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811452370.3A CN109710782B (en) | 2018-11-30 | 2018-11-30 | Bayonet picture management optimization method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811452370.3A CN109710782B (en) | 2018-11-30 | 2018-11-30 | Bayonet picture management optimization method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109710782A true CN109710782A (en) | 2019-05-03 |
CN109710782B CN109710782B (en) | 2023-11-28 |
Family
ID=66254436
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811452370.3A Active CN109710782B (en) | 2018-11-30 | 2018-11-30 | Bayonet picture management optimization method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109710782B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110222209A (en) * | 2019-06-14 | 2019-09-10 | 北京马赫谷科技有限公司 | Picture storage method, querying method, device and access system |
CN117850730A (en) * | 2024-03-08 | 2024-04-09 | 青岛罗博数码科技有限公司 | Method and system for displaying pictures by intelligent pen box |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103092775A (en) * | 2013-01-31 | 2013-05-08 | 武汉大学 | Spatial data double cache method and mechanism based on key value structure |
CN105511802A (en) * | 2015-11-24 | 2016-04-20 | 北京达沃时代科技有限公司 | Buffer memory writing method and apparatus and synchronizing method and apparatus for disk cache region |
US20160217078A1 (en) * | 2015-01-26 | 2016-07-28 | International Business Machines Corporation | Dynamically controlling a file system write cache |
CN106227794A (en) * | 2016-07-20 | 2016-12-14 | 北京航空航天大学 | The storage method and apparatus of dynamic attribute data in temporal diagram data |
CN106354724A (en) * | 2015-07-15 | 2017-01-25 | 阿里巴巴集团控股有限公司 | File archiving method and file reading method and device |
-
2018
- 2018-11-30 CN CN201811452370.3A patent/CN109710782B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103092775A (en) * | 2013-01-31 | 2013-05-08 | 武汉大学 | Spatial data double cache method and mechanism based on key value structure |
US20160217078A1 (en) * | 2015-01-26 | 2016-07-28 | International Business Machines Corporation | Dynamically controlling a file system write cache |
CN106354724A (en) * | 2015-07-15 | 2017-01-25 | 阿里巴巴集团控股有限公司 | File archiving method and file reading method and device |
CN105511802A (en) * | 2015-11-24 | 2016-04-20 | 北京达沃时代科技有限公司 | Buffer memory writing method and apparatus and synchronizing method and apparatus for disk cache region |
CN106227794A (en) * | 2016-07-20 | 2016-12-14 | 北京航空航天大学 | The storage method and apparatus of dynamic attribute data in temporal diagram data |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110222209A (en) * | 2019-06-14 | 2019-09-10 | 北京马赫谷科技有限公司 | Picture storage method, querying method, device and access system |
CN117850730A (en) * | 2024-03-08 | 2024-04-09 | 青岛罗博数码科技有限公司 | Method and system for displaying pictures by intelligent pen box |
CN117850730B (en) * | 2024-03-08 | 2024-05-28 | 青岛罗博数码科技有限公司 | Method and system for displaying pictures by intelligent pen box |
Also Published As
Publication number | Publication date |
---|---|
CN109710782B (en) | 2023-11-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10163135B2 (en) | Combining user content with supplemental content at a data storage device | |
US9575974B2 (en) | Distributed file system gateway | |
US7236992B2 (en) | Storage system | |
CN106303671B (en) | A kind of playback method of Streaming Media | |
US7461104B2 (en) | Method and system for rapid data-fragmentation analysis of a New Technology File System | |
CN107436725A (en) | A kind of data are write, read method, apparatus and distributed objects storage cluster | |
US6532517B1 (en) | System and method for reducing disk chatter from disk-based data storage systems | |
CN104063187B (en) | Hard disk file system suitable for security application and operation method thereof | |
US20080040538A1 (en) | File readahead method with the use of access pattern information attached to metadata | |
CN103399823B (en) | The storage means of business datum, equipment and system | |
CN103226965B (en) | Based on the audio/video data access method of time bitmap | |
CN111447505A (en) | Video clipping method, network device, and computer-readable storage medium | |
CN102479250A (en) | Disk caching method for embedded browser | |
CN102902709B (en) | The document storage system of a kind of fixed space distribution and implementation method | |
CN109710782A (en) | Bayonet pictures management optimization method | |
CN101751470B (en) | System for storing and/or retrieving a data-set and method thereof | |
CN111651127A (en) | Monitoring data storage method and device based on shingled magnetic recording disk | |
CN105068761B (en) | A kind of video interception storage method and system convenient for retrieval | |
van der Meer et al. | A contemporary investigation of NTFS file fragmentation | |
CN107122140A (en) | A kind of file intelligent storage method based on metadata information | |
CN104298747A (en) | Storage method and retrieval method of massive images | |
CN107430546A (en) | A kind of file updating method and storage device | |
US9870385B2 (en) | Computer system, data management method, and computer | |
CN105610921A (en) | Erasure code filing method based on data cache in cluster | |
CN110134615A (en) | The method and device of application program acquisition daily record data |
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 |