CN106506608A - The access method of distributed block data and device - Google Patents

The access method of distributed block data and device Download PDF

Info

Publication number
CN106506608A
CN106506608A CN201610912503.5A CN201610912503A CN106506608A CN 106506608 A CN106506608 A CN 106506608A CN 201610912503 A CN201610912503 A CN 201610912503A CN 106506608 A CN106506608 A CN 106506608A
Authority
CN
China
Prior art keywords
node server
numerical intervals
interval
random number
node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201610912503.5A
Other languages
Chinese (zh)
Inventor
游峰
王劲凯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Internet Science And Technology Ltd Of Cloud Of China
Original Assignee
Beijing Internet Science And Technology Ltd Of Cloud Of China
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 Beijing Internet Science And Technology Ltd Of Cloud Of China filed Critical Beijing Internet Science And Technology Ltd Of Cloud Of China
Priority to CN201610912503.5A priority Critical patent/CN106506608A/en
Publication of CN106506608A publication Critical patent/CN106506608A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1008Server selection for load balancing based on parameters of servers, e.g. available memory or workload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Embodiments provide a kind of access method of distributed block data and device.A kind of access method of the distributed block data, including:According to the data access request for receiving, data block to be visited is obtained;Obtain at least two node servers that at least two copies of the data block to be visited are located respectively;According to the load value of at least two node server, at least two numerical intervals are formed;A random number is generated at least two numerical intervals;According to the random number and at least two numerical intervals, from least two node server, a node server is selected;From the node server for selecting, the copy of the data block to be visited is accessed.The present invention can realize the load balancing of node server.

Description

