CN103379138A - Method and system for realizing load balance, and method and apparatus for gray scale publication - Google Patents

Method and system for realizing load balance, and method and apparatus for gray scale publication Download PDF

Info

Publication number
CN103379138A
CN103379138A CN2012101127532A CN201210112753A CN103379138A CN 103379138 A CN103379138 A CN 103379138A CN 2012101127532 A CN2012101127532 A CN 2012101127532A CN 201210112753 A CN201210112753 A CN 201210112753A CN 103379138 A CN103379138 A CN 103379138A
Authority
CN
China
Prior art keywords
load node
node
cryptographic hash
load
default
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.)
Granted
Application number
CN2012101127532A
Other languages
Chinese (zh)
Other versions
CN103379138B (en
Inventor
娄继冰
方允福
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Tencent Computer Systems Co Ltd
Original Assignee
Shenzhen Tencent Computer Systems Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Tencent Computer Systems Co Ltd filed Critical Shenzhen Tencent Computer Systems Co Ltd
Priority to CN201210112753.2A priority Critical patent/CN103379138B/en
Publication of CN103379138A publication Critical patent/CN103379138A/en
Application granted granted Critical
Publication of CN103379138B publication Critical patent/CN103379138B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Abstract

A method for realizing load balance comprises the following steps of acquiring a data access request, extracting a request identifier in the data access request and calculating a Hash value of the request identifier; finding a load node matching the Hash value in a preset corresponding table of the Hash value and load nodes, wherein the preset corresponding table of the Hash value and load nodes is provided with a preset number of load nodes corresponding to the same number of Hash values which are distributed in advance, the preset number being at least two; and distributing the load node to the data access request. In addition, a system for realizing load balance, a method and an apparatus for gray scale publication are correspondingly provided. The method and the apparatus for realizing load balance have relatively small data migration cost and relatively high controllability during capacity expanding and removal of load nodes. The method and the system for gray scale publication improve the controllability during gray scale publication.

Description

Realize the method and system of load balancing and method and the device of gray scale issue
[technical field]
The present invention relates to networking technology area, particularly a kind of method and system of load balancing and method and device of gray scale issue realized.
[background technology]
In traditional server/customer end constitution, the corresponding server of a plurality of clients.When concurrent data access request was more, single server was because computing capability and network bandwidth limitations often can't be processed a plurality of requests simultaneously.Then by a plurality of load nodes will process the task of asking and share with regard to adding a plurality of load nodes (being responsible for processing the server of asking) this moment, thereby alleviate the pressure of Single-Server.The method that this task processing pressure with single server is shared on a plurality of load nodes also is load balancing.
In the conventional art, obtain first the request mark of data access request, then calculate the cryptographic Hash of request mark, then the corresponding relation according to default cryptographic Hash and load node distributes corresponding load node to this data access request.In the corresponding relation of cryptographic Hash and load node, cryptographic Hash is corresponding one by one with load node in the conventional art, thereby so that identical request always processed by identical load node.When being provided with buffer memory in the load node, identical request can be in buffer memory intermediate data and the final data of acquisition unit divisional processing.
The method of this realization load balancing, in dilatation or when removing node, when namely having changed the quantity of load node, owing to need to rebulid the corresponding relation of cryptographic Hash and load node, corresponding load node changes to cause identical request before dilatation and after the dilatation, thereby so that the cache invalidation in the load node, thus the cost of Data Migration when having improved dilatation, so that realize that the method for load balancing is unstable.
Method based on the realization load balancing of consistency Hash in the conventional art has solved this problem, use continuous number as cryptographic Hash, and default cryptographic Hash is mapped to an annular chain meter by size, then each load node is set a position at annular chain meter and shine upon its cryptographic Hash.When the size of the cryptographic Hash of the request mark that calculates drops between two load nodes, then the load node of the end load node of less cryptographic Hash (corresponding larger or) is distributed to this request.When dilatation, only dilatation node (load node that increases newly) need be set a reposition and shone upon its cryptographic Hash at annular chain meter and can finish dilatation, and need not change the corresponding relation of data access request and other load nodes, thereby has less Data Migration cost.
Yet, in the conventional art based on the method for the realization load balancing of consistency Hash, can't data access request be pro rata distributed to load node and dilatation node as required, thereby number of request corresponding to each load node can't reasonably be set so that load balancing can handling deficiency.
[summary of the invention]
Based on this, be necessary to provide a kind of in dilatation or when removing node, can improve the method for realization load balancing that can be handling.
A kind of method that realizes load balancing may further comprise the steps:
Obtain data access request, extract the request mark in the described data access request, calculate the cryptographic Hash of described request sign;
In the corresponding table with load node of default cryptographic Hash, search the load node with described Hash values match, in the corresponding table with load node of described default cryptographic Hash, allocate the load node corresponding to cryptographic Hash of default number in advance, described default number is at least 2;
Described load node is distributed to described data access request.
Preferably, the described data access request of obtaining also comprises before:
In the corresponding table of described cryptographic Hash and load node, distribute the corresponding identical load node of cryptographic Hash of default number according to the performance parameter of load node;
The performance parameter of described load node comprise load node computational resource size, Internet resources are big or small and at least a in big or small of storage resources.
Preferably, the described data access request of obtaining also comprises before:
Set up the corresponding relation between load node and the default backup node;
Described described load node is distributed to also comprises after the described data access request:
Obtain the backup node corresponding with described load node according to the corresponding relation between described load node and the default backup node, and described backup node is distributed to described load node back up.
Preferably, described method also comprises:
When dilatation, obtain the dilatation node of interpolation;
Choose a plurality of described cryptographic Hash in the corresponding table with load node of described default cryptographic Hash, the load node that described cryptographic Hash is corresponding is updated to described dilatation node;
Described method also comprises: when removing load node, obtain the load node that removes;
Search the described load node that removes corresponding cryptographic Hash in the corresponding table with load node of described cryptographic Hash, the load node that described cryptographic Hash is corresponding is updated to the load node that is not removed.
Preferably, the described data access request of obtaining also comprises before:
Issue the corresponding table with load node of described cryptographic Hash and carry out buffer memory to client.
In addition, also be necessary to provide a kind of in dilatation or when removing node, can improve can be handling system.
A kind of system that realizes load balancing comprises with lower module:
The Hash calculation module is used for obtaining data access request, extracts the request mark in the described data access request, calculates the cryptographic Hash of described request sign;
Node is searched module, be used at the corresponding load node of showing to search with described Hash values match with load node of default cryptographic Hash, in the corresponding table with load node of described default cryptographic Hash, allocate the load node corresponding to cryptographic Hash of default number in advance, described default number is at least 2;
The node distribution module is used for described load node is distributed to described data access request.
Preferably, also comprise corresponding table creation module, be used for distributing the corresponding identical load node of cryptographic Hash of default number according to the performance parameter of load node at the corresponding table of described cryptographic Hash and load node;
The performance parameter of described load node comprise load node computational resource size, Internet resources are big or small and at least a in big or small of storage resources.
Preferably, also comprise backup module, be used for setting up the corresponding relation between load node and the default backup node, and obtain the backup node corresponding with described load node according to the corresponding relation between described load node and the default backup node, and described backup node is distributed to described load node back up.
Preferably, also comprise corresponding table update module, be used for when dilatation, obtaining the dilatation node of interpolation that choose a plurality of described cryptographic Hash in the corresponding table with load node of described default cryptographic Hash, the load node that described cryptographic Hash is corresponding is updated to described dilatation node; Also be used for obtaining the load node that removes when removing load node, search the described load node that removes corresponding cryptographic Hash in the corresponding table with load node of described cryptographic Hash, the load node that described cryptographic Hash is corresponding is updated to the load node that is not removed.
Preferably, comprise that also corresponding table issues module, is used for issuing show corresponding with load node of described cryptographic Hash and carries out buffer memory to client.
In addition, also provide a kind of method that can improve gray scale issue that can be handling.
A kind of method of gray scale issue may further comprise the steps
Obtain gray scale issue request;
Adjust the number of the cryptographic Hash that load node is corresponding in the corresponding table with load node of default cryptographic Hash according to described gray scale issue request, in the described corresponding table, allocate the load node corresponding to cryptographic Hash of default number in advance, described default number is at least 2;
Carry out the gray scale issue according to the cryptographic Hash number in the load node after adjusting.
In addition, also provide a kind of device that can improve gray scale issue that can be handling.
A kind of device of gray scale issue comprises:
Gray scale issue acquisition request module is used for obtaining gray scale issue request;
The gray scale adjusting module, be used for adjusting according to described gray scale issue request the number of cryptographic Hash corresponding to the corresponding table with load node of default cryptographic Hash load node, in the described corresponding table, allocate the load node corresponding to cryptographic Hash of default number in advance, described default number is at least 2;
The gray scale release module is used for carrying out the gray scale issue according to the cryptographic Hash number of the load node after adjusting.
The method and system of above-mentioned realization load balancing, when dilatation, because the default number of the cryptographic Hash of corresponding identical load node is at least 2, therefore can the partial data access request can be corresponded on the dilatation node by new portion corresponding relation more and realize dilatation; Simultaneously, when removing load node, can find first cryptographic Hash corresponding to load node that removes, and then cryptographic Hash is updated to the load node that other are not removed, can finish removing operation.So that in dilatation with when removing load node, all need not change the corresponding relation of original data access request and original load node, thereby have less Data Migration cost, improved stability.
Simultaneously, the method and system of above-mentioned realization load balancing, dilatation or when removing load node, the corresponding identical load node of cryptographic Hash of specifying number can be set, so that the number of cryptographic Hash can be according to certain ratio for each load node distribution in the corresponding table of cryptographic Hash and load node.Thereby make a plurality of load nodes and the dilatation node can be according to actual needs, the data access request of corresponding corresponding proportion, thereby improved load balancing can be handling.
[description of drawings]
Fig. 1 is the flow chart of realizing the method for load balancing among the embodiment;
Fig. 2 is the structural representation of realizing the system of load balancing among the embodiment;
Fig. 3 is the structural representation of realizing the system of load balancing among another embodiment;
Fig. 4 is the flow chart of the method for gray scale issue among the embodiment;
Fig. 5 is the structural representation of the device of gray scale issue among the embodiment.
[embodiment]
As shown in Figure 1, in one embodiment, a kind of method that realizes load balancing may further comprise the steps:
Step S102 obtains data access request, extracts the request mark in the data access request, the cryptographic Hash of computation requests sign.
Request mark in the data access request can be one section character string, for example URL of request access (Uniform Resource Locator, URL(uniform resource locator)) etc.Request mark can comprise request address part and argument section.Can distinguish different data access request by different request marks.
The method of the cryptographic Hash of computation requests sign is for using the cryptographic Hash of hash function computation requests sign.Hash function act as the less binary value that the binary value (request mark) of random length is mapped as regular length.This hash function be input as arbitrary string or numeral, be output as the cryptographic Hash that is distributed in certain interval.Cryptographic Hash can be that character string also can be numeral.For the request mark that comprises request address and parameter, can only calculate cryptographic Hash according to request address.Have identical request address when a plurality of request marks but during corresponding many kinds of parameters, can obtain identical cryptographic Hash.So just can distinguish easily similar request (being the identical request of request address).
For example, set hash function, this hash function converts the character string in the request mark to the ASCII character value first, then summation, and again to 100 remainders, function is exported this remainder, and this remainder is the cryptographic Hash of this request mark.If request mark is ' ABC ', then ASCII character is respectively 65,66,67, and the cryptographic Hash of then trying to achieve request mark ' ABC ' by this hash function is 98.
Step S104, in the corresponding table with load node of default cryptographic Hash, search the load node with Hash values match, in the default corresponding table with load node of cryptographic Hash, allocate the load node corresponding to cryptographic Hash of default number in advance, default number is at least 2.
In one embodiment, can be pre-created the corresponding table with load node of cryptographic Hash.Concrete, can the specific hash function of chosen in advance, then determine the span of this hash function output cryptographic Hash, this hash function is identical with the hash function that is used for the cryptographic Hash that computation requests identifies.Then corresponding certain load node of cryptographic Hash of default number will do not repeated to extract at random in this span, and with the cryptographic Hash and the form storage of its corresponding load node with key-value pair that extract, storage mode can be that the database storage also can be to use configuration file stores.Then travel through all load nodes, at last the cryptographic Hash of the corresponding default number of all load nodes is also stored.When creating the corresponding table with load node of cryptographic Hash, can use the expression load nodes such as IP, load node sign.
Further, in the corresponding table of cryptographic Hash and load node, can distribute according to the performance parameter of load node the corresponding identical load node of cryptographic Hash of default number.The performance parameter of load node comprises one or more in the CPU number, cpu frequency, bandwidth, memory size of load node.Set the number of the cryptographic Hash corresponding with load node according to the performance parameter of load node, namely process the number that the ability of asking is come reasonable distribution load node deal with data access request according to load node, like this so that when the deal with data access request, it is more balanced that Processing tasks distributes.
In one embodiment, the corresponding table with load node of the cryptographic Hash that is pre-created is as shown in table 1:
Table 1
Key Value
0 Y:192.168.1.2
1 X:192.168.1.1
2 Z:192.168.1.3
...... ......
6659 X:192.168.1.1
6660 Y:192.168.1.2
...... ......
9996 Z:192.168.1.3
9997 X:192.168.1.1
9998 Y:192.168.1.2
9999 Z:192.168.1.3
Wherein, cryptographic Hash is shown in the key tabulation, and the IP for the expression load node is shown in the value tabulation.Wherein, the span of selected hash function output cryptographic Hash is 0 to 9999 (10000 cryptographic Hash).In the present embodiment, it is corresponding with load node X to have allocated 2000 cryptographic Hash in advance, and 4000 cryptographic Hash and load node Y distribute.The default number of cryptographic Hash that each load node is corresponding can arrange according to a certain percentage, but this cryptographic Hash is fixed with the length of the corresponding table of load node, namely 10000 record numbers are fixed, and namely the default number sum of the cryptographic Hash of corresponding each load node is the constant that sets in advance.
In the corresponding table of default cryptographic Hash and load node, search the cryptographic Hash of utilizing the request mark that hash function calculates, then in the table record item that finds, find the load node IP of correspondence, namely found the load node corresponding with data access request.
Step S106 distributes to data access request with load node.
When load node is distributed to data access request, data access request load node can be forwarded to, also data access request load node can be redirected to.After load node receives data access request, process according to the particular content of data access request.
In another embodiment, also set up in advance the corresponding relation have between load node and the default backup node.Load node is distributed to after the data access request, can also be obtained the backup node corresponding with load node according to the corresponding relation between load node and the default backup node, and backup node be distributed to load node back up.
Load node can directly be added in the corresponding table with load node of default cryptographic Hash with the corresponding relation of the backup node of presetting.Backup node can be server, network hard disc or other memory device for backup.Can directly add row in the corresponding table with load node of cryptographic Hash, then the sign of the default backup node that load node is corresponding is added in the corresponding table record.
Table 2 shows the corresponding table with load node of cryptographic Hash that has added the backup node row among the embodiment.
Table 2
Key Value backup
0 Y:192.168.1.2 M
1 X:192.168.1.1 P
2 Z:192.168.1.3 N
...... ...... ......
6659 X:192.168.1.1 P
6660 Y:192.168.1.2 M
...... ...... ......
9996 Z:192.168.1.3 N
9997 X:192.168.1.1 P
9998 Y:192.168.1.2 M
9999 Z:192.168.1.3 N
Wherein, backup node is shown in the backup tabulation.Load node X can corresponding backup node M and N.When load node is assigned to after data access request processes, load node can be with the intermediate data processed and the data backup in final data and the buffer memory in corresponding backup node M and N.When the load node of being responsible for the request of processing breaks down, can by changing load node, then the data among backup node M and the N be reverted in the load node of having changed and prevent Missing data.
In another embodiment, also can obtain first the dilatation node of extra interpolation when dilatation, choose a plurality of cryptographic Hash in the corresponding table with load node of default cryptographic Hash, the load node that the cryptographic Hash of choosing is corresponding is updated to the dilatation node.The dilatation node is the load node of extra interpolation.And when removing load node, obtain first the load node that removes, and search the load node corresponding cryptographic Hash in the corresponding table with load node of cryptographic Hash that removes, the load node that cryptographic Hash is corresponding is updated to the load node that is not removed.
Concrete, when dilatation, obtain after the dilatation node of interpolation, when upgrading the default corresponding table with load node of cryptographic Hash, can choose at random first the cryptographic Hash of default number in the corresponding table with load node of default cryptographic Hash, then the load node that the cryptographic Hash of choosing is corresponding is updated to the dilatation node.If after load node is updated to the dilatation node, the number of load node corresponding cryptographic Hash in table that the cryptographic Hash of choosing is corresponding is less than threshold value, then abandons the cryptographic Hash that this is chosen when choosing at random, then again chooses at random.
And after removing load node, can obtain the sign of the load node that is removed, in the corresponding table with load node of cryptographic Hash, search the cryptographic Hash corresponding with the sign of this load node, and obtain the number of the load node that is not removed, and this cryptographic Hash is divided at random the same number of many groups of grouping number and the load node that is not removed, the number of the cryptographic Hash in each grouping can distribute according to a certain percentage, then the cryptographic Hash in each grouping is updated to corresponding unduplicated load node that is not removed.
In another embodiment, the corresponding table with load node of cryptographic Hash can be stored on the client.Can issue in advance the corresponding table with load node of cryptographic Hash to client.Client is behind the corresponding table with load node of cryptographic Hash, calculate the cryptographic Hash of the request mark of the data access request that sends, then search the load node corresponding with this cryptographic Hash at the corresponding table with load node of the cryptographic Hash that receives, then send data access request to this load node.Can be with its buffer memory after the cryptographic Hash that client arrives and the load node.If added the dilatation node, the corresponding table with load node of cryptographic Hash after then will upgrading is handed down to client and carries out buffer memory.
The corresponding table with load node of cryptographic Hash is handed down to client carries out buffer memory, the task of searching corresponding load node and distribution load node at the corresponding table with load node of cryptographic Hash can be handed down to the client and bring in execution, thereby alleviate the resource cost when distributing load node.
As shown in Figure 2, in one embodiment, a kind of system 100 that realizes load balancing comprises that Hash calculation module 102, node search module 104 and node distribution module 106, wherein:
Hash calculation module 102 is used for obtaining data access request, extracts the request mark in the data access request, the cryptographic Hash of computation requests sign.
Request mark in the data access request can one section character string, and for example request access is URL (Uniform Resource Locator, URL(uniform resource locator)).Request mark can comprise request address part and argument section.Can distinguish different data access request by different request marks.
The method of the cryptographic Hash of Hash calculation module 102 computation requests sign is for using the cryptographic Hash of hash function computation requests sign.Hash function act as the less binary value that the binary value (request mark) of random length is mapped as regular length.。This hash function be input as arbitrary string or numeral, be output as the cryptographic Hash that is distributed in certain interval.Cryptographic Hash can be that character string also can be numeral.For the request mark that comprises request address and parameter, can only calculate cryptographic Hash according to request address.Have identical request address when a plurality of request marks but during corresponding many kinds of parameters, can obtain identical cryptographic Hash.So just can distinguish easily similar request (being the identical request of request address).
For example, set hash function, this hash function converts the character string in the request mark to the ASCII character value first, then summation, and again to 100 remainders, function is exported this remainder, and this remainder is the cryptographic Hash of this request mark.If request mark is ' ABC ', then ASCII character is respectively 65,66,67, and the cryptographic Hash of then trying to achieve request mark ' ABC ' by this hash function is 98.
Node is searched module 104 and is used at the corresponding load node of showing to search with Hash values match with load node of default cryptographic Hash, in the default corresponding table with load node of cryptographic Hash, allocate the load node corresponding to cryptographic Hash of default number in advance, default number is at least 2.
In one embodiment, as shown in Figure 3, realize that the system 100 of load balancing also can comprise corresponding table creation module 108, be used for being pre-created the corresponding table with load node of cryptographic Hash.Concrete, corresponding table creation module 108 can the specific hash function of chosen in advance, then determines the span of this hash function output cryptographic Hash, and this hash function is identical with the hash function that is used for the cryptographic Hash that computation requests identifies.In this span, do not repeat at random to extract corresponding certain load node of cryptographic Hash of default number, and the cryptographic Hash that extraction is obtained and its corresponding load node be with the form storage of key-value pair, and storage mode can be that the database storage also can be to use configuration file stores.Then travel through all load nodes, at last the cryptographic Hash of the corresponding default number of all load nodes is also stored.When creating the corresponding table with load node of cryptographic Hash, can use the expression load nodes such as IP, load node sign.
Further, corresponding table creation module 108 can be used for distributing load node corresponding to cryptographic Hash of presetting number according to the performance parameter of load node.The performance parameter of load node comprises one or more in the CPU number, cpu frequency, bandwidth, memory size of load node.Set the number of the cryptographic Hash corresponding with load node according to the performance parameter of load node, namely process the number that the ability of asking is come reasonable distribution load node deal with data access request according to load node, like this so that when the deal with data access request, Processing tasks distributes more balanced.
In one embodiment, the corresponding table with load node of the cryptographic Hash that is pre-created is as shown in table 1.Wherein, the default number of cryptographic Hash that each load node is corresponding can arrange according to a certain percentage, but this cryptographic Hash is fixed with the length of the corresponding table of load node, namely 10000 record numbers are fixed, and namely the default number sum of the cryptographic Hash of corresponding each load node is the constant that sets in advance.
Node is searched module 104 and search the cryptographic Hash of utilizing the request mark that hash function calculates in the corresponding table of default cryptographic Hash and load node, then in the table record item that finds, find corresponding load node IP, namely found the load node corresponding with data access request.
Node distribution module 106 is used for load node is distributed to data access request.
When node distribution module 106 is distributed to data access request with load node, data access request load node can be forwarded to, also data access request load node can be redirected to.After load node receives data access request, process according to the particular content of data access request.
In another embodiment, as shown in Figure 3, realize that the system 100 of load balancing also comprises backup module 110, can be used for setting up in advance the corresponding relation between load node and the default backup node.Load node is distributed to after the data access request, and backup module 110 also can be used for obtaining the backup node corresponding with load node according to the corresponding relation between load node and the default backup node, and backup node is distributed to load node back up.
Load node can directly be added in the corresponding table with load node of default cryptographic Hash with the corresponding relation of the backup node of presetting.Backup node can be server, network hard disc or other memory device for backup.Can directly add row in the corresponding table with load node of cryptographic Hash, then the sign of the default backup node that load node is corresponding is added in the corresponding table record.
In the present embodiment, the corresponding table with load node of cryptographic Hash that has added the backup node row is as shown in table 2, when load node is assigned to after data access request processes, load node can be with the intermediate data processed and the data backup in final data and the buffer memory in corresponding backup node M and N.When the load node of being responsible for the request of processing breaks down, can by changing load node, then the data among backup node M and the N be reverted in the load node of having changed and prevent Missing data.
In another embodiment, as shown in Figure 3, the system 100 that realizes load balancing also comprises corresponding table update module 112, can be used for obtaining the dilatation node of extra interpolation, then choose a plurality of cryptographic Hash in the corresponding table with load node of default cryptographic Hash, and the load node that the cryptographic Hash of choosing is corresponding is updated to the dilatation node.
Obtained after the dilatation node that adds, when corresponding table update module 112 is upgraded the default corresponding table with load node of cryptographic Hash, can in the corresponding table with load node of default cryptographic Hash, choose at random first the cryptographic Hash of default number, if then the load node that the cryptographic Hash of choosing is corresponding is updated to the dilatation node after load node is updated to the dilatation node, the number of load node corresponding cryptographic Hash in table that the cryptographic Hash that corresponding table update module 112 is chosen is corresponding is less than threshold value, then when choosing at random, abandon the cryptographic Hash that this is chosen, then again choose at random.
And after removing load node, corresponding table update module 112 can be obtained the sign of the load node that is removed, in the corresponding table with load node of cryptographic Hash, search the cryptographic Hash corresponding with the sign of this load node, and obtain the number of the load node that is not removed, and this cryptographic Hash is divided at random the same number of many groups of grouping number and the load node that is not removed, the number of the cryptographic Hash in each grouping can distribute according to a certain percentage, then the cryptographic Hash in each grouping is updated to corresponding unduplicated load node that is not removed.
In another embodiment, the corresponding table with load node of cryptographic Hash can be stored on the client.As shown in Figure 3, the system 100 of realization load balancing comprises that also corresponding table issues module 114, can be used for issuing in advance the corresponding table with load node of cryptographic Hash to client.Client is behind the corresponding table with load node of cryptographic Hash, calculate the cryptographic Hash of the request mark of the data access request that sends, then search the load node corresponding with this cryptographic Hash at the corresponding table with load node of the cryptographic Hash that receives, then send data access request to this load node.Can be with its buffer memory after the cryptographic Hash that client arrives and the load node.If added the dilatation node, the corresponding table with load node of cryptographic Hash after then will upgrading is handed down to client.
The corresponding table with load node of cryptographic Hash is handed down to client, the task of searching corresponding load node and distribution load node at the corresponding table with load node of cryptographic Hash can be handed down to the client and bring in execution, thereby alleviate the resource cost when distributing load node.
In one embodiment, as shown in Figure 4, a kind of method of gray scale issue may further comprise the steps:
Step S202 obtains gray scale issue request.
Step S204 according to the number of the cryptographic Hash that load node is corresponding in the default corresponding table with load node of cryptographic Hash of gray scale issue request adjustment, in the corresponding table, allocates the identical load node of cryptographic Hash correspondence of default number in advance, and default number is at least 2.
Step S206 carries out the gray scale issue according to the cryptographic Hash number in the load node after adjusting.
Gray scale issue is namely issued in a part of client of expectation, and these client correspondences certain or certain server (load node).In order to reach this purpose, the client publish quantities that has comprised expection in the gray scale issue request, can adjust according to this quantity the number of the cryptographic Hash that load node is corresponding in the corresponding table with load node of aforesaid cryptographic Hash, then carry out the gray scale issue according to the cryptographic Hash number in the load node after adjusting.
For example, if comprise 2 load nodes in the system of this realization load balancing, the expection of the data access request on these two load nodes is respectively 3000 and 7000.In the constant situation of the number (1000) of total cryptographic Hash, if want to finish 10% gray scale issue, can change the data access request (corresponding cryptographic Hash number) of two load nodes into 1000 and 9000, load node in load 1000 clients carries out the gray scale issue again, can realize 10% gray scale issue.
In one embodiment, as shown in Figure 5, a kind of device of gray scale issue comprises:
Gray scale issue acquisition request module 202 is used for obtaining gray scale issue request.
Gray scale adjusting module 204, be used for adjusting according to gray scale issue request the number of cryptographic Hash corresponding to the corresponding table with load node of default cryptographic Hash load node, in the corresponding table, allocate the load node corresponding to cryptographic Hash of default number in advance, default number is at least 2.
Gray scale release module 206 is used for carrying out the gray scale issue according to the cryptographic Hash number of the load node after adjusting.
In the method and apparatus of above-mentioned gray scale issue, because the number of cryptographic Hash is corresponding with the ratio of data access request, therefore the number that only need adjust the cryptographic Hash that load node is corresponding in the corresponding table with load node of aforesaid cryptographic Hash can realize gray scale issue adjusting, can be handling thereby improved.
The method and system of above-mentioned realization load balancing, when dilatation, because the default number of the cryptographic Hash of corresponding identical load node is at least 2, therefore can the partial data access request can be corresponded on the dilatation node by new portion corresponding relation more and realize dilatation; Simultaneously, when removing load node, can find first cryptographic Hash corresponding to load node that removes, and then cryptographic Hash is updated to the load node that other are not removed, can finish removing operation.So that dilatation and remove load node and all need not change the corresponding relation of original data access request and original load node, thereby have less Data Migration cost, improved stability.
Simultaneously, the method and system of above-mentioned realization load balancing, dilatation or when removing load node, the corresponding identical load node of cryptographic Hash of specifying number can be set, so that the number of cryptographic Hash can be according to certain ratio for each load node distribution in the corresponding table of cryptographic Hash and load node.Thereby make a plurality of load nodes and the dilatation node can be according to actual needs, the data access request of corresponding corresponding proportion, thereby improved load balancing can be handling.
The above embodiment has only expressed several execution mode of the present invention, and it describes comparatively concrete and detailed, but can not therefore be interpreted as the restriction to claim of the present invention.Should be pointed out that for the person of ordinary skill of the art without departing from the inventive concept of the premise, can also make some distortion and improvement, these all belong to protection scope of the present invention.Therefore, the protection range of patent of the present invention should be as the criterion with claims.

Claims (14)

1. method that realizes load balancing may further comprise the steps:
Obtain data access request, extract the request mark in the described data access request, calculate the cryptographic Hash of described request sign;
In the corresponding table with load node of default cryptographic Hash, search the load node with described Hash values match, in the corresponding table with load node of described default cryptographic Hash, allocate the load node corresponding to cryptographic Hash of default number in advance, described default number is at least 2;
Described load node is distributed to described data access request.
2. the method for realization load balancing according to claim 1 is characterized in that, the described data access request of obtaining also comprises before:
In the corresponding table of described cryptographic Hash and load node, distribute the corresponding identical load node of cryptographic Hash of default number according to the performance parameter of load node;
The performance parameter of described load node comprise load node computational resource size, Internet resources are big or small and at least a in big or small of storage resources.
3. the method for realization load balancing according to claim 1 and 2 is characterized in that, the described data access request of obtaining also comprises before:
Set up the corresponding relation between load node and the default backup node;
Described described load node is distributed to also comprises after the described data access request:
Obtain the backup node corresponding with described load node according to the corresponding relation between described load node and the default backup node, and described backup node is distributed to described load node back up.
4. the method for realization load balancing according to claim 1 and 2 is characterized in that, described method also comprises:
When dilatation, obtain the dilatation node of interpolation;
Choose a plurality of described cryptographic Hash in the corresponding table with load node of described default cryptographic Hash, the load node that described cryptographic Hash is corresponding is updated to described dilatation node.
5. the method for realization load balancing according to claim 1 and 2 is characterized in that, described method also comprises:
When removing load node, obtain the load node that removes;
Search the described load node that removes corresponding cryptographic Hash in the corresponding table with load node of described cryptographic Hash, the load node that described cryptographic Hash is corresponding is updated to the load node that is not removed.
6. the method for realization load balancing according to claim 1 and 2 is characterized in that, the described data access request of obtaining also comprises before:
Issue the corresponding table with load node of described cryptographic Hash and carry out buffer memory to client.
7. a system that realizes load balancing is characterized in that, comprises with lower module:
The Hash calculation module is used for obtaining data access request, extracts the request mark in the described data access request, calculates the cryptographic Hash of described request sign;
Node is searched module, be used at the corresponding load node of showing to search with described Hash values match with load node of default cryptographic Hash, in the corresponding table with load node of described default cryptographic Hash, allocate the load node corresponding to cryptographic Hash of default number in advance, described default number is at least 2;
The node distribution module is used for described load node is distributed to described data access request.
8. the system of realization load balancing according to claim 7, it is characterized in that, also comprise corresponding table creation module, be used for distributing the corresponding identical load node of cryptographic Hash of default number according to the performance parameter of load node at the corresponding table of described cryptographic Hash and load node;
The performance parameter of described load node comprise load node computational resource size, Internet resources are big or small and at least a in big or small of storage resources.
9. according to claim 7 or the system of 8 described realization load balancing, it is characterized in that, also comprise backup module, be used for setting up the corresponding relation between load node and the default backup node, and obtain the backup node corresponding with described load node according to the corresponding relation between described load node and the default backup node, and described backup node is distributed to described load node back up.
10. according to claim 7 or the system of 8 described realization load balancing, it is characterized in that, also comprise corresponding table update module, be used for when dilatation, obtain the dilatation node of interpolation, choose a plurality of described cryptographic Hash in the corresponding table with load node of described default cryptographic Hash, the load node that described cryptographic Hash is corresponding is updated to described dilatation node.
11. according to claim 7 or the system of 8 described realization load balancing, it is characterized in that, also comprise corresponding table update module, be used for when removing load node, obtain the load node that removes, search the described load node that removes corresponding cryptographic Hash in the corresponding table with load node of described cryptographic Hash, the load node that described cryptographic Hash is corresponding is updated to the load node that is not removed.
12. according to claim 7 or the method for 8 described realization load balancing, it is characterized in that, comprise that also corresponding table issues module, is used for issuing show corresponding with load node of described cryptographic Hash and carries out buffer memory to client.
13. the method for a gray scale issue may further comprise the steps:
Obtain gray scale issue request;
According to described gray scale issue request, adjust the number of the cryptographic Hash that load node is corresponding in the corresponding table with load node of default cryptographic Hash, in the described corresponding table, allocate the load node corresponding to cryptographic Hash of default number in advance, described default number is at least 2;
Carry out the gray scale issue according to the cryptographic Hash number in the load node after adjusting.
14. the device of a gray scale issue is characterized in that, comprising:
Gray scale issue acquisition request module is used for obtaining gray scale issue request;
The gray scale adjusting module, be used for adjusting according to described gray scale issue request the number of cryptographic Hash corresponding to the corresponding table with load node of default cryptographic Hash load node, in the described corresponding table, allocate the load node corresponding to cryptographic Hash of default number in advance, described default number is at least 2;
The gray scale release module is used for carrying out the gray scale issue according to the cryptographic Hash number of the load node after adjusting.
CN201210112753.2A 2012-04-17 2012-04-17 Realize method that the method and system of load balancing and gray scale issue and device Active CN103379138B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210112753.2A CN103379138B (en) 2012-04-17 2012-04-17 Realize method that the method and system of load balancing and gray scale issue and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210112753.2A CN103379138B (en) 2012-04-17 2012-04-17 Realize method that the method and system of load balancing and gray scale issue and device

Publications (2)

Publication Number Publication Date
CN103379138A true CN103379138A (en) 2013-10-30
CN103379138B CN103379138B (en) 2016-04-13

Family

ID=49463695

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210112753.2A Active CN103379138B (en) 2012-04-17 2012-04-17 Realize method that the method and system of load balancing and gray scale issue and device

Country Status (1)

Country Link
CN (1) CN103379138B (en)

Cited By (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104202434A (en) * 2014-09-28 2014-12-10 北京奇虎科技有限公司 Node access method and device
CN104331413A (en) * 2014-09-28 2015-02-04 上海斐讯数据通信技术有限公司 Switch configuration file storage method and switch configuration file storage system
CN104852986A (en) * 2015-05-28 2015-08-19 北京奇艺世纪科技有限公司 Method and device for providing newly-added function
CN104852934A (en) * 2014-02-13 2015-08-19 阿里巴巴集团控股有限公司 Method for realizing flow distribution based on front-end scheduling, device and system thereof
CN105099988A (en) * 2014-04-24 2015-11-25 阿里巴巴集团控股有限公司 Method used for supporting gray releasing, access method, devices and system
CN105577806A (en) * 2015-12-30 2016-05-11 Tcl集团股份有限公司 Distributed cache method and system
CN105630590A (en) * 2014-11-28 2016-06-01 阿里巴巴集团控股有限公司 Business information processing method and device
CN105744001A (en) * 2016-04-11 2016-07-06 青岛海信传媒网络技术有限公司 Distributed Caching System Expanding Method, Data Access Method, and Device and System of the Same
CN105791344A (en) * 2014-12-22 2016-07-20 华为软件技术有限公司 Grayscale release service processing method, system, load balancer and service bus device
CN105978976A (en) * 2016-05-13 2016-09-28 中国建设银行股份有限公司 Information processing system and method
CN106027581A (en) * 2015-03-20 2016-10-12 中国移动通信集团河北有限公司 Method and system for achieving gray scale publishing based on load balancing
CN106487863A (en) * 2015-09-02 2017-03-08 阿里巴巴集团控股有限公司 A kind of based on the gray scale dissemination method of distributed system, client and platform
CN106649045A (en) * 2016-12-30 2017-05-10 重庆腾帆科技有限公司 Third-party interface exception monitoring device
CN106656842A (en) * 2015-10-29 2017-05-10 华为数字技术(苏州)有限公司 Load balancing method and flow forwarding device
CN106998370A (en) * 2017-06-15 2017-08-01 北京微影时代科技有限公司 Access control method, device and system
CN107580066A (en) * 2017-09-20 2018-01-12 郑州云海信息技术有限公司 The method, apparatus and system of file access in a kind of distributed NAS storage system
CN108696557A (en) * 2017-04-11 2018-10-23 北京京东尚科信息技术有限公司 Information processing system, method and apparatus
CN109388627A (en) * 2017-08-08 2019-02-26 阿里巴巴集团控股有限公司 A kind of control method of database access, device and electronic equipment
CN109388655A (en) * 2017-08-07 2019-02-26 北京京东尚科信息技术有限公司 A kind of method and apparatus of dynamic control of data access
CN109510852A (en) * 2017-09-15 2019-03-22 阿里巴巴集团控股有限公司 The method and device of gray scale publication
CN110531931A (en) * 2019-08-22 2019-12-03 济南浪潮数据技术有限公司 A kind of choosing method, device and computer readable storage medium storing equipment
CN110647335A (en) * 2019-07-26 2020-01-03 平安科技(深圳)有限公司 Software gray level release method and device, electronic equipment and storage medium
CN113610637A (en) * 2021-08-12 2021-11-05 上海通联金融服务有限公司 Intelligent route publishing method supported by gray algorithm
CN114780512A (en) * 2022-03-22 2022-07-22 荣耀终端有限公司 Gray scale publishing method, system and server

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105335204A (en) * 2014-07-29 2016-02-17 株式会社日立制作所 Grey level distribution control method and grey level distribution control device of software program

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102035861A (en) * 2009-09-24 2011-04-27 中兴通讯股份有限公司 Load balancing method and system of single-jump distributing type hash table superposition network

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102035861A (en) * 2009-09-24 2011-04-27 中兴通讯股份有限公司 Load balancing method and system of single-jump distributing type hash table superposition network

Cited By (34)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104852934A (en) * 2014-02-13 2015-08-19 阿里巴巴集团控股有限公司 Method for realizing flow distribution based on front-end scheduling, device and system thereof
CN105099988B (en) * 2014-04-24 2018-11-27 阿里巴巴集团控股有限公司 Method, access method and device and system for supporting gray scale to issue
CN105099988A (en) * 2014-04-24 2015-11-25 阿里巴巴集团控股有限公司 Method used for supporting gray releasing, access method, devices and system
CN104331413A (en) * 2014-09-28 2015-02-04 上海斐讯数据通信技术有限公司 Switch configuration file storage method and switch configuration file storage system
CN104202434A (en) * 2014-09-28 2014-12-10 北京奇虎科技有限公司 Node access method and device
CN105630590A (en) * 2014-11-28 2016-06-01 阿里巴巴集团控股有限公司 Business information processing method and device
CN105791344A (en) * 2014-12-22 2016-07-20 华为软件技术有限公司 Grayscale release service processing method, system, load balancer and service bus device
CN105791344B (en) * 2014-12-22 2019-03-19 华为软件技术有限公司 Method, system, load balancer and the service bus device of gray scale issuing service processing
CN106027581B (en) * 2015-03-20 2019-12-10 中国移动通信集团河北有限公司 Method and system for realizing gray scale release based on load balance
CN106027581A (en) * 2015-03-20 2016-10-12 中国移动通信集团河北有限公司 Method and system for achieving gray scale publishing based on load balancing
CN104852986A (en) * 2015-05-28 2015-08-19 北京奇艺世纪科技有限公司 Method and device for providing newly-added function
CN106487863B (en) * 2015-09-02 2019-05-07 阿里巴巴集团控股有限公司 A kind of gray scale dissemination method, client and platform based on distributed system
CN106487863A (en) * 2015-09-02 2017-03-08 阿里巴巴集团控股有限公司 A kind of based on the gray scale dissemination method of distributed system, client and platform
CN106656842A (en) * 2015-10-29 2017-05-10 华为数字技术(苏州)有限公司 Load balancing method and flow forwarding device
CN105577806B (en) * 2015-12-30 2019-11-12 Tcl集团股份有限公司 A kind of distributed caching method and system
CN105577806A (en) * 2015-12-30 2016-05-11 Tcl集团股份有限公司 Distributed cache method and system
CN105744001B (en) * 2016-04-11 2019-03-12 聚好看科技股份有限公司 Distributed cache system expansion method, data access method and device and system
CN105744001A (en) * 2016-04-11 2016-07-06 青岛海信传媒网络技术有限公司 Distributed Caching System Expanding Method, Data Access Method, and Device and System of the Same
CN105978976A (en) * 2016-05-13 2016-09-28 中国建设银行股份有限公司 Information processing system and method
CN106649045A (en) * 2016-12-30 2017-05-10 重庆腾帆科技有限公司 Third-party interface exception monitoring device
CN108696557A (en) * 2017-04-11 2018-10-23 北京京东尚科信息技术有限公司 Information processing system, method and apparatus
CN108696557B (en) * 2017-04-11 2021-08-10 北京京东尚科信息技术有限公司 Information processing system, method and device
CN106998370A (en) * 2017-06-15 2017-08-01 北京微影时代科技有限公司 Access control method, device and system
CN109388655A (en) * 2017-08-07 2019-02-26 北京京东尚科信息技术有限公司 A kind of method and apparatus of dynamic control of data access
CN109388627A (en) * 2017-08-08 2019-02-26 阿里巴巴集团控股有限公司 A kind of control method of database access, device and electronic equipment
CN109510852A (en) * 2017-09-15 2019-03-22 阿里巴巴集团控股有限公司 The method and device of gray scale publication
CN109510852B (en) * 2017-09-15 2021-07-06 阿里巴巴集团控股有限公司 Method and device for gray scale publishing
CN107580066A (en) * 2017-09-20 2018-01-12 郑州云海信息技术有限公司 The method, apparatus and system of file access in a kind of distributed NAS storage system
CN110647335A (en) * 2019-07-26 2020-01-03 平安科技(深圳)有限公司 Software gray level release method and device, electronic equipment and storage medium
CN110531931A (en) * 2019-08-22 2019-12-03 济南浪潮数据技术有限公司 A kind of choosing method, device and computer readable storage medium storing equipment
CN110531931B (en) * 2019-08-22 2022-03-22 济南浪潮数据技术有限公司 Storage device selection method and device and computer readable storage medium
CN113610637A (en) * 2021-08-12 2021-11-05 上海通联金融服务有限公司 Intelligent route publishing method supported by gray algorithm
CN113610637B (en) * 2021-08-12 2023-07-04 上海通联金融服务有限公司 Intelligent route publishing method under support of gray level algorithm
CN114780512A (en) * 2022-03-22 2022-07-22 荣耀终端有限公司 Gray scale publishing method, system and server

Also Published As

Publication number Publication date
CN103379138B (en) 2016-04-13

Similar Documents

Publication Publication Date Title
CN103379138A (en) Method and system for realizing load balance, and method and apparatus for gray scale publication
US11436224B2 (en) Parallel processing database system with a shared metadata store
CN102882973B (en) Distributed load balancing system and distributed load balancing method based on peer to peer (P2P) technology
JP5719323B2 (en) Distributed processing system, dispatcher and distributed processing management device
CN103873504A (en) System enabling data blocks to be stored in distributed server and method thereof
US20170366624A1 (en) Clustering layers in multi-node clusters
CN101692239A (en) Method for distributing metadata of distributed type file system
CN105468720A (en) Method for integrating distributed data processing systems, corresponding systems and data processing method
CN110941602B (en) Database configuration method and device, electronic equipment and storage medium
CN108345643A (en) A kind of data processing method and device
US20220261379A1 (en) Web-scale distributed deduplication
CN104268298A (en) Method for creating database index and inquiring data
CN111522811B (en) Database processing method and device, storage medium and terminal
CN106790489B (en) Parallel data loading method and system
CN111400301B (en) Data query method, device and equipment
CN110019205B (en) Data storage and restoration method and device and computer equipment
CN102394898A (en) File downloading method and system based on P2P (point to point)
CN109451069B (en) Network data file library storage and query method based on distributed storage
CN105138638A (en) Database distribution method based on application layer
CN103248636A (en) Offline download system and method
US11645266B2 (en) Automated pinning of file system subtrees
CN113377817A (en) Data processing method, system, device and storage medium
CN105120008B (en) A kind of distributed cloud computing center balancing method of loads based on layering
CN108763381B (en) Table dividing method and device based on consistent Hash algorithm
CN109144991B (en) Method and device for dynamic sub-metering, electronic equipment and computer-storable medium

Legal Events

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