CN112492008B - Node position determination method and device, computer equipment and storage medium - Google Patents

Node position determination method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN112492008B
CN112492008B CN202011300772.9A CN202011300772A CN112492008B CN 112492008 B CN112492008 B CN 112492008B CN 202011300772 A CN202011300772 A CN 202011300772A CN 112492008 B CN112492008 B CN 112492008B
Authority
CN
China
Prior art keywords
node
nodes
hash ring
existing
region
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011300772.9A
Other languages
Chinese (zh)
Other versions
CN112492008A (en
Inventor
刘宏亚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
OneConnect Financial Technology Co Ltd Shanghai
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
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 OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN202011300772.9A priority Critical patent/CN112492008B/en
Publication of CN112492008A publication Critical patent/CN112492008A/en
Priority to PCT/CN2021/109560 priority patent/WO2022105298A1/en
Application granted granted Critical
Publication of CN112492008B publication Critical patent/CN112492008B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system
    • 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)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present application relates to the field of artificial intelligence technologies, and in particular, to a method and an apparatus for determining a node position, a computer device, and a storage medium. The method comprises the following steps: acquiring a node region value corresponding to an existing node on a hash ring; acquiring a region reference value, and comparing the node region value with the region reference value; determining the hash ring uniformity according to the comparison result, and determining a target node from the existing nodes in the hash ring according to the hash ring uniformity; and determining the position of the newly added node according to the target node area corresponding to the target node. In addition, the invention also relates to a block chain technology, and the area reference value, the node area value and the position information can be stored in the block chain. By the method, load balance in the distributed system can be realized, and the data processing efficiency is improved.

Description

Node position determination method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of artificial intelligence technologies, and in particular, to a method and an apparatus for determining a node position, a computer device, and a storage medium.
Background
In order to ensure load balance among nodes in the distributed system, a node area corresponding to each node is determined by a consistent hash algorithm in the conventional technology, but in an actual application process, because the number of the nodes is relatively small compared with the size of the whole hash ring, in this case, the distribution of data objects among the nodes is unbalanced, and data skew is caused.
In the prior art, a solution of virtual nodes is provided for solving the problem of data tilt and data balance distribution when data tilt is realized, but the virtual node mode cannot solve the problems of new data tilt and balance caused when nodes are newly added, so that the load of a distributed system is unbalanced, and the data processing efficiency is low.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a node location determining method, apparatus, computer device and storage medium capable of improving system load balancing.
A node position determination method comprises the following steps:
acquiring a node region value corresponding to an existing node on a hash ring;
acquiring a region reference value, and comparing the node region value with the region reference value;
determining the uniformity of the hash ring according to the comparison result, and determining a target node from the existing nodes in the hash ring according to the uniformity of the hash ring;
and determining the position of the newly added node according to the target node area corresponding to the target node.
In one embodiment, obtaining a node region value corresponding to an existing node on a hash ring includes:
acquiring a hash position corresponding to an existing node on a hash ring;
and according to the clockwise direction, acquiring a next adjacent existing node corresponding to the existing node in the hash ring, and determining a node area value corresponding to the existing node on the hash ring according to the hash positions corresponding to the existing node and the next adjacent existing node respectively.
In one embodiment, obtaining the regional reference value comprises:
acquiring the number of existing nodes corresponding to the existing nodes on the hash ring and the number of newly added nodes corresponding to the newly added nodes in the hash ring;
calculating the relative value of the number of the newly added nodes and the number of the existing nodes;
and determining a region reference value according to the relative value, wherein the region reference value is stored in the block chain.
In one embodiment, determining a hash ring uniformity according to the comparison result, and determining a target node from existing nodes in the hash ring according to the hash ring uniformity includes:
when the existing node with the node area value larger than the area reference value exists in the hash ring, determining the existing node with the node area value larger than the area reference value as a target node;
and when the node area values corresponding to all the existing nodes in the hash ring are less than or equal to the area reference value, determining all the existing nodes in the hash ring as target nodes.
In one embodiment, existing nodes in the hash ring with node region values greater than the region reference value exist; determining the position of the newly added node according to the target node area corresponding to the target node, comprising:
determining an allocable area corresponding to each node on the hash ring according to the number of the nodes on the hash ring, wherein the nodes comprise the existing nodes and the newly added nodes;
dividing an area range corresponding to the distributable area from a target node area corresponding to the target node, and taking the divided area range as a new node area of the new node;
and determining the position of the newly added node according to the newly added node area.
In one embodiment, the node region values corresponding to all existing nodes in the hash ring are all less than or equal to the region reference value; determining the position of the newly added node according to the target node area corresponding to the target node, comprising:
determining an allocable area corresponding to each node on the hash ring according to the number of the nodes on the hash ring, wherein the nodes comprise the existing nodes and the newly added nodes;
dividing sub-regions from the existing nodes respectively to make the total region obtained according to each sub-region consistent with the region range corresponding to the distributable region;
and taking each sub-area as a node area of the newly added node, and determining the position of the newly added node according to the node area of the newly added node.
An apparatus for node location determination, the apparatus comprising:
the acquisition module is used for acquiring a node region value corresponding to the existing node on the hash ring;
the comparison module is used for acquiring a region reference value and comparing the node region value with the region reference value;
the first determining module is used for determining the uniformity of the hash ring according to the comparison result and determining a target node from the existing nodes in the hash ring according to the uniformity of the hash ring;
and the second determining module is used for determining the position of the newly added node according to the target node area corresponding to the target node.
A computer device comprising a memory storing a computer program and a processor implementing the steps of the method of any of the embodiments described above when the computer program is executed by the processor.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method of any of the above embodiments.
According to the node position determining method, the node position determining device, the computer equipment and the storage medium, the uniformity of the node distribution on the hash ring is determined according to the comparison result of the node area value corresponding to the existing node in the hash ring and the reference area value, the target node is determined in the existing node according to the actual uniformity condition of the hash ring, and the position of the newly added node is determined according to the target node. Under the constraint of the hash ring uniformity value, the positions of the newly added nodes are determined, so that the uniformity of the node distribution on the hash ring can still be ensured when the nodes are newly added in the hash ring, the load balance of the nodes in the distributed system is realized, and the data processing efficiency is improved.
Drawings
FIG. 1 is a diagram of an application environment of a node location determination method in one embodiment;
FIG. 2 is a flow diagram illustrating a method for node location determination in one embodiment;
FIG. 3 is a hash ring diagram provided in one embodiment;
FIG. 4 is a diagram illustrating an added node in a non-uniform hash ring, according to an embodiment;
FIG. 5 is a diagram illustrating an added node in a uniform hash ring, according to an embodiment;
FIG. 6 is a block diagram showing the structure of a node position determining apparatus according to an embodiment;
FIG. 7 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The node position determining method provided by the application can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The server 104 acquires a node area value corresponding to an existing node on the hash ring; acquiring a region reference value, and comparing the node region value with the region reference value; determining the uniformity of the hash ring according to the comparison result, and determining a target node from the existing nodes in the hash ring according to the uniformity of the hash ring; and determining the position of the newly added node according to the target node area corresponding to the target node. Further, the position of the newly added node is pushed to the terminal 102. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented by an independent server or a server cluster formed by a plurality of servers.
In one embodiment, as shown in fig. 2, a node location determining method is provided, which is described by taking the method as an example applied to the server in fig. 1, and includes the following steps:
step 202, obtaining a node region value corresponding to an existing node on the hash ring.
The hash ring is an annular hash space constructed according to a hash (hash) algorithm. Specifically, the value is hashed into a space with power of 2^32, namely a digital space of 0 ^ 2^ 32-1 according to a hash algorithm, and the numbers are connected end to be imagined as a closed ring, namely a hash ring. The existing node is a node already existing in the hash ring, and the node may refer to a computer device, and specifically, four machines (computer devices or nodes) are included in one distributed system, so that the distributed system includes four existing nodes. The node area is an area range occupied by an existing node in the hash ring, and the node area value is a range size used for measuring the node area. In a distributed system, more than one existing node may be included and each existing node corresponds to a node locale value, and if the existing nodes are evenly distributed in the hash ring, the node locale value corresponding to each existing node in the hash ring should be approximately the same. Specifically, each existing node in the hash ring corresponds to a computer device with a data processing function, and when the distributed system receives a data processing request, the corresponding request can be allocated to the computer device corresponding to one of the existing nodes in the distributed storage system through a request allocation algorithm, so that the allocated request is processed by the corresponding computer device.
Referring to fig. 3, fig. 3 is a schematic diagram of a hash ring provided in an embodiment. When the distributed system corresponds to a hash ring, the step of distributing the corresponding four nodes into the corresponding hash ring includes: assuming that there are A, B, C, D four machines, a KEY value corresponding to each machine is obtained through a Hash algorithm, and then each existing node is mapped into a Hash ring according to the KEY value, specifically: hash (a) -KEY 1, hash (b) -KEY 2, hash (c) -KEY 3, and hash (d) -KEY 4.
Continuing with fig. 3, it can be seen in fig. 3 that A, B, C, D four existing nodes exist in the hash ring, and the node area of each existing node is determined in the clockwise direction, for example, arc AB is the node area corresponding to existing node a, arc BC is the node area corresponding to existing node B, arc CD is the node area corresponding to existing node C, and arc DA is the node area corresponding to existing node D. The node area value is a quantization value used for measuring an area range corresponding to the node area, for example, the node area value may be an arc length of the node area, or a central angle corresponding to the node area, and the like, which is not limited herein.
With continued reference to fig. 3, in an embodiment, when the distributed system receives the request data, the corresponding key value may be calculated from the corresponding object data through a Hash function, and then the corresponding object data may be distributed to the corresponding node according to the key value. Specifically, the data is mapped to the ring after being processed by a certain Hash algorithm, for example, four objects of object1, object2, object3 and object4 are processed by a specific Hash function to calculate corresponding key values, and then the key values are hashed to the Hash ring. Hash (object1) key 1; hash (object2) key 2; hash (object3) key 3; hash (object4) key 4. It can be seen from FIG. 3 that the object is in the same hash space as the machine, so that clockwise rotation of object1 is stored in existing node B, object2 is stored in existing node C, object3 is stored in existing node D, and object4 is stored in existing node A. In such a deployment environment, the hash ring is not changed, so that the hash value of the object can be calculated to quickly locate the corresponding machine, so that the real storage position of the object can be found.
And 204, acquiring a region reference value, and comparing the node region value with the region reference value.
The area parameter value is predetermined and is an index for measuring the uniformity of the hash ring, and the area reference value is used for representing the area size that each existing node should occupy when the existing nodes in the hash ring are uniformly distributed. Specifically, when the existing nodes in the hash ring are uniformly distributed, the node area ranges corresponding to each existing node should be substantially the same, that is, the circumferences corresponding to the hash ring are uniformly distributed to each existing node to obtain the node area corresponding to each existing node, and at this time, each existing node is uniformly distributed in the hash ring, that is, the existing nodes in the hash ring are uniformly distributed.
Specifically, the area reference value may be determined according to the circumference of the hash ring and the total number of existing nodes, and specifically, the area reference value may be determined according to a ratio of the circumference to the total number of nodes.
In one embodiment, the computer device may compare the node region value with a region reference value in size, and determine whether the nodes on the hash ring are uniformly distributed according to the size comparison result.
And step 206, determining the uniformity of the hash ring according to the comparison result, and determining a target node from the existing nodes in the hash ring according to the uniformity of the hash ring.
The existing nodes are nodes already existing in the hash ring, and the newly added nodes are nodes to be newly added in the hash ring. The target node is extracted from the existing node, and is used to determine a node of the position of the newly added node, specifically, the position of the newly added node is determined according to a target node area corresponding to the target node in the hash ring.
Generally, when the node area value is greater than the area reference value, it indicates that the area occupied by the existing node whose node area value is greater than the area reference value is larger, in other words, it also indicates that there may be an existing node occupying a smaller area in the hash ring, that is, there is a possibility that the corresponding existing node in the hash ring has uneven distribution. When the node area value is smaller than or equal to the area reference value, it is indicated that the area occupied by the existing node having the node area value smaller than or equal to the area reference value in the hash ring is small, that is, the node distribution in the hash ring is not uniform.
In one embodiment, the computer device obtains a node area corresponding to each existing node in the hash ring, compares a node area value corresponding to each node area with a reference area value, and determines the distribution condition of each existing node in the hash ring according to the comparison result. Generally, when the node area value is larger than the area reference value, the existing node is determined as a node with a larger area range, and conversely, the existing node is determined as a node with a smaller area range.
And the computer equipment also judges the uniformity of the hash ring according to the uniformity condition of each node in the hash ring. And determining the position of the newly added node in the hash ring according to the uniformity of the hash ring.
It should be noted that, in order to ensure load balancing of existing nodes in the distributed system, it is necessary to ensure that the existing nodes can be uniformly distributed in the distributed system as much as possible. Therefore, when a node needs to be added in the distributed system, the position of the added node needs to be determined in the hash ring, so as to ensure that the existing nodes and the added node in the hash ring are uniformly distributed after the node is added. In one embodiment, when the existing nodes in the hash ring are not uniformly distributed, when nodes are added in the hash ring, the nodes are added in the hash ring as much as possible to form a hash ring with uniformly distributed nodes. In another embodiment, when existing nodes in the hash ring are uniformly distributed, when nodes are added in the hash ring, the nodes are guaranteed to be uniformly distributed after the nodes are added in the hash ring.
Specifically, a determination strategy for the positions of the newly added nodes is determined according to the uniformity. In one embodiment, the hash ring uniformity is divided into different uniformity levels, and the different uniformity levels correspond to different new node position determination strategies. For example, when the hash ring is uniformly distributed, the corresponding location determination policy may be a uniform determination policy and determine the target node according to the uniform determination policy, and when the hash ring is non-uniformly distributed, the corresponding location determination policy may be a non-uniform determination policy and determine the target node according to the non-uniform determination policy.
And 208, determining the position of the newly added node according to the target node area corresponding to the target node.
Specifically, the position of the newly added node is determined according to the position determination strategy. In one embodiment, one or more nodes in the existing nodes may be determined as target nodes, and the positions of the newly added nodes are determined according to target node areas corresponding to the target nodes in the hash ring.
In one embodiment, one of the existing nodes is extracted as a target node, a sub-region is divided in a target node region corresponding to the target node, the sub-region is used as a new node region corresponding to the new node, and the position of the new node is determined according to the boundary point of the new node region.
In another embodiment, a plurality of or all nodes in the existing nodes are extracted as target nodes, each target node is divided into a sub-region, all the sub-regions are used as new node regions of the new nodes, and the positions of the new nodes are determined according to the new node regions. Furthermore, it should be noted that the position of the newly added node may be one position or multiple positions, which is not limited herein.
In the above embodiment, the uniformity of the node distribution on the hash ring is determined according to the comparison result between the node region value corresponding to the existing node in the hash ring and the reference region value, and then the target node is determined in the existing node according to the actual uniformity condition of the hash ring, and then the position of the newly added node can be determined according to the target node, so that the technical effect of determining the position of the newly added node under the constraint of the uniformity value of the hash ring is achieved, and the uniformity of the hash ring can still be ensured when the node is newly added in the hash ring. The load balance of the nodes in the distributed system is realized, and the data processing efficiency is improved.
In one embodiment, obtaining a node region value corresponding to an existing node on a hash ring includes: acquiring a hash position corresponding to an existing node on a hash ring; and according to the clockwise direction, acquiring a next adjacent existing node corresponding to the existing node in the hash ring, and determining a node area value corresponding to the existing node on the hash ring according to the hash positions corresponding to the existing node and the next adjacent existing node respectively.
The node area value is the proportion of the storage range of the node in the whole hash ring, and the proportion can be specifically calculated according to the proportion of the arc length. The hash position refers to a corresponding position of a node in a hash ring, and can be specifically represented by data such as coordinates. And determining the region values between the adjacent nodes on the hash ring according to the hash positions respectively corresponding to the adjacent nodes in the hash ring, and representing the node region values corresponding to the nodes by using the region values. Specifically, the arc length of each region is then compared with the calculated reference value to determine whether the arc length of the region has the problem of data skew. Specifically, exceeding this value indicates that the amount of data skew is large and there is enough room to accommodate the new node data. Continuing with fig. 3, the node area value corresponding to the area between the existing node a and the existing node D in fig. 3 is greater than 75%, which indicates that the node area DA corresponding to the existing node D is a non-uniform area, and indicates that there is a data skew problem in the existing node D.
In the above embodiment, the node region value corresponding to each existing node is determined by calculating the hash value corresponding to each node in the hash ring, so that the node region value is calculated simply and efficiently, and the calculation efficiency of the node region value is improved.
In one embodiment, obtaining the regional reference value comprises: acquiring the number of existing nodes corresponding to the existing nodes on the hash ring and the number of newly added nodes corresponding to the newly added nodes in the hash ring; calculating the relative value of the number of the newly added nodes and the number of the existing nodes; and determining a region reference value according to the relative value, wherein the region reference value is stored in the block chain.
In a specific embodiment, the formula for calculating the area reference value may be: the reference area value is (number of existing nodes-number of newly added nodes)/number of existing nodes. It is emphasized that the local reference values may also be stored in a node of a block chain in order to further ensure privacy and security of the local reference values.
In the above embodiment, the corresponding reference region value calculation formula is set, so that the method is applicable to the reference region value calculation process in any scene, that is, no matter the number of nodes in the hash ring is multiple, the corresponding reference region value can be quickly and accurately obtained through the set formula, and the reference region value is determined through the formula, so that not only can the reference value be quickly determined, but also the determination of the reference value is based on the same standard, and the accuracy and the efficiency of the determination of the reference region value are greatly improved.
In one embodiment, determining a hash ring uniformity according to the comparison result, and determining a target node from existing nodes in the hash ring according to the hash ring uniformity includes: when the existing node with the node area value larger than the area reference value exists in the hash ring, determining the existing node with the node area value larger than the area reference value as a target node; and when the node area values corresponding to all the existing nodes in the hash ring are less than or equal to the area reference value, determining all the existing nodes in the hash ring as target nodes.
In one embodiment, the hash ring uniformity is determined according to the comparison result, and a determination strategy for the positions of the newly added nodes is determined according to the uniformity.
The hash uniformity is used for representing the distribution condition of nodes in a hash ring, and generally, the higher the hash uniformity is, the more uniform the distribution of the existing nodes on the hash ring is, and the more load balance can be realized in a distributed system. Specifically, when the node area value of the existing node in the hash ring is greater than the area reference value, it is determined that the existing node in the hash ring has an unbalanced distribution, and the lower the uniformity of the hash ring is determined.
In an embodiment, when the value of the node area value of the existing node in the hash ring is greater than the reference area value, the corresponding existing node is determined as the target node, and it can be understood that the target node is a node which is not uniformly distributed in the hash ring (the target node occupies a larger proportion in the hash ring), so that when a new node needs to be added in the hash ring at this time, the position of the new node can be determined within the node area range occupied by the target node, and the distribution of the nodes in the existing hash ring is adjusted by using the new node, so that the hash ring determined according to the existing node and the new node is more uniform, and further load balancing is realized.
In another embodiment, when the nodes in the hash ring are distributed relatively uniformly, for example, no node area value corresponding to a node in the hash ring is greater than a reference area value, or the node area values in the hash ring are approximately the same, it is stated that the system can basically achieve load balancing when distributed. And when the nodes need to be continuously added in the hash ring, determining all the existing nodes in the hash ring as target nodes so as to determine the positions of the added nodes according to all the target nodes. For example, partial regions may be respectively divided from the node regions corresponding to the target node as the additional node regions of the additional nodes. Therefore, by dividing all the nodes into sub-regions respectively to form a newly added node region of the newly added node, the nodes in the system can be ensured to be uniformly distributed even if the newly added node is distributed, and further load balance is approximately realized.
In the above embodiment, the hash ring uniformity is determined according to the comparison result, and the determination strategy for the position of the newly added node is determined according to the uniformity. The method and the device realize the self-adaptive determination of the target node under different Hash ring uniformity conditions and the mode strategy of self-adaptively determining the position of the newly added node according to the target node, realize the determination of the position of the newly added node by selecting the mode which is most matched with the scene under different scenes, and further ensure that the target of load balancing can be realized under different conditions.
In one embodiment, existing nodes in the hash ring with node region values greater than the region reference value exist; determining the position of the newly added node according to the target node area corresponding to the target node, comprising: determining an allocable area corresponding to each node on the hash ring according to the number of the nodes on the hash ring, wherein the nodes comprise the existing nodes and the newly added nodes; dividing an area range corresponding to the distributable area from a target node area corresponding to the target node, and taking the divided area range as a new node area of the new node; and determining the position of the newly added node according to the newly added node area.
As shown in fig. 4, fig. 4 is a schematic diagram of a node newly added in a non-uniform hash ring according to an embodiment. In fig. 4, the existing node in the hash ring is node A, B, C, D, the newly added node is node E, and the node area value of node D is calculated to be greater than 75% of the reference area value in fig. 3, so node D is taken as the target node, and the node area DA corresponding to node D is taken as the target node area. And then calculating the allocable region corresponding to each node according to the total number of the existing nodes and the newly added nodes and the hash ring and the total number, specifically calculating the ratio of the circumference corresponding to the hash ring to the total number of the nodes, and determining the allocable region value corresponding to each node in the hash ring after the nodes are newly added to the hash ring according to the ratio.
In one embodiment, since the target node region is a region in which the node region value existing in the hash ring is greater than the region reference value, a partial region can be divided from the target node region and used as a newly added node region, so that not only is the larger target region approached to the reference region value, but also the technical effect of ensuring relatively uniform node distribution after nodes are newly added in the hash ring is solved.
In one embodiment, a region that is consistent with the range of the assignable region may be divided from the target region as the new node region, so that it is at least ensured that the region values of the new node region and the other non-target regions are consistent and are all assignable region values.
In another embodiment, the target area may be further divided into two parts, wherein one part is continuously used as the target area, and the other part may be used as the new node area. In the embodiment, the consistency of the target area and the newly added node area can be ensured, and the condition that after the node is newly added, the difference value of the area values of the target area and the newly added area is too large, so that the nodes are unevenly distributed in the hash ring is prevented.
In one embodiment, the node region values corresponding to all existing nodes in the hash ring are all less than or equal to the region reference value; determining the position of the newly added node according to the target node area corresponding to the target node, wherein the determining step comprises the following steps: determining an allocable area corresponding to each node on the hash ring according to the number of the nodes on the hash ring, wherein the nodes comprise the existing nodes and the newly added nodes; dividing sub-regions from the existing nodes respectively to ensure that the total region obtained according to each sub-region is consistent with the region range corresponding to the distributable region; and taking each sub-area as a node area of the newly added node, and determining the position of the newly added node according to the node area of the newly added node.
As shown in fig. 5, fig. 5 is a schematic diagram of a new node in a uniform hash ring according to an embodiment, in fig. 5, an existing node in the hash ring is a node A, B, C, D, the new node is a node E, no more than 75% of the node area value of the existing node A, B, C, D is calculated in fig. 5, and the node area values of the existing nodes are substantially the same, so that all the existing nodes can be simultaneously used as target nodes, and the node areas AB, BC, CD, and DA corresponding to the target nodes are used as target node areas. And then calculating the allocable region corresponding to each node according to the total number of the existing nodes and the newly added nodes and the hash ring and the total number, specifically calculating the ratio of the circumference corresponding to the hash ring to the total number of the nodes, and determining the allocable region value corresponding to each node in the hash ring after the nodes are newly added to the hash ring according to the ratio.
In one embodiment, since the target node regions are uniformly distributed in the hash ring, it is ensured that the uniformity of the target node is still ensured after the sub-regions are divided by dividing a part of the region from each target node region and using the part of the region as the sub-region of the newly added node, and further by dividing the corresponding sub-regions from each target node region respectively. Meanwhile, the value of the newly added node area formed by all the sub-areas divided from the target node area is approximately consistent with the value of the distributable area, so that the area values of the newly added node area and the target area in the hash ring are also guaranteed to be consistent, and the uniformity of the node distribution on the hash ring is guaranteed after the nodes are newly added in the uniform hash ring.
In one embodiment, the sub-regions of the newly added node may be divided in the first half of the region of each target region in a clockwise direction. In another embodiment, the sub-regions of the newly added node may be divided into the second half region of each target node region in a clockwise direction. Alternatively, in other embodiments, the sub-regions are divided into the first half or the second half without specific limitation.
In another embodiment, when the node region values of the existing node regions are not relatively uniform, a proportional relationship may be further constructed according to the existing node region values, and the range of the sub-region partitioned from the corresponding existing node region is determined according to the corresponding proportional relationship, so that the ranges of the remaining sub-regions after partitioning are substantially the same, thereby further achieving node load balancing in the distributed system.
As shown in FIG. 5, for the newly added node E, the newly added sub-region of the newly added node E is composed of four parts, namely, the sub-region (A: E-1), the sub-region (B: E-2), the sub-region (C: E-3) and the sub-region (D: E-1), and the newly added region of the newly added node E is determined according to the 4 newly added sub-regions. That is, it is realized in fig. 5 that one quarter of the space required for E is divided each by four areas of ABCD to E.
It should be noted that, in other embodiments, after nodes are added to the hash ring, uniform distribution of the nodes in the hash ring may be further achieved by adding virtual nodes. Specifically, the nodes virtually copied from the real nodes are called "virtual nodes", that is, multiple hashes are calculated for each node, and one node is placed at each calculation result position, which is called a virtual node. The specific implementation can be realized by adding numbers behind the IP or host name of the server. In practical applications, the number of virtual nodes is typically set to 32 or even larger, so that even a few service nodes can achieve relatively even data distribution. Due to the fact that the number of the virtual nodes is large, the mapping relation between the virtual nodes is relatively balanced. In this embodiment, the position of the newly added node is determined in consideration of the limitation of the distribution uniformity of the nodes in the hash ring, and virtual nodes can be further arranged in the hash ring, so that the distribution uniformity of the nodes on the multi-dimensional control hash ring is realized. Further realizing load balance.
In the conventional technology, the node distribution in the hash ring can be relatively balanced by setting a virtual node in the hash ring, but the conventional method cannot solve the problems of new data skew and balance caused when a node is newly added. According to the scheme, the corresponding newly added node position determining strategy is determined according to the uniformity value of the Hash ring, the newly added node with the Hash ring uniformity as the limiting condition is used, and the condition that the uniformity of the Hash ring is still met after the newly added node is ensured. In addition, the proposal can be matched with a scheme of newly adding virtual nodes, thereby further ensuring the uniformity of the Hash ring under the dual conditions. When the capacity expansion mode is adopted, the situation of data inclination can be effectively prevented no matter under the condition of an original consistent hash algorithm or under the condition of a consistent algorithm under a virtual node, and the balance of the system after the node capacity expansion is greatly improved.
In another embodiment, the whole size of the hash ring can be reduced on the basis of constructing the hash ring. For example, reducing hash rings of size 2^32 to size 2^ 20. Since the conventional consistent hash requires a considerable number of virtual nodes to be set, a large-point ring helps reduce contingency. The improved consistency hash does not need to set virtual nodes, so that the calculation amount is increased and the calculation amount is reduced in a proper amount if the hash ring is too large. However, in the case of more nodes, too small a ring may cause data congestion, so 2^20 is in a suitable range, not absolutely, and the space size of the hash ring may be scaled up or down appropriately according to the requirement in different embodiments.
In an embodiment, when a plurality of nodes are newly added, a node may be newly added in the hash ring, and after the end, a node may be newly added and the process may be repeated.
In the above embodiment, the positions of the newly added nodes in the hash ring are determined through a uniformity constraint condition, so as to ensure that a more uniform node distribution effect is achieved after the nodes are newly added in the hash ring. Specifically, the position determination strategy of the newly added node is determined by calculating the area occupation ratio of each node in the hash ring. Moreover, according to the scheme in the application, the uniformity of the nodes on the hash ring can be ensured only according to actual nodes, and the number of the nodes is small, so that the management of the nodes is reduced, and the nodes can be expanded more conveniently. The method for determining the position of the newly added node is further determined according to the actual distribution condition of the nodes on the hash ring by two different strategies, wherein the first strategy is a newly added node determination strategy under the condition that the existing nodes on the hash ring are uniformly distributed, and the second strategy is a newly added node determination strategy under the condition that the existing nodes in the hash ring are non-uniformly distributed. The newly added node position determining strategy provided by the application is more reasonable, is suitable for more scenes, determines the obtained newly added node position more accurately in a corresponding mode, and can realize load balancing. And the method can further realize load balance by combining the mode of the virtual node, and the mode is more flexible.
It should be understood that, although the steps in the flowchart of fig. 2 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in fig. 2 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least a portion of the other steps or stages.
In one embodiment, as shown in fig. 6, there is provided a node position determination apparatus including:
an obtaining module 602, configured to obtain a node region value corresponding to an existing node on a hash ring;
a comparison module 604, configured to obtain a region reference value, and compare the node region value with the region reference value;
a first determining module 606, configured to determine a hash ring uniformity according to the comparison result, and determine a target node from existing nodes in the hash ring according to the hash ring uniformity;
the second determining module 608 is configured to determine the position of the newly added node according to the target node area corresponding to the target node.
In one embodiment, the obtaining module 602 is further configured to obtain a hash position corresponding to an existing node on the hash ring; and according to the clockwise direction, acquiring a next adjacent existing node corresponding to the existing node in the hash ring, and determining a node area value corresponding to the existing node on the hash ring according to the hash positions corresponding to the existing node and the next adjacent existing node respectively.
In an embodiment, the comparing module 604 is further configured to obtain the number of existing nodes corresponding to the existing nodes on the hash ring and the number of new nodes corresponding to the new nodes in the hash ring; calculating the relative value of the number of the newly added nodes and the number of the existing nodes; and determining the area reference value according to the relative value.
In one embodiment, the first determining module 606 is further configured to determine, as the target node, an existing node whose node area value is greater than the area reference value when the existing node whose node area value is greater than the area reference value exists in the hash ring; and when the node area values corresponding to all the existing nodes in the hash ring are less than or equal to the area reference value, determining all the existing nodes in the hash ring as target nodes.
In an embodiment, the second determining module 608 is further configured to determine an allocable area corresponding to each node on the hash ring according to the number of nodes on the hash ring, where the nodes include an existing node and a newly added node; dividing an area range corresponding to the distributable area from a target node area corresponding to the target node, and taking the divided area range as a new node area of the new node; and determining the position of the newly added node according to the newly added node area.
In one embodiment, the node region values corresponding to all existing nodes in the hash ring are all less than or equal to the region reference value; the second determining module 608 is further configured to determine an allocable area corresponding to each node on the hash ring according to the number of nodes on the hash ring, where the nodes include an existing node and a newly added node; dividing sub-regions from the existing nodes respectively to make the total region obtained according to each sub-region consistent with the region range corresponding to the distributable region; and taking each sub-area as a node area of the newly added node, and determining the position of the newly added node according to the node area of the newly added node.
For the specific definition of the node position determining apparatus, reference may be made to the above definition of the node position determining method, which is not described herein again. The respective modules in the node position determining apparatus may be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used to store node data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a node location determination method.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program: acquiring a node region value corresponding to an existing node on a hash ring; acquiring a region reference value, and comparing the node region value with the region reference value; determining the hash ring uniformity according to the comparison result, and determining a target node from the existing nodes in the hash ring according to the hash ring uniformity; and determining the position of the newly added node according to the target node area corresponding to the target node.
In one embodiment, the processor, when executing the computer program, further performs the steps of: acquiring a hash position corresponding to an existing node on a hash ring; and according to the clockwise direction, acquiring a next adjacent existing node corresponding to the existing node in the hash ring, and determining a node area value corresponding to the existing node on the hash ring according to the hash positions corresponding to the existing node and the next adjacent existing node respectively.
In one embodiment, the processor, when executing the computer program, further performs the steps of: acquiring the number of the existing nodes corresponding to the existing nodes on the hash ring and the number of the newly added nodes corresponding to the newly added nodes in the hash ring; calculating the relative value of the number of the newly added nodes and the number of the existing nodes; and determining a region reference value according to the relative value, wherein the region reference value is stored in the block chain.
In one embodiment, the processor, when executing the computer program, further performs the steps of: when the existing node with the node area value larger than the area reference value exists in the hash ring, determining the existing node with the node area value larger than the area reference value as a target node; and when the node area values corresponding to all the existing nodes in the hash ring are less than or equal to the area reference value, determining all the existing nodes in the hash ring as target nodes.
In one embodiment, the processor, when executing the computer program, further performs the steps of: determining an allocable area corresponding to each node on the hash ring according to the number of the nodes on the hash ring, wherein the nodes comprise the existing nodes and the newly added nodes; dividing an area range corresponding to the distributable area from a target node area corresponding to the target node, and taking the divided area range as a new node area of the new node; and determining the position of the newly added node according to the newly added node area.
In one embodiment, the processor, when executing the computer program, further performs the steps of: determining an allocable area corresponding to each node on the hash ring according to the number of the nodes on the hash ring, wherein the nodes comprise the existing nodes and the newly added nodes; dividing sub-regions from the existing nodes respectively to make the total region obtained according to each sub-region consistent with the region range corresponding to the distributable region; and taking each sub-area as a node area of the newly added node, and determining the position of the newly added node according to the node area of the newly added node.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of: acquiring a node region value corresponding to an existing node on a hash ring; acquiring a region reference value, and comparing the node region value with the region reference value; determining the hash ring uniformity according to the comparison result, and determining a target node from the existing nodes in the hash ring according to the hash ring uniformity; and determining the position of the newly added node according to the target node area corresponding to the target node.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring a hash position corresponding to an existing node on a hash ring; and according to the clockwise direction, acquiring a next adjacent existing node corresponding to the existing node in the hash ring, and determining a node area value corresponding to the existing node on the hash ring according to the hash positions corresponding to the existing node and the next adjacent existing node respectively.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring the number of existing nodes corresponding to the existing nodes on the hash ring and the number of newly added nodes corresponding to the newly added nodes in the hash ring; calculating the relative value of the number of the newly added nodes and the number of the existing nodes; and determining a region reference value according to the relative value, wherein the region reference value is stored in the block chain.
In one embodiment, the computer program when executed by the processor further performs the steps of: when the existing node with the node area value larger than the area reference value exists in the hash ring, determining the existing node with the node area value larger than the area reference value as a target node; and when the node area values corresponding to all the existing nodes in the hash ring are less than or equal to the area reference value, determining all the existing nodes in the hash ring as target nodes.
In one embodiment, the computer program when executed by the processor further performs the steps of: determining a distributable area corresponding to each node on the hash ring according to the number of the nodes on the hash ring, wherein the nodes comprise the existing nodes and the newly added nodes; dividing an area range corresponding to the distributable area from a target node area corresponding to the target node, and taking the divided area range as a new node area of the new node; and determining the position of the newly added node according to the newly added node area.
In one embodiment, the computer program when executed by the processor further performs the steps of: determining an allocable area corresponding to each node on the hash ring according to the number of the nodes on the hash ring, wherein the nodes comprise the existing nodes and the newly added nodes; dividing sub-regions from the existing nodes respectively to make the total region obtained according to each sub-region consistent with the region range corresponding to the distributable region; and taking each sub-area as a node area of the newly added node, and determining the position of the newly added node according to the node area of the newly added node.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
It should be appreciated that the subject application is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware related to instructions of a computer program, and the computer program can be stored in a computer readable storage medium, and when executed, the computer program can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above examples only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method for node location determination, the method comprising:
acquiring a node region value corresponding to an existing node on a hash ring;
acquiring a region reference value, and comparing the node region value with the region reference value;
determining hash ring uniformity according to the comparison result, and determining a target node from the existing nodes in the hash ring according to the hash ring uniformity;
determining the position of a newly added node according to a target node area corresponding to the target node;
the acquiring of the node region value corresponding to the existing node on the hash ring includes:
acquiring a hash position corresponding to an existing node on a hash ring;
acquiring a next adjacent existing node corresponding to the existing node in the hash ring according to the clockwise direction;
determining the proportion of the storage range of the node in the whole hash ring according to the hash positions respectively corresponding to the existing node and the next adjacent existing node, and taking the calculated proportion as the corresponding node area value of the existing node on the hash ring;
determining the hash ring uniformity according to the comparison result, and determining a target node from the existing nodes in the hash ring according to the hash ring uniformity, including:
when the existing node with the node area value larger than the area reference value exists in the hash ring, determining the existing node with the node area value larger than the area reference value as a target node;
the determining the position of the newly added node according to the target node area corresponding to the target node comprises:
determining an allocable area corresponding to each node on the hash ring according to the number of the nodes on the hash ring, wherein the nodes comprise the existing nodes and the newly added nodes;
dividing an area range corresponding to the distributable area from a target node area corresponding to the target node, and taking the divided area range as a new node area of the new node;
determining the position of the newly added node according to the newly added node area;
the obtaining of the region reference value includes:
acquiring the number of existing nodes corresponding to the existing nodes on a hash ring and the number of newly added nodes corresponding to the newly added nodes in the hash ring;
calculating the relative value of the number of the newly added nodes and the number of the existing nodes, wherein the relative value comprises the difference value between the number of the existing nodes and the number of the newly added nodes, and the ratio of the difference value to the number of the existing nodes is calculated as the relative value;
and determining a region reference value according to the relative value.
2. The method of claim 1, wherein the region reference value is stored in a block chain.
3. The method of claim 1, wherein determining a hash ring uniformity based on the comparison, and determining a target node from the existing nodes in the hash ring based on the hash ring uniformity, further comprises:
when the node region values corresponding to all the existing nodes in the hash ring are all smaller than or equal to the region reference value, determining all the existing nodes in the hash ring as target nodes.
4. The method according to claim 3, wherein the node region values corresponding to all the existing nodes in the hash ring are less than or equal to the region reference value; the determining the position of the newly added node according to the target node area corresponding to the target node comprises:
determining an allocable area corresponding to each node on the hash ring according to the node number of the nodes on the hash ring, wherein the nodes comprise the existing nodes and the newly added nodes;
dividing sub-regions from the existing nodes respectively to make the total region obtained according to each sub-region consistent with the region range corresponding to the distributable region;
and taking each sub-region as the node region of the newly added node, and determining the position of the newly added node according to the node region of the newly added node.
5. An apparatus for node location determination, the apparatus comprising:
the acquisition module is used for acquiring a node region value corresponding to the existing node on the hash ring;
the comparison module is used for acquiring a region reference value and comparing the node region value with the region reference value;
the first determining module is used for determining the uniformity of a hash ring according to the comparison result and determining a target node from the existing nodes in the hash ring according to the uniformity of the hash ring;
the second determining module is used for determining the position of the newly added node according to the target node area corresponding to the target node;
the acquisition module is also used for acquiring a hash position corresponding to the existing node on the hash ring; according to the clockwise direction, acquiring a next adjacent existing node corresponding to the existing node in the hash ring, determining the proportion of the storage range of the node in the whole hash ring according to the hash positions respectively corresponding to the existing node and the next adjacent existing node, and taking the calculated proportion as a node area value for determining the correspondence of the existing node on the hash ring;
the first determining module is further configured to determine, as a target node, the existing node whose node area value is greater than the area reference value when the existing node whose node area value is greater than the area reference value exists in the hash ring;
the second determining module is further configured to determine, according to the number of nodes on the hash ring, an allocable area corresponding to each node on the hash ring, where the nodes include the existing node and the newly added node; dividing an area range corresponding to the distributable area from a target node area corresponding to the target node, and taking the divided area range as a new node area of the new node; determining the position of the newly added node according to the newly added node area;
the comparison module is further used for acquiring the number of the existing nodes corresponding to the existing nodes on the hash ring and the number of the newly added nodes corresponding to the newly added nodes in the hash ring; calculating a relative value of the number of the newly added nodes and the number of the existing nodes, wherein the relative value comprises a difference value between the number of the existing nodes and the number of the newly added nodes, and a ratio of the difference value to the number of the existing nodes is calculated as a relative value; and determining a region reference value according to the relative value.
6. The apparatus of claim 5, wherein the region reference value is stored in a block chain.
7. The apparatus of claim 5, wherein the determining the hash ring uniformity according to the comparison result further determines all the existing nodes in the hash ring as target nodes when the node region values corresponding to all the existing nodes in the hash ring are less than or equal to the region reference value according to the first determining module.
8. The apparatus according to claim 7, wherein the node region values corresponding to all the existing nodes in the hash ring are less than or equal to the region reference value; the second determining module is further configured to determine an allocable area corresponding to each node on the hash ring according to the number of nodes on the hash ring, where the nodes include the existing node and the newly added node; dividing sub-regions from the existing nodes respectively to make the total region obtained according to each sub-region consistent with the region range corresponding to the distributable region; and taking each sub-region as the node region of the newly added node, and determining the position of the newly added node according to the node region of the newly added node.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 4.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 4.
CN202011300772.9A 2020-11-19 2020-11-19 Node position determination method and device, computer equipment and storage medium Active CN112492008B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202011300772.9A CN112492008B (en) 2020-11-19 2020-11-19 Node position determination method and device, computer equipment and storage medium
PCT/CN2021/109560 WO2022105298A1 (en) 2020-11-19 2021-07-30 Node position determination method and apparatus, computer device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011300772.9A CN112492008B (en) 2020-11-19 2020-11-19 Node position determination method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112492008A CN112492008A (en) 2021-03-12
CN112492008B true CN112492008B (en) 2022-05-20

Family

ID=74931780

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011300772.9A Active CN112492008B (en) 2020-11-19 2020-11-19 Node position determination method and device, computer equipment and storage medium

Country Status (2)

Country Link
CN (1) CN112492008B (en)
WO (1) WO2022105298A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112492008B (en) * 2020-11-19 2022-05-20 深圳壹账通智能科技有限公司 Node position determination method and device, computer equipment and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012055242A1 (en) * 2010-10-27 2012-05-03 中兴通讯股份有限公司 Method and apparatus for realizing load balance in distributed hash table network
WO2012086920A2 (en) * 2010-12-24 2012-06-28 (주)케이티 Distributed storage system having content-based overlap prevention function, method for storing object thereof, and storage medium readable by computer
CN104378447A (en) * 2014-12-03 2015-02-25 深圳市鼎元科技开发有限公司 Non-migration distributed storage method and non-migration distributed storage system on basis of Hash ring
CN105187547A (en) * 2015-09-25 2015-12-23 浪潮(北京)电子信息产业有限公司 Load balancing method and system
WO2017203093A1 (en) * 2016-05-25 2017-11-30 Nokia Technologies Oy Method, device and system for utilizing block chain to define trusted circle
CN110830562A (en) * 2019-10-30 2020-02-21 重庆邮电大学 Limited load consistency Hash load balancing strategy based on virtual nodes
CN111225059A (en) * 2020-01-10 2020-06-02 中移(杭州)信息技术有限公司 Network request resource scheduling method and device, electronic equipment and storage medium
CN111680019A (en) * 2020-04-29 2020-09-18 杭州趣链科技有限公司 Data capacity expansion method and device for block chain
CN111917851A (en) * 2020-07-22 2020-11-10 电信科学技术第五研究所有限公司 Load balancing scheduling method for realizing weighted load based on consistent hash

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10657061B1 (en) * 2017-09-29 2020-05-19 Amazon Technologies, Inc. Resource distribution using attributes of versioned hash rings
CN109617986B (en) * 2018-12-27 2020-08-07 华为技术有限公司 Load balancing method and network equipment
CN110071978B (en) * 2019-04-28 2022-04-22 新华三信息安全技术有限公司 Cluster management method and device
CN110888735A (en) * 2019-11-12 2020-03-17 厦门网宿有限公司 Distributed message distribution method and device based on consistent hash and scheduling node
CN111614760A (en) * 2020-05-20 2020-09-01 浩云科技股份有限公司 Method and device for balanced distribution access of Internet of things equipment
CN112492008B (en) * 2020-11-19 2022-05-20 深圳壹账通智能科技有限公司 Node position determination method and device, computer equipment and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012055242A1 (en) * 2010-10-27 2012-05-03 中兴通讯股份有限公司 Method and apparatus for realizing load balance in distributed hash table network
WO2012086920A2 (en) * 2010-12-24 2012-06-28 (주)케이티 Distributed storage system having content-based overlap prevention function, method for storing object thereof, and storage medium readable by computer
CN104378447A (en) * 2014-12-03 2015-02-25 深圳市鼎元科技开发有限公司 Non-migration distributed storage method and non-migration distributed storage system on basis of Hash ring
CN105187547A (en) * 2015-09-25 2015-12-23 浪潮(北京)电子信息产业有限公司 Load balancing method and system
WO2017203093A1 (en) * 2016-05-25 2017-11-30 Nokia Technologies Oy Method, device and system for utilizing block chain to define trusted circle
CN110830562A (en) * 2019-10-30 2020-02-21 重庆邮电大学 Limited load consistency Hash load balancing strategy based on virtual nodes
CN111225059A (en) * 2020-01-10 2020-06-02 中移(杭州)信息技术有限公司 Network request resource scheduling method and device, electronic equipment and storage medium
CN111680019A (en) * 2020-04-29 2020-09-18 杭州趣链科技有限公司 Data capacity expansion method and device for block chain
CN111917851A (en) * 2020-07-22 2020-11-10 电信科学技术第五研究所有限公司 Load balancing scheduling method for realizing weighted load based on consistent hash

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"基于贪心算法的一致性哈希负载均衡优化";王诚 等;《南京邮电大学学报自然科学版》;20180615;全文 *

Also Published As

Publication number Publication date
WO2022105298A1 (en) 2022-05-27
CN112492008A (en) 2021-03-12

Similar Documents

Publication Publication Date Title
CN110996352B (en) Flow control method, device, computer equipment and storage medium
JP5514041B2 (en) Identifier assignment method and program
US20170034272A1 (en) Data transfer priority levels
CN109032803B (en) Data processing method and device and client
CN112099979B (en) Access control method, device, computer equipment and storage medium
CN101276389A (en) Separation of logical trusted platform modules within a single physical trusted platform module
CN111723148A (en) Data storage method and device, storage medium and electronic device
CN112492008B (en) Node position determination method and device, computer equipment and storage medium
CN113282941A (en) Method and device for acquiring object identification, electronic equipment and storage medium
CN111340483A (en) Data management method based on block chain and related equipment
CN114969061A (en) Distributed storage method and device for industrial time sequence data
CN107391039B (en) Data object storage method and device
US20220413807A1 (en) Secure random number generation system, secure computation apparatus, secure random number generation method, and program
US20150278543A1 (en) System and Method for Optimizing Storage of File System Access Control Lists
CN116303343A (en) Data slicing method, device, electronic equipment and storage medium
Danish A blockchain-based adaptive middleware for large scale internet of things data storage selection
Gai et al. Smart data deduplication for telehealth systems in heterogeneous cloud computing
CN114756380A (en) Cloud server deployment method and device, electronic equipment and storage medium
US8621557B2 (en) Information processing system judging whether manipulation is possible or not based on access control policy and method of operation thereof
CN114064806A (en) Distributed serial number generation method and device, computer equipment and storage medium
CN109492376B (en) Device access authority control method and device and bastion machine
CN111078712B (en) Big data cluster updating method and device, computer equipment and storage medium
CN114637472A (en) DHT-based block chain storage expansion method, electronic equipment and storage medium
CN112291241A (en) Firewall wall opening method, firewall wall opening device and terminal equipment
TW202008153A (en) Data processing method and apparatus, and server

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40045441

Country of ref document: HK

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant