[go: up one dir, main page]

CN103164452B - The method of picture-storage and reading, Apparatus and system - Google Patents

The method of picture-storage and reading, Apparatus and system Download PDF

Info

Publication number
CN103164452B
CN103164452B CN201110420176.9A CN201110420176A CN103164452B CN 103164452 B CN103164452 B CN 103164452B CN 201110420176 A CN201110420176 A CN 201110420176A CN 103164452 B CN103164452 B CN 103164452B
Authority
CN
China
Prior art keywords
picture
data block
data length
different size
data
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.)
Active
Application number
CN201110420176.9A
Other languages
Chinese (zh)
Other versions
CN103164452A (en
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.)
Shenzhen Tencent Computer Systems Co Ltd
Original Assignee
Shenzhen Tencent Computer Systems 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 Shenzhen Tencent Computer Systems Co Ltd filed Critical Shenzhen Tencent Computer Systems Co Ltd
Priority to CN201110420176.9A priority Critical patent/CN103164452B/en
Publication of CN103164452A publication Critical patent/CN103164452A/en
Application granted granted Critical
Publication of CN103164452B publication Critical patent/CN103164452B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention is applicable to field of computer technology, provide the method for picture-storage and reading, Apparatus and system, described picture-storage method comprises: the N of same former figure is opened different size picture and is stored in same data block successively, described N be more than or equal to 2 integer; According to described data block generating indexes information, described index information comprises the order of picture in described data block and data length thereof of often opening different size.The present invention is by storing the synthesis of the different size picture of same former figure a data block, and by configuration corresponding index information, the different size picture in data block is distinguished, make the picture concerned of same former figure different size be not easy to occur excalation phenomenon, and decrease system resources consumption on certain procedures.

Description

