CN110347333A - Improve method, apparatus, computer equipment and the storage medium of clone's mirror image performance - Google Patents
Improve method, apparatus, computer equipment and the storage medium of clone's mirror image performance Download PDFInfo
- Publication number
- CN110347333A CN110347333A CN201910441492.0A CN201910441492A CN110347333A CN 110347333 A CN110347333 A CN 110347333A CN 201910441492 A CN201910441492 A CN 201910441492A CN 110347333 A CN110347333 A CN 110347333A
- Authority
- CN
- China
- Prior art keywords
- mirror image
- read
- clone
- write
- metadata
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 52
- 238000004590 computer program Methods 0.000 claims description 7
- 238000012545 processing Methods 0.000 claims description 6
- 230000015572 biosynthetic process Effects 0.000 claims description 3
- 239000013589 supplement Substances 0.000 claims description 3
- 238000010367 cloning Methods 0.000 abstract description 4
- 238000004364 calculation method Methods 0.000 description 11
- 238000010586 diagram Methods 0.000 description 11
- 238000004422 calculation algorithm Methods 0.000 description 9
- 238000004891 communication Methods 0.000 description 3
- 230000003321 amplification Effects 0.000 description 2
- 238000006073 displacement reaction Methods 0.000 description 2
- 230000005012 migration Effects 0.000 description 2
- 238000013508 migration Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 238000003199 nucleic acid amplification method Methods 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 241000406668 Loxodonta cyclotis Species 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000007717 exclusion Effects 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 210000003127 knee Anatomy 0.000 description 1
- 230000003362 replicative effect Effects 0.000 description 1
- 238000004904 shortening Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0604—Improving or facilitating administration, e.g. storage management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0655—Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/067—Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention is suitable for block chain field, method, apparatus, computer equipment and the storage medium for improving clone's mirror image performance are provided, wherein, the described method includes: according to getting to read-write object, judgement whether there is pre-set global mirror inheritance to the corresponding mirror image of read-write object with described, and the global mirror inheritance includes source mirror image and the inheritance of cloning mirror image;The global mirror inheritance if it exists, then according to the global mirror inheritance obtain with the metadata to the corresponding source object of read-write object, the metadata includes for the information described in calculating to the consistency Hash node where the corresponding source object of read-write object;Consistency cryptographic Hash is calculated according to the metadata, is obtained described to the consistency Hash node where the corresponding source object of read-write object;It is written and read on the consistency Hash node where the corresponding source object to read-write object.The application can shorten read/write path, improve clone's mirror image performance.
Description
Technical field
The invention belongs to block chain technical fields, more particularly to the method, apparatus of raising clone's mirror image performance, computer to set
Standby and storage medium.
Background technique
Currently, including multiple objects of the same size in mirror image in consistency Hash storage system, these objects press one
Then group is mirrored into set pattern, such as: the mirror image of a 1G may include the object of 256 4M, the object of this 256 4M is by certain
Rule forms the mirror image of this 1G.It, will by calculating the cryptographic Hash of this 256 4M objects when carrying out clone's storage to mirror image
This 256 4M objects are stored on corresponding consistency Hash node.When needing to be written and read some object, pass through Hash
Value calculates to the node where this 4M object and reads out this 4M object to find this 4M object on this node and go out
To merge with write-in data, to achieve the purpose that modify to mirror image.
Consistency hash algorithm is by Node distribution on Hash ring, by the data storage between node to corresponding node
In, to realize that data distribution formula stores, when one of node breaks down, then by the node data move in next node into
Row storage, so that node be avoided to change the migration for causing all data in whole system.And when being written and read to clone's mirror image,
Object if necessary to read-write is to may require that source object, which is read client, to carry out sometimes based on the modified data of source object
Then modification merges the source object read out and modified data to obtain new object, new object storage is arrived
New node.As it can be seen that it is long that there are read/write paths in prior art consistency Hash storage system, clone's mirror image performance difference is asked
Topic.
Summary of the invention
The embodiment of the present invention provides a kind of method, apparatus, computer equipment and storage medium for improving clone's mirror image performance,
It is long to aim to solve the problem that there are read/write paths, clones the problem of mirror image performance difference.
To solve the above-mentioned problems, the embodiments of the present invention are implemented as follows, provides a kind of improve and clones mirror image performance
Method, comprising steps of
According to getting to read-write object, judgement is preset with described whether there is to the corresponding mirror image of read-write object
Global mirror inheritance, the global mirror inheritance include source mirror image and clone mirror image inheritance;
The global mirror inheritance if it exists is then obtained with described according to the global mirror inheritance wait read and write
The metadata of the corresponding source object of object, the metadata include described to the corresponding source object place of read-write object for calculating
Consistency Hash node information;
Consistency cryptographic Hash is calculated according to the metadata, is obtained described to one where the corresponding source object of read-write object
Cause property Hash node;
It is written and read on the consistency Hash node where the corresponding source object to read-write object.
The present invention also provides a kind of devices for improving clone's mirror image performance, comprising:
First judgment module, for according to getting to read-write object, judgement is with described to the corresponding mirror of read-write object
As whether there is pre-set global mirror inheritance, the global mirror inheritance includes source mirror image and clone's mirror image
Inheritance;
First obtains module, for the global mirror inheritance if it exists, is then inherited and is closed according to the global mirror
System obtain with the metadata to the corresponding source object of read-write object, the metadata include for described in calculating wait read and write pair
As the information of the consistency Hash node where corresponding source object;
Computing module obtains described corresponding to read-write object for calculating consistency cryptographic Hash according to the metadata
Consistency Hash node where source object;
Module for reading and writing, for being read on the consistency Hash node where the corresponding source object to read-write object
It writes.
The present invention also provides a kind of computer equipment, including memory and processor, calculating is stored in the memory
Machine program, the processor realize the raising gram as described in any one of claim one to seven when executing the computer program
The step of method of grand mirror image performance.
The present invention also provides a kind of computer readable storage mediums, which is characterized in that the computer readable storage medium
On be stored with computer program, when the computer program is executed by processor realize such as any one of claim one to seven institute
The step of method for the raising clone's mirror image performance stated.
It is that the present invention realizes the utility model has the advantages that the present invention to described to the corresponding mirror image of read-write object due to by presetting
The global mirror inheritance goes to obtain the correspondence source object to read-write object based on the global mirror inheritance
Metadata, consistency cryptographic Hash is calculated using the metadata as the calculating data as consistency hash algorithm, from institute
State it is available described to the consistency Hash node where the corresponding source object of read-write object in consistency cryptographic Hash, it is described to
Read-write object can be written and read on the consistency Hash node.So it is based on the preset global mirror inheritance,
To the consistency Hash node where the source object of read-write object described in may finally finding, and in the consistency Hash
Node is written and read, and can shorten read/write path, improves clone's mirror image performance.
Detailed description of the invention
Fig. 1 is that this application can be applied to exemplary system architecture figures therein;
Fig. 2 is the flow chart of one embodiment of the method provided in an embodiment of the present invention for improving clone's mirror image performance;
Fig. 2 a is the Hash ring structure schematic diagram of the method provided in an embodiment of the present invention for improving clone's mirror image performance;
Fig. 2 b is another Hash ring structure signal of the method provided in an embodiment of the present invention for improving clone's mirror image performance
Figure;
Fig. 2 c is another Hash ring structure signal of the method provided in an embodiment of the present invention for improving clone's mirror image performance
Figure;
Fig. 3 is the flow chart of another embodiment of the method provided in an embodiment of the present invention for improving clone's mirror image performance;
Fig. 4 is the flow chart of another embodiment of the method provided in an embodiment of the present invention for improving clone's mirror image performance;
Fig. 5 is a kind of flow chart of specific embodiment of S204 in Fig. 2;
Fig. 6 is the flow chart of another embodiment of the method provided in an embodiment of the present invention for improving clone's mirror image performance;
Fig. 7 is the flow chart of another embodiment of the method provided in an embodiment of the present invention for improving clone's mirror image performance;
Fig. 8 is the flow chart of another embodiment of the method provided in an embodiment of the present invention for improving clone's mirror image performance;
Fig. 9 is the structural schematic diagram of one embodiment of the device of raising clone's mirror image performance of the application;
Figure 10 is the structural schematic diagram of another embodiment of the device of raising clone's mirror image performance of the application;
Figure 11 is the structural schematic diagram of another embodiment of the device of raising clone's mirror image performance of the application;
Figure 12 is the structural schematic diagram of another embodiment of the device of raising clone's mirror image performance of the application;
Figure 13 is the structural schematic diagram of another embodiment of the device of raising clone's mirror image performance of the application;
Figure 14 is the structural schematic diagram of another embodiment of the device of raising clone's mirror image performance of the application;
Figure 15 is the structural schematic diagram of one embodiment of the computer equipment of the application.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right
The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and
It is not used in the restriction present invention.
The present invention is due to by being based on the overall situation to global mirror inheritance is preset to the corresponding mirror image of read-write object
Mirror image inheritance goes to obtain the metadata of the correspondence source object to read-write object, calculates consistency cryptographic Hash according to metadata,
It obtains to the consistency Hash node where the corresponding source object of read-write object, and is written and read on above-mentioned node.So can
To shorten read/write path, clone's mirror image performance is improved.
As shown in Figure 1, system architecture 100 may include server 105, network 102 and terminal device 101,102,103.
Network 104 between server 105 and terminal device 101,102,103 to provide the medium of communication link.Network 104 can be with
Including various connection types, such as wired, wireless communication link or fiber optic cables etc..Terminal device 101,102,103 can be with
It is that can carry out the various electronic equipments of reading and writing data etc., including but not limited to intelligence with display screen with downloading application software
Can mobile phone, tablet computer, pocket computer on knee and desktop computer etc., client can be used terminal device 101,102,
103 are interacted by network 104 with server 105, to receive or obtain information etc..
It should be understood that the number of mobile terminal, network in Fig. 1 and equipment is only schematical, according to realizing needs,
It can have any number of mobile terminal, network and server.
As shown in Fig. 2, for the stream of one embodiment according to provided by the method for raising clone's mirror image performance of the application
Cheng Tu.The method of above-mentioned raising clone's mirror image performance, comprising steps of
S201, according to getting to read-write object, judgement is set in advance with whether there is to the corresponding mirror image of read-write object
The global mirror inheritance set, global mirror inheritance include the inheritance of source mirror image and clone's mirror image.
In the present embodiment, it is (such as shown in FIG. 1 to improve the electronic equipment of the method operation of clone's mirror image performance thereon
Mobile terminal).Wherein, it is above-mentioned when read-write object can be by user treat read-write mirror image operate when voluntarily obtain,
Such as: user is written and read a mirror image to be read and write, according to the position acquisition of read-write to read-write object in mirror image
Position.Above-mentioned can be document files, application file or other kinds of file to the corresponding mirror image of read-write object, on
That states can be the object in document files, application file or other kinds of file to read-write object.It is to be appreciated that
Mirror image is a kind of file layout, and multiple files can be made into an image file, above-mentioned to be to read-write object
A part in mirror image, object are the component part of mirror image, and a mirror image is by multiple objects of the same size according to certain rule
Then form, such as: the mirror image of a 1G can be made of 256 4M objects by rule, and above-mentioned rule can be sequence and advise
Then, i.e., 256 objects are ranked up association by 0-255, when to be written and read to the 12M556K of mirror image, that is to say and be greater than
3 4M, less than 5 4M are written and read to No. 4 objects.It can be mobile phone, flat to the equipment of read-write object for obtaining
Plate, computer etc. have the terminal device of reading and writing data ability, and above-mentioned terminal device can be by taking where network and mirror image
Business device interacts.
Specifically, above-mentioned global mirror inheritance can be understood as the set membership of global mirror, i.e. a source pair
As the relationship with multiple subobjects, above-mentioned inheritance can also include to clone the clone path of mirror image, by cloning road
Diameter can find father's mirror image (source mirror image) of clone's mirror image, such as: mirror image A ' is clone's mirror image of source mirror image A, passes through global mirror
As inheritance, the source mirror image A of clone mirror image A ' is found, global mirror inheritance is used to record source mirror image and clones mirror image
Clone's relationship.The path that read-write object is written and read is treated in this way, shortening.
S202, global mirror inheritance if it exists, then according to global mirror inheritance obtain with to read-write object pair
The metadata for the source object answered, metadata include for calculating to the consistency Hash section where the corresponding source object of read-write object
The information of point.
In the present embodiment, above-mentioned metadata can be in the mirror image of source and to the corresponding object oriented of read-write object, example
Such as: being the A ' 0 cloned in mirror image to read-write object, the corresponding object in the mirror image of source is A0, then to the metadata of read-write object
It can be the array of A0-A ' 0.Above-mentioned metadata can be array or key assignments relationship including A0 Yu A ' 0, such as: to A ' 0 into
Row read-write, then the source mirror image that A ' 0 can be found according to global inheritance picture is A, and the displacement of A ' 0 is 0, then corresponding in the mirror image of source
The displacement of object is also 0, then source object is A0.Hash calculation is carried out to A0, what is obtained is the cryptographic Hash of source object A0, passes through this
A cryptographic Hash, the consistency Hash node where available source object share a Kazakhstan to read-write object and source object A0
Uncommon value, thus be to find corresponding A 0 by metadata to carry out Hash as the cryptographic Hash to read-write object, rather than wait read and write pair
The A ' 0 of elephant carries out Hash.Thus it is possible to which the consistency Hash where finding source object by metadata, avoids obtaining it with A ' 0
His node, read/write path is elongated when causing to read and write.
Specifically, as shown in Figure 2 a, a kind of Hash ring structure schematic diagram is provided, for consistency Hash, it can be understood as
By N number of point, such as 232The Hash ring of a point composition, N indicate the number of the point of composition Hash ring, then corresponding cryptographic Hash can be
Hash (A0) %N).An initial point is determined on Hash ring, such as: setting O point is initial point, then first on the right side of O point
Point represents 1, and first, left side point represents 232-1.As shown in Figure 2 b, it is assumed that there are 3 storage servers for storage object, point
Not Wei server A, server B, server C, then, this 3 servers have the IP address of oneself, to their own IP
Location carries out Hash calculation, i.e. hash (IP address of server) %232, according to the value being calculated, corresponding on Hash ring
Value, it will obtain server A, B, C are mapped in position on Hash ring, can be and be distributed by clock-wise order.It can be later
The object for needing to store is subjected to Hash calculation, it can be with the title of object as key assignments, i.e. hash (object oriented) %232, root
Object is mapped on Hash ring, as shown in Figure 2 c according to the value being calculated corresponding to the value on Hash ring.Such as: it calculates
To value be respectively object 1,2,3,4, then object 1,2,3,4 and server A, B, C co-map are on Hash ring.If Hash ring
On object 1,2 between server A and server C, according to storage clockwise, then object 1,2 can be stored in server A
On the node of place, if object 3 between server A and server B, can be stored on the node of server B place, object
If 4 between server B and server C, where server C can be stored on node.In this way, being inherited by global mirror
Relationship carries out consistency Hash calculation to metadata, shortens and treat the path that read-write object is written and read.
S203 calculates consistency cryptographic Hash according to metadata, obtains consistent where to the corresponding source object of read-write object
Property Hash node.
Wherein, consistency cryptographic Hash is obtained according to consistency hash algorithm, and consistency hash algorithm is a kind of modulus calculation
Method is the operation taken the remainder to value, so that it is guaranteed that cryptographic Hash is an integer, such as: there are 3 nodes, by object
0, object 1, object 2 are stored in respectively in this 3 nodes, then it is 0 that the obtained remainder of modulus can be carried out to object 0, to object 1 into
The remainder that row modulus obtains is 1, and carrying out the remainder that modulus obtains to object 2 is 2, then object 0 is stored in No. 1 node, object 1 is deposited
Enter No. 2 nodes, object 2 is stored in No. 3 nodes, if it exists object 3, and it is 0 that modulus, which obtains remainder, then is stored in No. 1 node.
Specifically, being calculated by consistency hash algorithm metadata, since metadata includes for calculating source pair
As the information of the consistency Hash node at place, i.e., the obtained value of consistency Hash calculation is carried out by metadata, be source
The value of the place node of object, thus the consistency Hash node where obtaining source object.It is understood that read-write object
It can be cloned object, and the metadata of cloned object can be the key of source object, the title of source object can be value.In this way,
It is Hash to be carried out by the value of source object, and breathed out according to the metadata to read-write object when being stored to source object
It is uncommon, then it is the metadata (key of source object) according to cloned object, inquires value corresponding with the key of source object, that is, pass through
The value of source object carries out Hash.Hash is carried out to identical value, identical cryptographic Hash can be obtained, to obtain to read-write object
Source object where node.
S204 is written and read on to the consistency Hash node where the corresponding source object of read-write object.
In embodiments of the present invention, the node of source object be by consistency hash algorithm calculate after obtain, by
The metadata of read-write object, the memory node for the read-write node source object for accessing user, is written and read on this node, can
To determine that the node certainly exists the data of source object, read-write could be completed by avoiding migrate by the data of source object.
The present invention is due to by being based on the overall situation to global mirror inheritance is preset to the corresponding mirror image of read-write object
Mirror image inheritance goes to obtain the metadata of the correspondence source object to read-write object, calculates using metadata as consistency Hash
The calculating data of method calculate consistency cryptographic Hash, available to the corresponding source object of read-write object from consistency cryptographic Hash
The consistency Hash node at place, then, it will be written and read on consistency Hash node to read-write object.So being based on
Preset global mirror inheritance may finally be found to the consistency Hash node where the source object of read-write object, and
It is written and read in consistency Hash node, read/write path can be shortened, improve clone's mirror image performance.
Further, as shown in figure 3, the above method further comprises the steps of: after obtaining to read-write object
S301 is configured the corresponding data of source mirror image;
The corresponding data of source mirror image after setting are generated clone's mirror image by clone by S302;
S303, record source mirror image and the formation path for cloning mirror image are based on path, form source mirror image and clone's mirror image entirely
Office's mirror image inheritance.
Specifically, setting global mirror inheritance, specifically can be and carries out snapshot to source mirror image, make the number in the mirror image of source
According to that can not modify, according to the data of source mirror image, one or more clone's mirror image is cloned, and record clone's mirror image and source mirror
Which source object the clone path of picture, i.e., above-mentioned clone's echo cloning come from, such as: clone's mirror image of source mirror image A has Aa,
Ab, then record Aa, and Ab clone comes from source mirror image A, forms the global mirror inheritance of source mirror image A.
In a kind of way of example of possible realization, global mirror inheritance be can recorde in a list,
Source mirror image can be inquired by above-mentioned list and clones the inheritance of mirror image;Global mirror inheritance can also be recorded in
In relational tree, the root node of clone's mirror image can be inquired by relational tree.
In this way, generating clone's mirror image by carrying out clone to source mirror image, diameter is cloned on the road that then record generates clone's mirror image,
Be conducive to source mirror image and clone's mirror image forms global mirror relationship.
Further, as shown in figure 4, the above method further comprises the steps of:
S401, based on the global mirror inheritance after being configured, setting allow cloned object in clone's mirror image with it is right
The associated metadata of the source object for the source mirror image answered;
S402 passes through metadata and obtains corresponding with cloned object source object, wherein source object as consistency Hash into
The data that row calculates;
Cloned object is stored in the calculated consistency Hash node of source object institute corresponding with cloned object by S403
On.
In embodiments of the present invention, above-mentioned metadata can be the array or key of description cloned object and source object relationship
Value, such as: the entitled A001 of source object, the title of cloned object can be B001, wherein A, B can be source mirror image respectively
And the title of clone's mirror image, 001 can be the shift value of first object in mirror image, and A001 indicates first in above-mentioned image
Object, B001 clone then indicate first cloned object in clone's mirror image.It can be by the title of cloned object and source object
Title is indexed association, such as: the title " A0 " of source object is indexed by the title " A ' 0 " of cloned object, to clone
When object is searched, " A0 " can be indexed, consistency Hash is carried out to " A0 ", to find the source object institute of cloned object
In node.
Specifically, in order to make cloned object and source object be located at the same node source object can be obtained by metadata
Title, use the title of source object as the title of consistency Hash calculation, i.e. the consistency cryptographic Hash of cloned object is
Hash (title of source object) %N.Cloned object is stored using consistency Hash it is to be understood that in clone's mirror image
Cloned object metadata application consistency hash algorithm (hash (title of cloned object) %N), the clone is calculated
Cloned object is stored in corresponding nodes of locations, nodes of locations by the consistency cryptographic Hash of object according to consistency cryptographic Hash
It can be understood as corresponding memory or server, on Hash ring, may exist multiple nodes of locations, form memory cluster
Or server cluster.
It is to be appreciated that the same key of Hash, what is obtained is identical value, and Hash is not in consistency hash algorithm
Same key, is likely to be obtained different values, such as: the value that consistency Hash obtains is carried out to " A0 ", can be not necessarily equal to " A0 grams
It is grand ", " A1 " or " A0 clone " carry out the value that consistency Hash obtains, N is bigger, and the probability for obtaining identical value is smaller.
In this way, obtaining source object progress consistency Hash calculation when searching cloned object by metadata and obtaining being deposited
The consistency Hash node of storage, can find the node that cloned object is stored, and not need to other node to be looked into
It looks for, further shortens read/write path, improve the performance of clone's mirror image.
Further, as shown in figure 5, the step of above-mentioned S204 specifically includes:
S501 is write when data are written on the corresponding consistency Hash node of source object when read-write object using increment
The mode entered carries out data write-in, indexes and carries out supplement generation new object to the corresponding data of source object of read-write object.
In embodiments of the present invention, it needs to treat read-write object when being written, increment is carried out on the node of source object
Write-in, i.e., only write-in needs the data being written, and is written again without copying the data in source object, such as: source object
Data are 4M, need to be written 4K data, then only need to be written on 4K to the node, and are not had on duplication write-in 4M to the node,
Remaining data forms new object with 4K data from being indexed in new object in the data of source object in the form that indexes.
In this way, by the data write required for writing direct, and do not have to replicating the data of source object into write-in, it can be to avoid
Write-in amplification.
Further, as shown in fig. 6, the above method further include:
S601 judges in new object with the presence or absence of the metadata based on global mirror inheritance;
S602 is inherited according to global mirror and is closed if there is the metadata based on global mirror inheritance in new object
The metadata of system carries out the storage of consistency Hash to new object.
In embodiments of the present invention, if there are metadata to read-write object itself, data are carried out treating read-write object
When write-in, keep original to read-write object metadata constant, thus obtain one include original metadata new object, then
It is can be in new object in the presence of the metadata based on global mirror inheritance, one is carried out to this new object using the metadata
Cause property Hash calculation, the consistency Hash node stored required for obtaining are simultaneously stored.
In this way, exist in the new object based on global mirror inheritance to metadata existing for read-write object itself
When, by directly calculating the metadata node that can be obtained new object and be stored, the path of read-write can be shortened.
Further, as shown in fig. 7, the above method further include:
S701 is based on global mirror inheritance, and corresponding metadata is arranged to new object;
S702 is based on the corresponding metadata of new object, is stored by consistency Hash to new object, wherein first number
According to including information for calculating the consistency Hash node where source object.
In embodiments of the present invention, above-mentioned new object can be stored in in the same node of source object and new object
There are global mirror inheritances between source object, in this way, can pass through the member of new object when being written and read to new object
Data carry out consistency Hash calculation to source object, obtain the node that source object is stored, and new object also is stored in the section
Point on.
This way it is possible to avoid new object is because move on other nodes, and source object place node is needed to read
The data of source object, so that it is elongated to further result in read/write path.
Further, as shown in figure 8, the above method further include:
S801, after generating new object, the object and new object of Index Sources mirror image form new clone mirror image;
S802 is that corresponding metadata is arranged in the object in new clone mirror image, based on the object setting in new clone mirror image
Corresponding metadata stores the object in new clone mirror image using consistency Hash;
S803 new clone mirror image is written in global mirror inheritance, wherein first number of the object in new clone mirror image
According to including and the consistency Hash nodal information where metadata.
In embodiments of the present invention, it is based on new object, other objects and new object form new clone mirror in Index Sources mirror image
Picture, it should be noted that may include the new object and index object for being written with data in new clone mirror image, be written with data
New object can be including write-in data, index data and metadata, wherein write-in data can be the number of user's write-in
According to index data can be the data for indexing source object data, and metadata refers to the data of description new object attribute, first number
According to the consistency Hash nodal information including source object, index object can be understood as other objects in source object, source object
In other objects and write-in data new object constitute new clone object.
In this way, other objects and new object form new clone mirror image in Index Sources mirror image, according to new object so as to reality
It is now synchronous with the data of rear end to front-end business, and by carrying out consistency Hash calculation, Ke Yishi to above-mentioned metadata
Now to the storage of object in new clone mirror image.
By obtaining metadata to the mirror settings consistency hash algorithm in consistency Hash storage system, in needs pair
Clone's mirror image education is when changing read-write, by metadata calculate in the mirror image of source source object the location of on Hash ring directly into
Row read-write.Cloned object and source object are associated by metadata, the relevant metadata of source object is can use and calculates
The position of source object, and cloned object is stored on the node of source object.When data are written, without the section from source object
Source object is read in point and carries out write operation, but is write direct in the node of source object.This way it is possible to avoid read/write path becomes
It is long, the performance of clone's mirror image is improved, simultaneously, moreover it is possible to avoid the problem that the migration and write-in amplification of data.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with
Relevant hardware is instructed to complete by computer program, which can be stored in a computer-readable storage and be situated between
In matter, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, storage medium above-mentioned can be
The non-volatile memory mediums such as magnetic disk, CD, read-only memory (Read-Only Memory, ROM) or random storage note
Recall body (Random Access Memory, RAM) etc..
It should be understood that although each step in the flow chart of attached drawing is successively shown according to the instruction of arrow,
These steps are not that the inevitable sequence according to arrow instruction successively executes.Unless expressly stating otherwise herein, these steps
Execution there is no stringent sequences to limit, can execute in the other order.Moreover, at least one in the flow chart of attached drawing
Part steps may include that perhaps these sub-steps of multiple stages or stage are not necessarily in synchronization to multiple sub-steps
Completion is executed, but can be executed at different times, execution sequence, which is also not necessarily, successively to be carried out, but can be with other
At least part of the sub-step or stage of step or other steps executes in turn or alternately.
As shown in figure 9, to improve the schematic diagram of the device of clone's mirror image performance, above-mentioned apparatus provided by the present embodiment
900 include: first judgment module 901, acquisition module 902, computing module 903, module for reading and writing 904.Wherein:
First judgment module 901, for according to getting to read-write object, judgement with to the corresponding mirror image of read-write object
With the presence or absence of pre-set global mirror inheritance, global mirror inheritance includes the succession of source mirror image and clone's mirror image
Relationship;
First obtains module 902, for global mirror inheritance if it exists, is then obtained according to global mirror inheritance
With the metadata to the corresponding source object of read-write object, metadata includes for calculating to where the corresponding source object of read-write object
Consistency Hash node information;
Computing module 903 is obtained for calculating consistency cryptographic Hash according to metadata to the corresponding source object of read-write object
The consistency Hash node at place;
Module for reading and writing 904, for being read on to the consistency Hash node where the corresponding source object of read-write object
It writes.
Further, as shown in Figure 10, above-mentioned apparatus 900 further include: the first setup module 905, generation module 906, note
Record module 907.Wherein,
First setup module 905, for being configured to the corresponding data of source mirror image;
Generation module 906 generates clone's mirror image by clone for the corresponding data of source mirror image after being arranged;
Logging modle 907, for record source mirror image and clone mirror image formation path, be based on path, make source mirror image with gram
Grand mirror image forms global mirror inheritance.
Further, as shown in figure 11, above-mentioned apparatus 900 further include: the second setup module 908, second obtains module
909, the first memory module 910.Wherein,
Second setup module 908, for based on the global mirror inheritance after being configured, setting to be allowed in clone's mirror image
Cloned object and the associated metadata of source object of corresponding source mirror image;
Second obtains module 909, for obtaining source object corresponding with cloned object by metadata, wherein source object
The data calculated as consistency Hash;
First memory module 910, it is calculated for cloned object to be stored in source object institute corresponding with cloned object
On consistency Hash node.
Further, above-mentioned module for reading and writing 904 is also used in the corresponding consistency Hash section of source object to read-write object
When data being written on point, data write-in is carried out by the way of increment write-in, indexes the corresponding number of source object to read-write object
New object is generated according to supplement is carried out.
Further, as shown in figure 12, above-mentioned apparatus 900 further include: the second judgment module 911, the second memory module
912.Wherein,
Second judgment module 911, for judging in new object with the presence or absence of the metadata based on global mirror inheritance;
Second memory module 912, if for there is the metadata based on global mirror inheritance, basis in new object
The metadata of global mirror inheritance carries out the storage of consistency Hash to new object.
Further, as shown in figure 13, above-mentioned apparatus 900 further include: third setup module 913, third memory module
914.Wherein,
Corresponding metadata is arranged to new object for being based on global mirror inheritance in third setup module 913;
Third memory module 914 carries out new object by consistency Hash for being based on the corresponding metadata of new object
Storage, wherein metadata includes the information for calculating the consistency Hash node where source object.
Further, as shown in figure 14, above-mentioned apparatus 900 further include: index module 915, is write the 4th memory module 916
Enter module 917.Wherein,
Index module 915, for after generating new object, the object and new object of Index Sources mirror image to form new clone mirror
Picture;
4th memory module 916 is based on new clone mirror for corresponding metadata to be arranged for the object in new clone mirror image
Corresponding metadata is arranged in object as in, stores using consistency Hash to the object in new clone mirror image;
Writing module 917, for new clone mirror image to be written in global mirror inheritance, wherein in new clone mirror image
The metadata of object include and the consistency Hash nodal information where metadata.
The device provided by the embodiments of the present application for improving clone's mirror image performance can be realized the embodiment of the method for Fig. 2 to Fig. 8
In each embodiment and corresponding beneficial effect, to avoid repeating, which is not described herein again.
In order to solve the above technical problems, the embodiment of the present application also provides computer equipment.Referring specifically to Figure 15, Tu15Wei
The present embodiment computer equipment basic structure block diagram.
Computer equipment 15 includes that connection memory 151, processor 152, network interface are in communication with each other by system bus
153.It should be pointed out that the computer equipment 15 with component 151-153 is illustrated only in figure, it should be understood that simultaneously
All components shown realistic are not applied, the implementation that can be substituted is more or less component.Wherein, the art technology
Personnel are appreciated that computer equipment here is that one kind can carry out automatically numerical value according to the instruction for being previously set or storing
The equipment of calculating and/or information processing, hardware includes but is not limited to microprocessor, specific integrated circuit (Application
Specific Integrated Circuit, ASIC), programmable gate array (Field-Programmable GateArray,
FPGA), digital processing unit (Digital Signal Processor, DSP), embedded device etc..
Computer equipment can be desktop PC, notebook, palm PC and cloud server etc. and calculate equipment.Meter
Human-computer interaction can be carried out by modes such as keyboard, mouse, remote controler, touch tablet or voice-operated devices with client by calculating machine equipment.
Memory 151 includes at least a type of readable storage medium storing program for executing, and readable storage medium storing program for executing includes flash memory, hard disk, more
Media card, card-type memory (for example, SD or DX memory etc.), random access storage device (RAM), static random-access memory
(SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read only memory
(PROM), magnetic storage, disk, CD etc..In some embodiments, memory 151 can be the interior of computer equipment 15
Portion's storage unit, such as the hard disk or memory of the computer equipment 15.In further embodiments, memory 151 is also possible to
The plug-in type hard disk being equipped on the External memory equipment of computer equipment 15, such as the computer equipment 15, intelligent memory card
(Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash Card) etc..When
So, memory 151 can also both including computer equipment 15 internal storage unit and also including its External memory equipment.This implementation
In example, memory 151 is installed on the operating system and types of applications software of computer equipment 15 commonly used in storage, such as improves
Clone the program code etc. of the method for mirror image performance.In addition, memory 151 can be also used for temporarily storing exported or
The Various types of data that will be exported.
Processor 152 can be in some embodiments central processing unit (Central Processing Unit, CPU),
Controller, microcontroller, microprocessor or other data processing chips.The processor 152 is commonly used in control computer equipment
15 overall operation.In the present embodiment, program code or processing number of the processor 152 for being stored in run memory 151
According to, such as run the program code for improving the method for clone's mirror image performance.
Network interface 153 may include radio network interface or wired network interface, which is commonly used in counting
It calculates to establish between machine equipment 15 and other electronic equipments and communicate to connect.
Present invention also provides another embodiments, that is, provide a kind of computer readable storage medium, computer-readable
Storage medium storage is improved program of the Clone mirror as performance, and the program of above-mentioned raising clone mirror image performance can be by least one
It manages device to execute, so that the step of at least one processor executes the method such as above-mentioned raising clone's mirror image performance.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on this understanding, the technical solution of the application substantially in other words does the prior art
The part contributed out can be embodied in the form of software products, which is stored in a storage medium
In (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal device (can be mobile phone, computer, clothes
Business device, air conditioner or the network equipment etc.) execute the method that mirror image performance is cloned in the raising of each embodiment of the application.
Term " includes " in the description and claims of this application and above-mentioned Detailed description of the invention and " having " and it
Any deformation, it is intended that cover and non-exclusive include.In the description and claims of this application or above-mentioned attached drawing
Term " first ", " second " etc. be to be not use to describe a particular order for distinguishing different objects.It is referenced herein
" embodiment " is it is meant that a particular feature, structure, or characteristic described may be embodied at least one of the application in conjunction with the embodiments
In embodiment.The phrase, which occurs, in each position in the description might not each mean identical embodiment, nor and its
The independent or alternative embodiment of its embodiment mutual exclusion.Those skilled in the art explicitly and implicitly understand, herein
Described embodiment can be combined with other embodiments.
Above embodiments are only presently preferred embodiments of the present invention, are not intended to limit the invention, all of the invention
Made any modifications, equivalent replacements, and improvements etc., should all be included in the protection scope of the present invention within spirit and principle.
Claims (10)
1. the method for improving clone's mirror image performance, which is characterized in that comprising steps of
According to getting to read-write object, judgement with it is described to the corresponding mirror image of read-write object with the presence or absence of it is pre-set entirely
Office's mirror image inheritance, the global mirror inheritance include the inheritance of source mirror image and clone's mirror image;
The global mirror inheritance if it exists, then according to the global mirror inheritance obtain with it is described to read-write object
The metadata of corresponding source object, the metadata include described to one where the corresponding source object of read-write object for calculating
The information of cause property Hash node;
Consistency cryptographic Hash is calculated according to the metadata, is obtained described to the consistency where the corresponding source object of read-write object
Hash node;
It is written and read on the consistency Hash node where the corresponding source object to read-write object.
2. it is according to claim 1 improve clone mirror image performance method, which is characterized in that obtain to read-write object it
Afterwards, the method also includes steps:
The corresponding data of the source mirror image are configured;
The corresponding data of source mirror image after setting are generated into clone's mirror image by clone;
The formation path for recording the source mirror image and clone's mirror image, is based on the path, makes the source mirror image and described gram
Grand mirror image forms the global mirror inheritance.
3. the method according to claim 2 for improving clone's mirror image performance, which is characterized in that the method also includes steps
It is rapid:
Based on the global mirror inheritance after being configured, setting allows cloned object in clone's mirror image and corresponding source
The associated metadata of the source object of mirror image;
Source object corresponding with the cloned object is obtained by the metadata, wherein the source object is breathed out as consistency
The uncommon data calculated;
The cloned object is stored on the calculated consistency Hash node of source object institute corresponding with the cloned object.
4. the method according to claim 1 for improving clone's mirror image performance, which is characterized in that it is described described wait read and write pair
As the step of being written and read on the consistency Hash node where corresponding source object specifically includes:
Described when data are written on the corresponding consistency Hash node of the source object of read-write object, using the side of increment write-in
Formula carries out data write-in, and the index corresponding data of source object to read-write object carry out supplement and generate new object.
5. the method according to claim 4 for improving clone's mirror image performance, which is characterized in that the method also includes steps
It is rapid:
Judge in the new object with the presence or absence of the metadata based on the global mirror inheritance;
If there is the metadata based on the global mirror inheritance in the new object, inherited according to the global mirror
The metadata of relationship carries out the storage of consistency Hash to the new object.
6. the method according to claim 4 for improving clone's mirror image performance, which is characterized in that the method also includes steps
It is rapid:
Based on the global mirror inheritance, corresponding metadata is set to the new object;
Based on the corresponding metadata of the new object, the new object is stored by consistency Hash, wherein the member
Data include the information for calculating the consistency Hash node where source object.
7. the method according to claim 4 for improving clone's mirror image performance, which is characterized in that the method also includes steps
It is rapid:
After generating the new object, the object of Index Sources mirror image and the new object form new clone mirror image;
Corresponding metadata is set for the object in the new clone mirror image, based on the object setting pair in the new clone mirror image
The metadata answered stores the object in the new clone mirror image using consistency Hash;
The new clone mirror image is written in the global mirror inheritance, wherein object in the new clone mirror image
Metadata includes and the consistency Hash nodal information where the metadata.
8. improving the device of clone's mirror image performance characterized by comprising
First judgment module, for according to getting to read-write object, judgement is to the corresponding mirror image of read-write object with described
It is no there are pre-set global mirror inheritance, the global mirror inheritance include source mirror image and clone mirror image after
Hold relationship;
First obtains module, for the global mirror inheritance if it exists, is then obtained according to the global mirror inheritance
Take with the metadata to the corresponding source object of read-write object, the metadata includes described to read-write object pair for calculating
The information of consistency Hash node where the source object answered;
Computing module obtains described to the corresponding source pair of read-write object for calculating consistency cryptographic Hash according to the metadata
As the consistency Hash node at place;
Module for reading and writing, for being written and read on the consistency Hash node where the corresponding source object to read-write object.
9. a kind of computer equipment, including memory and processor, computer program, the processing are stored in the memory
Device realizes raising clone's mirror image performance as described in any one of claims 1 to 7 method when executing the computer program
The step of.
10. a kind of computer readable storage medium, which is characterized in that be stored with computer on the computer readable storage medium
Program realizes that mirror image is cloned in the raising as described in any one of claims 1 to 7 when the computer program is executed by processor
The step of method of performance.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910441492.0A CN110347333A (en) | 2019-05-24 | 2019-05-24 | Improve method, apparatus, computer equipment and the storage medium of clone's mirror image performance |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910441492.0A CN110347333A (en) | 2019-05-24 | 2019-05-24 | Improve method, apparatus, computer equipment and the storage medium of clone's mirror image performance |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110347333A true CN110347333A (en) | 2019-10-18 |
Family
ID=68174025
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910441492.0A Pending CN110347333A (en) | 2019-05-24 | 2019-05-24 | Improve method, apparatus, computer equipment and the storage medium of clone's mirror image performance |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110347333A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114860350A (en) * | 2022-07-07 | 2022-08-05 | 杭州子默网络科技有限公司 | Data processing method and device based on cloud diskless tree-like mirror image |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104182184A (en) * | 2014-08-27 | 2014-12-03 | 浪潮电子信息产业股份有限公司 | Distributed block storing and cloning method |
CN106161120A (en) * | 2016-10-08 | 2016-11-23 | 电子科技大学 | The distributed meta-data management method of dynamic equalization load |
CN106506587A (en) * | 2016-09-23 | 2017-03-15 | 中国人民解放军国防科学技术大学 | A kind of Docker image download methods based on distributed storage |
-
2019
- 2019-05-24 CN CN201910441492.0A patent/CN110347333A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104182184A (en) * | 2014-08-27 | 2014-12-03 | 浪潮电子信息产业股份有限公司 | Distributed block storing and cloning method |
CN106506587A (en) * | 2016-09-23 | 2017-03-15 | 中国人民解放军国防科学技术大学 | A kind of Docker image download methods based on distributed storage |
CN106161120A (en) * | 2016-10-08 | 2016-11-23 | 电子科技大学 | The distributed meta-data management method of dynamic equalization load |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114860350A (en) * | 2022-07-07 | 2022-08-05 | 杭州子默网络科技有限公司 | Data processing method and device based on cloud diskless tree-like mirror image |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112035410B (en) | Log storage method, device, node equipment and storage medium | |
US10810179B2 (en) | Distributed graph database | |
CN109086388B (en) | Block chain data storage method, device, equipment and medium | |
US10310904B2 (en) | Distributed technique for allocating long-lived jobs among worker processes | |
US8527559B2 (en) | Garbage collector with concurrent flipping without read barrier and without verifying copying | |
CN107016027A (en) | The method and apparatus for realizing business information fast search | |
CN110737682A (en) | cache operation method, device, storage medium and electronic equipment | |
CN110968554A (en) | Block chain storage method, storage system and storage medium based on file chain blocks | |
CN109344348A (en) | A kind of resource regeneration method and device | |
CN103412822A (en) | Operation method of non-volatile RAM, data operation method and relevant device | |
EP3470992B1 (en) | Efficient storage and utilization of a hierarchical data set | |
CN107766355B (en) | Hierarchical data management method, hierarchical data management system and instant messaging system | |
CN110119386A (en) | Data processing method, data processing equipment, medium and calculating equipment | |
CN109491962A (en) | A kind of file directory tree management method and relevant apparatus | |
CN109460406A (en) | Data processing method and device | |
CN105045789A (en) | Game server database buffer memory method and system | |
JP4951137B2 (en) | How to manage the database | |
CN110020272A (en) | Caching method, device and computer storage medium | |
CN110347333A (en) | Improve method, apparatus, computer equipment and the storage medium of clone's mirror image performance | |
WO2024087777A1 (en) | Data reorganization method and apparatus for database table, medium, and computer device | |
CN109815047A (en) | A kind of method and relevant apparatus of data processing | |
KR102214697B1 (en) | A computer program for providing space managrment for data storage in a database management system | |
CN108595488B (en) | Data migration method and device | |
CN114253944B (en) | Database bidirectional synchronization method and device and electronic equipment | |
CN106484379B (en) | A kind of processing method and processing device of application |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |