CN103019895B - File storage method and device - Google Patents

File storage method and device Download PDF

Info

Publication number
CN103019895B
CN103019895B CN201210586541.8A CN201210586541A CN103019895B CN 103019895 B CN103019895 B CN 103019895B CN 201210586541 A CN201210586541 A CN 201210586541A CN 103019895 B CN103019895 B CN 103019895B
Authority
CN
China
Prior art keywords
coordinate
data
coordinates
ordinate
orthogonal axes
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
CN201210586541.8A
Other languages
Chinese (zh)
Other versions
CN103019895A (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.)
Hefei Zhonghuan Technology Information Consulting Co ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201210586541.8A priority Critical patent/CN103019895B/en
Publication of CN103019895A publication Critical patent/CN103019895A/en
Application granted granted Critical
Publication of CN103019895B publication Critical patent/CN103019895B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

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

Abstract

The embodiment of the invention relates to a file storage method and a device. The method comprises the following steps: performing packet processing on data in a binary source file to obtain data sets, wherein the data in each data set is the same; according to the sequence of the data set in the source file, generating a corresponding two-dimensional coordinate for each data set to form a coordinate set, wherein the even coordinate value in the x-coordinate value of the two-dimensional coordinate expresses first data, the y-coordinate value of the two-dimensional coordinate expresses the number of the data expressed by the x-coordinate value, and the first data is 0 or 1; and storing the coordinate set onto storage equipment, therefore, the size of a mirror image file is decreased, the consumption to a back-end disk can be reduced, and the reading and writing speed of data can be accelerated, so that the processing efficiency is improved. To each file, the file is subjected to partition processing, so that the mirror image quantity of one file and even one file block can be flexibly added during mirroring.

Description