The method of picture-storage and reading, Apparatus and system
Technical field
The invention belongs to field of computer technology, particularly relate to the method for picture-storage and reading, Apparatus and system.
Background technology
Under the picture browsing such as image processing software, network album scene, generally for the different viewing demand meeting user, or in order to adapt to different network environments, need same pictures to be processed into multiple size to tackle different application scenarioss.Such as browsing pictures in the photograph album of QQ space, user can select to check picture with the different size such as thumbnail, middle figure, large figure, high definition figure usually.
For above-mentioned situation, prior art is a picture former figure being compressed into multiple different size, and the picture of each size is corresponded to a file, store respectively according to different indexes and data storage location, the file of multiple size has different indexes and data storage location.Therefore there is following defect in prior art: when 1, the picture of multiple size uses multiple index and storage block, may occur the situation that multiple size image data is inconsistent, such as portion size disappearance, or two sizes corresponding be not same former figure; 2, multiple index and storage block, consumes inode node and the storage space of a large amount of bottoms.
Summary of the invention
The object of the embodiment of the present invention is to provide a kind of picture-storage method, is intended to solve existing many sizes picture storage mode and easily causes portion size picture to be lost, and the problem that system resources consumption is large.
The embodiment of the present invention is achieved in that a kind of picture-storage method, and described method comprises:
The N of same former figure is opened different size picture to be stored in same data block successively, described N be more than or equal to 2 integer;
According to described data block generating indexes information, described index information comprises the order of picture in described data block and data length thereof of often opening different size.
Another object of the embodiment of the present invention is to provide a kind of picture read method, and described method opens different size picture for the N reading same former figure in same data block, described N be more than or equal to 2 integer, described method comprises:
The order of picture in described data block and data length thereof of often opening different size is obtained by index information;
According to described order and data length, in described data block, intercept required picture.
Another object of the embodiment of the present invention is to provide a kind of data storage device, and described device comprises:
Memory module, is stored in same data block for the N of same former figure is opened different size picture successively, described N be more than or equal to 2 integer;
Index generation module, for according to described data block generating indexes information, described index information comprises the order of picture in described data block and data length thereof of often opening different size.
Another object of the embodiment of the present invention is to provide a kind of figure slice reading device, and described device opens different size picture for the N reading same former figure in same data block, described N be more than or equal to 2 integer, comprising:
Data length acquisition module, for obtaining the order of picture in described data block and data length thereof of often opening different size by index information;
Picture acquisition module, for according to described order and data length, intercepts required picture in described data block.
The embodiment of the present invention is by storing the synthesis of the different size picture of same former figure a data block, and by configuration corresponding index information, the different size picture in data block is distinguished, make the picture concerned of same former figure different size be not easy to occur excalation phenomenon, and decrease system resources consumption on certain procedures.
Accompanying drawing explanation
Fig. 1 is the realization flow figure of the picture-storage method that first embodiment of the invention provides;
Fig. 2 is that the picture-storage method that provides of first embodiment of the invention realizes schematic diagram in concrete application scenarios;
Fig. 3 is the realization flow figure of the picture read method that second embodiment of the invention provides;
Fig. 4 is the specific implementation process flow diagram of the picture read method step S202 that second embodiment of the invention provides;
Fig. 5 is that the picture read method that provides of second embodiment of the invention realizes schematic diagram in concrete application scenarios;
Fig. 6 is the structural drawing of the picture system that third embodiment of the invention provides.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
The embodiment of the present invention is by storing the synthesis of the different size picture of same former figure a data block, and by configuration corresponding index information, the different size picture in data block is distinguished, make the picture concerned of same former figure different size be not easy to occur excalation phenomenon, and decrease system resources consumption on certain procedures.
Fig. 1 shows the realization flow of the picture-storage method that first embodiment of the invention provides, and details are as follows:
In step S101, the N of same former figure is opened different size picture and is stored in successively in same data block.
Usually, when needing the different size picture according to the same Zhang Yuantu of different application scene display, the meeting former figure that first basis gets carries out compression process in various degree, thus obtain the picture of several different size sizes, the image content obtained is consistent, only represents different sizes because of the difference of compressibility.
After the N obtaining same Zhang Yuantu in process opens different size picture, successively N pictures is stored in same data block, to facilitate the picture of the size finding needs when reading image data according to order, wherein, N be more than or equal to 2 integer.Preferably, according to the order that size is ascending or descending, different size picture can be stored in same data block successively.
In step s 102, according to described data block generating indexes information, described index information comprises the order of picture in described data block and data length thereof of often opening different size.
In the present embodiment, for the data block storing different size picture generates corresponding index information, for when exhibiting pictures, conveniently required picture can be read from data block.Wherein, index information includes and is stored in the order of every pictures in this data block in this data block and shared data length thereof.
As one embodiment of the present of invention, the memory location of described data block can also be write described index information, by the memory location in index information, namely data block and corresponding index information thereof establish incidence relation.
As another embodiment of the present invention, can also comprise in index information store in this data block picture number, data block associated by it format identification (FID), this format identification (FID) is for indicating that this data block is the data block of being synthesized by many sizes picture.Meanwhile, can also comprise information of the version number for indicating this block data structure etc. in index information, index information content can decide according to embody rule scene, in this no limit.
As a realization example of the present invention, below for wherein a part of data structure of the index information shown in table 1, a kind of implementation of the present embodiment picture-storage method index information is described:
Flag
Head Len
Head
Table 1
As shown in table 1, this index information can be applied to the application scenarioss such as individual subscriber space photograph album, wherein, flag data bit is format identification (FID), for indicating that the data block that this index information associates is the data block that many sizes picture synthesizes, head data bit stores the data block relevant information of this index information association, comprises the data length of every pictures in the data block mentioned in step S102, etc.Headlen data bit for indicating the data block relevant information stored in this index information, i.e. the length of head data bit.Illustrate at this, the structure of head data bit can be defined as follows:
Wherein, ver is the version number of the data block of its association, and this version number can identify the structure of this data block; Id can be used for defining this data block specifically for which business scenario, such as, be applied to individual subscriber space photograph album; Uin can be used for identifying the user profile uploading picture in this data block, namely the user account in this space is used, num then represents the picture number in data block, array off_a can be used for identifying the picture data length within the data block of often kind of size, num and off_a, when carrying out picture and reading, can be used to refer to the picture how cutting out the size of needs from data block.
As a preferred embodiment of the present invention, index information can be added in addition the head data of data block, using as backup, prevent when index information in index occurs to lose, the situation that the relevant information of data block cannot be given for change.
The realization flow of said method is described below in concrete application scenarios, concrete application scenarios can be that user's uploading pictures is to network album, cyberspace etc., as shown in Figure 2, first user uploads a former figure by upper transmission module 21, this former figure returns the cover figure comprising multiple different size picture by the process of picture processing module 22, cover diagram data block is obtained according to said method again by upper transmission module 22, this cover diagram data block comprises the data block and corresponding index information that store multiple size picture, and index information and data block are stored as index data and file data blocks respectively.
In the present embodiment, by above-mentioned embodiment, namely the synthesis of the picture of the different size size of same former figure can be stored in a data block, efficiently avoid the situation that portion size image data is lost, and save the bottom inode node consumption and system storage consumption that are brought by multiple index and multiple data block in a large number, save system resource.
Fig. 3 shows the realization flow of the picture read method that second embodiment of the invention provides, and the picture-storage method that the present embodiment provides based on first embodiment of the invention realizes, and details are as follows for its concrete realization flow:
In step S301, obtained the order of picture in described data block and data length thereof of often opening different size by index information.
In the present embodiment, by search index, obtain the index information associated by data block at the picture place of required size, and from this index information, get order and the data length thereof of every pictures that this data block stores.As a realization example of the present invention, in data block, the data length of every pictures according to every pictures ordering within the data block, can be acquired in the mode of array.
Meanwhile, as one embodiment of the present of invention, also need the memory location getting this data block from index information, so that navigate to this data block, carry out image data intercepting.
In step s 302, according to described order and data length, in described data block, intercept required picture.
In the present embodiment, because every pictures of different size in data block all stores according to a graded successively when storing, therefore, according to order in this data block of the picture of each size and data length, namely can navigate to required size picture particular location within the data block, thus directly within the data block this picture be intercepted according to the position of orienting.
For step S302, particularly, flow process as shown in Figure 4 the picture of required size can be intercepted:
In step S401, calculate according to described order and data length all pictures be arranged in described data block before described required picture data length and.
Such as, by size, to carry out sizes of memory successively to large order be the picture of 300*400,600*800 and 960*1280 from little, to read the picture being of a size of 600*800, then according to the order preset, the second of picture arrangement in data block of 600*800 can be known.
In the present embodiment, calculate all pictures be arranged within the data block before required picture data length and, namely representative calculated the data-bias of required picture in affiliated data block.Such as array off_a identifies the picture data length within the data block of often kind of size, then required picture data-bias is within the data block wherein, n is the ranking within the data block of required picture.
As one embodiment of the present of invention, when index information being added in addition the head data of data block using during as backup, when the data-bias of required picture being calculated in step S401, also need the data length calculated and in add the data length of a data.
In step S402, according to described memory location, data length and and the data length of required picture, intercept required picture.
In the present embodiment, by described data length and and the data length of required picture, namely can determine required picture position within the data block, from data block, intercept out required picture exactly.
The realization flow of above-mentioned picture read method is described below in concrete application scenarios, concrete application scenarios can be customer access network photograph album, cyberspace etc., as shown in Figure 5, when user needs the picture of download n-th size, download module 51 is search index data first, obtain the memory location of picture in file data blocks of the n-th size, order and data length, after the skew of the picture calculating the n-th size according to the above-mentioned information got in file data blocks, namely the picture of the n-th size can be intercepted out exactly from file data blocks.
The embodiment of the present invention, by the synthesis of the different size picture of same former figure being carried out storing a data block and configure corresponding index information, makes when reading picture, can the position of orienting required picture exactly within the data block.
Fig. 6 shows the structure of the picture system that third embodiment of the invention provides, and for convenience of explanation, illustrate only part related to the present embodiment.
With reference to Fig. 6, this data system can be the system that the webserver, network hard disc etc. need to carry out many sizes picture-storage and reading, and comprise picture storage means 61 and corresponding figure slice reading device 62, wherein, picture storage means 61 comprises:
Memory module 611, opens different size picture by the N of same former figure and is stored in same data block successively, described N be more than or equal to 2 integer.
Index generation module 612, according to described data block generating indexes information, described index information comprises the order of picture in described data block and data length thereof of often opening different size.
As one embodiment of the present of invention, index generation module 612 is also for writing described index information by the memory location of described data block in storage space.
And figure slice reading device comprises:
Data length acquisition module 621, obtains the order of picture in described data block and data length thereof of often opening different size by index information.
Picture acquisition module 622, according to described order and data length, intercepts required picture in described data block.
Also comprise:
Memory location acquisition module 623, obtains the memory location of described data block in storage space by described index information.
Particularly, picture acquisition module 622 comprises:
Data length and calculating sub module 6221, according to described order and data length and calculating be arranged in described data block all pictures before described required picture data length and.
Intercept submodule 6222, according to described memory location, data length and and the data length of required picture, intercept required picture.
The embodiment of the present invention is by storing the synthesis of the different size picture of same former figure a data block, and by configuration corresponding index information, the different size picture in data block is distinguished, make the picture concerned of same former figure different size be not easy to occur excalation phenomenon, and decrease system resources consumption on certain procedures.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all any amendments done within the spirit and principles in the present invention, equivalent replacement and improvement etc., all should be included within protection scope of the present invention.