The access method of distributed block data and device
Technical field
The present invention relates to distributed block technical field of memory, more particularly to a kind of access method of distributed block data and dress Put.
Background technology
Used as the key foundation platform of cloud storage, the importance of distributed storage is increasingly highlighted.Distributed memory system leads to Mode frequently with many copies is preserving data.The minimum unit of data is referred to as data block, multiple pairs of same data block This is stored on different server node respectively.This mechanism is mainly used to the availability of lift system, i.e., in a number of copies After according to damage, there are other copy data backups available.
User is to consume very much server resource to the access of data.If it is very big that some access concentrate on current pressure When on server node, the serious unbalance of load is may result in so that system is difficult to give play to due performance, and upper-layer service is received To impact.Accordingly, it would be desirable to a kind of load-balancing algorithm of the selection that can solve to access data trnascription.
Present load equilibrium has many algorithms, such as polling method, randomized.
Randomized is by system random function, randomly chooses wherein one according to the numbering of node listing and is visited Ask.By Probability Statistics Theory it is known that with the increase of the amount of calling, its actual effect is become closer in mean allocation flow Each node, that is, the effect of poll is arrived, the algorithm does not account for the dynamic load of each server node, therefore, meeting Cause the load imbalance of server node.
Content of the invention
The embodiment provides a kind of access method of distributed block data and device, can be better achieved The effect of the load of weighing apparatus node server.
To achieve these goals, following technical scheme this invention takes.
A kind of access method of distributed block data, including:
According to the data access request for receiving, data block to be visited is obtained;
Obtain at least two node servers that at least two copies of the data block to be visited are located respectively;
According to the load value of at least two node server, at least two numerical intervals are formed;
A random number is generated at least two numerical intervals;
According to the random number and at least two numerical intervals, from least two node server, choosing Select a node server;
From the node server for selecting, a copy of the data block to be visited is accessed.
Described according to the random number and at least two numerical intervals, from least two node server In, select a node server the step of include:
From the maximum of numerical intervals each described, the numerical intervals maximum of the minimum more than the random number is chosen Value;
Obtain the sequence number of the corresponding node server of the numerical intervals maximum that chooses;
According to the sequence number of the node server, a node server is selected.
Described according to the random number and at least two numerical intervals, from least two node server In, select a node server the step of include:
Obtain the numerical intervals that the random number is located;
Obtain the maximum of the numerical intervals that the random number is located;
Obtain the sequence number of the corresponding node server of maximum of the numerical intervals that the random number is located;
According to the sequence number of the node server, a node server is selected.
The step of load value according at least two node server, at least two numerical intervals of formation, wraps Include:
According to the load value of at least two node server, the interval boundary value Interval of difference evaluation [h];Wherein, sequence numbers of the h for numerical intervals, h are integer, and 1≤h≤r, r are that at least two copies of data block are located respectively The total quantity of node server;
Using Interval [h] as h-th numerical intervals maximum;Using Interval [h-1] as h-th numerical value area Between minima, the minima of first numerical intervals is set to 0, at least two numerical intervals is formed, and is recorded the numerical value Corresponding relation between interval maximum and the sequence number of the node server.
The load value according at least two node server, the interval boundary value of difference evaluation The step of Interval [h], is specially and is calculated according to below equation:
Wherein, the copy sequence numbers of node server that be located of the i for data block, i is integer, 1≤i≤r;
Loadi is the load value of i-th node server;
Max is the maximum in the load value of at least two node server.
The numerical intervals being located according to the random number, from least two node server, select one to save The step of point server, includes:
Obtain the numerical intervals that the random number is located;
According to the corresponding relation between the sequence number of the numerical intervals and the sequence number of the node server, the number is obtained The sequence number of the corresponding node server of the sequence number of the interval numerical intervals being located of value;
According to the sequence number of the node server for obtaining, a node server is selected.
The step of load value according at least two node server, at least two numerical intervals of formation, wraps Include:
According to the load value of at least two node server, the interval boundary value Interval of difference evaluation [h];Sequence numbers of the h for numerical intervals, h are integer, and 1≤h≤r, r are the node clothes that at least two copies of data block are located respectively The total quantity of business device;
Using Interval [h] as h-th numerical intervals maximum;Using Interval [h-1] as h-th numerical value area Between minima, the minima of first numerical intervals is set to 0, at least two numerical intervals is formed, and is recorded the numerical value Corresponding relation between interval sequence number and the sequence number of the node server.
Described include the step of obtain the numerical intervals that the random number is located:
When the random number is the interval minima of current value, then using interval for the current value as described random The numerical intervals that number is located.
A kind of access mechanism of distributed block data, including:
First acquisition unit, according to the data access request for receiving, obtains data block to be visited;
Second acquisition unit, obtains at least two nodes that at least two copies of the data block to be visited are located respectively Server;
First signal generating unit, according to the load value of at least two node server, generates at least two numerical intervals;
Second signal generating unit, generates a random number at least two numerical intervals;
Select unit, according to the random number and at least two numerical intervals, takes from least two node In business device, a node server is selected;
Access unit, from the node server for selecting, accesses the copy of the data block to be visited.
The select unit includes:
Subelement is chosen, the number of the minimum more than the random number from the maximum of numerical intervals each described, is chosen The interval maximum of value;
Subelement is obtained, the sequence number of the corresponding node server of the numerical intervals maximum that chooses is obtained;
Subelement is selected, according to the sequence number of the node server, a node server is selected.
For the maximum in the load value of at least two node server.There is provided by embodiments of the invention described above Technical scheme is can be seen that in the embodiment of the present invention, and at least two of at least two copies place of acquisition data block to be visited Node server;According to the load value of at least two node server, at least two numerical intervals are formed;Described at least A random number is generated in two values are interval;According to the random number and at least two numerical intervals, from described to In few two node servers, a node server is selected;From the node server for selecting, the data to be visited are accessed The copy of block, the present invention can select node server according to the load of node server, therefore, it is possible to balanced better The load of node server.
The additional aspect of the present invention and advantage will be set forth in part in the description, and these will become from the following description Obtain substantially, or recognized by the practice of the present invention.
Description of the drawings
In order to be illustrated more clearly that the technical scheme of the embodiment of the present invention, below will be to using needed for embodiment description Accompanying drawing be briefly described, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for this For the those of ordinary skill of field, without having to pay creative labor, can be obtaining other according to these accompanying drawings Accompanying drawing.
Fig. 1 is a kind of process chart of the access method of distributed block data that the embodiment of the present invention one is provided;
Fig. 2 is a kind of process chart of the access method of distributed block data that the embodiment of the present invention two is provided;
Fig. 3 is a kind of process chart of the access method of distributed block data that the embodiment of the present invention three is provided;
Fig. 4 is a kind of process chart of the access method of distributed block data that the embodiment of the present invention four is provided;
Fig. 5 is a kind of process chart of the access method of distributed block data that the embodiment of the present invention five is provided;
Fig. 6 is a kind of schematic diagram in the interval of the access method of distributed block data provided in an embodiment of the present invention;
Fig. 7 is a kind of connection diagram of the access mechanism of distributed block data that the embodiment of the present invention five is provided.
Specific embodiment
Embodiments of the present invention are described below in detail, the example of the embodiment is shown in the drawings, wherein ad initio Same or similar element is represented to same or similar label eventually or the element with same or like function.Below by ginseng The embodiment for examining Description of Drawings is exemplary, is only used for explaining the present invention, and is not construed as limiting the claims.
Those skilled in the art of the present technique are appreciated that unless otherwise defined all terms used herein are (including technology art Language and scientific terminology) have with art of the present invention in those of ordinary skill general understanding identical meaning.Should also It is understood by, those terms defined in such as general dictionary should be understood that the meaning having with the context of prior art The consistent meaning of justice, and unless defined as here, will not be with idealizing or excessively formal implication is explaining.
For ease of the understanding to the embodiment of the present invention, do by taking several specific embodiments as an example further below in conjunction with accompanying drawing Explanation, and each embodiment does not constitute the restriction to the embodiment of the present invention.
Embodiment 1:
The embodiment is described in conjunction with Fig. 6 by taking three node servers as an example.
As shown in figure 1, for a kind of access method of distributed block data of the present invention, including:
Step 11, according to the data access request for receiving, obtains data block to be visited;
Step 12, obtains at least two node servers that at least two copies of the data block to be visited are located.This In inventive embodiments, there are three copies, three copies to be respectively distributed on 3 node servers, also with same data block It is to say, three node servers are stored with the copy of same data block respectively.
Step 13, according to the load value of at least two node server, forms at least two numerical intervals;At least two It is continuous between individual numerical intervals.In Fig. 6 by taking continuum as an example.In the embodiment of the present invention, according to three node servers Load value, form three numerical intervals, three numerical intervals are respectively [0, Interval [1]], [Interval [1], Interval [2]], [Interval [2], Interval [3]].
Step 14, generates a random number at least two numerical intervals;
Step 15, according to the random number and at least two numerical intervals, from least two node serve In device, a node server is selected.In the embodiment, scolded in the position of numerical intervals at random as indicated by the arrows in fig. 6, root Secondary nodal point server is selected according to random number.
Step 16, from the node server for selecting, accesses the copy of the data block to be visited.
In above-described embodiment, can be selected according to the load value of the node server at the copy of data block to be visited place Node server, therefore, it is possible to the load of good equilibrium node server.
Embodiment 2:
The embodiment has three copies with same data block, three copies be respectively distributed on 3 node servers be Example, is described in conjunction with Fig. 6, and the step identical with a upper embodiment is repeated no more.
As shown in Fig. 2 for a kind of access method of distributed block data of the present invention, including:
Step 21, according to the data access request for receiving, obtains data block to be visited;
Step 22, obtains at least two node servers that at least two copies of the data block to be visited are located;
Step 23, according to the load value of at least two node server, forms at least two numerical intervals;
Wherein, step 23 includes:
Step 231, according to the load value of at least two node server, the interval boundary value of difference evaluation Interval[h];Wherein, sequence numbers of the h for numerical intervals, h are integer, and 1≤h≤r, r divide at least two copies of data block The total quantity of the node server not being located;
Wherein, step 231 is specially and is calculated according to below equation:
Loadi is the load value of i-th node server;
Max is the maximum in the load value of at least two node server.
In the embodiment, the step is specially:Using the load value of three node servers, according to above-mentioned formula, calculate Interval [1], Interval [2], Interval [3] is obtained, wherein, Interval [3] is more than Interval [2], Interval [2] is more than Interval [1].
Step 232, using Interval [h] as h-th numerical intervals maximum;Using Interval [h-1] as h The minima of first numerical intervals is set to 0 by the minima of individual numerical intervals, is formed at least two numerical intervals, and is recorded Corresponding relation between the sequence number of the maximum of the numerical intervals and the node server.Wherein, the maximum of numerical intervals Value and the boundary value that minima is numerical intervals.Sequence numbers of the h for numerical intervals, h is integer, 1≤h≤r.Being somebody's turn to do in the embodiment Step is specially:The minima of first numerical intervals is set to 0, using Interval [1] as the 1st numerical intervals maximum Value, forms the first numerical intervals;Using Interval [1] as the 2nd numerical intervals minima, using Interval [2] as The maximum of the 2nd numerical intervals, forms the 2nd numerical intervals;Using Interval [2] as the 3rd numerical intervals minima, Using Interval [3] as the maximum of the 3rd numerical intervals, the 3rd numerical intervals are formed;Record the maximum of each numerical intervals Corresponding relation between value and the sequence number of each node server, corresponding relation are specially:Interval [1] is taken with primary nodal point Business device is corresponding, and Interval [2] is corresponding with secondary nodal point server;Interval [3] is corresponding with the 3rd node server.
Step 24, generates a random number at least two numerical intervals;
Step 25, according to the random number and at least two numerical intervals, from least two node serve In device, a node server is selected;
Wherein, step 25 includes:
Step 251, from the maximum of numerical intervals each described, chooses the numerical value area of the minimum more than the random number Between maximum.The step in the embodiment is specially:Position of the random number for arrow indication;Minimum more than the random number Numerical intervals maximum be Interval [2].
Step 252, obtains the sequence number of the corresponding node server of the numerical intervals maximum that chooses.In the embodiment The step be specially:The serial number 2 of the corresponding node servers of Interval [2].
Step 253, according to the sequence number of the node server, selects a node server.The step in the embodiment Specially:Select secondary nodal point server.
Step 26, from the node server for selecting, accesses the copy of the data block to be visited.In the embodiment The step is specially:From secondary nodal point server, the copy of the data block to be visited is accessed.
In above-described embodiment, can be selected according to the load value of the node server at the copy of data block to be visited place Node server, therefore, it is possible to the load of good equilibrium node server.
Embodiment 3
In the embodiment of the present invention, same data block has three copies, three copies to be respectively distributed to 3 node servers On, that is to say, that three node servers are stored with the copy of same data block respectively.It is described in conjunction with Fig. 6, real with upper one Apply the identical step of example to repeat no more.
As shown in figure 3, for a kind of access method of distributed block data of the present invention, including:
Step 31, according to the data access request for receiving, obtains data block to be visited;
Step 32, obtains at least two node servers that at least two copies of the data block to be visited are located;
Step 33, according to the load value of at least two node server, forms at least two numerical intervals;
Wherein, step 33 includes:
Step 331, according to the load value of at least two node server, the interval boundary value of difference evaluation Interval[h];Wherein, sequence numbers of the h for numerical intervals, h are integer, and 1≤h≤r, r divide at least two copies of data block The total quantity of the node server not being located;
Wherein, step 331 is specially and is calculated according to below equation:
Wherein, the copy sequence numbers of node server that be located of the i for data block, i is integer, 1≤i≤r;
Loadi is the load value of i-th node server;
Max is the maximum in the load value of at least two node server.
In the embodiment, the step is specially:Using the load value of three node servers, according to above-mentioned formula, calculate Obtain Interval [1], Interval [2], Interval [3].Interval [1], Interval [2], Interval [3] point Do not calculated according to below equation:
Sequence numbers of the h for numerical intervals, h is integer, and 1≤h≤3, i are data block The sequence number of node server that is located of copy, i is integer, 1≤i≤3.
Step 332, using Interval [h] as h-th numerical intervals maximum;Using Interval [h-1] as h The minima of first numerical intervals is set to 0 by the minima of individual numerical intervals, is formed at least two numerical intervals, and is recorded Corresponding relation between the sequence number of the maximum of the numerical intervals and the node server;Sequence numbers of the h for numerical intervals, h For integer, 1≤h≤r.The step in the embodiment is specially:The minima of first numerical intervals is set to 0, will Maximums of the Interval [1] as the 1st numerical intervals, forms the first numerical intervals;Using Interval [1] as the 2nd The minima of numerical intervals, using Interval [2] as the maximum of the 2nd numerical intervals, forms the 2nd numerical intervals;Will Minima of the Interval [2] as the 3rd numerical intervals, using Interval [3] as the 3rd numerical intervals maximum, Form the 3rd numerical intervals;Corresponding relation between the sequence number of the maximum and each node server that record each numerical intervals, Corresponding relation is specially:Interval [1] is corresponding with primary nodal point server, Interval [2] and secondary nodal point server pair Should;Interval [3] is corresponding with the 3rd node server.
Step 34, generates a random number at least two numerical intervals;
Step 35, according to the random number and at least two numerical intervals, from least two node serve In device, a node server is selected;
Wherein, step 35 includes:
Step 351, obtains the numerical intervals that the random number is located;The step in the embodiment is specially:Random number Position for arrow indication shown in Fig. 6;The numerical intervals that random number is located are that second value is interval.
Step 352, obtains the maximum of the numerical intervals that the random number is located;The step in the embodiment is concrete For:It is Interval [2] to obtain the interval maximum of second value.
Step 353, obtains the sequence of the corresponding node server of maximum of the numerical intervals that the random number is located Number;The step in the embodiment is specially:Obtain the serial number 2 of the corresponding node servers of Interval [2].
Step 354, according to the sequence number of the node server, selects a node server.The step in the embodiment Specially:Select secondary nodal point server.
Step 36, from the node server for selecting, accesses the copy of the data block to be visited.In the embodiment The step is specially:From secondary nodal point server, the copy of the data block to be visited is accessed.
In above-described embodiment, can be selected according to the load value of the node server at the copy of data block to be visited place Node server, therefore, it is possible to the load of good equilibrium node server.
Embodiment 4
In the embodiment of the present invention, same data block has three copies, three copies to be respectively distributed to 3 node servers On, that is to say, that three node servers are stored with the copy of same data block respectively.It is described in conjunction with Fig. 6, real with upper one Apply the identical step of example to repeat no more.
As shown in figure 4, for a kind of access method of distributed block data of the present invention, including:
Step 41, according to the data access request for receiving, obtains data block to be visited;
Step 42, obtains at least two node servers that at least two copies of the data block to be visited are located;
Step 43, according to the load value of at least two node server, forms at least two numerical intervals;
Step 43 includes:
Step 431, according to the load value of at least two node server, the interval boundary value of difference evaluation Interval[h];Wherein, the copy sequence numbers of node server that be located of the i for data block, i is integer, 1≤i≤r;R is number The total quantity of the node server being located according to the copy of block;
Wherein, step 431 is specially and is calculated according to below equation:
Wherein, loadi is the load value of i-th node server;
Max is the maximum in the load value of at least two node server.
Step 432, using Interval [h] as h-th numerical intervals maximum;Using Interval [h-1] as h The minima of first numerical intervals is set to 0 by the minima of individual numerical intervals, is formed at least two numerical intervals, and is recorded Corresponding relation between the sequence number of the sequence number of the numerical intervals and the node server, sequence numbers of the h for numerical intervals, h is Integer, 1≤h≤r.The step in the embodiment is specially:Interval [3] is more than Interval [2], Interval [2] It is more than Interval [1].The minima of first numerical intervals is set to 0, using Interval [1] as the 1st numerical intervals Maximum, formed the first numerical intervals;Using Interval [1] as the 2nd numerical intervals minima, by Interval [2] as the maximum of the 2nd numerical intervals, the 2nd numerical intervals are formed;Using Interval [2] as the 3rd numerical intervals Minima, using Interval [3] as the maximum of the 3rd numerical intervals, forms the 3rd numerical intervals;Record the numerical value area Between sequence number and the sequence number of the node server between corresponding relation, corresponding relation is specially:Interval [1] and first Node server is corresponding, and Interval [2] is corresponding with secondary nodal point server;Interval [3] and the 3rd node server pair Should.
Step 44, generates a random number at least two numerical intervals;
Step 45, according to the random number and at least two numerical intervals, from least two node serve In device, a node server is selected;
Step 45 includes:
Step 451, obtains the numerical intervals that the random number is located.When the border that is scolded in numerical intervals at random When, such as when the random number is the interval minima of current value, then using interval for the current value as described random The numerical intervals that number is located.The step in the embodiment is specially:Random number is the position of arrow indication shown in Fig. 6;With The numerical intervals that machine number is located are that second value is interval.
Step 452, according to the corresponding relation between the sequence number of the numerical intervals and the sequence number of the node server, obtains Take the sequence number of the corresponding node server of sequence number of the numerical intervals that the numerical intervals are located.The step tool in the embodiment Body is:The serial number 2 of the interval corresponding node server of second value.
Step 453, according to the sequence number of the node server for obtaining, selects a node server.In the embodiment The step is specially:Select secondary nodal point server.
Step 46, from the node server for selecting, accesses the copy of the data block to be visited.
In above-described embodiment, can be selected according to the load value of the node server at the copy of data block to be visited place Node server, therefore, it is possible to the load of good equilibrium node server.
Embodiment 5
The present invention provides the load-balancing method in a kind of distributed block storage, accesses asking for temperature inequality for resource A kind of topic, there is provided simple and effective load-balancing algorithm.Load statistics of the present invention according to each node of system, dynamic arranges negative Weight is carried, and optimal node is selected according to weight, problem of load balancing is solved with this.
When data (data block to be visited) is read every time, the node server selected according to algorithm is reading corresponding pair This.Assume that current system is three copies, be stored on three node servers respectively, respectively node1, node2, node3. By the integrated load state on each node server, the load value for quantifying three nodes is respectively load1, load2, load3.Load value can according to task completion status statistics draw, related to many factors of system, node server bear Load state is directly proportional to load value, and load is bigger, and load value is bigger.That is, load value according to following one or more Combined factors be calculated:The size and utilization rate of the CPU of node server, the utilization rate of the internal memory of node server, section The channel number (being connected number) that the residual memory space of point server, present node server are communicated with other node servers.
As shown in figure 5, the method for the application scenarios is comprised the following steps:
First, access request of data is received;
Then, corresponding data block is had access to;
Then, the load value loadi of data block corresponding node is obtained, the maximum Max, i.e. Max=of three loads is calculated Max (load1, load2, load3).
Then, the inverse of each load value is taken, and sequence forms an interval successively, calculates corresponding to each node Interval.Formula is as follows:
Wherein:
I is integer, 1≤i≤r, represents the sequence number of node server.
Total quantitys of the r for copy, that is, the total quantity of the node server of same copy is stored, it is 3 herein.
Loadi represents the load value of i-th node server.
Interval [h] represents the maximum boundary value in the interval at i-th node server place.
Max is the maximum in load value, i.e. Max=max (loadi).
If the starting point in interval is set as 0, can obtain interval graph as shown in Figure 6.
Then, when copy is read, the random number in interval is generated, for example:One is produced between 0 and Interval [3] Individual random number;
Then, corresponding node is selected according to random number.Specially:According to being scolded in interval position at random, selection is more than Node corresponding to the minimum Interval [h] of random number is used as reading replica node.For example as shown in fig. 6, scolding at random Between Interval [1] and Interval [2], then choose node2 nodes.
Then, corresponding node is had access to.
The Integral Thought of this algorithm is to load high node, and the value after inverse is little, and selected probability is low, and final realization is negative Carry balance.
As shown in fig. 7, for the access mechanism of distributed block data of the present invention, including:
First acquisition unit 71, according to the data access request for receiving, obtains data block to be visited;
Second acquisition unit 72, obtains at least two nodes clothes of at least two copies of the storage data block to be visited Business device;
First signal generating unit 73, according to the load value of at least two node server, generates at least two numerical value areas Between;
Second signal generating unit 74, generates a random number at least two numerical intervals;
Select unit 75, according to the random number and at least two numerical intervals, from least two node In server, a node server is selected;
Access unit 76, from the node server for selecting, accesses the copy of the data block to be visited.
The select unit 75 includes:
Subelement is chosen, the number of the minimum more than the random number from the maximum of numerical intervals each described, is chosen The interval maximum of value;
Subelement is obtained, the sequence number of the corresponding node server of the numerical intervals maximum that chooses is obtained;
Subelement is selected, according to the sequence number of the node server, a node server is selected.
One of ordinary skill in the art will appreciate that:Accompanying drawing is the schematic diagram of one embodiment, module in accompanying drawing or Flow process is not necessarily implemented necessary to the present invention.
As seen through the above description of the embodiments, those skilled in the art can be understood that the present invention can Mode by software plus required general hardware platform is realizing.It is based on such understanding, technical scheme essence On part that in other words prior art is contributed can be embodied in the form of software product, the computer software product Can be stored in storage medium, such as ROM/RAM, magnetic disc, CD etc., use so that a computer equipment including some instructions (can be personal computer, server, or network equipment etc.) executes some of each embodiment of the invention or embodiment Method described in part.
Each embodiment in this specification is described by the way of going forward one by one, identical similar portion between each embodiment Divide mutually referring to what each embodiment was stressed is the difference with other embodiment.Especially for device or For system embodiment, as which is substantially similar to embodiment of the method, so describing fairly simple, related part is referring to method The part explanation of embodiment.Apparatus and system embodiment described above is only schematically wherein described conduct Separating component explanation unit can be or may not be physically separate, as the part that unit shows can be or Person may not be physical location, you can be located at a place, or can also be distributed on multiple NEs.Can be with root Factually border need select some or all of module therein to realize the purpose of this embodiment scheme.Ordinary skill Personnel are not in the case where creative work is paid, you can to understand and implement.
The above, the only present invention preferably specific embodiment, but protection scope of the present invention is not limited thereto, Any those familiar with the art the invention discloses technical scope in, the change or replacement that can readily occur in, Should all be included within the scope of the present invention.Therefore, protection scope of the present invention should be with scope of the claims It is defined.

Claims (10)

1. a kind of access method of distributed block data, it is characterised in that include:
According to the data access request for receiving, data block to be visited is obtained;
Obtain at least two node servers that at least two copies of the data block to be visited are located respectively;
According to the load value of at least two node server, at least two numerical intervals are formed;
A random number is generated at least two numerical intervals;
According to the random number and at least two numerical intervals, from least two node server, one is selected Node server;
From the node server for selecting, a copy of the data block to be visited is accessed.
2. method according to claim 1, it is characterised in that described according to the random number and at least two number Value is interval, from least two node server, includes the step of select a node server:
From the maximum of numerical intervals each described, the numerical intervals maximum of the minimum more than the random number is chosen;
Obtain the sequence number of the corresponding node server of the numerical intervals maximum that chooses;
According to the sequence number of the node server, a node server is selected.
3. method according to claim 1, it is characterised in that described according to the random number and at least two number Value is interval, from least two node server, includes the step of select a node server:
Obtain the numerical intervals that the random number is located;
Obtain the maximum of the numerical intervals that the random number is located;
Obtain the sequence number of the corresponding node server of maximum of the numerical intervals that the random number is located;
According to the sequence number of the node server, a node server is selected.
4. the method according to claim 2 or 3, it is characterised in that described according at least two node server Load value, formed at least two numerical intervals the step of include:
According to the load value of at least two node server, the interval boundary value Interval [h] of difference evaluation;Its In, sequence numbers of the h for numerical intervals, h are integer, and 1≤h≤r, r are the node clothes that at least two copies of data block are located respectively The total quantity of business device;
Using Interval [h] as h-th numerical intervals maximum;Using Interval [h-1] as h-th numerical intervals The minima of first numerical intervals is set to 0 by minima, is formed at least two numerical intervals, and is recorded the numerical intervals Maximum and the sequence number of the node server between corresponding relation.
5. method according to claim 4, it is characterised in that the load according at least two node server Value, is specially the step of boundary value Interval [h] in evaluation interval respectively and is calculated according to below equation:
I n t e r v a l [ h ] = Σ i = 1 h m a x l o a d i ;
Wherein, the copy sequence numbers of node server that be located of the i for data block, i is integer, 1≤i≤r;
Loadi is the load value of i-th node server;
Max is the maximum in the load value of at least two node server.
6. method according to claim 1, it is characterised in that the numerical intervals being located according to the random number, from In at least two node server, select a node server the step of include:
Obtain the numerical intervals that the random number is located;
According to the corresponding relation between the sequence number of the numerical intervals and the sequence number of the node server, the numerical value area is obtained Between the sequence number of the corresponding node server of sequence number of numerical intervals that is located;
According to the sequence number of the node server for obtaining, a node server is selected.
7. method according to claim 6, it is characterised in that the load according at least two node server The step of value, at least two numerical intervals of formation, includes:
According to the load value of at least two node server, the interval boundary value Interval [h] of difference evaluation;h For the sequence number of numerical intervals, h is integer, and 1≤h≤r, r are the node server that at least two copies of data block are located respectively Total quantity;
Using Interval [h] as h-th numerical intervals maximum;Using Interval [h-1] as h-th numerical intervals The minima of first numerical intervals is set to 0 by minima, is formed at least two numerical intervals, and is recorded the numerical intervals Sequence number and the sequence number of the node server between corresponding relation.
8. method according to claim 6, it is characterised in that the step of the numerical intervals that the acquisition random number is located Suddenly include:
When the random number is the interval minima of current value, then using current value interval as the random number institute Numerical intervals.
9. a kind of access mechanism of distributed block data, it is characterised in that include:
First acquisition unit, according to the data access request for receiving, obtains data block to be visited;
Second acquisition unit, obtains at least two node serves that at least two copies of the data block to be visited are located respectively Device;
First signal generating unit, according to the load value of at least two node server, generates at least two numerical intervals;
Second signal generating unit, generates a random number at least two numerical intervals;
Select unit, according to the random number and at least two numerical intervals, from least two node server In, select a node server;
Access unit, from the node server for selecting, accesses the copy of the data block to be visited.
10. device according to claim 9, it is characterised in that the select unit includes:
Subelement is chosen, the numerical value area of the minimum more than the random number from the maximum of numerical intervals each described, is chosen Between maximum;
Subelement is obtained, the sequence number of the corresponding node server of the numerical intervals maximum that chooses is obtained;
Subelement is selected, according to the sequence number of the node server, a node server is selected.
CN201610912503.5A 2016-10-19 2016-10-19 The access method of distributed block data and device Pending CN106506608A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610912503.5A CN106506608A (en) 2016-10-19 2016-10-19 The access method of distributed block data and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610912503.5A CN106506608A (en) 2016-10-19 2016-10-19 The access method of distributed block data and device

Publications (1)

Publication Number Publication Date
CN106506608A true CN106506608A (en) 2017-03-15

Family

ID=58294344

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610912503.5A Pending CN106506608A (en) 2016-10-19 2016-10-19 The access method of distributed block data and device

Country Status (1)

Country Link
CN (1) CN106506608A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106254516A (en) * 2016-08-31 2016-12-21 北京小米移动软件有限公司 Load-balancing method and device
CN110955642A (en) * 2019-10-12 2020-04-03 平安科技(深圳)有限公司 Data acquisition optimization method, device and equipment and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7231445B1 (en) * 2000-11-16 2007-06-12 Nortel Networks Limited Technique for adaptively distributing web server requests
CN101753444A (en) * 2009-12-31 2010-06-23 卓望数码技术(深圳)有限公司 Method and device for load balancing
CN101957780A (en) * 2010-08-17 2011-01-26 中国电子科技集团公司第二十八研究所 Resource state information-based grid task scheduling processor and grid task scheduling processing method
CN102541655A (en) * 2010-12-31 2012-07-04 中国银联股份有限公司 Method and device for implementing dynamic load balancing
CN102833326A (en) * 2012-08-15 2012-12-19 广东工业大学 Grey prediction-based cloud storage load balancing method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7231445B1 (en) * 2000-11-16 2007-06-12 Nortel Networks Limited Technique for adaptively distributing web server requests
CN101753444A (en) * 2009-12-31 2010-06-23 卓望数码技术(深圳)有限公司 Method and device for load balancing
CN101957780A (en) * 2010-08-17 2011-01-26 中国电子科技集团公司第二十八研究所 Resource state information-based grid task scheduling processor and grid task scheduling processing method
CN102541655A (en) * 2010-12-31 2012-07-04 中国银联股份有限公司 Method and device for implementing dynamic load balancing
CN102833326A (en) * 2012-08-15 2012-12-19 广东工业大学 Grey prediction-based cloud storage load balancing method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106254516A (en) * 2016-08-31 2016-12-21 北京小米移动软件有限公司 Load-balancing method and device
CN106254516B (en) * 2016-08-31 2020-02-28 北京小米移动软件有限公司 Load balancing method and device
CN110955642A (en) * 2019-10-12 2020-04-03 平安科技(深圳)有限公司 Data acquisition optimization method, device and equipment and readable storage medium

Similar Documents

Publication Publication Date Title
Tang et al. An intermediate data placement algorithm for load balancing in spark computing environment
US8762534B1 (en) Server load balancing using a fair weighted hashing technique
CN111064808B (en) Load balancing method and device based on distributed storage system
CN107562531A (en) A kind of data balancing method and device
CN106385468A (en) Method for balancing predictable dynamic load of Web clusters
CN102609446A (en) Distributed Bloom filter system and application method thereof
CN111290699B (en) Data migration method, device and system
CN107729514A (en) A kind of Replica placement node based on hadoop determines method and device
CN104683408A (en) Method and system for OpenStack cloud computing management platform to build virtual machine instance
CN113572697A (en) Load balancing method based on graph convolution neural network and deep reinforcement learning
CN106506608A (en) The access method of distributed block data and device
WO2016182636A1 (en) System and method for determining concurrency factors for dispatch size of parallel processor kernels
CN111475402B (en) Program function testing method and related device
CN114429195B (en) Performance optimization method and device for training mixed expert model
US20090254319A1 (en) Method and system for numerical simulation of a multiple-equation system of equations on a multi-processor core system
CN105915626A (en) Data copy initial placement method for cloud storage
US20140181174A1 (en) Distributed processing of stream data on an event protocol
CN110019205A (en) A kind of data storage, restoring method, device and computer equipment
CN118175059A (en) Network link quality analysis method, device and related equipment
Feuillet et al. A scaling analysis of a transient stochastic network
EP4057142A1 (en) Job scheduling method and job scheduling apparatus
CN106484714B (en) A kind of storage method and equipment of behavior record
CN110851282B (en) Distributed data calculation method and system based on memory grid
CN101340458B (en) Grid data copy generation method based on time and space limitation
CN110209350A (en) It is a kind of to mix in storage architecture HPC system using the dynamic dispatching method of I/O request

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20170315