CN102904931A - Method for storing and reading picture - Google Patents
Method for storing and reading picture Download PDFInfo
- Publication number
- CN102904931A CN102904931A CN2012103486258A CN201210348625A CN102904931A CN 102904931 A CN102904931 A CN 102904931A CN 2012103486258 A CN2012103486258 A CN 2012103486258A CN 201210348625 A CN201210348625 A CN 201210348625A CN 102904931 A CN102904931 A CN 102904931A
- Authority
- CN
- China
- Prior art keywords
- picture
- value
- server
- file
- storing
- 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
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses a method for storing and reading a picture. The method comprises a picture storing method and a picture reading method, wherein the picture storing method comprises the following steps that: step 1, the picture is uploaded by a user; step 2, a MD5 (Message Digest 5) value of the picture uploaded by the user is computed; a server is determined by two front characters of the MD5 value, a configuration file of server information is read, and the server is determined; a second-level directory of a file picture is determined by a third character and a fourth character of the MD5 value; the fifth to ninth characters of the MD5 value are converted into decimal systems, and the remainder of 1024 is taken as a third-level directory; and step 3, the picture is saved, and the MD5 value is stored into a database. According to the method for storing and reading picture, the distribution-type storage is adopted, a system for storing the file can be formed by one or more servers, a cloud platform is unnecessary to be built, the number of the files in each folder of a picture server can be controlled by the picture server, and the cross-server backup is benefited.
Description
Technical field
The present invention relates to a kind of picture-storage and read method.
Background technology
Picture-storage is website storage commonly used always, and in the face of day by day huge picture library, the picture-storage that picture servers far away can not satisfying magnanimity needs.The catalogue of general picture-storage is stored by date, but will face a problem like this, and when picture was increasing, picture indices will be more and more slower, and when server is filled with, will be faced with the problem of picture migration.
Summary of the invention
In view of this, the purpose of this invention is to provide a kind of picture-storage and read method, adopt distributed storage, the system that one or more server composing document storage can be arranged, need not to build the cloud platform, what of file can oneself go control in each file of picture servers, and are convenient to the backup of cross-server.
To achieve these goals, the present invention is by the following technical solutions:
A kind of picture-storage and read method wherein, comprise picture-storage method and picture read method, and described picture-storage method comprises the steps:
Step 1, user's uploading pictures;
Step 2, the MD5 value of calculating user uploading pictures; Decide server by MD5 value the first two character, read the configuration file of server info, determine server; Determine the file, picture second-level directory by MD5 value the 3rd, 4 characters; MD5 value 5-9 character scaling is become the decimal system, and getting 1024 remainder is three grades of catalogues;
Step 3 is preserved picture, and with MD5 value stored data base.
As preferably, described picture read method comprises the steps:
Step 1, the MD5 value that the reading database picture is corresponding;
Step 2 is determined server by MD5 value the first two character; Determine the file, picture second-level directory by MD5 value the 3rd, 4 characters; MD5 value 5-9 character scaling is become the decimal system, and getting 1024 remainder is three grades of catalogues;
Step 3 finds picture address, reads picture.
Beneficial effect of the present invention is:
The present invention adopts distributed storage, and the system of one or more server composing document storage can be arranged, and need not to build the cloud platform, and what of file can oneself go control in each file of picture servers, and are convenient to the backup of cross-server.The invention provides a kind of new picture-storage and read method, improved picture indices speed, needs that can the satisfying magnanimity picture-storage, the picture servers that especially is fit to medium-sized and small enterprises oneself system that builds a station.
Other advantages of the present invention, target and feature will be set forth to a certain extent in the following description, and to a certain extent, based on being apparent to those skilled in the art to investigating hereinafter, perhaps can be instructed from the practice of the present invention.Target of the present invention and other advantages can realize and obtain by specifically noted structure in following specification or the accompanying drawing.
Description of drawings
Fig. 1 is the flow chart that the present invention stores picture;
Fig. 2 is the flow chart that the present invention reads picture.
Embodiment
The present invention will be further described below by accompanying drawing:
The present invention adopts the MD5 value of calculating user's uploading pictures, and this MD5 value is the character string of 16 systems, can identify the uniqueness of this picture, or the character string of 16 systems.Front 9 of intercepting MD5 value, wherein front two is as the ground floor catalogue, middle two the 3rd layer of catalogue converts 10 systems to being left 5 as second layer catalogue, with 1024 remainders as the 3rd layer of catalogue, file just exists under this catalogue.The benefit of storage is like this, and every layer catalogue can greater than 1024, not improve the speed of physics file reading.Configuration file of the present invention is exactly the routing file of a storage/file reading, can determine by front several letters of MD5 value the store path of file.
As shown in Figure 1, picture-storage method of the present invention comprises the steps:
Step 1, user's uploading pictures;
Step 2, the MD5 value of calculating user uploading pictures; Decide server by MD5 value the first two character, read the configuration file of server info, determine server; Determine the file, picture second-level directory by MD5 value the 3rd, 4 characters; MD5 value 5-9 character scaling is become the decimal system, and getting 1024 remainder is three grades of catalogues;
Step 3 is preserved picture, and with MD5 value stored data base.
As shown in Figure 2, picture read method of the present invention comprises the steps:
Step 1, the MD5 value that the reading database picture is corresponding;
Step 2 is determined server by MD5 value the first two character; Determine the file, picture second-level directory by MD5 value the 3rd, 4 characters; MD5 value 5-9 character scaling is become the decimal system, and getting 1024 remainder is three grades of catalogues;
Step 3 finds picture address, reads picture.
Explanation is at last, above embodiment is only unrestricted in order to technical scheme of the present invention to be described, other modifications that those of ordinary skills make technical scheme of the present invention or be equal to replacement, only otherwise break away from the spirit and scope of technical solution of the present invention, all should be encompassed in the middle of the claim scope of the present invention.
Claims (2)
1. a picture-storage and read method, it is characterized in that: comprise picture-storage method and picture read method, described picture-storage method comprises the steps:
Step 1, user's uploading pictures;
Step 2, the MD5 value of calculating user uploading pictures; Decide server by MD5 value the first two character, read the configuration file of server info, determine server; Determine the file, picture second-level directory by MD5 value the 3rd, 4 characters; MD5 value 5-9 character scaling is become the decimal system, and getting 1024 remainder is three grades of catalogues;
Step 3 is preserved picture, and with MD5 value stored data base.
2. a kind of picture-storage according to claim 1 and read method, it is characterized in that: described picture read method comprises the steps:
Step 1, the MD5 value that the reading database picture is corresponding;
Step 2 is determined server by MD5 value the first two character; Determine the file, picture second-level directory by MD5 value the 3rd, 4 characters; MD5 value 5-9 character scaling is become the decimal system, and getting 1024 remainder is three grades of catalogues;
Step 3 finds picture address, reads picture.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2012103486258A CN102904931A (en) | 2012-09-19 | 2012-09-19 | Method for storing and reading picture |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2012103486258A CN102904931A (en) | 2012-09-19 | 2012-09-19 | Method for storing and reading picture |
Publications (1)
Publication Number | Publication Date |
---|---|
CN102904931A true CN102904931A (en) | 2013-01-30 |
Family
ID=47576966
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2012103486258A Pending CN102904931A (en) | 2012-09-19 | 2012-09-19 | Method for storing and reading picture |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102904931A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105701178A (en) * | 2016-01-05 | 2016-06-22 | 北京汇商融通信息技术有限公司 | Distributed image storage system |
CN106940733A (en) * | 2017-04-12 | 2017-07-11 | 福建中金在线信息科技有限公司 | A kind of picture storage method and server |
CN107562786A (en) * | 2017-07-27 | 2018-01-09 | 平安科技(深圳)有限公司 | File memory method, terminal and computer-readable recording medium |
CN111078650A (en) * | 2019-12-20 | 2020-04-28 | 成都康赛信息技术有限公司 | File storage method |
CN111274004A (en) * | 2020-02-27 | 2020-06-12 | 深圳市腾讯信息技术有限公司 | Process instance management method and device and computer storage medium |
CN113094526A (en) * | 2021-04-23 | 2021-07-09 | 深圳壹账通创配科技有限公司 | Picture batch uploading and displaying method and device, computer equipment and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101859316A (en) * | 2010-04-29 | 2010-10-13 | 北京无限立通通讯技术有限责任公司 | Method and device for mass file access |
CN102314512A (en) * | 2011-09-16 | 2012-01-11 | 北京理工大学 | Synchronous storage system and method of data file based on Bluetooth technology |
-
2012
- 2012-09-19 CN CN2012103486258A patent/CN102904931A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101859316A (en) * | 2010-04-29 | 2010-10-13 | 北京无限立通通讯技术有限责任公司 | Method and device for mass file access |
CN102314512A (en) * | 2011-09-16 | 2012-01-11 | 北京理工大学 | Synchronous storage system and method of data file based on Bluetooth technology |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105701178A (en) * | 2016-01-05 | 2016-06-22 | 北京汇商融通信息技术有限公司 | Distributed image storage system |
CN105701178B (en) * | 2016-01-05 | 2017-06-09 | 北京汇商融通信息技术有限公司 | Distributed picture storage system |
CN106940733A (en) * | 2017-04-12 | 2017-07-11 | 福建中金在线信息科技有限公司 | A kind of picture storage method and server |
CN107562786A (en) * | 2017-07-27 | 2018-01-09 | 平安科技(深圳)有限公司 | File memory method, terminal and computer-readable recording medium |
CN111078650A (en) * | 2019-12-20 | 2020-04-28 | 成都康赛信息技术有限公司 | File storage method |
CN111274004A (en) * | 2020-02-27 | 2020-06-12 | 深圳市腾讯信息技术有限公司 | Process instance management method and device and computer storage medium |
CN111274004B (en) * | 2020-02-27 | 2023-06-20 | 深圳市腾讯信息技术有限公司 | Process instance management method and device and computer storage medium |
CN113094526A (en) * | 2021-04-23 | 2021-07-09 | 深圳壹账通创配科技有限公司 | Picture batch uploading and displaying method and device, computer equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102904931A (en) | Method for storing and reading picture | |
US10353884B2 (en) | Two-stage front end for extent map database | |
CN104408091B (en) | The date storage method and system of distributed file system | |
CN103327052B (en) | Date storage method and system and data access method and system | |
CN103605805B (en) | A kind of storage method of magnanimity time series data | |
CN102821138B (en) | Metadata distributed storage method applicable to cloud storage system | |
JP2012531675A5 (en) | ||
CN102332027A (en) | Mass non-independent small file associated storage method based on Hadoop | |
EP2688000A1 (en) | Data deduplication method and device | |
US10310765B1 (en) | Record-oriented data storage for a distributed storage system | |
US20160171025A1 (en) | Method and apparatus for object storage | |
CN102915278A (en) | Data deduplication method | |
CN105117451B (en) | A kind of storage method of map tile file | |
CN104965845A (en) | Small file positioning method and system | |
CN102768662A (en) | Method and device for loading picture | |
CN109976669A (en) | A kind of edge storage method, device and storage medium | |
CN105279258A (en) | File storage method and system with even distribution function | |
CN107111460A (en) | Use the data de-duplication of block file | |
CN102523301A (en) | Method for caching data on client in cloud storage | |
CN107135662B (en) | Differential data backup method, storage system and differential data backup device | |
CN104182487A (en) | Unified storage method supporting various storage modes | |
CN108287869A (en) | A kind of mass small documents solution based on speedy storage equipment | |
CN102024019A (en) | Suffix tree based catalog organizing method in distributed file system | |
CN103473258A (en) | Cloud storage file system | |
US9063949B2 (en) | Inferring a sequence of editing operations to facilitate merging versions of a shared document |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C05 | Deemed withdrawal (patent law before 1993) | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20130130 |