File memory method and device
Technical field
The present invention relates to technical field of memory, particularly relate to a kind of file memory method and device.
Background technology
Along with the scope of computer utility constantly expands, data storage technology is deep into finance, communication, the all trades and professions such as insurance, the data of these industries possess a common ground: data security is primary, even when there is disaster, and the recovery that data all must at all not leaked, so mirror image technology arises at the historic moment.Mirror image technology is by setting up one and the on all four copy of ontology data, for data provide complete redundancy, data security is greatly improved, its unique deficiency is exactly that needs take large quantity space, but along with the continuous lifting of storage hardware technique, the unit capacity of various storage medium constantly increases.And cost is in continuous reduction, for the universal of mirror image technology has laid solid material base.
For network attached storage (Network Attached Storage, NAS) serve, externally all provide the service of file-level, therefore, file system is absolutely necessary, in order to ensure the data security of file system, usually namely to establish mirror image relation at file system layer, mirror file system has also just been born.
Conventional image file system is when writing data, can raw data be cloned and two parts of identical data are all write rear end disk, these two disks physically often two independently individual, they are equipped with identical two number certificates, therefore, if any a data generation problem, all can 100% recovery.
But there is following shortcoming in this method:
Although storage medium there occurs earth-shaking change in recent years, single-deck capacity can go up T level, but data volume increases with becoming geometric series, the absolute price of adding the medium of present To enterprises level is also not very cheap, cause the cost setting up mirrored storage to be still high, and mirror image technology is limited to the design philosophy of itself, the utilization rate of the useful space only has 50% to be the fact that cannot change, cause when in the face of mass data, the cost of mirror image technology is very high;
Mirror image is write during conventional image file system writing in files, so in general in file system each file there is the mirror image of same number, suppose in a file system, have partial document to be core document, we wish that these core documents have mirror image more more than other file, and other file keeps the mirror image of original quantity, under this application scenarios, traditional mirror file system cannot meet.
Summary of the invention
In first aspect, embodiments provide a kind of file memory method, comprising:
Data in binary source file are carried out packet transaction and obtain data group, the data in data group described in each are identical;
By the order of described data group in described source file, for each described data group generates corresponding two-dimensional coordinate, form set of coordinates, even number coordinate figure in the abscissa value of described two-dimensional coordinate represents the first data, the ordinate value of described two-dimensional coordinate represents the number of the data represented by described abscissa value, and described first data are 0 or 1;
Described set of coordinates is stored on a storage device.
In conjunction with first aspect, in the implementation that the first is possible, the maximal value of the transverse axis coordinate figure of described two-dimensional coordinate is no more than the binary data number in described source file.
In second aspect, embodiments provide a kind of file memory method, comprising:
Data in binary source file are carried out packet transaction and obtain data group, described in each, data group has identical data volume;
By the order of described data group in described source file, for each described data group generates corresponding two-dimensional coordinate, form two-dimensional coordinate group;
By in described two-dimensional coordinate group, there is identical transverse axis coordinate figure, and ordinate of orthogonal axes value continually varying first set of coordinates boil down to cylindrical coordinates, first coordinate figure of described cylindrical coordinates is identical with the transverse axis coordinate figure of described first set of coordinates, second coordinate figure of described cylindrical coordinates is the first coordinate range, and described first coordinate range utilizes the minimum ordinate of orthogonal axes value in described first set of coordinates and maximum ordinate of orthogonal axes value to represent;
Described cylindrical coordinates is stored on a storage device.
In conjunction with second aspect, in the implementation that the first is possible, the maximal value of the ordinate of orthogonal axes value of described two-dimensional coordinate is, data represented when each in described data group being got 1.
In conjunction with the implementation that the first is possible, in the implementation that the second is possible, the ordinate of orthogonal axes value of the first coordinate in described two-dimensional coordinate group is identical with its first corresponding data, if described first data are not more than the second data, then the transverse axis coordinate figure of described first coordinate is add 1 on the basis of transverse axis coordinate figure corresponding to the second data, otherwise, the transverse axis coordinate figure that the transverse axis coordinate figure of described first coordinate is corresponding with described second data is identical, and described second data are the previous data of described first data.
In conjunction with the implementation that the second is possible, in the implementation that the third is possible, by in described two-dimensional coordinate group, there is identical transverse axis coordinate figure, and ordinate of orthogonal axes is worth the second set of coordinates boil down to cylindrical coordinates of discontinuous change, first coordinate figure of described cylindrical coordinates is identical with the transverse axis coordinate figure of described second set of coordinates, when the coordinate quantity in described second set of coordinates is no more than the first amount threshold, other coordinate figure of described cylindrical coordinates comprises the ordinate of orthogonal axes value of described second set of coordinates, otherwise
Other coordinate figure of described cylindrical coordinates comprises negative set of coordinates, and described negative set of coordinates is the ordinate of orthogonal axes value removed from the scope of described ordinate of orthogonal axes value in described second set of coordinates, and remaining ordinate of orthogonal axes value is got negative.
In the third aspect, embodiments provide a kind of file storage device, comprising:
Grouped element, obtain data group for the data in binary source file being carried out packet transaction, the data in data group described in each are identical, and described data group is sent to generation unit;
Generation unit, for receiving the described data group that described grouped element sends, by the order of described data group in described source file, for each described data group generates corresponding two-dimensional coordinate, form set of coordinates, the even number coordinate figure in the abscissa value of described two-dimensional coordinate represents the first data, and the ordinate value of described two-dimensional coordinate represents the number of the data represented by described abscissa value, described first data are 0 or 1, and described set of coordinates is sent to storage unit;
Storage unit, for receiving the described data group that described generation unit sends, stores described set of coordinates on a storage device.
In conjunction with the third aspect, in the implementation that the first is possible, the maximal value of the transverse axis coordinate figure of the described two-dimensional coordinate in described generation unit is no more than the binary data number in described source file.
In fourth aspect, embodiments provide a kind of file storage device, comprising:
Grouped element, obtain data group for the data in binary source file being carried out packet transaction, described in each, data group has identical data volume, and described data group is sent to generation unit;
Generation unit, for receiving the described data group that described grouped element sends, by the order of described data group in described source file, for each described data group generates corresponding two-dimensional coordinate, form two-dimensional coordinate group, described two-dimensional coordinate group is sent to compression unit;
Compression unit, for receiving the described two-dimensional coordinate group that described generation unit sends, by in described two-dimensional coordinate group, there is identical transverse axis coordinate figure, and ordinate of orthogonal axes value continually varying first set of coordinates boil down to cylindrical coordinates, first coordinate figure of described cylindrical coordinates is identical with the transverse axis coordinate figure of described first set of coordinates, second coordinate figure of described cylindrical coordinates is the first coordinate range, described first coordinate range utilizes the minimum ordinate of orthogonal axes value in described first set of coordinates and maximum ordinate of orthogonal axes value to represent, described cylindrical coordinates is sent to storage unit;
Storage unit, for receiving the described cylindrical coordinates that described compression unit sends, stores described cylindrical coordinates on a storage device.
In conjunction with fourth aspect, in the implementation that the first is possible, the maximal value of the ordinate of orthogonal axes value of the described two-dimensional coordinate in described generation unit is, data represented when each in described data group being got 1.
In conjunction with the implementation that the first is possible, in the implementation that the second is possible, the ordinate of orthogonal axes value of the first coordinate in the described two-dimensional coordinate group in described generation unit is identical with its first corresponding data, if described first data are not more than the second data, then the transverse axis coordinate figure of described first coordinate is add 1 on the basis of transverse axis coordinate figure corresponding to the second data, otherwise, the transverse axis coordinate figure that the transverse axis coordinate figure of described first coordinate is corresponding with described second data is identical, and described second data are the previous data of described first data.
In conjunction with the implementation that the second is possible, in the implementation that the third is possible, described compression unit also for:
By in described two-dimensional coordinate group, there is identical transverse axis coordinate figure, and ordinate of orthogonal axes is worth the second set of coordinates boil down to cylindrical coordinates of discontinuous change, first coordinate figure of described cylindrical coordinates is identical with the transverse axis coordinate figure of described second set of coordinates, when the coordinate quantity in described second set of coordinates is no more than the first amount threshold, other coordinate figure of described cylindrical coordinates comprises the ordinate of orthogonal axes value of described second set of coordinates, otherwise
Other coordinate figure of described cylindrical coordinates comprises negative set of coordinates, and described negative set of coordinates is the ordinate of orthogonal axes value removed from the scope of described ordinate of orthogonal axes value in described second set of coordinates, and remaining ordinate of orthogonal axes value is got negative.
In the embodiment of the present invention, by two-dimensional coordinate or cylindrical coordinates are stored as image file, thus reduce the size of image file, and no matter conventional image file system is in write operation or read operation, capital relates to the access of the big data quantity to disk, and on hard disk, only need write or read a small amount of coordinate data based on the mirror file system of two-dimensional coordinate, combination is then all perform at region of memory, the consumption to rear end disk can be reduced like this, the read or write speed of data can also be accelerated, thus add treatment effeciency, for each file, our piecemeal process, this makes us when mirror image, a file even the mirror image quantity of a blocks of files can be increased neatly.
Accompanying drawing explanation
The file memory method process flow diagram that Fig. 1 provides for the embodiment of the present invention one;
The file memory method process flow diagram that Fig. 2 provides for the embodiment of the present invention two;
The file memory method schematic diagram that Fig. 3 provides for the embodiment of the present invention two;
The cylindrical coordinates generation method schematic diagram that Fig. 4 provides for the embodiment of the present invention two;
The file storage device schematic diagram that Fig. 5 provides for the embodiment of the present invention three;
The file storage device schematic diagram that Fig. 6 provides for the embodiment of the present invention four.
Embodiment
For making the object, technical solutions and advantages of the present invention clearly, below in conjunction with accompanying drawing, the specific embodiment of the invention is described in further detail.
We know, 2 numerals are only had inside PC World, namely 0 and 1, no matter how excellent computer software performance is, search to the bottom, still 0 and 1, so, when we at storage file time, as long as know and where writing 0, where write 1 just passable, and a file composition can simply be expressed as: file=file header+source file data, wherein, what store in source file is useful data in file, file header is also referred to as metadata, it is the storage mode to the data stored in source file, the description of data structure etc., do not belong to document text.In above-mentioned equation, the data in source file data can orientate equation below as:
Source file data=position 0* [0|1]+position 1* [0|1]+position 2* [0|1]+position 3* [0|1]+...+position (N-1) * [0|1]+position N* [0|1],
Attention: in above-mentioned equation, symbol " | " represent or the meaning, it is continuous print 0 or continuous print 1 in certain position that the factor (position N* [0|1]) represents, and plus sige (+) represents and they is together in series.
Based on above-mentioned principle, the embodiment of the present invention proposes a kind of file memory method, namely source file can be regarded as a sequence be made up of continuous print 0 and continuous print 1 by us, in source file 0 and 1 can be expressed as the form of two-dimensional coordinate by us, these two-dimensional coordinates can be stored as image file, detailed process is as described below:
What following embodiment described is a kind of file memory method.The file memory method process flow diagram that Fig. 1 provides for the embodiment of the present invention one.As shown in Figure 1, the file memory method that the embodiment of the present invention provides comprises:
S101, the data in binary source file are carried out packet transaction and obtain data group, the data in data group described in each are identical.
Particularly, suppose that source file data are: 0000111111100000011111110000011110
000000101111, then by this packet, to be source file data be the data after grouping: 0000,1111111,000000,1111111,00000,1111,0000000,1,0,1111, can find out that the data in every group are identical.
S102, by the order of described data group in described source file, for each described data group generates corresponding two-dimensional coordinate, form set of coordinates, even number coordinate figure in the abscissa value of described two-dimensional coordinate represents the first data, the ordinate value of described two-dimensional coordinate represents the number of the data represented by described abscissa value, and described first data are 0 or 1.
Particularly, need to calculate the data amount check that each data group comprises, using the ordinate of this number as two-dimensional coordinate, abscissa value enter successively from 0 one (here by transverse axis coordinate figure from 0, also can from other data, as long as transverse axis coordinate figure increases progressively, also can successively decrease, namely coordinate figure is only to successively decrease or to increase progressively always always, identical in this below, repeat no more), and the even number value set in horizontal ordinate represents 0, odd number value represents 1, can certainly do contrary setting.
Data group with above: 0000,1111111,000000,1111111,00000,1111,0000000,1,0,1111 is example, the two-dimensional coordinate generated for these data groups is respectively (0,4), (1,7), (2,6), (3,7), (4,5), (5,4), (6,7) (7,1), (8,1), (9,4).
With second coordinate (1,7) for example, source file data are seven 1, if this segment data is copied one time, then data volume is seven bits, if write as the form of coordinate, data volume is the data volume of two coordinate figures, transverse axis coordinate figure is 1, therefore takies 1 bit, and ordinate of orthogonal axes value is 7, therefore, take 3 bits, summation is 4 bits, is less than the data volume copied, therefore, stored number can be reduced.
S103, stores described set of coordinates on a storage device.
Particularly, due to set in S102 represent Y-axis record when transverse axis coordinate figure is even number be 0 number, what transverse axis coordinate figure represented Y-axis record when being odd number is 1 number, therefore, can know that the content of source file is 0000111111100000011111110000011110000000101111 according to above-mentioned coordinate.
In addition, as can be seen from said process, occur if the content of source file is 0 and 1 interval circulation, then can know that the maximal value of the transverse axis coordinate figure of two-dimensional coordinate is the binary data number in source file.
What above-described embodiment described is that the data in binary source file are carried out packet transaction and obtain data group, the data in data group described in each are identical; By the order of described data group in described source file, for each described data group generates corresponding two-dimensional coordinate, form set of coordinates, even number coordinate figure in the abscissa value of described two-dimensional coordinate represents the first data, the ordinate value of described two-dimensional coordinate represents the number of the data represented by described abscissa value, and described first data are 0 or 1; Described set of coordinates is stored on a storage device.Thus reduce the size of image file, and no matter conventional image file system is in write operation or read operation, capital relates to the access of the big data quantity to disk, and on hard disk, only need write or read a small amount of coordinate data based on the mirror file system of two-dimensional coordinate, combination is then all perform at region of memory, the consumption to rear end disk can be reduced like this, the read or write speed of data can also be accelerated, thus add treatment effeciency, for each file, our piecemeal process, this makes us when mirror image, a file even the mirror image quantity of a blocks of files can be increased neatly.
Can be found out by above-described embodiment, the number of bits comprised due to a file is very big, if as stated above, treatment effeciency is lower, for improving treatment effeciency, multiple data can be processed as a unit, therefore, the embodiment of the present invention proposes the another kind of file memory method based on two-dimensional coordinate.The file memory method process flow diagram that Fig. 2 provides for the embodiment of the present invention two.As shown in Figure 2, the file memory method that the embodiment of the present invention provides comprises:
S201, the data in binary source file are carried out packet transaction and obtain data group, described in each, data group has identical data volume.
Data volume in each data group can be 1 byte, may also be other size, for setting forth conveniently, here for 1 byte, we know that a byte is made up of 8 bits, and therefore, it has 256 kinds of combinations, also can represent 256 kinds of states, we using these 256 kinds of states namely also 0 (00000000) ~ 255 (11111111) as the content of the ordinate of orthogonal axes value of two-dimensional coordinate.Suppose that the content of source file is: 00,000,011,000,010,000,000,000,100,000,111,000,001,110,000,100,000,111,000 0011100001, the data after division are 00000011,00001000,00000001,00000111,00000111,0000100,00000010,00001001,00000110, divide into 6 groups by source file data, define data group (3,8,1,7,7,8,2,5,6), wherein the discontented byte of last group, mends 0 at low level.
S202, by the order of described data group in described source file, for each described data group generates corresponding two-dimensional coordinate, forms two-dimensional coordinate group.
Particularly, be that each described data group generates corresponding two-dimensional coordinate in order, process for data genaration two-dimensional coordinate is process data being write two-dimensional coordinate system, when in order above-mentioned data group being write in two-dimensional coordinate system, the ordinate of orthogonal axes value of the first coordinate in described two-dimensional coordinate group is identical with its first corresponding data, if described first data are not more than the second data, then the transverse axis coordinate figure of described first coordinate is add 1 on the basis of transverse axis coordinate figure corresponding to the second data, otherwise, the transverse axis coordinate figure that the transverse axis coordinate figure of described first coordinate is corresponding with described second data is identical, described second data are the previous data of described first data.
Being convenient to for making technique scheme understand, elaborating the process of data group (3,8,1,7,7,8,2,5,6) write two-dimensional coordinate system for Fig. 3 below, the file memory method schematic diagram that Fig. 3 provides for the embodiment of the present invention two.Particularly, first first data " 3 " being write X-coordinate is 0, and Y-coordinate is in the coordinate of 3, then by second data " 8 " write coordinate system, because 8 are greater than 3, therefore, X-coordinate is constant, and in the coordinate be by " 8 " write Y-coordinate, the 3rd data are " 7 ", 7 are less than 8, therefore, need X-coordinate to add that 1(enters by 0 is 1), then " 7 " being write X-coordinate is 1, Y-coordinate is in the coordinate of 7, by that analogy, and can by other data write coordinate system.
Therefrom can find out, the maximal value that Y-coordinate can represent is 255(scale-of-two: 11111111).Therefore, the maximal value of the ordinate of orthogonal axes value of described two-dimensional coordinate is, data represented when each in described data group being got 1.
S203, by in described two-dimensional coordinate group, there is identical transverse axis coordinate figure, and ordinate of orthogonal axes value continually varying first set of coordinates boil down to cylindrical coordinates, first coordinate figure of described cylindrical coordinates is identical with the transverse axis coordinate figure of described first set of coordinates, second coordinate figure of described cylindrical coordinates is the first coordinate range, and described first coordinate range utilizes the minimum ordinate of orthogonal axes value in described first set of coordinates and maximum ordinate of orthogonal axes value to represent.
Particularly, after all data genaration two-dimensional coordinates, also need the two-dimensional coordinate of generation to be done compression process, to reduce file size.The cylindrical coordinates generation method schematic diagram that Fig. 4 provides for the embodiment of the present invention two.As shown in the figure (a) in Fig. 4, suppose to have coordinate in the set of coordinates of identical X-coordinate for (A, a), (A, b), (A, c), (A, d), (A, e), then these coordinates can be written as cylindrical coordinates (A, a ~ e), this cylindrical coordinates represents that a, b, c, d, e are selected.
Described method also comprises: have identical transverse axis coordinate figure by described two-dimensional coordinate group, and ordinate of orthogonal axes is worth the second set of coordinates boil down to cylindrical coordinates of discontinuous change, first coordinate figure of described cylindrical coordinates is identical with the transverse axis coordinate figure of described second set of coordinates, when the coordinate quantity in described second set of coordinates is no more than the first amount threshold, other coordinate figure of described cylindrical coordinates comprises the ordinate of orthogonal axes value of described second set of coordinates, otherwise, other coordinate figure of described cylindrical coordinates comprises negative set of coordinates, described negative set of coordinates is the ordinate of orthogonal axes value removed from the scope of described ordinate of orthogonal axes value in described second set of coordinates, remaining ordinate of orthogonal axes value is got negative.For the figure (b) in Fig. 4, suppose that the coordinate had in the set of coordinates of identical X-coordinate is (A, b), (A, c), (A, d), (A, e), (A, g), (A, h), only have data a and f not selected, namely the data do not chosen are 2, the data chosen are 6, the coordinate that these are chosen can be expressed as cylindrical coordinates (A, b, c, d, e, f, h), also these coordinates can be expressed as cylindrical coordinates (A,-a,-f), visible, in second, method more saves space, therefore second cylindrical coordinates is adopted, this cylindrical coordinates represents except a, outside f, other data are selected.Shown in figure (c) in Fig. 4 be: the coordinate had in the set of coordinates of identical X-coordinate is (A, c), (A, e), (A, g), then these coordinates can be written as cylindrical coordinates (A, c, e, g), this cylindrical coordinates represents that c, e, g are selected.
Therefrom can find out, the first amount threshold is a half of the maximal value of described ordinate of orthogonal axes value, and the cylindrical coordinates obtained more saves space.
S204, stores described cylindrical coordinates on a storage device.
In order above-mentioned cylindrical coordinates storage can be formed image file.
What above-described embodiment described is that the data in binary source file are carried out packet transaction and obtain data group, described in each, data group has identical data volume, by the order of described data group in described source file, for each described data group generates corresponding two-dimensional coordinate, form two-dimensional coordinate group, by in described two-dimensional coordinate group, there is identical transverse axis coordinate figure, and ordinate of orthogonal axes value continually varying first set of coordinates boil down to cylindrical coordinates, described cylindrical coordinates is stored on a storage device, thus reduce the size of image file, and no matter conventional image file system is in write operation or read operation, capital relates to the access of the big data quantity to disk, and on hard disk, only need write or read a small amount of coordinate data based on the mirror file system of two-dimensional coordinate, combination is then all perform at region of memory, the consumption to rear end disk can be reduced like this, the read or write speed of data can also be accelerated, thus add treatment effeciency, for each file, our piecemeal process, this makes us when mirror image, a file even the mirror image quantity of a blocks of files can be increased neatly.
Correspondingly, embodiments provide the file storage device corresponding with file memory method, what following embodiment described is the file storage device corresponding with the file memory method of above-described embodiment one.The file storage device schematic diagram that Fig. 5 provides for the embodiment of the present invention three.As shown in Figure 5, the device that the embodiment of the present invention provides comprises: determining unit 501, generation unit 502 and storage unit 503.
Determining unit 501, obtain data group for the data in binary source file being carried out packet transaction, the data in data group described in each are identical, and described data group is sent to generation unit 502;
Generation unit 502, for receiving the described data group that described determining unit 501 sends, by the order of described data group in described source file, for each described data group generates corresponding two-dimensional coordinate, form set of coordinates, the even number coordinate figure in the abscissa value of described two-dimensional coordinate represents the first data, and the ordinate value of described two-dimensional coordinate represents the number of the data represented by described abscissa value, described first data are 0 or 1, and described set of coordinates is sent to storage unit 503;
Storage unit 503, for receiving the described data group that described generation unit 502 sends, stores described set of coordinates on a storage device.
The maximal value of the transverse axis coordinate figure of the described two-dimensional coordinate in described generation unit 502 is no more than the binary data number in described source file.
It should be noted that, the device that the embodiment of the present invention provides implants the file memory method in above-described embodiment one, and therefore, the course of work of the unit included by the device that the embodiment of the present invention provides does not repeat again at this.
What above-described embodiment described is that the data in binary source file are carried out packet transaction and obtained data group by grouped element, and the data in data group described in each are identical; Generation unit is by the order of described data group in described source file, for each described data group generates corresponding two-dimensional coordinate, form set of coordinates, even number coordinate figure in the abscissa value of described two-dimensional coordinate represents the first data, the ordinate value of described two-dimensional coordinate represents the number of the data represented by described abscissa value, and described first data are 0 or 1 yuan; Described set of coordinates stores on a storage device by storage unit.Thus reduce the size of image file, and no matter conventional image file system is in write operation or read operation, capital relates to the access of the big data quantity to disk, and on hard disk, only need write or read a small amount of coordinate data based on the mirror file system of two-dimensional coordinate, combination is then all perform at region of memory, the consumption to rear end disk can be reduced like this, the read or write speed of data can also be accelerated, thus add treatment effeciency, for each file, our piecemeal process, this makes us when mirror image, a file even the mirror image quantity of a blocks of files can be increased neatly.
What following embodiment described is the file storage device corresponding with the file memory method of above-described embodiment two.The file storage device schematic diagram that Fig. 6 provides for the embodiment of the present invention four.As shown in Figure 6, the device that the embodiment of the present invention provides comprises: grouped element 601, generation unit 602, compression unit 603 and storage unit 604.
Grouped element 601, obtain data group for the data in binary source file being carried out packet transaction, data group described in each has data group described in identical data volume and is sent to generation unit 602.
Generation unit 602, for receiving the described data group that described grouped element 601 sends, by the order of described data group in described source file, for each described data group generates corresponding two-dimensional coordinate, form two-dimensional coordinate group, described two-dimensional coordinate group is sent to compression unit 603.
Compression unit 603, the 603 described two-dimensional coordinate groups sent are sent out for receiving described generation unit, by in described two-dimensional coordinate group, there is identical transverse axis coordinate figure, and ordinate of orthogonal axes value continually varying first set of coordinates boil down to cylindrical coordinates, first coordinate figure of described cylindrical coordinates is identical with the transverse axis coordinate figure of described first set of coordinates, second coordinate figure of described cylindrical coordinates is the first coordinate range, described first coordinate range utilizes the minimum ordinate of orthogonal axes value in described first set of coordinates and maximum ordinate of orthogonal axes value to represent, described cylindrical coordinates is sent to storage unit 604.
Storage unit 604, for receiving the described cylindrical coordinates that described compression unit 603 sends, stores described cylindrical coordinates on a storage device.
The maximal value of the ordinate of orthogonal axes value of the described two-dimensional coordinate in described generation unit 602 is, data represented when each in described data group being got 1.
The ordinate of orthogonal axes value of the first coordinate in the described two-dimensional coordinate group in described generation unit 602 is identical with its first corresponding data, if described first data are not more than the second data, then the transverse axis coordinate figure of described first coordinate is add 1 on the basis of transverse axis coordinate figure corresponding to the second data, otherwise, the transverse axis coordinate figure that the transverse axis coordinate figure of described first coordinate is corresponding with described second data is identical, and described second data are the previous data of described first data.
Described compression unit 603 also for: by described two-dimensional coordinate group, there is identical transverse axis coordinate figure, and ordinate of orthogonal axes is worth the second set of coordinates boil down to cylindrical coordinates of discontinuous change, first coordinate figure of described cylindrical coordinates is identical with the transverse axis coordinate figure of described second set of coordinates, when the coordinate quantity in described second set of coordinates is no more than the first amount threshold, other coordinate figure of described cylindrical coordinates comprises the ordinate of orthogonal axes value of described second set of coordinates, otherwise, other coordinate figure of described cylindrical coordinates comprises negative set of coordinates, described negative set of coordinates is the ordinate of orthogonal axes value removed from the scope of described ordinate of orthogonal axes value in described second set of coordinates, remaining ordinate of orthogonal axes value is got negative.
First amount threshold is a half of the maximal value of described ordinate of orthogonal axes value, and the cylindrical coordinates obtained more saves space.
It should be noted that, the device that the embodiment of the present invention provides implants the file memory method in above-described embodiment two, and therefore, the course of work of the unit included by the device that the embodiment of the present invention provides does not repeat again at this.
What above-described embodiment described is that grouped element is used for the data in binary source file being carried out packet transaction and obtains data group, and described in each, data group has identical data volume, generation unit is used for by the order of described data group in described source file, for each described data group generates corresponding two-dimensional coordinate, forms two-dimensional coordinate group, compression unit is used for having identical transverse axis coordinate figure by described two-dimensional coordinate group, and ordinate of orthogonal axes value continually varying first set of coordinates boil down to cylindrical coordinates, storage unit is used for described cylindrical coordinates to store on a storage device, thus reduce the size of image file, and no matter conventional image file system is in write operation or read operation, capital relates to the access of the big data quantity to disk, and on hard disk, only need write or read a small amount of coordinate data based on the mirror file system of two-dimensional coordinate, combination is then all perform at region of memory, the consumption to rear end disk can be reduced like this, the read or write speed of data can also be accelerated, thus add treatment effeciency, for each file, our piecemeal process, this makes us when mirror image, a file even the mirror image quantity of a blocks of files can be increased neatly.
Professional should recognize further, in conjunction with unit and the algorithm steps of each example of embodiment disclosed herein description, can realize with electronic hardware, computer software or the combination of the two, in order to the interchangeability of hardware and software is clearly described, generally describe composition and the step of each example in the above description according to function.These functions perform with hardware or software mode actually, depend on application-specific and the design constraint of technical scheme.Professional and technical personnel can use distinct methods to realize described function to each specifically should being used for, but this realization should not thought and exceeds scope of the present invention.
The software module that the method described in conjunction with embodiment disclosed herein or the step of algorithm can use hardware, processor to perform, or the combination of the two is implemented.Software module can be placed in the storage medium of other form any known in random access memory (RAM), internal memory, ROM (read-only memory) (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technical field.
Above-described embodiment; object of the present invention, technical scheme and beneficial effect are further described; be understood that; the foregoing is only the specific embodiment of the present invention; the protection domain be not intended to limit the present invention; within the spirit and principles in the present invention all, any amendment made, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (8)

1. a file memory method, is characterized in that, described method comprises:
Data in binary source file are carried out packet transaction and obtain data group, described data group all has identical data volume;
By the order of described data group in described source file, for each described data group generates corresponding two-dimensional coordinate, form two-dimensional coordinate group;
By in described two-dimensional coordinate group, there is identical transverse axis coordinate figure, and ordinate of orthogonal axes value continually varying first set of coordinates boil down to cylindrical coordinates, first coordinate figure of described cylindrical coordinates is identical with the transverse axis coordinate figure of described first set of coordinates, second coordinate figure of described cylindrical coordinates is the first coordinate range, and described first coordinate range utilizes the minimum ordinate of orthogonal axes value in described first set of coordinates and maximum ordinate of orthogonal axes value to represent;
Described cylindrical coordinates is stored on a storage device.
2. file memory method according to claim 1, is characterized in that, the maximal value of the ordinate of orthogonal axes value of described two-dimensional coordinate is, data represented when each in described data group being got 1.
3. file memory method according to claim 2, it is characterized in that, the ordinate of orthogonal axes value of the first coordinate in described two-dimensional coordinate group is identical with its first corresponding data, if described first data are not more than the second data, then the transverse axis coordinate figure of described first coordinate is add 1 on the basis of transverse axis coordinate figure corresponding to the second data, otherwise, the transverse axis coordinate figure that the transverse axis coordinate figure of described first coordinate is corresponding with described second data is identical, and described second data are the previous data of described first data.
4. file memory method according to claim 3, is characterized in that, described method also comprises:
By in described two-dimensional coordinate group, there is identical transverse axis coordinate figure, and ordinate of orthogonal axes is worth the second set of coordinates boil down to cylindrical coordinates of discontinuous change, first coordinate figure of described cylindrical coordinates is identical with the transverse axis coordinate figure of described second set of coordinates, when the coordinate quantity in described second set of coordinates is no more than the first amount threshold, other coordinate figure of described cylindrical coordinates comprises the ordinate of orthogonal axes value of described second set of coordinates, otherwise
Other coordinate figure of described cylindrical coordinates comprises negative set of coordinates, and described negative set of coordinates is the ordinate of orthogonal axes value removed from the scope of described ordinate of orthogonal axes value in described second set of coordinates, and remaining ordinate of orthogonal axes value is got negative.
5. a file storage device, is characterized in that, described device comprises:
Grouped element, obtain data group for the data in binary source file being carried out packet transaction, described data group all has identical data volume, and described data group is sent to generation unit;
Generation unit, for receiving the described data group that described grouped element sends, by the order of described data group in described source file, for each described data group generates corresponding two-dimensional coordinate, form two-dimensional coordinate group, described two-dimensional coordinate group is sent to compression unit;
Compression unit, for receiving the described two-dimensional coordinate group that described generation unit sends, by in described two-dimensional coordinate group, there is identical transverse axis coordinate figure, and ordinate of orthogonal axes value continually varying first set of coordinates boil down to cylindrical coordinates, first coordinate figure of described cylindrical coordinates is identical with the transverse axis coordinate figure of described first set of coordinates, second coordinate figure of described cylindrical coordinates is the first coordinate range, described first coordinate range utilizes the minimum ordinate of orthogonal axes value in described first set of coordinates and maximum ordinate of orthogonal axes value to represent, described cylindrical coordinates is sent to storage unit;
Storage unit, for receiving the described cylindrical coordinates that described compression unit sends, stores described cylindrical coordinates on a storage device.
6. file storage device according to claim 5, is characterized in that, the maximal value of the ordinate of orthogonal axes value of the described two-dimensional coordinate in described generation unit is, data represented when each in described data group being got 1.
7. file storage device according to claim 6, it is characterized in that, the ordinate of orthogonal axes value of the first coordinate in the described two-dimensional coordinate group in described generation unit is identical with its first corresponding data, if described first data are not more than the second data, then the transverse axis coordinate figure of described first coordinate is add 1 on the basis of transverse axis coordinate figure corresponding to the second data, otherwise, the transverse axis coordinate figure that the transverse axis coordinate figure of described first coordinate is corresponding with described second data is identical, and described second data are the previous data of described first data.
8. file storage device according to claim 7, is characterized in that, described compression unit also for:
By in described two-dimensional coordinate group, there is identical transverse axis coordinate figure, and ordinate of orthogonal axes is worth the second set of coordinates boil down to cylindrical coordinates of discontinuous change, first coordinate figure of described cylindrical coordinates is identical with the transverse axis coordinate figure of described second set of coordinates, when the coordinate quantity in described second set of coordinates is no more than the first amount threshold, other coordinate figure of described cylindrical coordinates comprises the ordinate of orthogonal axes value of described second set of coordinates, otherwise
Other coordinate figure of described cylindrical coordinates comprises negative set of coordinates, and described negative set of coordinates is the ordinate of orthogonal axes value removed from the scope of described ordinate of orthogonal axes value in described second set of coordinates, and remaining ordinate of orthogonal axes value is got negative.
CN201210586541.8A 2012-12-28 2012-12-28 File storage method and device Active CN103019895B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210586541.8A CN103019895B (en) 2012-12-28 2012-12-28 File storage method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210586541.8A CN103019895B (en) 2012-12-28 2012-12-28 File storage method and device

Publications (2)

Publication Number Publication Date
CN103019895A CN103019895A (en) 2013-04-03
CN103019895B true CN103019895B (en) 2015-01-28

Family

ID=47968525

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210586541.8A Active CN103019895B (en) 2012-12-28 2012-12-28 File storage method and device

Country Status (1)

Country Link
CN (1) CN103019895B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107748797A (en) * 2017-11-07 2018-03-02 众安信息技术服务有限公司 The processing method of financial market data
CN108809514B (en) 2018-04-23 2021-01-12 华为技术有限公司 Data transmission method and related equipment
CN114281239A (en) * 2020-09-28 2022-04-05 华为云计算技术有限公司 Mirror image file writing method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1494767A (en) * 2001-02-02 2004-05-05 Method for compressing/decompressing structured document
CN1902826A (en) * 2003-09-25 2007-01-24 皮尔雷斯系统公司 Split runlength encoding method and apparatus
WO2010108373A1 (en) * 2009-03-27 2010-09-30 广东国笔科技股份有限公司 Method and system for compressed encoding and decoding for word stock
CN102306180A (en) * 2011-08-29 2012-01-04 北京建筑工程学院 Modeling method based on mass laser radar grid point cloud data

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1494767A (en) * 2001-02-02 2004-05-05 Method for compressing/decompressing structured document
CN1902826A (en) * 2003-09-25 2007-01-24 皮尔雷斯系统公司 Split runlength encoding method and apparatus
WO2010108373A1 (en) * 2009-03-27 2010-09-30 广东国笔科技股份有限公司 Method and system for compressed encoding and decoding for word stock
CN102306180A (en) * 2011-08-29 2012-01-04 北京建筑工程学院 Modeling method based on mass laser radar grid point cloud data

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
高健,刘万等.基于长度减半的二进制码流的压缩算法.《计算机应用》.2011,(第7期),第1856-1857页. *

Also Published As

Publication number Publication date
CN103019895A (en) 2013-04-03

Similar Documents

Publication Publication Date Title
US10031675B1 (en) Method and system for tiering data
CN102222085B (en) Data de-duplication method based on combination of similarity and locality
CN102629258B (en) Repeating data deleting method and device
CN101777017B (en) Rapid recovery method of continuous data protection system
CN103118133B (en) Based on the mixed cloud storage means of the file access frequency
CN106874348B (en) File storage and index method and device and file reading method
CN101882141A (en) Method and system for implementing repeated data deletion
CN102142032B (en) Method and system for reading and writing data of distributed file system
CN110532201B (en) Metadata processing method and device
CN103473314A (en) Key value pair storing method and device based on shared memory
CN102915278A (en) Data deduplication method
CN103019887A (en) Data backup method and device
CN110968554A (en) Block chain storage method, storage system and storage medium based on file chain blocks
CN105117351A (en) Method and apparatus for writing data into cache
CN103152430B (en) A kind of reduce the cloud storage method that data take up room
CN104199784A (en) Data migration method and device based on hierarchical storage
CN103019895B (en) File storage method and device
CN104360914A (en) Incremental snapshot method and device
CN103257830A (en) Storage cell accessing method and storage cell
CN103473266A (en) Solid state disk and method for deleting repeating data thereof
CN103049224A (en) Method, device and system for importing data into physical tape
CN103473258A (en) Cloud storage file system
CN107135662A (en) A kind of variance data backup method, storage system and variance data back-up device
CN107423425B (en) Method for quickly storing and inquiring data in K/V format
CN103544124B (en) The access method of Nand flash storages

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20170612

Address after: 510640 Guangdong City, Tianhe District Province, No. five, road, public education building, unit 371-1, unit 2401

Patentee after: GUANGDONG GAOHANG INTELLECTUAL PROPERTY OPERATION Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.

CB03 Change of inventor or designer information
CB03 Change of inventor or designer information

Inventor after: Wang Yuxia

Inventor before: Li Tong

TR01 Transfer of patent right

Effective date of registration: 20170907

Address after: 110000, Liaoning province Shenyang Sujiatun District High Street 2 group 24

Patentee after: Wang Yuxia

Address before: 510640 Guangdong City, Tianhe District Province, No. five, road, public education building, unit 371-1, unit 2401

Patentee before: GUANGDONG GAOHANG INTELLECTUAL PROPERTY OPERATION Co.,Ltd.

TR01 Transfer of patent right
CP02 Change in the address of a patent holder
CP02 Change in the address of a patent holder

Address after: 541199 Lingui County, Guilin, Lingui County, Lingui Town, Xinglin Road, No. 1, unit 202, Room 202

Patentee after: Wang Yuxia

Address before: 110000, Liaoning province Shenyang Sujiatun District High Street 2 group 24

Patentee before: Wang Yuxia

CP02 Change in the address of a patent holder
CP02 Change in the address of a patent holder

Address after: 110000, Liaoning province Shenyang Sujiatun District High Street 2 group 24

Patentee after: Wang Yuxia

Address before: 541199 Lingui County, Guilin, Lingui County, Lingui Town, Xinglin Road, No. 1, unit 202, Room 202

Patentee before: Wang Yuxia

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20180817

Address after: 244000 Shun an Jinshan Industrial Park, Yi An District, Tongling, Anhui

Patentee after: ANHUI RONGJING FENGDAN BIOTECHNOLOGY Co.,Ltd.

Address before: 110000 2 group 24 of tall building street, Sujiatun District, Shenyang, Liaoning

Patentee before: Wang Yuxia

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230810

Address after: Room 604, Building 28, Block B, Wanda Lanhuyuan, No. 711, Luzhou Avenue, Baohe District, Hefei City, Anhui Province, 230041

Patentee after: Hefei Zhonghuan Technology Information Consulting Co.,Ltd.

Address before: 244000 Shun an Jinshan Industrial Park, Yi An District, Tongling, Anhui

Patentee before: ANHUI RONGJING FENGDAN BIOTECHNOLOGY Co.,Ltd.