Claims (8)

1. a picture-storage method, is characterized in that, described method comprises:
The N of same former figure is opened different size picture to be stored in same data block successively, described N be more than or equal to 2 integer;
According to described data block generating indexes information, described index information comprises the order of picture in described data block and data length thereof of often opening different size, and the memory location of described data block in storage space.
2. a picture read method, is characterized in that, described method opens different size picture for the N reading same former figure in same data block, described N be more than or equal to 2 integer, described method comprises:
The order of picture in described data block and data length thereof of often opening different size is obtained by index information;
According to described order and data length, in described data block, intercept required picture.
3. method as claimed in claim 2, is characterized in that, also comprise and obtain the memory location of described data block in storage space by index information, according to described memory location, order and data length, intercepts required picture in described data block.
4. method as claimed in claim 3, is characterized in that, described according to described memory location, order and data length, and the step intercepting required picture in described data block is specially:
Calculate according to described order and data length all pictures be arranged in described data block before described required picture data length and;
According to described memory location, data length and and the data length of required picture, intercept required picture.
5. a data storage device, is characterized in that, described device comprises:
Memory module, is stored in same data block for the N of same former figure is opened different size picture successively, described N be more than or equal to 2 integer;
Index generation module, for according to described data block generating indexes information, described index information comprises the order of picture in described data block and data length thereof of often opening different size, and the memory location of described data block in storage space.
6. a figure slice reading device, is characterized in that, described device opens different size picture for the N reading same former figure in same data block, described N be more than or equal to 2 integer, comprising:
Data length acquisition module, for obtaining the order of picture in described data block and data length thereof of often opening different size by index information;
Picture acquisition module, for according to described order and data length, intercepts required picture in described data block.
7. device as claimed in claim 6, is characterized in that, also comprise:
Memory location acquisition module, for obtaining the memory location of described data block in storage space by index information.
8. device as claimed in claim 7, it is characterized in that, described picture acquisition module comprises:
Data length and calculating sub module, for calculate according to described order and data length all pictures be arranged in described data block before described required picture data length and;
Intercept submodule, for according to described memory location, data length and and the data length of required picture, intercept required picture.
CN201110420176.9A 2011-12-15 2011-12-15 The method of picture-storage and reading, Apparatus and system Active CN103164452B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110420176.9A CN103164452B (en) 2011-12-15 2011-12-15 The method of picture-storage and reading, Apparatus and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110420176.9A CN103164452B (en) 2011-12-15 2011-12-15 The method of picture-storage and reading, Apparatus and system

Publications (2)

Publication Number Publication Date
CN103164452A CN103164452A (en) 2013-06-19
CN103164452B true CN103164452B (en) 2016-04-13

Family

ID=48587546

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110420176.9A Active CN103164452B (en) 2011-12-15 2011-12-15 The method of picture-storage and reading, Apparatus and system

Country Status (1)

Country Link
CN (1) CN103164452B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105100826B (en) * 2015-07-17 2018-11-23 小米科技有限责任公司 Image processing method, apparatus and system
CN105611341B (en) * 2015-12-21 2019-02-22 小米科技有限责任公司 A kind of method, apparatus and system for transmitting image
CN107798093B (en) * 2017-10-25 2022-05-03 成都尽知致远科技有限公司 Image retrieval method
CN107679235B (en) * 2017-10-25 2021-09-21 成都尽知致远科技有限公司 Retrieval system based on cloud platform
CN107766087A (en) 2017-10-31 2018-03-06 歌尔科技有限公司 Image processing method, method for displaying user interface and equipment
CN113568578B (en) * 2021-07-27 2023-10-10 北京奇艺世纪科技有限公司 Picture processing method and device, electronic equipment and readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1551019A (en) * 2003-05-14 2004-12-01 ������������ʽ���� Recording medium, image recording apparatus and image recording method
CN1851692A (en) * 2005-08-05 2006-10-25 华为技术有限公司 Picture data storage and read method
JP2011090648A (en) * 2009-10-26 2011-05-06 Sony Computer Entertainment Inc Image processing device and image processing method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090185762A1 (en) * 2008-01-18 2009-07-23 Inventec Corporation Data structure for image file

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1551019A (en) * 2003-05-14 2004-12-01 ������������ʽ���� Recording medium, image recording apparatus and image recording method
CN1851692A (en) * 2005-08-05 2006-10-25 华为技术有限公司 Picture data storage and read method
JP2011090648A (en) * 2009-10-26 2011-05-06 Sony Computer Entertainment Inc Image processing device and image processing method

Also Published As

Publication number Publication date
CN103164452A (en) 2013-06-19

Similar Documents

Publication Publication Date Title
CN103164452B (en) The method of picture-storage and reading, Apparatus and system
US10140743B2 (en) Displaying clusters of media items on a map using representative media items
CA2766140C (en) Non-homogeneous objects magnification and reduction
US20140222809A1 (en) Processing media items in location-based groups
WO2016077834A1 (en) Systems and methods of building and using an image catalog
US20160179760A1 (en) Photo narrative essay application
EP3472729A1 (en) Suggesting image files for deletion based on image file parameters
CN105677904A (en) Distributed file system based small file storage method and device
WO2018067415A1 (en) Automatically uploading image files based on image capture context
CN111708738A (en) Method and system for realizing data inter-access between hdfs of hadoop file system and s3 of object storage
US8862995B1 (en) Automatically creating a movie from geo located content using earth
CN110062028A (en) Data synchronous method, apparatus, computer equipment and computer storage medium
US20220035851A1 (en) Systems and methods to autonomously add geolocation information to media objects
US7870137B2 (en) Information processing apparatus, information processing method, and program
CN102789458B (en) A kind of image file disposal route and system
US8635270B2 (en) Thread mechanism for media and metadata upload
CN103838746A (en) Method for multiple CPU systems to share storage data and systems
US20090198739A1 (en) File management method and system for image capturing device
US20140040242A1 (en) Method and device based on android system for tracking imported file
EP2686791B1 (en) Variants of files in a file system
CN103345495A (en) Method for speedy presentation of ultra-precise image in network environment
US8824794B1 (en) Graduated color correction of digital terrain assets across different levels of detail
EP2960778A1 (en) A storage abstraction layer and a system and a method thereof
KR101228057B1 (en) Method for sharing memos corresponding contents and recording-medium recorded program thereof
KR100563085B1 (en) Composite display method of numerical map and photographic image

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant