CN102904931A - Method for storing and reading picture - Google Patents

Method for storing and reading picture Download PDF

Info

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
Application number
CN2012103486258A
Other languages
Chinese (zh)
Inventor
李超
周朋辉
吴继平
李沛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
HENAN RUIZHIQI INFORMATION TECHNOLOGY CO LTD
Original Assignee
HENAN RUIZHIQI INFORMATION TECHNOLOGY CO LTD
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by HENAN RUIZHIQI INFORMATION TECHNOLOGY CO LTD filed Critical HENAN RUIZHIQI INFORMATION TECHNOLOGY CO LTD
Priority to CN2012103486258A priority Critical patent/CN102904931A/en
Publication of CN102904931A publication Critical patent/CN102904931A/en
Pending legal-status Critical Current

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

A kind of picture-storage and read method
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.
CN2012103486258A 2012-09-19 2012-09-19 Method for storing and reading picture Pending CN102904931A (en)

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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

Patent Citations (2)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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
CN103327052B (en) Date storage method and system and data access method and system
CN101446984B (en) Method and device for storing files and method and device for deleting files
CN102821138B (en) Metadata distributed storage method applicable to cloud storage system
US10089338B2 (en) Method and apparatus for object storage
CN103282899B (en) The storage method of data, access method and device in file system
JP2012531675A5 (en)
CN102332027A (en) Mass non-independent small file associated storage method based on Hadoop
US10310765B1 (en) Record-oriented data storage for a distributed storage system
EP3196781A1 (en) Method and apparatus for deleting duplicate data
CN102915278A (en) Data deduplication method
CN103268270B (en) The management method of snapshot and device
KR102179855B1 (en) Web page deduplication method and apparatus
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
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
CN103793475A (en) Distributed file system data migration method
US9063949B2 (en) Inferring a sequence of editing operations to facilitate merging versions of a shared document
CN107741968A (en) A kind of method of document retrieval, system, device and computer-readable recording medium
CN102955808A (en) Data acquisition method and distributed file system

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