WO2014047902A1 - Load balancing method, device, system and computer readable medium - Google Patents

Load balancing method, device, system and computer readable medium Download PDF

Info

Publication number
WO2014047902A1
WO2014047902A1 PCT/CN2012/082382 CN2012082382W WO2014047902A1 WO 2014047902 A1 WO2014047902 A1 WO 2014047902A1 CN 2012082382 W CN2012082382 W CN 2012082382W WO 2014047902 A1 WO2014047902 A1 WO 2014047902A1
Authority
WO
WIPO (PCT)
Prior art keywords
processing
node
load
distributed
processing node
Prior art date
Application number
PCT/CN2012/082382
Other languages
French (fr)
Chinese (zh)
Inventor
宁德刚
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2012/082382 priority Critical patent/WO2014047902A1/en
Priority to CN201280001746.3A priority patent/CN103918239A/en
Publication of WO2014047902A1 publication Critical patent/WO2014047902A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers

Definitions

  • the present invention relates to communication technologies, and in particular, to a load balancing method, apparatus, system, and computer readable medium. Background technique
  • the distributed processing system clusters a large number of inexpensive servers, each of which is a processing node, which provides an overall high-performance cluster processing capability by processing node parallel processing.
  • a processing task is usually decomposed into multiple processing requests and distributed to multiple processing nodes for parallel processing, so that high parallel processing capability can be obtained, which requires balancing multiple processing requests. Assigned to each processing node.
  • Embodiments of the present invention provide a load balancing method, apparatus, system, and computer readable medium, so that processing nodes in a distributed processing system are more balanced in load distribution.
  • a load balancing processing method including:
  • the first load is greater than the average load, migrating at least one virtual node distributed on the first processing node to at least one processing node in the distributed processing system with a load less than the average load.
  • the at least one virtual node that is distributed on the first processing node is migrated to the distributed processing system, and the load is less than At least one processing node of the average load, including:
  • the overload amount is a load amount of the first load exceeding the average load, and the total amount of underload is a sum of load of each of the at least one processing node being lower than a load of the average load .
  • the at least one virtual node that is distributed on the first processing node is migrated to the Before the load in the distributed processing system is less than the average load on at least one processing node, the method further includes:
  • load information of each processing node in the distributed processing system where the load information includes load information of each virtual node distributed on each processing node;
  • the at least one virtual node distributed on the first processing node is migrated to the at least one processing node in the distributed processing system where the load is less than the average load, specifically:
  • the migration request response message is a success response message, migrating at least one virtual node distributed on the first processing node to the at least one processing node.
  • the method further includes:
  • a load balancing processing apparatus including:
  • An obtaining module configured to acquire a first load of a first processing node in the distributed processing system and an average load of all processing nodes in the distributed processing system;
  • a processing module if the first load is greater than the average load, migrating at least one virtual node distributed on the first processing node to at least one processing in the distributed processing system that has a load less than the average load On the node.
  • the processing module is specifically configured to migrate at least one virtual node that is distributed on the first processing node to a total amount of load less than or equal to an overload amount to the distributed
  • the at least one processing node in the processing system is greater than or equal to the total amount of the load
  • the overload amount is a load amount of the first load exceeding the average load
  • the total underload is the at least The load of each processing node in a processing node is lower than the sum of the load of the average load.
  • the determining module, the sending module, and the receiving module are further included;
  • the acquiring module is further configured to acquire load information of each processing node in the distributed processing system, where the load information includes load information of each virtual node distributed on each processing node;
  • the determining module is configured to determine, according to load information of each processing node, the at least one processing node;
  • the sending module is configured to send a migration request message to the at least one processing node, where the migration request message carries information of the at least one virtual node;
  • the receiving module is configured to receive a migration request response message that is sent by the at least one processing node according to the migration request message;
  • the processing module is specifically configured to: if the migration request response message is a success response message, And then migrating at least one virtual node distributed on the first processing node to the at least one processing node.
  • the method further includes:
  • an update module configured to update a mapping relationship table between the first processing node and the at least one virtual node
  • the sending module is further configured to send update information to other processing nodes in the distributed processing system, so that other processing nodes in the distributed processing system update the locally stored processing node and the virtual according to the update information.
  • the method further includes:
  • a synchronization module configured to synchronize data corresponding to the at least one virtual node to the at least one processing node.
  • the device is a processing node or a master control center.
  • a distributed processing system comprising: at least two processing nodes described in the above fifth possible implementation manner.
  • a distributed processing system including: at least two processing nodes and a master control center as described in the fifth possible implementation manner.
  • a processing node including a processor and a memory, the memory storing execution instructions, when the device is running, the processor is in communication with the memory, the processor executing the Executing the instructions causes the processing node to perform the method of the first aspect.
  • a master control center including a processor and a memory, the memory storing execution instructions, when the device is running, the processor is in communication with the memory, and the processor executes Executing the instructions causes the master control center to perform the method of the first aspect.
  • a distributed processing system comprising at least two processing nodes described in the fifth aspect.
  • a distributed processing system including at least two processing nodes And the main control center of the sixth aspect.
  • a computer readable medium comprising computer executed instructions for causing a processing node to perform the method of the first aspect.
  • a computer readable medium comprising computer executed instructions for causing a master control center to perform the method of the first aspect.
  • the load balancing processing method provided by the embodiment, the device, the system, and the computer readable medium, wherein at least one virtual node corresponding to the processing node with a load greater than the average load is migrated to the distributed processing system in the distributed system, and the load is less than the average load.
  • At least one processing node can make the processing nodes in the distributed processing system more balanced in load distribution, thereby enhancing the parallel processing capability of the distributed processing system and improving the efficiency of the distributed processing system.
  • Embodiment 1 is a flowchart of Embodiment 1 of a load balancing processing method provided by the present invention
  • Embodiment 2 is a flowchart of Embodiment 2 of a load balancing processing method provided by the present invention
  • Embodiment 3 is a flowchart of Embodiment 3 of a load balancing processing method provided by the present invention.
  • FIG. 4 is a schematic structural diagram of Embodiment 1 of a load balancing processing apparatus according to the present invention
  • FIG. 5 is a schematic structural diagram of Embodiment 2 of a load balancing processing apparatus according to the present invention
  • FIG. 6 is a third embodiment of a load balancing processing apparatus according to the present invention.
  • FIG. 7 is a schematic structural diagram of Embodiment 4 of a load balancing processing apparatus according to the present invention
  • FIG. 8 is a schematic structural diagram of Embodiment 1 of a processing node according to the present invention;
  • FIG. 9 is a schematic structural diagram of Embodiment 1 of a main control center according to the present invention.
  • FIG. 10 is a schematic structural diagram of Embodiment 1 of a distributed processing system according to the present invention
  • FIG. 11 is a schematic structural diagram of Embodiment 2 of a distributed processing system according to the present invention.
  • FIG. 1 is a flowchart of Embodiment 1 of a load balancing processing method according to the present invention. As shown in FIG. 1, the load balancing processing method in this embodiment includes:
  • Step 101 Acquire a first load of a first processing node in a distributed processing system and an average load of all processing nodes in the distributed processing system;
  • the manner of obtaining the first load of the first processing node in the distributed processing system may be: setting a load counter on the first processing node, and receiving, by the first processing node, a processing request,
  • the processing request amount recorded by the load counter is the load of the first processing node;
  • another case may be: setting a load counter on each virtual node corresponding to the first processing node, then each virtual node The sum of the loads is the load of the first processing node described above.
  • the average load of all processing nodes of the distributed processing system may be obtained by: Each processing node in the distributed processing system elects a main processing node by using a consistency algorithm such as pasox, and a software timer is set on the main processing node, and the main processing is performed.
  • the node timing sends its load information to other processing nodes in the distributed processing system.
  • the other processing nodes After receiving the load information of the main processing node, the other processing nodes send their own load information to the main processing node, and the main processing node according to the distributed processing.
  • the load information of all processing nodes in the system calculates the average load of all processing nodes of the distributed processing system, and then broadcasts the average load to other processing nodes.
  • the average load of all processing nodes of the distributed processing system may also be obtained by:
  • the master control center in the distributed processing system obtains all the processing of the distributed processing system by acquiring load information of all processing nodes in the distributed processing system. The average load of the nodes, and then broadcast the above average load to other processing nodes.
  • a distributed hash called a virtual node is employed.
  • the spatial ring of the keyword is randomly divided into Q intervals (Q»N) by an algorithm.
  • One interval is called a virtual node.
  • randomly divide the Q virtual nodes It is allocated to N processing nodes, and each processing node stores about Q/N virtual nodes.
  • N and Q are both positive integers.
  • the distributed processing system in the embodiments of the present invention is also applicable to the distributed processing system described in the following specific embodiments.
  • Step 102 If the first load is greater than the average load, migrating the at least one virtual node distributed on the first processing node to at least one processing node in the distributed processing system whose load is less than the average load.
  • an overload amount threshold may be set according to the situation, that is, the overload amount at the first processing node. The above migration process is performed when the threshold is exceeded. After the virtual node is migrated, the at least one processing node that receives the load of the migrated virtual node that is less than the average load may process a part of the processing request corresponding to the migrated virtual node, thereby reducing the load of the first processing node.
  • the load balancing processing method provided in this embodiment is configured to migrate, by using a distributed system, at least one virtual node distributed on a processing node with a load greater than an average load to at least one processing node in a distributed processing system with a load less than an average load,
  • the processing nodes in the distributed processing system are more balanced in load distribution, thereby enhancing the parallel processing capability of the distributed processing system and improving the efficiency of the distributed processing system.
  • the at least one virtual node that is distributed on the first processing node is migrated to the at least one processing node in the distributed processing system where the load is less than the average load, including:
  • At least one virtual node distributed on the first processing node with a total load less than or equal to the overload amount is migrated to at least one processing node in the distributed processing system with the total underload being greater than or equal to the total load, and the overload is greater than the first load.
  • the load of the average load, the total amount of underload is the sum of the load of each processing node in at least one processing node being lower than the load of the average load.
  • the total load is the load of the one virtual node, and if the at least one virtual node is a plurality of virtual nodes, the total load is multiple virtual The sum of the load of the node.
  • the total amount of the underload is a load of the one processing node that is lower than the average load, if the at least one processing node is multiple Processing the node, the total amount of the underload is lower than the load of each of the at least one processing node The sum of the load of the average load.
  • the overload of processing node A in the distributed processing system is 50
  • the load of one virtual node A1 distributed on processing node A is 50
  • the underload of another processing node B in the distributed processing system is 50
  • the virtual node A1 is migrated to the processing node B
  • the other case may be: if the overload of the processing node A in the distributed processing system is 50, the two virtual nodes A1 and A2 distributed on the processing node A
  • the load is 20 and 30 respectively, and the other node B in the distributed processing system has an underload of 60, and the virtual nodes A1 and A2 are migrated to the processing node B.
  • the overload of processing node A in the distributed processing system is 50, the loads of the two virtual nodes A1 and A2 distributed on the processing node A are 20 and 30, respectively, and the other two processing nodes B and C in the distributed processing system.
  • the underloads are 20 and 30 respectively, then the virtual node A1 is migrated to the processing node B, and the virtual node A2 is migrated to the processing node C.
  • the other case may be: if the distributed processing system processes the node A
  • the overload is 50
  • the load of the three virtual nodes A1, A2 and A3 distributed on the processing node A are 15, 20 and 10 respectively
  • the underload of the other processing nodes B and C in the distributed processing system are respectively 25 and 45
  • the virtual node A1 is migrated to the processing node B
  • the virtual nodes A2 and A3 are migrated to the processing node C.
  • the load balancing processing method provided in this embodiment is configured to migrate at least one virtual node in the processing node with a total load less than or equal to the overload amount to at least one processing node in the distributed processing system with the total amount of underload being greater than or equal to the total load.
  • the processing nodes in the distributed processing system can be more balanced in load distribution, enhance the parallel processing capability of the distributed processing system, and improve the efficiency of the distributed processing system.
  • the load balancing processing method in this embodiment includes:
  • Step 201 Acquire load information of each processing node in the distributed processing system, where the load information includes load information of each virtual node distributed on each processing node.
  • the method for obtaining load information of each processing node in the distributed processing system may be:
  • Each processing node in the distributed processing system elects a main processing node by using a consistency algorithm such as pasox, and sets a software timing on the main processing node.
  • the main processing node periodically sends its load information to other processing nodes in the distributed processing system. After receiving the load information of the main processing node, the other processing nodes send their own load information to the main processing section.
  • the primary processing node broadcasts load information of all processing nodes to other processing nodes in the distributed processing system, or the primary processing node periodically sends its load information to other processing nodes in the distributed processing system, and the other processing nodes receive After the main processing node loads the information, it sends its own load information to other processing nodes in the distributed processing system.
  • the method for obtaining load information of each processing node in the distributed processing system may also be:
  • the master control center in the distributed processing system acquires load information of all processing nodes in the distributed processing system, and then performs other processing in the distributed processing system.
  • the node broadcasts the above load information.
  • the load information of the processing node includes the virtual nodes distributed on the processing node and the load on each virtual node.
  • Step 202 Determine at least one processing node according to load information of each processing node. Since each processing node in the distributed processing system can learn the load information of other processing nodes, if the first load of the first processing node is greater than the average load of the distributed processing system, the processing node or the control center is according to the foregoing The overload of the processing node and the load of the virtual node distributed on the first processing node determine at least one processing node in the distributed processing system that has a load less than the average load.
  • Step 203 Send a migration request message to at least one processing node, where the migration request message carries information of at least one virtual node.
  • the first processing node or the control center After the at least one processing node is determined, the first processing node or the control center sends a migration request message to the determined at least one processing node, where the migration request message carries the virtual node information to be migrated.
  • Step 204 Receive a migration request response message of the determined at least one processing node.
  • the at least one determined processing node After receiving the foregoing migration request message, the at least one determined processing node feeds back a migration request response message to the first processing node.
  • Step 205 If the migration request response message is a success response message, at least one virtual node distributed on the first processing node is migrated to at least one processing node in the distributed processing system whose load is less than the average load.
  • the migration request response message is a failure response cancellation
  • the foregoing may determine that the total underload of the at least one processing node determined by the foregoing is smaller than the total load of the at least one virtual node to be migrated.
  • the load balancing processing method provided in this embodiment firstly is based on the load signal of each processing node. And determining, by the at least one processing node, sending a migration request message to the at least one processing node, and if the migration request response message is a success response message, migrating the at least one virtual node distributed on the first processing node to the distributed processing system.
  • the at least one processing node with a medium load less than the average load can make the processing nodes in the distributed processing system more balanced in load distribution, enhance the parallel processing capability of the distributed processing system, and improve the efficiency of the distributed processing system.
  • the at least one virtual node distributed on the first processing node is migrated to the at least one processing node in the distributed processing system where the load is less than the average load, including:
  • the update information is sent to other processing nodes in the distributed processing system to cause other processing nodes in the distributed processing system to update the mapping table between the locally stored processing nodes and the virtual nodes based on the update information.
  • one implementation manner of migrating at least one virtual node distributed on the first processing node to at least one processing node whose load is less than the average load in the distributed processing system is: the foregoing first processing node or
  • the master control center updates the mapping relationship table between the first processing node and the at least one virtual node according to the information of the at least one virtual node, and the mapping relationship table can be, for example, as shown in Table 1:
  • Processing node C virtual node C1 (range), virtual node C2 (range), ... the first processing node or the master control center updates the first processing node and the at least one virtual node according to the information of the at least one virtual node
  • the update information is sent to other processing nodes in the distributed processing system, and the updated information may include an updated mapping relationship table, and other processing nodes in the distributed processing system are updated according to the The information updates the mapping table between the locally stored processing node and the virtual node.
  • the load balancing processing method updates the mapping relationship table between the first processing node and the at least one virtual node, and sends update information to other processing nodes in the distributed processing system, so as to enable other in the distributed processing system.
  • the processing node updates the mapping table between the locally stored processing node and the virtual node according to the update information, so that at least one virtual node on the processing node with a load greater than the average load is migrated to the distributed processing system in the distributed system, and the load is less than At least one processing node of the average load realizes that the processing nodes in the distributed processing system are more balanced in load distribution, enhance the parallel processing capability of the distributed processing system, and improve the efficiency of the distributed processing system.
  • the method further includes:
  • the virtual node is After A1 is migrated to the processing node B, the data corresponding to A1 distributed in the processing node A is synchronized to the processing node B. If the processing request received by the virtual node A1 is a read operation, the data corresponding to A1 is synchronized to the processing node. After B, the processing node B can also process the above read operation processing request; if the processing request received by the virtual node A1 is a write operation, the processing node B can also process the write operation for the virtual node distributed on the processing node A.
  • the load balancing processing method synchronizes the data corresponding to the virtual node on the first processing node to the at least one processing node after the virtual node is migrated, and in the case that some processing nodes store the hot resources,
  • the processing nodes in the distributed processing system can be more balanced in load distribution, enhance the parallel processing capability of the distributed processing system, and improve the efficiency of the distributed processing system.
  • FIG. 3 is a flowchart of a third embodiment of a load balancing processing method according to the present invention. As shown in FIG. 3, the load balancing processing method in this embodiment includes:
  • Step 301 The timer expires.
  • the above-mentioned timers can be set on the main processing node or the main control center.
  • the main processing nodes are elected by the processing nodes in the distributed processing system through a consistency algorithm such as pasox. For details, see Embodiment 1.
  • Step 302 The main processing node sends its load information to other processing nodes in the distributed processing system.
  • Step 303 The other processing nodes in the distributed processing system send their own load information to the primary processing node.
  • Step 304 The main processing node broadcasts load information of all processing nodes to other processing nodes in the distributed processing system.
  • Step 305 Each processing node calculates an average load of the distributed processing system according to the received load information, compares the self load and the average load, and determines whether the load needs to be migrated.
  • the load of the processing node A is greater than the average load, and the load of the processing node A exceeds the average load is called the overload amount of the processing node A, and the threshold is set in advance.
  • the overload amount is greater than the threshold, the load migration is performed. .
  • Step 306 The processing node A determines, according to the load information of each processing node, at least one virtual node and at least one processing node whose total underload is greater than or equal to the total load of the virtual node to be migrated.
  • the total load is the load of the one virtual node
  • the at least one virtual node is a plurality of virtual nodes
  • the total load is multiple virtual The sum of the loads of the nodes.
  • the at least one processing node is a processing node
  • the total amount of the underload is the one processing node. The load is lower than the load of the average load. If the at least one processing node is a plurality of processing nodes, the total amount of underload is the sum of the load of each processing node of the at least one processing node being lower than the average load. .
  • the load of the processing node B is less than the average load, and the underload amount is greater than or equal to the total load of the virtual node to be migrated, and the load of the virtual node A1 distributed on the processing node A is smaller than the overload of the processing node A. .
  • Step 307 The processing node A sends a migration request message to the processing node B.
  • the above migration message carries the load information of the virtual node A1.
  • Step 308 The processing node B sends a migration request response message to the processing node A.
  • the processing node B sends a migration request response message to the processing node A.
  • Step 309 The processing node A updates the mapping relationship table between the virtual node A1 and the processing node A.
  • Processing node A updates the pre-migration A1-A to the migrated Al-B.
  • Step 310 The processing node B updates the mapping relationship table between the virtual node A1 and the processing node B.
  • Step 311 The processing node A sends update information to other processing nodes in the distributed processing system.
  • Step 312 The other processing nodes in the distributed processing system update the mapping table between the locally stored processing node and the virtual node according to the update information.
  • the load balancing processing method provided by the embodiment, by updating a mapping relationship table between the first processing node and the virtual node distributed on the first processing node, and the determined at least one processing node and the at least one processing node distributed in the determining
  • the mapping manner of the virtual node on the virtual node is implemented in the distributed system to migrate at least one virtual node distributed on the processing node with a load greater than the average load to at least one processing node in the distributed processing system with a load less than the average load,
  • the processing nodes in the distributed processing system are more balanced in load distribution, enhance the parallel processing capability of the distributed processing system, and improve the efficiency of the distributed processing system.
  • the load balancing processing apparatus includes an obtaining module 41 and a processing module. 42 .
  • the obtaining module 41 is configured to acquire a first load of the first processing node in the distributed processing system and an average load of the distributed processing system
  • the processing module 42 is configured to: if the first load is greater than the average load, the first The at least one virtual node corresponding to the processing node is migrated to at least one processing node in the distributed processing system whose load is less than the average load.
  • the device in this embodiment may be used to implement the technical solution of the method embodiment shown in FIG. 1.
  • the implementation principle and technical effects are similar, and details are not described herein again.
  • the processing module 42 is configured to migrate at least one virtual node that is distributed on the first processing node with a total load less than or equal to the overload amount to at least one processing in the distributed processing system, where the total amount of underload is greater than or equal to the total amount of the load.
  • the overload is the load of the first load exceeding the average load
  • the total amount of the underload is the sum of the load of each processing node of the at least one processing node being lower than the load of the average load.
  • the total load is the load of the one virtual node, and if the at least one virtual node is a plurality of virtual nodes, the total load is multiple virtual The sum of the load of the node.
  • the total amount of the underload is a load of the one processing node that is lower than the average load, if the at least one processing node is multiple Processing the node, the total amount of underload is the sum of the load of each processing node in the at least one processing node being lower than the load of the average load.
  • FIG. 5 is a schematic structural diagram of a second embodiment of a load balancing processing apparatus according to the present invention.
  • the load balancing processing apparatus provided in this embodiment, based on the embodiment shown in FIG. 4, further includes a determining module 43, a sending module 44, and a receiving module 45, wherein the obtaining module 41 is further configured to acquire load information of each processing node in the distributed processing system, where the load information includes each distributed on each processing node
  • the load information of the virtual node the determining module 43 is configured to determine at least one processing node according to the load information of each processing node, and the sending module 44 is configured to send a migration request message to the at least one processing node, where the migration request message carries the The information of the at least one virtual node
  • the receiving module 45 is configured to receive the migration request response message that is sent by the processing node according to the migration request message
  • the processing module 42 is specifically configured to: if the migration request response message is a success response message, At least one virtual node on the first processing
  • the device of this embodiment may be used to implement the technical solution of the method embodiment shown in FIG. 2,
  • the implementation principle is similar to the technical effect, and will not be described here.
  • FIG. 6 is a schematic structural diagram of a third embodiment of a load balancing processing apparatus according to the present invention.
  • the load balancing processing apparatus provided in this embodiment based on the embodiment shown in FIG. 5, further includes
  • the update module 46 is configured to update a mapping relationship table between the first processing node and the at least one virtual node, where the sending module 44 is further configured to send to other processing nodes in the distributed processing system.
  • the information is updated such that other processing nodes in the distributed processing system update the mapping table between the locally stored processing node and the virtual node according to the update information.
  • the device in this embodiment may be used to implement the technical solution of the method embodiment shown in FIG. 3, and the implementation principle and the technical effect are similar, and details are not described herein again.
  • FIG. 7 is a schematic structural diagram of Embodiment 4 of a load balancing processing apparatus according to the present invention.
  • the load balancing processing apparatus provided in this embodiment based on the embodiment shown in FIG. 6, further includes The synchronization module 47, the synchronization unit 47 is configured to synchronize data corresponding to the at least one virtual node to the at least one processing node.
  • the load balancing processing apparatus may be a processing node or a master control center.
  • the case where the load balancing processing device is a processing node may include: any processing node in the distributed processing system may perform load balancing processing on the distributed processing system or may be performed by a primary processing node in the distributed processing system.
  • the distributed processing system performs load balancing processing.
  • a main control center may be set in the distributed processing system for performing load balancing processing on the distributed processing system.
  • FIG. 8 is a schematic structural diagram of Embodiment 1 of a processing node according to the present invention.
  • the processing node provided in this embodiment includes: at least one processor 801, at least one network interface 804 or other user interface 803, and a memory 805. And at least one communication bus 802.
  • the load balancing processing device optionally includes a user interface 803 including a display, a keyboard or a pointing device.
  • the memory 805 may include a high speed RAM memory and may also include a non-volatile memory such as at least one disk memory.
  • the memory 805 can optionally include at least one storage device located remotely from the load balancing processing device. Save The memory 805 stores execution instructions.
  • the processor 801 communicates with the memory 805, and the processor 801 executes the execution instructions so that the load balancing processing device can execute the above-described method embodiments.
  • Operating system 806, which includes various programs for implementing various basic services and processing hardware-based tasks.
  • FIG. 9 is a schematic structural diagram of Embodiment 1 of a main control center according to the present invention.
  • the main control center provided in this embodiment includes: at least one processor 901, at least one network interface 904, or another user interface 903.
  • the load balancing processing device optionally includes a user interface 903 including a display, a keyboard or a pointing device.
  • Memory 905 may contain high speed RAM memory and may also include non-volatile memory, such as at least one disk memory.
  • the memory 905 can optionally include at least one storage device located remotely from the load balancing processing device.
  • the memory 905 stores execution instructions.
  • the processor 901 communicates with the memory 905, and the processor 901 executes the execution instructions so that the load balancing processing device can execute the above-described method embodiments.
  • Operating system 906, which contains various programs for implementing various basic services and handling hardware-based tasks.
  • the main control center provided by the embodiment of the present invention can perform the technical solution of the embodiment of the load balancing processing method, and the implementation principle and the technical effect are similar, and details are not described herein again.
  • FIG. 10 is a schematic structural diagram of Embodiment 1 of a distributed processing system according to the present invention, as shown in FIG.
  • the distributed processing system of this embodiment includes at least two processing nodes 1000, and the processing node 1000 can adopt the structure of any device embodiment of FIG. 4 to FIG. 8, correspondingly, any one of the processing nodes 1000 can execute
  • the technical solution of the embodiment of the load balancing processing method is similar to the technical solution, and details are not described herein again.
  • FIG. 11 is a schematic structural diagram of Embodiment 2 of a distributed processing system according to the present invention, as shown in FIG.
  • the distributed processing system of the present embodiment includes at least two processing nodes 1010 and a main control center 1020.
  • the processing node 1010 can adopt the structure of the processing node in the prior art, and the main control center 1020 can adopt FIG.
  • the configuration of the device embodiment of FIG. 8 is correspondingly configured to implement the technical solution of the embodiment of the load balancing processing method. The implementation principle and technical effects are similar, and details are not described herein again.
  • the embodiment of the present invention further provides a distributed processing system, including at least two processing nodes in the embodiment shown in FIG.
  • the embodiment of the present invention further provides a distributed processing system, which includes two processing nodes and a main control center in the embodiment shown in FIG.
  • the embodiment of the invention further provides a computer readable medium, comprising computer execution instructions, wherein the computer execution instructions are used to enable any one of the processing nodes in the above embodiments to execute the load balancing processing method.
  • the embodiment of the present invention further provides a computer readable medium, comprising computer execution instructions, wherein the computer execution instructions may be used to enable any one of the above-mentioned embodiments to execute the load balancing processing method.
  • the foregoing program may be stored in a computer readable medium, and when executed, the program includes the above The steps of the method embodiments; and the aforementioned computer readable medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Multi Processors (AREA)

Abstract

Embodiments of the present invention provide a load balancing method, device, system and computer readable medium. The load balancing method comprises: obtaining a first load of a first processing node in a distributed processing system and an average load of all processing nodes in the distributed processing system; if the first load is greater than the average load, migrating at least one virtual node distributed on the first processing node to at least one processing node whose load is less than the average load in the distributed processing system. By means of the embodiment of the present invention, at least one virtual node corresponding to a processing node whose load is greater than an average load in a distributed system can be migrated to at least one processing node whose load is less than the average load in the distributed processing system, so that the load distribution on processing nodes in the distributed processing system becomes more balanced, thereby enhancing the parallel processing capability of the distributed processing system and improving the efficiency of the distributed processing system.

Description

负载均衡方法、 装置、 系统及计算机可读介质 技术领域 本发明实施例涉及通信技术, 尤其涉及一种负载均衡方法、 装置、 系 统及计算机可读介质。 背景技术  The present invention relates to communication technologies, and in particular, to a load balancing method, apparatus, system, and computer readable medium. Background technique
随着互联网的高速发展, 企业对分布式处理能力的要求越来越高。 分 布式处理系统将大量廉价的服务器组成集群, 每个服务器即为一个处理节 点, 通过处理节点并行处理, 来提供一个整体高性能的集群处理能力。  With the rapid development of the Internet, enterprises are increasingly demanding distributed processing capabilities. The distributed processing system clusters a large number of inexpensive servers, each of which is a processing node, which provides an overall high-performance cluster processing capability by processing node parallel processing.
目前, 分布式处理系统中, 一个处理任务通常会被分解为多个处理请 求并分配给多个处理节点并行处理, 从而可以获得较高的并行处理能力, 这就需要将多个处理请求均衡地分配给各个处理节点。  At present, in a distributed processing system, a processing task is usually decomposed into multiple processing requests and distributed to multiple processing nodes for parallel processing, so that high parallel processing capability can be obtained, which requires balancing multiple processing requests. Assigned to each processing node.
在实现本发明实施例的过程中, 发明人发现现有技术中的处理方法时 常出现处理请求分配不均衡的问题, 进而导致负载重的处理节点成为整个 分布式处理系统的瓶颈, 而负载轻的处理节点又浪费其处理能力, 使得分 布式处理系统的处理效率下降。 发明内容 本发明实施例提供一种负载均衡方法、装置、系统和计算机可读介质, 以实现分布式处理系统中的处理节点在负载的分配上更加均衡。  In the process of implementing the embodiments of the present invention, the inventor finds that the processing method in the prior art often has a problem of unbalanced processing request allocation, which in turn causes the heavily loaded processing node to become the bottleneck of the entire distributed processing system, and the load is light. The processing node wastes its processing power, which reduces the processing efficiency of the distributed processing system. SUMMARY OF THE INVENTION Embodiments of the present invention provide a load balancing method, apparatus, system, and computer readable medium, so that processing nodes in a distributed processing system are more balanced in load distribution.
第一方面, 提供一种负载均衡处理方法, 包括:  In a first aspect, a load balancing processing method is provided, including:
获取分布式处理系统中的第一处理节点的第一负载以及所述分布式 处理系统中所有处理节点的平均负载;  Obtaining a first load of a first processing node in the distributed processing system and an average load of all processing nodes in the distributed processing system;
若所述第一负载大于所述平均负载, 则将分布在所述第一处理节点 上的至少一个虚拟节点迁移到所述分布式处理系统中负载小于所述平均 负载的至少一个处理节点上。  And if the first load is greater than the average load, migrating at least one virtual node distributed on the first processing node to at least one processing node in the distributed processing system with a load less than the average load.
在第一方面的第一种可能的实现方式中, 所述将分布在所述第一处 理节点上的至少一个虚拟节点迁移到所述分布式处理系统中负载小于所 述平均负载的至少一个处理节点上, 包括: In a first possible implementation manner of the first aspect, the at least one virtual node that is distributed on the first processing node is migrated to the distributed processing system, and the load is less than At least one processing node of the average load, including:
将分布在所述第一处理节点上负载总量小于等于过载量的至少一个 虚拟节点迁移到所述分布式处理系统中欠载总量大于等于所述负载总量 的至少一个处理节点上, 所述过载量为所述第一负载超过所述平均负载 的负载量, 所述欠载总量为所述至少一个处理节点中的每个处理节点的 负载低于所述平均负载的负载量之和。  Migrating at least one virtual node distributed on the first processing node with a total load less than or equal to an overload amount to at least one processing node in the distributed processing system, wherein the total amount of underload is greater than or equal to the total amount of the load, The overload amount is a load amount of the first load exceeding the average load, and the total amount of underload is a sum of load of each of the at least one processing node being lower than a load of the average load .
结合第一方面或所述第一方面的第一种可能的实施方式, 在第二种 可能的实施方式中, 所述将分布在所述第一处理节点上的至少一个虚拟 节点迁移到所述分布式处理系统中负载小于所述平均负载的至少一个处 理节点上之前, 还包括:  With reference to the first aspect or the first possible implementation manner of the first aspect, in a second possible implementation, the at least one virtual node that is distributed on the first processing node is migrated to the Before the load in the distributed processing system is less than the average load on at least one processing node, the method further includes:
获取所述分布式处理系统中各处理节点的负载信息, 所述负载信息 包括所述分布在各处理节点上的各虚拟节点的负载信息;  Obtaining load information of each processing node in the distributed processing system, where the load information includes load information of each virtual node distributed on each processing node;
根据所述各处理节点的负载信息, 确定所述至少一个处理节点; 向所述至少一个处理节点发送迁移请求消息, 所述迁移请求消息携 带所述至少一个虚拟节点的信息;  Determining, according to load information of each processing node, the at least one processing node; sending, to the at least one processing node, a migration request message, where the migration request message carries information of the at least one virtual node;
接收所述至少一个处理节点的迁移请求响应消息;  Receiving a migration request response message of the at least one processing node;
所述将分布在所述第一处理节点上的至少一个虚拟节点迁移到所述 分布式处理系统中负载小于所述平均负载的至少一个处理节点上, 具体 为:  The at least one virtual node distributed on the first processing node is migrated to the at least one processing node in the distributed processing system where the load is less than the average load, specifically:
若所述迁移请求响应消息为成功响应消息, 则将分布在所述第一处 理节点上的至少一个虚拟节点迁移到所述至少一个处理节点上。  And if the migration request response message is a success response message, migrating at least one virtual node distributed on the first processing node to the at least one processing node.
结合第一方面或所述第一方面的第一种可能的实施方式, 在第三种 可能的实施方式中, 所述将分布在所述第一处理节点上的至少一个虚拟 节点迁移到所述分布式处理系统中负载小于所述平均负载的至少一个处 理节点上, 包括:  With reference to the first aspect or the first possible implementation manner of the first aspect, in a third possible implementation, the at least one virtual node that is distributed on the first processing node is migrated to the The at least one processing node in the distributed processing system whose load is less than the average load includes:
更新所述第一处理节点与所述至少一个虚拟节点之间的映射关系 表;  Updating a mapping relationship table between the first processing node and the at least one virtual node;
向所述分布式处理系统中的其他处理节点发送更新信息, 以使所述 分布式处理系统中的其他处理节点根据所述更新信息更新本地存储的处 理节点与虚拟节点之间的映射关系表。 结合第一方面或所述第一方面的第一种可能的实施方式, 在第四种 可能的实施方式中, 所述将分布在所述第一处理节点上的至少一个虚拟 节点迁移到所述分布式处理系统中负载小于所述平均负载的至少一个处 理节点上之后, 还包括: And transmitting, to the other processing nodes in the distributed processing system, update information, so that other processing nodes in the distributed processing system update the mapping table between the locally stored processing node and the virtual node according to the update information. With reference to the first aspect or the first possible implementation manner of the first aspect, in a fourth possible implementation, the at least one virtual node that is distributed on the first processing node is migrated to the After the load in the distributed processing system is less than the processing load on the at least one processing node, the method further includes:
将所述至少一个虚拟节点对应的数据同步到所述至少一个处理节点 上。  Synchronizing data corresponding to the at least one virtual node to the at least one processing node.
第二方面, 提供一种负载均衡处理装置, 包括:  In a second aspect, a load balancing processing apparatus is provided, including:
获取模块, 用于获取分布式处理系统中的第一处理节点的第一负载 以及所述分布式处理系统中所有处理节点的平均负载;  An obtaining module, configured to acquire a first load of a first processing node in the distributed processing system and an average load of all processing nodes in the distributed processing system;
处理模块, 若所述第一负载大于所述平均负载, 则将分布在所述第 一处理节点上的至少一个虚拟节点迁移到所述分布式处理系统中负载小 于所述平均负载的至少一个处理节点上。  a processing module, if the first load is greater than the average load, migrating at least one virtual node distributed on the first processing node to at least one processing in the distributed processing system that has a load less than the average load On the node.
在第二方面的第一种可能的实现方式中, 所述处理模块, 具体用于 将分布在所述第一处理节点上负载总量小于等于过载量的至少一个虚拟 节点迁移到所述分布式处理系统中欠载总量大于等于所述负载总量的至 少一个处理节点上, 所述过载量为所述第一负载超过所述平均负载的负 载量, 所述欠载总量为所述至少一个处理节点中的每个处理节点的负载 低于所述平均负载的负载量之和。  In a first possible implementation manner of the second aspect, the processing module is specifically configured to migrate at least one virtual node that is distributed on the first processing node to a total amount of load less than or equal to an overload amount to the distributed The at least one processing node in the processing system is greater than or equal to the total amount of the load, the overload amount is a load amount of the first load exceeding the average load, and the total underload is the at least The load of each processing node in a processing node is lower than the sum of the load of the average load.
结合第二方面或所述第二方面的第一种可能的实施方式, 在第二种 可能的实施方式中, 还包括确定模块、 发送模块和接收模块;  With reference to the second aspect or the first possible implementation manner of the second aspect, in a second possible implementation, the determining module, the sending module, and the receiving module are further included;
所述获取模块, 还用于获取所述分布式处理系统中各处理节点的负 载信息, 所述负载信息包括分布在所述各处理节点上的各虚拟节点的负 载信息;  The acquiring module is further configured to acquire load information of each processing node in the distributed processing system, where the load information includes load information of each virtual node distributed on each processing node;
所述确定模块, 用于根据所述各处理节点的负载信息, 确定所述至 少一个处理节点;  The determining module is configured to determine, according to load information of each processing node, the at least one processing node;
所述发送模块, 用于向所述至少一个处理节点发送迁移请求消息, 所述迁移请求消息携带所述至少一个虚拟节点的信息;  The sending module is configured to send a migration request message to the at least one processing node, where the migration request message carries information of the at least one virtual node;
所述接收模块, 用于接收所述至少一个处理节点根据所述迁移请求 消息反馈的迁移请求响应消息;  The receiving module is configured to receive a migration request response message that is sent by the at least one processing node according to the migration request message;
所述处理模块具体用于若所述迁移请求响应消息为成功响应消息, 则将分布在所述第一处理节点上的至少一个虚拟节点迁移到所述至少一 个处理节点上。 The processing module is specifically configured to: if the migration request response message is a success response message, And then migrating at least one virtual node distributed on the first processing node to the at least one processing node.
结合第二方面或所述第二方面的第一种可能的实施方式, 在第三种 可能的实施方式中, 还包括:  With reference to the second aspect or the first possible implementation manner of the second aspect, in a third possible implementation manner, the method further includes:
更新模块, 用于更新所述第一处理节点与所述至少一个虚拟节点之 间的映射关系表;  And an update module, configured to update a mapping relationship table between the first processing node and the at least one virtual node;
所述发送模块, 还用于向所述分布式处理系统中的其他处理节点发 送更新信息, 以使所述分布式处理系统中的其他处理节点根据所述更新 信息更新本地存储的处理节点与虚拟节点之间的映射关系表。  The sending module is further configured to send update information to other processing nodes in the distributed processing system, so that other processing nodes in the distributed processing system update the locally stored processing node and the virtual according to the update information. A mapping table between nodes.
结合第二方面或所述第二方面的第一种可能的实施方式, 在第四种 可能的实施方式中, 还包括:  With reference to the second aspect or the first possible implementation manner of the second aspect, in a fourth possible implementation, the method further includes:
同步模块, 用于将所述至少一个虚拟节点对应的数据同步到所述至 少一个处理节点上。  And a synchronization module, configured to synchronize data corresponding to the at least one virtual node to the at least one processing node.
结合第二方面或所述第二方面的第一种可能的实施方式, 在第五种 可能的实施方式中, 所述装置为处理节点或者主控中心。  In conjunction with the second aspect or the first possible implementation of the second aspect, in a fifth possible implementation, the device is a processing node or a master control center.
第三方面, 提供一种分布式处理系统, 包括: 至少两个上述第五种 可能的实现方式中所述的处理节点。  In a third aspect, a distributed processing system is provided, comprising: at least two processing nodes described in the above fifth possible implementation manner.
第四方面, 还提供一种分布式处理系统, 包括: 至少两个处理节点 以及上述第五种可能的实现方式中所述的主控中心。  In a fourth aspect, a distributed processing system is provided, including: at least two processing nodes and a master control center as described in the fifth possible implementation manner.
第五方面, 提供了一种处理节点, 包括处理器和存储器, 所述存储 器存储执行指令, 当所述装置运行时, 所述处理器与所述存储器之间通 信, 所述处理器执行所述执行指令使得所述处理节点执行第一方面所述 的方法。  In a fifth aspect, a processing node is provided, including a processor and a memory, the memory storing execution instructions, when the device is running, the processor is in communication with the memory, the processor executing the Executing the instructions causes the processing node to perform the method of the first aspect.
第六方面, 提供了一种主控中心, 包括处理器和存储器, 所述存储 器存储执行指令, 当所述装置运行时, 所述处理器与所述存储器之间通 信, 所述处理器执行所述执行指令使得所述主控中心执行第一方面所述 的方法。  In a sixth aspect, a master control center is provided, including a processor and a memory, the memory storing execution instructions, when the device is running, the processor is in communication with the memory, and the processor executes Executing the instructions causes the master control center to perform the method of the first aspect.
第七方面, 还提供了一种分布式处理系统, 包括至少两个第五方面 所述的处理节点。  In a seventh aspect, a distributed processing system is provided, comprising at least two processing nodes described in the fifth aspect.
第八方面, 又提供了一种分布式处理系统, 包括至少两个处理节点 以及第六方面的主控中心。 In an eighth aspect, a distributed processing system is provided, including at least two processing nodes And the main control center of the sixth aspect.
第九方面, 提供了一种计算机可读介质, 包含计算机执行指令, 所 述计算机执行指令用于使处理节点执行第一方面所述的方法。  In a ninth aspect, a computer readable medium is provided, comprising computer executed instructions for causing a processing node to perform the method of the first aspect.
第十方面, 还提供了一种计算机可读介质, 包含计算机执行指令, 所述计算机执行指令用于使主控中心执行第一方面所述的方法。  In a tenth aspect, there is provided a computer readable medium comprising computer executed instructions for causing a master control center to perform the method of the first aspect.
本实施例提供的负载均衡处理方法, 装置、 系统及计算机可读介质, 通过分布式系统中将负载大于平均负载的处理节点所对应的至少一个虚 拟节点迁移到分布式处理系统中负载小于平均负载的至少一个处理节点 上, 可以使分布式处理系统中的处理节点在负载的分配上更加均衡, 进而 增强分布式处理系统的并行处理能力, 提高分布式处理系统的效率。 附图说明  The load balancing processing method provided by the embodiment, the device, the system, and the computer readable medium, wherein at least one virtual node corresponding to the processing node with a load greater than the average load is migrated to the distributed processing system in the distributed system, and the load is less than the average load. At least one processing node can make the processing nodes in the distributed processing system more balanced in load distribution, thereby enhancing the parallel processing capability of the distributed processing system and improving the efficiency of the distributed processing system. DRAWINGS
实施例或现有技术描述中所需要使用的附图作一简单地介绍, 显而易见 地, 下面描述中的附图是本发明的一些实施例, 对于本领域普通技术人员 来讲, 在不付出创造性劳动性的前提下, 还可以根据这些附图获得其他的 附图。 The drawings used in the embodiments or the description of the prior art are briefly described. It is obvious that the drawings in the following description are some embodiments of the present invention, and are not creative to those skilled in the art. Other drawings can also be obtained from these drawings on the premise of labor.
图 1为本发明提供的负载均衡处理方法实施例一的流程图;  1 is a flowchart of Embodiment 1 of a load balancing processing method provided by the present invention;
图 2为本发明提供的负载均衡处理方法实施例二的流程图;  2 is a flowchart of Embodiment 2 of a load balancing processing method provided by the present invention;
图 3为本发明提供的负载均衡处理方法实施例三的流程图;  3 is a flowchart of Embodiment 3 of a load balancing processing method provided by the present invention;
图 4为本发明提供的负载均衡处理装置实施例一的结构示意图; 图 5为本发明提供的负载均衡处理装置实施例二的结构示意图; 图 6为本发明提供的负载均衡处理装置实施例三的结构示意图; 图 7为本发明提供的负载均衡处理装置实施例四的结构示意图; 图 8为本发明提供的处理节点实施例一的结构示意图;  4 is a schematic structural diagram of Embodiment 1 of a load balancing processing apparatus according to the present invention; FIG. 5 is a schematic structural diagram of Embodiment 2 of a load balancing processing apparatus according to the present invention; FIG. 6 is a third embodiment of a load balancing processing apparatus according to the present invention. FIG. 7 is a schematic structural diagram of Embodiment 4 of a load balancing processing apparatus according to the present invention; FIG. 8 is a schematic structural diagram of Embodiment 1 of a processing node according to the present invention;
图 9为本发明提供的主控中心实施例一的结构示意图;  FIG. 9 is a schematic structural diagram of Embodiment 1 of a main control center according to the present invention;
图 10为本发明提供的分布式处理系统实施例一的结构示意图; 图 1 1为本发明提供的分布式处理系统实施例二的结构示意图。 具体实施方式 为使本发明实施例的目的、 技术方案和优点更加清楚, 下面将结合本 发明实施例中的附图, 对本发明实施例中的技术方案进行清楚、 完整地描 述, 显然, 所描述的实施例是本发明一部分实施例, 而不是全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有作出创造性劳动前提 下所获得的所有其他实施例, 都属于本发明保护的范围。 FIG. 10 is a schematic structural diagram of Embodiment 1 of a distributed processing system according to the present invention; FIG. 11 is a schematic structural diagram of Embodiment 2 of a distributed processing system according to the present invention. detailed description The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is a partial embodiment of the invention, and not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
图 1为本发明提供的负载均衡处理方法实施例一的流程图, 如图 1所 示, 本实施例中负载均衡处理方法包括:  FIG. 1 is a flowchart of Embodiment 1 of a load balancing processing method according to the present invention. As shown in FIG. 1, the load balancing processing method in this embodiment includes:
步骤 101、 获取分布式处理系统中的第一处理节点的第一负载以及分 布式处理系统中所有处理节点的平均负载;  Step 101: Acquire a first load of a first processing node in a distributed processing system and an average load of all processing nodes in the distributed processing system;
举例来说, 获取分布式处理系统中的第一处理节点的第一负载的方 式可以是在第一处理节点上设置一个负载计数器, 第一处理节点接收到 一个处理请求, 则对上述负载计数器进行加 1操作, 上述负载计数器记录 的处理请求量为上述第一处理节点的负载; 另一种情况可以是: 在上述 第一处理节点对应的每一个虚拟节点上设置负载计数器, 则每一个虚拟 节点的负载之和为上述第一处理节点的负载。  For example, the manner of obtaining the first load of the first processing node in the distributed processing system may be: setting a load counter on the first processing node, and receiving, by the first processing node, a processing request, In addition to the operation, the processing request amount recorded by the load counter is the load of the first processing node; another case may be: setting a load counter on each virtual node corresponding to the first processing node, then each virtual node The sum of the loads is the load of the first processing node described above.
分布式处理系统的所有处理节点的平均负载的获取方式可以是: 分 布式处理系统中的各处理节点通过 pasox等一致性算法选举一个主处理节 点, 主处理节点上设置一个软件定时器, 主处理节点定时将其负载信息 发送给分布式处理系统中的其他处理节点, 上述其他处理节点接收到主 处理节点的负载信息后, 将自身的负载信息发送给主处理节点, 主处理 节点根据分布式处理系统中所有处理节点的负载信息计算出整个分布式 处理系统所有处理节点的平均负载, 再向其他处理节点广播上述平均负 载。  The average load of all processing nodes of the distributed processing system may be obtained by: Each processing node in the distributed processing system elects a main processing node by using a consistency algorithm such as pasox, and a software timer is set on the main processing node, and the main processing is performed. The node timing sends its load information to other processing nodes in the distributed processing system. After receiving the load information of the main processing node, the other processing nodes send their own load information to the main processing node, and the main processing node according to the distributed processing. The load information of all processing nodes in the system calculates the average load of all processing nodes of the distributed processing system, and then broadcasts the average load to other processing nodes.
分布式处理系统的所有处理节点的平均负载的获取方式还可以是: 分布式处理系统中的主控中心通过获取分布式处理系统中所有处理节点 的负载信息, 计算得到分布式处理系统的所有处理节点的平均负载, 再 向其他处理节点广播上述平均负载。  The average load of all processing nodes of the distributed processing system may also be obtained by: The master control center in the distributed processing system obtains all the processing of the distributed processing system by acquiring load information of all processing nodes in the distributed processing system. The average load of the nodes, and then broadcast the above average load to other processing nodes.
分布式处理系统中, 采用了一种叫做虚拟节点的分布式哈希。 假设 有 N 个处理节点, 通过算法将关键字的空间环随机分成 Q 个区间 (Q»N), 一个区间就称为一个虚拟节点。 然后将这 Q 个虚拟节点随机分 配到 N个处理节点上, 每个处理节点上存放大约为 Q/N个虚拟节点。 其 中, 这里 N、 Q均为正整数。 本发明实施例中分布式处理系统也适用下面 具体实施例中所描述的分布式处理系统。 In a distributed processing system, a distributed hash called a virtual node is employed. Suppose there are N processing nodes, and the spatial ring of the keyword is randomly divided into Q intervals (Q»N) by an algorithm. One interval is called a virtual node. Then randomly divide the Q virtual nodes It is allocated to N processing nodes, and each processing node stores about Q/N virtual nodes. Where N and Q are both positive integers. The distributed processing system in the embodiments of the present invention is also applicable to the distributed processing system described in the following specific embodiments.
步骤 102、 若第一负载大于平均负载, 则将分布在第一处理节点上的 至少一个虚拟节点迁移到分布式处理系统中负载小于所述平均负载的至 少一个处理节点上。  Step 102: If the first load is greater than the average load, migrating the at least one virtual node distributed on the first processing node to at least one processing node in the distributed processing system whose load is less than the average load.
举例来说, 若第一处理节点的第一负载大于平均负载, 第一负载超 过平均负载的负载量称为过载量, 可以根据情况设置一个过载量阈值, 即, 在第一处理节点的过载量超过阈值的情况下才进行上述迁移过程。 上述虚拟节点迁移以后, 接收上述被迁移的虚拟节点的负载小于平均负 载的至少一个处理节点则可以处理上述被迁移的虚拟节点所对应的一部 分处理请求, 进而降低上述第一处理节点的负载。  For example, if the first load of the first processing node is greater than the average load, and the load amount of the first load exceeding the average load is called an overload amount, an overload amount threshold may be set according to the situation, that is, the overload amount at the first processing node. The above migration process is performed when the threshold is exceeded. After the virtual node is migrated, the at least one processing node that receives the load of the migrated virtual node that is less than the average load may process a part of the processing request corresponding to the migrated virtual node, thereby reducing the load of the first processing node.
本实施例提供的负载均衡处理方法, 通过分布式系统中将分布在负 载大于平均负载的处理节点上的至少一个虚拟节点迁移到分布式处理系 统中负载小于平均负载的至少一个处理节点上, 可以使分布式处理系统 中的处理节点在负载的分配上更加均衡, 进而增强分布式处理系统的并 行处理能力, 提高分布式处理系统的效率。  The load balancing processing method provided in this embodiment is configured to migrate, by using a distributed system, at least one virtual node distributed on a processing node with a load greater than an average load to at least one processing node in a distributed processing system with a load less than an average load, The processing nodes in the distributed processing system are more balanced in load distribution, thereby enhancing the parallel processing capability of the distributed processing system and improving the efficiency of the distributed processing system.
可选地, 在图 1对应实施例的基础上, 上述将分布在第一处理节点上 的至少一个虚拟节点迁移到分布式处理系统中负载小于平均负载的至少 一个处理节点上, 包括:  Optionally, on the basis of the corresponding embodiment of FIG. 1, the at least one virtual node that is distributed on the first processing node is migrated to the at least one processing node in the distributed processing system where the load is less than the average load, including:
将分布在第一处理节点上负载总量小于等于过载量的至少一个虚拟 节点迁移到分布式处理系统中欠载总量大于等于负载总量的至少一个处 理节点上, 过载量为第一负载超过平均负载的负载量, 欠载总量为至少 一个处理节点中的每个处理节点的负载低于平均负载的负载量之和。  At least one virtual node distributed on the first processing node with a total load less than or equal to the overload amount is migrated to at least one processing node in the distributed processing system with the total underload being greater than or equal to the total load, and the overload is greater than the first load. The load of the average load, the total amount of underload is the sum of the load of each processing node in at least one processing node being lower than the load of the average load.
具体来说, 若上述至少一个虚拟节点为一个虚拟节点, 则上述负载 总量即该一个虚拟节点的负载量, 若上述至少一个虚拟节点是多个虚拟 节点, 则上述负载总量就是多个虚拟节点的负载之和, 同样的, 若上述 至少一个处理节点为一个处理节点, 则上述欠载总量为该一个处理节点 的负载低于平均负载的负载量, 若上述至少一个处理节点为多个处理节 点, 则上述欠载总量为至少一个处理节点中的每个处理节点的负载低于 平均负载的负载量之和。 Specifically, if the at least one virtual node is a virtual node, the total load is the load of the one virtual node, and if the at least one virtual node is a plurality of virtual nodes, the total load is multiple virtual The sum of the load of the node. Similarly, if the at least one processing node is a processing node, the total amount of the underload is a load of the one processing node that is lower than the average load, if the at least one processing node is multiple Processing the node, the total amount of the underload is lower than the load of each of the at least one processing node The sum of the load of the average load.
举例来说, 若分布式处理系统中处理节点 A的过载量为 50, 分布在 处理节点 A上的一个虚拟节点 A1的负载为 50, 分布式处理系统中另一个 处理节点 B的欠载量为 50, 则将虚拟节点 A1迁移到处理节点 B上, 另一 种情况可以是: 若分布式处理系统中处理节点 A的过载量为 50, 分布在 处理节点 A上的两个虚拟节点 A1和 A2的负载分别为 20和 30, 分布式 处理系统中另一个处理节点 B的欠载量为 60, 则将虚拟节点 A1和 A2迁 移到处理节点 B上。  For example, if the overload of processing node A in the distributed processing system is 50, the load of one virtual node A1 distributed on processing node A is 50, and the underload of another processing node B in the distributed processing system is 50, the virtual node A1 is migrated to the processing node B, and the other case may be: if the overload of the processing node A in the distributed processing system is 50, the two virtual nodes A1 and A2 distributed on the processing node A The load is 20 and 30 respectively, and the other node B in the distributed processing system has an underload of 60, and the virtual nodes A1 and A2 are migrated to the processing node B.
若分布式处理系统中处理节点 A的过载量为 50, 分布在处理节点 A 上的两个虚拟节点 A1和 A2的负载分别为 20和 30, 分布式处理系统中另 外两个处理节点 B和 C的欠载量分别为 20和 30, 则将虚拟节点 A1迁移 到处理节点 B上, 将虚拟节点 A2迁移到处理节点 C上, 另一种情况可以 是: 若分布式处理系统中处理节点 A的过载量为 50, 分布在处理节点 A 上的三个虚拟节点 Al、 和 A2和 A3的负载分别为 15、 20和 10, 分布式 处理系统中另一个处理节点 B和 C的欠载量分别为 25和 45 , 则将虚拟节 点 A1迁移到处理节点 B上, 将虚拟节点 A2和 A3迁移到处理节点 C上。 本实施例提供的负载均衡处理方法, 通过将处理节点中负载总量小于等 于过载量的至少一个虚拟节点迁移到分布式处理系统中欠载总量大于等 于负载总量的至少一个处理节点上, 可以使分布式处理系统中的处理节 点在负载的分配上更加均衡, 增强分布式处理系统的并行处理能力, 提 高分布式处理系统的效率。  If the overload of processing node A in the distributed processing system is 50, the loads of the two virtual nodes A1 and A2 distributed on the processing node A are 20 and 30, respectively, and the other two processing nodes B and C in the distributed processing system. The underloads are 20 and 30 respectively, then the virtual node A1 is migrated to the processing node B, and the virtual node A2 is migrated to the processing node C. The other case may be: if the distributed processing system processes the node A The overload is 50, the load of the three virtual nodes A1, A2 and A3 distributed on the processing node A are 15, 20 and 10 respectively, and the underload of the other processing nodes B and C in the distributed processing system are respectively 25 and 45, the virtual node A1 is migrated to the processing node B, and the virtual nodes A2 and A3 are migrated to the processing node C. The load balancing processing method provided in this embodiment is configured to migrate at least one virtual node in the processing node with a total load less than or equal to the overload amount to at least one processing node in the distributed processing system with the total amount of underload being greater than or equal to the total load. The processing nodes in the distributed processing system can be more balanced in load distribution, enhance the parallel processing capability of the distributed processing system, and improve the efficiency of the distributed processing system.
图 2为本发明提供的负载均衡处理方法实施例二的流程图, 如图 2所 示, 本实施例中负载均衡处理方法包括:  2 is a flowchart of a second embodiment of a load balancing processing method according to the present invention. As shown in FIG. 2, the load balancing processing method in this embodiment includes:
步骤 201、 获取分布式处理系统中各处理节点的负载信息, 负载信息 包括分布在各处理节点上的各虚拟节点的负载信息。  Step 201: Acquire load information of each processing node in the distributed processing system, where the load information includes load information of each virtual node distributed on each processing node.
举例来说, 获取分布式处理系统中各处理节点的负载信息的方法可 以是: 分布式处理系统中的各处理节点通过 pasox等一致性算法选举一个 主处理节点, 主处理节点上设置一个软件定时器, 主处理节点定时将其 负载信息发送给分布式处理系统中的其他处理节点, 上述其他处理节点 接收到主处理节点的负载信息后, 将自身的负载信息发送给主处理节 点, 主处理节点向分布式处理系统中其他处理节点广播所有处理节点的 负载信息, 或是主处理节点定时将其负载信息发送给分布式处理系统中 的其他处理节点, 上述其他处理节点接收到主处理节点的负载信息后, 将自身的负载信息发送给分布式处理系统中的其他处理节点。 For example, the method for obtaining load information of each processing node in the distributed processing system may be: Each processing node in the distributed processing system elects a main processing node by using a consistency algorithm such as pasox, and sets a software timing on the main processing node. The main processing node periodically sends its load information to other processing nodes in the distributed processing system. After receiving the load information of the main processing node, the other processing nodes send their own load information to the main processing section. Point, the primary processing node broadcasts load information of all processing nodes to other processing nodes in the distributed processing system, or the primary processing node periodically sends its load information to other processing nodes in the distributed processing system, and the other processing nodes receive After the main processing node loads the information, it sends its own load information to other processing nodes in the distributed processing system.
获取分布式处理系统中各处理节点的负载信息的方法还可以是: 分 布式处理系统中的主控中心通过获取分布式处理系统中所有处理节点的 负载信息, 再向分布式处理系统中其他处理节点广播上述负载信息。  The method for obtaining load information of each processing node in the distributed processing system may also be: The master control center in the distributed processing system acquires load information of all processing nodes in the distributed processing system, and then performs other processing in the distributed processing system. The node broadcasts the above load information.
上述处理节点的负载信息包括分布在处理节点上的虚拟节点以及各 虚拟节点上的负载量。  The load information of the processing node includes the virtual nodes distributed on the processing node and the load on each virtual node.
步骤 202、 根据各处理节点的负载信息, 确定至少一个处理节点。 由于分布式处理系统中每个处理节点都可以获知其他处理节点的负 载信息, 所以若第一处理节点的第一负载大于分布式处理系统的平均负 载, 该处理节点或主控中心则根据上述第一处理节点的过载量及其分布 在第一处理节点上的虚拟节点的负载确定分布式处理系统中负载小于该 平均负载的至少一个处理节点。  Step 202: Determine at least one processing node according to load information of each processing node. Since each processing node in the distributed processing system can learn the load information of other processing nodes, if the first load of the first processing node is greater than the average load of the distributed processing system, the processing node or the control center is according to the foregoing The overload of the processing node and the load of the virtual node distributed on the first processing node determine at least one processing node in the distributed processing system that has a load less than the average load.
步骤 203、 向至少一个处理节点发送迁移请求消息, 迁移请求消息携 带至少一个虚拟节点的信息。  Step 203: Send a migration request message to at least one processing node, where the migration request message carries information of at least one virtual node.
确定上述至少一个处理节点后, 第一处理节点或主控中心向确定的 至少一个处理节点发送迁移请求消息, 迁移请求消息携带待迁移的虚拟 节点信息。  After the at least one processing node is determined, the first processing node or the control center sends a migration request message to the determined at least one processing node, where the migration request message carries the virtual node information to be migrated.
步骤 204、 接收确定的至少一个处理节点的迁移请求响应消息。  Step 204: Receive a migration request response message of the determined at least one processing node.
上述确定的至少一个处理节点接收到上述迁移请求消息后, 向上述 第一处理节点反馈一个迁移请求响应消息。  After receiving the foregoing migration request message, the at least one determined processing node feeds back a migration request response message to the first processing node.
步骤 205、 若迁移请求响应消息为成功响应消息, 则将分布在第一处 理节点上的至少一个虚拟节点迁移到分布式处理系统中负载小于该平均 负载的至少一个处理节点上。  Step 205: If the migration request response message is a success response message, at least one virtual node distributed on the first processing node is migrated to at least one processing node in the distributed processing system whose load is less than the average load.
举例来说, 迁移请求响应消息为失败响应消 , 的情况可以是上述确 定的至少一个处理节点的欠载总量小于上述待迁移的至少一个虚拟节点 的负载总量。  For example, the migration request response message is a failure response cancellation, and the foregoing may determine that the total underload of the at least one processing node determined by the foregoing is smaller than the total load of the at least one virtual node to be migrated.
本实施例提供的负载均衡处理方法, 首先根据各处理节点的负载信 息, 确定至少一个处理节点, 再向该至少一个处理节点发送迁移请求消 息, 若迁移请求响应消息为成功响应消息, 则将分布在第一处理节点上 的至少一个虚拟节点迁移到分布式处理系统中负载小于该平均负载的至 少一个处理节点上, 可以使分布式处理系统中的处理节点在负载的分配 上更加均衡, 增强分布式处理系统的并行处理能力, 提高分布式处理系 统的效率。 The load balancing processing method provided in this embodiment firstly is based on the load signal of each processing node. And determining, by the at least one processing node, sending a migration request message to the at least one processing node, and if the migration request response message is a success response message, migrating the at least one virtual node distributed on the first processing node to the distributed processing system The at least one processing node with a medium load less than the average load can make the processing nodes in the distributed processing system more balanced in load distribution, enhance the parallel processing capability of the distributed processing system, and improve the efficiency of the distributed processing system.
在图 1和图 2对应的实施例的基础上, 进一步地, 将分布在第一处理 节点上的至少一个虚拟节点迁移到分布式处理系统中负载小于平均负载 的至少一个处理节点上, 包括:  On the basis of the corresponding embodiments of FIG. 1 and FIG. 2, further, the at least one virtual node distributed on the first processing node is migrated to the at least one processing node in the distributed processing system where the load is less than the average load, including:
更新第一处理节点与至少一个虚拟节点之间的映射关系表。  Updating a mapping relationship table between the first processing node and the at least one virtual node.
向分布式处理系统中的其他处理节点发送更新信息, 以使分布式处 理系统中的其他处理节点根据更新信息更新本地存储的处理节点与虚拟 节点之间的映射关系表。  The update information is sent to other processing nodes in the distributed processing system to cause other processing nodes in the distributed processing system to update the mapping table between the locally stored processing nodes and the virtual nodes based on the update information.
具体来说, 上述将分布在第一处理节点上的至少一个虚拟节点迁移 到分布式处理系统中负载小于平均负载的至少一个处理节点上的操作的 一种实现方式为: 上述第一处理节点或主控中心根据上述至少一个虚拟 节点的信息更新第一处理节点与上述至少一个虚拟节点之间的映射关系 表, 映射关系表例如可以如表 1所示:  Specifically, one implementation manner of migrating at least one virtual node distributed on the first processing node to at least one processing node whose load is less than the average load in the distributed processing system is: the foregoing first processing node or The master control center updates the mapping relationship table between the first processing node and the at least one virtual node according to the information of the at least one virtual node, and the mapping relationship table can be, for example, as shown in Table 1:
表 1  Table 1
Figure imgf000012_0001
Figure imgf000012_0001
举例来说, 若处理节点 A的过载量为 50, 分布在处理节点 A上的一 个虚拟节点 A1的负载为 50, 分布式处理系统中另一个处理节点 B的欠载 量为 50, 则将虚拟节点 A1迁移到处理节点 B上, 则更新后的映射关系表 如表 2所示:  For example, if the overload of processing node A is 50, the load of one virtual node A1 distributed on processing node A is 50, and the load of another processing node B in the distributed processing system is 50, it will be virtual. Node A1 is migrated to processing node B, and the updated mapping table is as shown in Table 2:
表 2  Table 2
处理节点 A 虚拟节点 A2(范围), 处理节点 B 虚拟节点 A1 (范围), 虚拟节点 B1 (范围), 虚拟节点 B2(范围), ...... Processing node A virtual node A2 (range), processing node B virtual node A1 (range), virtual node B1 (range), virtual node B2 (range), ......
处理节点 C 虚拟节点 C1 (范围), 虚拟节点 C2(范围), ...... 上述第一处理节点或主控中心根据上述至少一个虚拟节点的信息更 新第一处理节点与上述至少一个虚拟节点之间的映射关系表之后, 会向 分布式处理系统中的其他处理节点发送更新信息, 该更新信息中可以包 括更新后的映射关系表, 分布式处理系统中的其他处理节点根据所述更 新信息更新本地存储的处理节点与虚拟节点之间的映射关系表。  Processing node C virtual node C1 (range), virtual node C2 (range), ... the first processing node or the master control center updates the first processing node and the at least one virtual node according to the information of the at least one virtual node After the mapping table between the nodes, the update information is sent to other processing nodes in the distributed processing system, and the updated information may include an updated mapping relationship table, and other processing nodes in the distributed processing system are updated according to the The information updates the mapping table between the locally stored processing node and the virtual node.
本实施例提供的负载均衡处理方法, 通过更新第一处理节点与至少 一个虚拟节点的映射关系表, 并向分布式处理系统中的其他处理节点发 送更新信息, 以使分布式处理系统中的其他处理节点根据更新信息更新 本地存储的处理节点与虚拟节点之间的映射关系表的方式实现分布式系 统中将负载大于平均负载的处理节点上的至少一个虚拟节点迁移到分布 式处理系统中负载小于平均负载的至少一个处理节点上, 实现分布式处 理系统中的处理节点在负载的分配上更加均衡, 增强分布式处理系统的 并行处理能力, 提高分布式处理系统的效率。  The load balancing processing method provided in this embodiment updates the mapping relationship table between the first processing node and the at least one virtual node, and sends update information to other processing nodes in the distributed processing system, so as to enable other in the distributed processing system. The processing node updates the mapping table between the locally stored processing node and the virtual node according to the update information, so that at least one virtual node on the processing node with a load greater than the average load is migrated to the distributed processing system in the distributed system, and the load is less than At least one processing node of the average load realizes that the processing nodes in the distributed processing system are more balanced in load distribution, enhance the parallel processing capability of the distributed processing system, and improve the efficiency of the distributed processing system.
在图 1对应的实施例的基础上, 进一步地, 将分布在第一处理节点上 的至少一个虚拟节点迁移到分布式处理系统中负载小于平均负载的至少 一个处理节点上之后, 还包括:  On the basis of the embodiment corresponding to FIG. 1, after the at least one virtual node that is distributed on the first processing node is migrated to the at least one processing node whose load is less than the average load in the distributed processing system, the method further includes:
将该至少一个虚拟节点对应的数据同步到至少一个处理节点上。  Synchronizing data corresponding to the at least one virtual node to at least one processing node.
具体来说, 若处理节点 A的过载量为 50, 分布在处理节点 A上的一 个虚拟节点 A1的负载为 50, 分布式处理系统中另一个处理节点 B的欠载 量为 50, 将虚拟节点 A1迁移到处理节点 B上之后, 将分布在处理节点 A 的 A1对应的数据同步到处理节点 B上, 若虚拟节点 A1接收到的处理请 求为读操作, 则将 A1对应的数据同步到处理节点 B后, 处理节点 B也可 以处理上述读操作处理请求; 若虚拟节点 A1 接收到的处理请求为写操 作, 则处理节点 B也可以处理该写操作进行, 针对分布在处理节点 A上 的虚拟节点 A1存储有热门资源, 而导致处理节点 A负载过大的情况, 则 将分布在处理节点 A上的虚拟节点 A1迁移到处理节点 B上, 并由处理节 点 B来处理该请求。 本实施例提供的负载均衡处理方法, 通过在虚拟节点迁移之后将该 虚拟节点在第一处理节点上对应的数据同步到至少一个处理节点上, 在 一些处理节点存储有热门资源的情况下, 仍然可以使分布式处理系统中 的处理节点在负载的分配上更加均衡, 增强分布式处理系统的并行处理 能力, 提高分布式处理系统的效率。 Specifically, if the overload amount of the processing node A is 50, the load of one virtual node A1 distributed on the processing node A is 50, and the load of another processing node B in the distributed processing system is 50, the virtual node is After A1 is migrated to the processing node B, the data corresponding to A1 distributed in the processing node A is synchronized to the processing node B. If the processing request received by the virtual node A1 is a read operation, the data corresponding to A1 is synchronized to the processing node. After B, the processing node B can also process the above read operation processing request; if the processing request received by the virtual node A1 is a write operation, the processing node B can also process the write operation for the virtual node distributed on the processing node A. If A1 stores hot resources and causes the processing node A to be overloaded, the virtual node A1 distributed on the processing node A is migrated to the processing node B, and the processing node B processes the request. The load balancing processing method provided in this embodiment synchronizes the data corresponding to the virtual node on the first processing node to the at least one processing node after the virtual node is migrated, and in the case that some processing nodes store the hot resources, The processing nodes in the distributed processing system can be more balanced in load distribution, enhance the parallel processing capability of the distributed processing system, and improve the efficiency of the distributed processing system.
图 3为本发明提供的负载均衡处理方法实施例三的流程图, 如图 3所 示, 本实施例中负载均衡处理方法包括:  FIG. 3 is a flowchart of a third embodiment of a load balancing processing method according to the present invention. As shown in FIG. 3, the load balancing processing method in this embodiment includes:
步骤 301、 定时器到时。  Step 301: The timer expires.
上述定时器可以设置在主处理节点或主控中心上, 主处理节点由分 布式处理系统中的各处理节点通过 pasox等一致性算法选举, 具体描述请 见实施例一。  The above-mentioned timers can be set on the main processing node or the main control center. The main processing nodes are elected by the processing nodes in the distributed processing system through a consistency algorithm such as pasox. For details, see Embodiment 1.
步骤 302、 主处理节点将其负载信息发送分布式处理系统中其他处理 节点。  Step 302: The main processing node sends its load information to other processing nodes in the distributed processing system.
步骤 303、 分布式处理系统中其他处理节点将自身的负载信息发送给 主处理节点。  Step 303: The other processing nodes in the distributed processing system send their own load information to the primary processing node.
步骤 304、 主处理节点向分布式处理系统中其他处理节点广播所有处 理节点的负载信息。  Step 304: The main processing node broadcasts load information of all processing nodes to other processing nodes in the distributed processing system.
步骤 305、 每个处理节点根据接收到的负载信息计算分布式处理系统 的平均负载, 将自身负载和平均负载进行比较, 判断是否需要迁移负 载。  Step 305: Each processing node calculates an average load of the distributed processing system according to the received load information, compares the self load and the average load, and determines whether the load needs to be migrated.
本实施例中, 处理节点 A的负载大于平均负载, 处理节点 A的负载 超过平均负载的负载量称为处理节点 A 的过载量, 预先设置阈值, 当过 载量大于上述阈值时, 才进行负载迁移。  In this embodiment, the load of the processing node A is greater than the average load, and the load of the processing node A exceeds the average load is called the overload amount of the processing node A, and the threshold is set in advance. When the overload amount is greater than the threshold, the load migration is performed. .
步骤 306、 处理节点 A根据各处理节点的负载信息, 确定至少一个虚 拟节点和欠载总量大于等于待迁移虚拟节点负载总量的至少一个处理节 点。  Step 306: The processing node A determines, according to the load information of each processing node, at least one virtual node and at least one processing node whose total underload is greater than or equal to the total load of the virtual node to be migrated.
具体来说, 若上述至少一个虚拟节点为一个虚拟节点, 则上述负载 总量即该一个虚拟节点的负载量, 若上述至少一个虚拟节点是多个虚拟 节点, 则上述负载总量就是多个虚拟节点的负载之和, 同样的, 若上述 至少一个处理节点为一个处理节点, 则上述欠载总量为该一个处理节点 的负载低于平均负载的负载量, 若上述至少一个处理节点为多个处理节 点, 则上述欠载总量为至少一个处理节点中的每个处理节点的负载低于 平均负载的负载量之和。 Specifically, if the at least one virtual node is a virtual node, the total load is the load of the one virtual node, and if the at least one virtual node is a plurality of virtual nodes, the total load is multiple virtual The sum of the loads of the nodes. Similarly, if the at least one processing node is a processing node, the total amount of the underload is the one processing node. The load is lower than the load of the average load. If the at least one processing node is a plurality of processing nodes, the total amount of underload is the sum of the load of each processing node of the at least one processing node being lower than the average load. .
本实施例中, 处理节点 B 的负载小于平均负载, 且其欠载量大于等 于待迁移虚拟节点的负载总量, 分布在处理节点 A上的虚拟节点 A1的负 载量小于处理节点 A的过载量。  In this embodiment, the load of the processing node B is less than the average load, and the underload amount is greater than or equal to the total load of the virtual node to be migrated, and the load of the virtual node A1 distributed on the processing node A is smaller than the overload of the processing node A. .
步骤 307、 处理节点 A向处理节点 B发送迁移请求消息。  Step 307: The processing node A sends a migration request message to the processing node B.
上述迁移消息携带虚拟节点 A1的负载信息。  The above migration message carries the load information of the virtual node A1.
步骤 308、 处理节点 B向处理节点 A发送迁移请求响应消息。  Step 308: The processing node B sends a migration request response message to the processing node A.
若处理节点 B的欠载量大于等于虚拟节点 A1的负载量, 处理节点 B 向处理节点 A发送迁移请求响应消息。  If the underload of the processing node B is greater than or equal to the load of the virtual node A1, the processing node B sends a migration request response message to the processing node A.
步骤 309、 处理节点 A更新虚拟节点 A1 和处理节点 A的映射关系 表。  Step 309: The processing node A updates the mapping relationship table between the virtual node A1 and the processing node A.
处理节点 A将迁移前的 A1-A更新为迁移后的 Al-B。  Processing node A updates the pre-migration A1-A to the migrated Al-B.
步骤 310、 处理节点 B更新虚拟节点 A1 和处理节点 B 的映射关系 表。  Step 310: The processing node B updates the mapping relationship table between the virtual node A1 and the processing node B.
步骤 311、 处理节点 A向所述分布式处理系统中的其他处理节点发送 更新信息。  Step 311: The processing node A sends update information to other processing nodes in the distributed processing system.
步骤 312、 分布式处理系统中的其他处理节点根据更新信息更新本地 存储的处理节点与虚拟节点之间的映射关系表。  Step 312: The other processing nodes in the distributed processing system update the mapping table between the locally stored processing node and the virtual node according to the update information.
本实施例提供的负载均衡处理方法, 通过更新第一处理节点与分布 在该第一处理节点上的虚拟节点的映射关系表以及该确定的至少一个处 理节点与分布在该确定的至少一个处理节点上的虚拟节点的映射关系表 的方式实现分布式系统中将分布在负载大于平均负载的处理节点上的至 少一个虚拟节点迁移到分布式处理系统中负载小于平均负载的至少一个 处理节点上, 可以使分布式处理系统中的处理节点在负载的分配上更加 均衡, 增强分布式处理系统的并行处理能力, 提高分布式处理系统的效 率。  The load balancing processing method provided by the embodiment, by updating a mapping relationship table between the first processing node and the virtual node distributed on the first processing node, and the determined at least one processing node and the at least one processing node distributed in the determining The mapping manner of the virtual node on the virtual node is implemented in the distributed system to migrate at least one virtual node distributed on the processing node with a load greater than the average load to at least one processing node in the distributed processing system with a load less than the average load, The processing nodes in the distributed processing system are more balanced in load distribution, enhance the parallel processing capability of the distributed processing system, and improve the efficiency of the distributed processing system.
图 4为本发明提供的负载均衡处理装置实施例一的结构示意图, 如图 4 所示, 本实施例提供的负载均衡处理装置包括获取模块 41 和处理模块 42 , 其中, 获取模块 41 用于获取分布式处理系统中的第一处理节点的第 一负载以及分布式处理系统的平均负载, 处理模块 42用于若第一负载大 于平均负载, 则将第一处理节点对应的至少一个虚拟节点迁移到分布式 处理系统中负载小于平均负载的至少一个处理节点上。 4 is a schematic structural diagram of Embodiment 1 of a load balancing processing apparatus according to the present invention. As shown in FIG. 4, the load balancing processing apparatus provided in this embodiment includes an obtaining module 41 and a processing module. 42 . The obtaining module 41 is configured to acquire a first load of the first processing node in the distributed processing system and an average load of the distributed processing system, and the processing module 42 is configured to: if the first load is greater than the average load, the first The at least one virtual node corresponding to the processing node is migrated to at least one processing node in the distributed processing system whose load is less than the average load.
本实施例的装置, 可以用于执行图 1所示方法实施例的技术方案, 其 实现原理和技术效果类似, 此处不再赘述。  The device in this embodiment may be used to implement the technical solution of the method embodiment shown in FIG. 1. The implementation principle and technical effects are similar, and details are not described herein again.
可选地, 处理模块 42具体用于将分布在第一处理节点上负载总量小 于等于过载量的至少一个虚拟节点迁移到分布式处理系统中欠载总量大 于等于负载总量的至少一个处理节点上, 过载量为第一负载超过平均负 载的负载量, 欠载总量为至少一个处理节点中的每个处理节点的负载低 于平均负载的负载量之和。  Optionally, the processing module 42 is configured to migrate at least one virtual node that is distributed on the first processing node with a total load less than or equal to the overload amount to at least one processing in the distributed processing system, where the total amount of underload is greater than or equal to the total amount of the load. On the node, the overload is the load of the first load exceeding the average load, and the total amount of the underload is the sum of the load of each processing node of the at least one processing node being lower than the load of the average load.
具体来说, 若上述至少一个虚拟节点为一个虚拟节点, 则上述负载 总量即该一个虚拟节点的负载量, 若上述至少一个虚拟节点是多个虚拟 节点, 则上述负载总量就是多个虚拟节点的负载之和, 同样的, 若上述 至少一个处理节点为一个处理节点, 则上述欠载总量为该一个处理节点 的负载低于平均负载的负载量, 若上述至少一个处理节点为多个处理节 点, 则上述欠载总量为至少一个处理节点中的每个处理节点的负载低于 平均负载的负载量之和。  Specifically, if the at least one virtual node is a virtual node, the total load is the load of the one virtual node, and if the at least one virtual node is a plurality of virtual nodes, the total load is multiple virtual The sum of the load of the node. Similarly, if the at least one processing node is a processing node, the total amount of the underload is a load of the one processing node that is lower than the average load, if the at least one processing node is multiple Processing the node, the total amount of underload is the sum of the load of each processing node in the at least one processing node being lower than the load of the average load.
图 5为本发明提供的负载均衡处理装置实施例二的结构示意图, 如图 5 所示, 本实施例提供的负载均衡处理装置, 在图 4 所示实施例的基础 上, 进一步地, 还包括确定模块 43、 发送模块 44、 接收模块 45 , 其中, 获取模块 41 还用于获取所述分布式处理系统中各处理节点的负载信息, 所述负载信息包括分布在所述各处理节点上的各虚拟节点的负载信息, 确定模块 43 用于根据各处理节点的负载信息, 确定至少一个处理节点, 发送模块 44用于向所述至少一个处理节点发送迁移请求消息, 所述迁移 请求消息携带所述至少一个虚拟节点的信息, 接收模块 45 用于接收至少 一个处理节点根据迁移请求消息反馈的迁移请求响应消息, 处理模块 42 具体用于若所述迁移请求响应消息为成功响应消息, 则将分布在所述第 一处理节点上的至少一个虚拟节点迁移到所述至少一个处理节点上。  FIG. 5 is a schematic structural diagram of a second embodiment of a load balancing processing apparatus according to the present invention. As shown in FIG. 5, the load balancing processing apparatus provided in this embodiment, based on the embodiment shown in FIG. 4, further includes a determining module 43, a sending module 44, and a receiving module 45, wherein the obtaining module 41 is further configured to acquire load information of each processing node in the distributed processing system, where the load information includes each distributed on each processing node The load information of the virtual node, the determining module 43 is configured to determine at least one processing node according to the load information of each processing node, and the sending module 44 is configured to send a migration request message to the at least one processing node, where the migration request message carries the The information of the at least one virtual node, the receiving module 45 is configured to receive the migration request response message that is sent by the processing node according to the migration request message, and the processing module 42 is specifically configured to: if the migration request response message is a success response message, At least one virtual node on the first processing node To at least one processing node.
本实施例的装置, 可以用于执行图 2所示方法实施例的技术方案, 其 实现原理和技术效果类似, 此处不再赘述。 The device of this embodiment may be used to implement the technical solution of the method embodiment shown in FIG. 2, The implementation principle is similar to the technical effect, and will not be described here.
图 6为本发明提供的负载均衡处理装置实施例三的结构示意图, 如图 6 所示, 本实施例提供的负载均衡处理装置, 在图 5 所示实施例的基础 上, 进一步地, 还包括: 更新模块 46更新模块 46用于更新所述第一处理 节点与所述至少一个虚拟节点之间的映射关系表, 上述发送模块 44还用 于向所述分布式处理系统中的其他处理节点发送更新信息, 以使所述分 布式处理系统中的其他处理节点根据所述更新信息更新本地存储的处理 节点与虚拟节点之间的映射关系表。  FIG. 6 is a schematic structural diagram of a third embodiment of a load balancing processing apparatus according to the present invention. As shown in FIG. 6, the load balancing processing apparatus provided in this embodiment, based on the embodiment shown in FIG. 5, further includes The update module 46 is configured to update a mapping relationship table between the first processing node and the at least one virtual node, where the sending module 44 is further configured to send to other processing nodes in the distributed processing system. The information is updated such that other processing nodes in the distributed processing system update the mapping table between the locally stored processing node and the virtual node according to the update information.
本实施例的装置, 可以用于执行图 3所示方法实施例的技术方案, 其 实现原理和技术效果类似, 此处不再赘述。  The device in this embodiment may be used to implement the technical solution of the method embodiment shown in FIG. 3, and the implementation principle and the technical effect are similar, and details are not described herein again.
图 7为本发明提供的负载均衡处理装置实施例四的结构示意图, 如图 7 所示, 本实施例提供的负载均衡处理装置, 在图 6 所示实施例的基础 上, 进一步地, 还包括同步模块 47, , 同步单元 47用于将所述至少一个 虚拟节点对应的数据同步到所述至少一个处理节点上。  FIG. 7 is a schematic structural diagram of Embodiment 4 of a load balancing processing apparatus according to the present invention. As shown in FIG. 7, the load balancing processing apparatus provided in this embodiment, based on the embodiment shown in FIG. 6, further includes The synchronization module 47, the synchronization unit 47 is configured to synchronize data corresponding to the at least one virtual node to the at least one processing node.
可选地, 本发明实施例提供的负载均衡处理装置可以是处理节点或 者主控中心。  Optionally, the load balancing processing apparatus provided by the embodiment of the present invention may be a processing node or a master control center.
具体来说, 负载均衡处理装置为处理节点的情况可以包括: 分布式 处理系统中任一处理节点均可对分布式处理系统进行负载均衡处理或者 由分布式处理系统中的一个主处理节点来对分布式处理系统进行负载均 衡处理。  Specifically, the case where the load balancing processing device is a processing node may include: any processing node in the distributed processing system may perform load balancing processing on the distributed processing system or may be performed by a primary processing node in the distributed processing system. The distributed processing system performs load balancing processing.
针对本发明实施例提供的负载均衡处理装置为主控中心的情况, 可 以在分布式处理系统中设置一个主控中心用来对分布式处理系统进行负 载均衡处理。  For the case where the load balancing processing device provided by the embodiment of the present invention is the main control center, a main control center may be set in the distributed processing system for performing load balancing processing on the distributed processing system.
图 8为本发明提供的处理节点实施例一的结构示意图, 如图 8所示, 本实施例提供的处理节点包括: 至少一个处理器 801 , 至少一个网络接口 804或者其他用户接口 803 , 存储器 805 , 和至少一通信总线 802。 该负载 均衡处理装置可选的包含用户接口 803 , 包括显示器, 键盘或者点击设 备。 存储器 805可能包含高速 RAM存储器, 也可能还包括非不稳定的存 储器 ( non- volatile memory ) , 例如至少一个磁盘存储器。 存储器 805可 选的可以包含至少一个位于远离前述负载均衡处理装置的存储装置。 存 储器 805存储了执行指令, 当负载均衡处理装置运行时, 处理器 801与存 储器 805之间通信, 处理器 801执行执行指令使得负载均衡处理装置可以 执行上述的方法实施例。 操作系统 806, 包含各种程序, 用于实现各种基 础业务以及处理基于硬件的任务。 FIG. 8 is a schematic structural diagram of Embodiment 1 of a processing node according to the present invention. As shown in FIG. 8, the processing node provided in this embodiment includes: at least one processor 801, at least one network interface 804 or other user interface 803, and a memory 805. And at least one communication bus 802. The load balancing processing device optionally includes a user interface 803 including a display, a keyboard or a pointing device. The memory 805 may include a high speed RAM memory and may also include a non-volatile memory such as at least one disk memory. The memory 805 can optionally include at least one storage device located remotely from the load balancing processing device. Save The memory 805 stores execution instructions. When the load balancing processing device is in operation, the processor 801 communicates with the memory 805, and the processor 801 executes the execution instructions so that the load balancing processing device can execute the above-described method embodiments. Operating system 806, which includes various programs for implementing various basic services and processing hardware-based tasks.
本发明实施例提供的处理节点, 可以执行负载均衡处理方法的实施 例的技术方案, 其实现原理和技术效果类似, 此处不再赘述。 图 9为本发明提供的主控中心实施例一的结构示意图, 如图 9所示, 本实施例提供的主控中心包括: 至少一个处理器 901 , 至少一个网络接口 904或者其他用户接口 903 , 存储器 905 , 和至少一通信总线 902。 该负载 均衡处理装置可选的包含用户接口 903 , 包括显示器, 键盘或者点击设 备。 存储器 905可能包含高速 RAM存储器, 也可能还包括非不稳定的存 储器 ( non- volatile memory ) , 例如至少一个磁盘存储器。 存储器 905可 选的可以包含至少一个位于远离前述负载均衡处理装置的存储装置。 存 储器 905存储了执行指令, 当负载均衡处理装置运行时, 处理器 901与存 储器 905之间通信, 处理器 901执行执行指令使得负载均衡处理装置可以 执行上述的方法实施例。 操作系统 906, 包含各种程序, 用于实现各种基 础业务以及处理基于硬件的任务。  The processing node provided by the embodiment of the present invention may perform the technical solution of the embodiment of the load balancing processing method, and the implementation principle and the technical effect thereof are similar, and details are not described herein again. FIG. 9 is a schematic structural diagram of Embodiment 1 of a main control center according to the present invention. As shown in FIG. 9, the main control center provided in this embodiment includes: at least one processor 901, at least one network interface 904, or another user interface 903. A memory 905, and at least one communication bus 902. The load balancing processing device optionally includes a user interface 903 including a display, a keyboard or a pointing device. Memory 905 may contain high speed RAM memory and may also include non-volatile memory, such as at least one disk memory. The memory 905 can optionally include at least one storage device located remotely from the load balancing processing device. The memory 905 stores execution instructions. When the load balancing processing device operates, the processor 901 communicates with the memory 905, and the processor 901 executes the execution instructions so that the load balancing processing device can execute the above-described method embodiments. Operating system 906, which contains various programs for implementing various basic services and handling hardware-based tasks.
本发明实施例提供的主控中心, 可以执行负载均衡处理方法的实施 例的技术方案, 其实现原理和技术效果类似, 此处不再赘述。  The main control center provided by the embodiment of the present invention can perform the technical solution of the embodiment of the load balancing processing method, and the implementation principle and the technical effect are similar, and details are not described herein again.
图 10为本发明提供的分布式处理系统实施例一的结构示意图, 如图 FIG. 10 is a schematic structural diagram of Embodiment 1 of a distributed processing system according to the present invention, as shown in FIG.
10所示, 本实施例的分布式处理系统, 包括至少两个处理节点 1000, 处 理节点 1000可以采用图 4〜图 8任一装置实施例的结构, 其对应地, 任意 一个处理节点 1000可以执行负载均衡处理方法的实施例的技术方案, 其 实现原理和技术效果类似, 此处不再赘述。 10, the distributed processing system of this embodiment includes at least two processing nodes 1000, and the processing node 1000 can adopt the structure of any device embodiment of FIG. 4 to FIG. 8, correspondingly, any one of the processing nodes 1000 can execute The technical solution of the embodiment of the load balancing processing method is similar to the technical solution, and details are not described herein again.
图 11 为本发明提供的分布式处理系统实施例二的结构示意图, 如图 FIG. 11 is a schematic structural diagram of Embodiment 2 of a distributed processing system according to the present invention, as shown in FIG.
1 1所示, 本实施例的分布式处理系统, 包括至少两个处理节点 1010以及 主控中心 1020, 处理节点 1010可以采用现有技术中的处理节点的结构, 主控中心 1020可以采用图 4〜图 8任一装置实施例的结构, 其对应地, 可 以执行负载均衡处理方法的实施例的技术方案, 其实现原理和技术效果 类似, 此处不再赘述。 本发明实施例还提供一种分布式处理系统, 包括至少两个如图 8所示 实施例中的处理节点。 As shown in FIG. 1 , the distributed processing system of the present embodiment includes at least two processing nodes 1010 and a main control center 1020. The processing node 1010 can adopt the structure of the processing node in the prior art, and the main control center 1020 can adopt FIG. The configuration of the device embodiment of FIG. 8 is correspondingly configured to implement the technical solution of the embodiment of the load balancing processing method. The implementation principle and technical effects are similar, and details are not described herein again. The embodiment of the present invention further provides a distributed processing system, including at least two processing nodes in the embodiment shown in FIG.
本发明实施例又提供一种分布式处理系统, 包括两个处理节点以及 如图 9所示实施例中的主控中心。  The embodiment of the present invention further provides a distributed processing system, which includes two processing nodes and a main control center in the embodiment shown in FIG.
本发明实施例还提供一种计算机可读介质, 包含计算机执行指令, 该计算机执行指令可以用于使上述实施例中任意一种处理节点执行上述 负载均衡处理方法。  The embodiment of the invention further provides a computer readable medium, comprising computer execution instructions, wherein the computer execution instructions are used to enable any one of the processing nodes in the above embodiments to execute the load balancing processing method.
本发明实施例又提供一种计算机可读介质, 包含计算机执行指令, 该计算机执行指令可以用于使上述实施例中任意一种主控中心执行上述 负载均衡处理方法。  The embodiment of the present invention further provides a computer readable medium, comprising computer execution instructions, wherein the computer execution instructions may be used to enable any one of the above-mentioned embodiments to execute the load balancing processing method.
本领域普通技术人员可以理解: 实现上述方法实施例的全部或部分 步骤可以通过程序指令相关的硬件来完成, 前述的程序可以存储于一计 算机可读介质中, 该程序在执行时, 执行包括上述方法实施例的步骤; 而前述的计算机可读介质包括: ROM、 RAM, 磁碟或者光盘等各种可以 存储程序代码的介质。  It will be understood by those skilled in the art that all or part of the steps of implementing the above method embodiments may be performed by hardware related to program instructions. The foregoing program may be stored in a computer readable medium, and when executed, the program includes the above The steps of the method embodiments; and the aforementioned computer readable medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
最后应说明的是: 以上实施例仅用以说明本发明的技术方案, 而非 对其限制; 尽管参照前述实施例对本发明进行了详细的说明, 本领域的 普通技术人员应当理解: 其依然可以对前述各实施例所记载的技术方案 进行修改, 或者对其中部分技术特征进行等同替换; 而这些修改或者替 换, 并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和 范围。  It should be noted that the above embodiments are only for explaining the technical solutions of the present invention, and are not intended to be limiting; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those skilled in the art that: The technical solutions described in the foregoing embodiments are modified, or some of the technical features are equivalently replaced. The modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

权 利 要 求 书 Claim
1、 一种负载均衡处理方法, 其特征在于, 包括:  A load balancing processing method, comprising:
获取分布式处理系统中的第一处理节点的第一负载以及所述分布式 处理系统中所有处理节点的平均负载;  Obtaining a first load of a first processing node in the distributed processing system and an average load of all processing nodes in the distributed processing system;
若所述第一负载大于所述平均负载, 则将分布在所述第一处理节点 上的至少一个虚拟节点迁移到所述分布式处理系统中负载小于所述平均 负载的至少一个处理节点上。  And if the first load is greater than the average load, migrating at least one virtual node distributed on the first processing node to at least one processing node in the distributed processing system with a load less than the average load.
2、 根据权利要求 1所述的方法, 其特征在于, 所述将分布在所述第 一处理节点上的至少一个虚拟节点迁移到所述分布式处理系统中负载小 于所述平均负载的至少一个处理节点上, 包括:  2. The method according to claim 1, wherein the migrating at least one virtual node distributed on the first processing node to the distributed processing system is less than at least one load of the average load On the processing node, including:
将分布在所述第一处理节点上负载总量小于等于过载量的至少一个 虚拟节点迁移到所述分布式处理系统中欠载总量大于等于所述负载总量 的至少一个处理节点上, 所述过载量为所述第一负载超过所述平均负载 的负载量, 所述欠载总量为所述至少一个处理节点中的每个处理节点的 负载低于所述平均负载的负载量之和。  Migrating at least one virtual node distributed on the first processing node with a total load less than or equal to an overload amount to at least one processing node in the distributed processing system, wherein the total amount of underload is greater than or equal to the total amount of the load, The overload amount is a load amount of the first load exceeding the average load, and the total amount of underload is a sum of load of each of the at least one processing node being lower than a load of the average load .
3、 根据权利要求 1或 2中任一项所述的方法, 其特征在于, 所述将 分布在所述第一处理节点上的至少一个虚拟节点迁移到所述分布式处理 系统中负载小于所述平均负载的至少一个处理节点上之前, 还包括: 获取所述分布式处理系统中各处理节点的负载信息, 所述负载信息 包括所述分布在各处理节点上的各虚拟节点的负载信息;  The method according to any one of claims 1 or 2, wherein the migration of at least one virtual node distributed on the first processing node to the distributed processing system is less than Before the at least one processing node of the average load, the method further includes: acquiring load information of each processing node in the distributed processing system, where the load information includes load information of each virtual node distributed on each processing node;
根据所述各处理节点的负载信息, 确定所述至少一个处理节点; 向所述至少一个处理节点发送迁移请求消息, 所述迁移请求消息携 带所述至少一个虚拟节点的信息;  Determining, according to load information of each processing node, the at least one processing node; sending, to the at least one processing node, a migration request message, where the migration request message carries information of the at least one virtual node;
接收所述至少一个处理节点的迁移请求响应消息;  Receiving a migration request response message of the at least one processing node;
所述将分布在所述第一处理节点上的至少一个虚拟节点迁移到所述 分布式处理系统中负载小于所述平均负载的至少一个处理节点上, 具体 为:  The at least one virtual node distributed on the first processing node is migrated to the at least one processing node in the distributed processing system where the load is less than the average load, specifically:
若所述迁移请求响应消息为成功响应消息, 则将分布在所述第一处 理节点上的所述至少一个虚拟节点迁移到所述至少一个处理节点上。  And if the migration request response message is a success response message, migrating the at least one virtual node distributed on the first processing node to the at least one processing node.
4、 根据权利要求 1或 2中任一项所述的方法, 其特征在于, 所述将 分布在所述第一处理节点上的至少一个虚拟节点迁移到所述分布式处理 系统中负载小于所述平均负载的至少一个处理节点上, 包括: The method according to any one of claims 1 or 2, wherein The at least one virtual node distributed on the first processing node is migrated to the at least one processing node in the distributed processing system where the load is less than the average load, including:
更新所述第一处理节点与所述至少一个虚拟节点之间的映射关系 表;  Updating a mapping relationship table between the first processing node and the at least one virtual node;
向所述分布式处理系统中的其他处理节点发送更新信息, 以使所述 分布式处理系统中的其他处理节点根据所述更新信息更新本地存储的处 理节点与虚拟节点之间的映射关系表。  The update information is sent to other processing nodes in the distributed processing system such that other processing nodes in the distributed processing system update the mapping table between the locally stored processing node and the virtual node based on the update information.
5、 根据权利要求 1或 2中任一项所述的方法, 其特征在于, 所述将 分布在所述第一处理节点上的至少一个虚拟节点迁移到所述分布式处理 系统中负载小于所述平均负载的至少一个处理节点上之后, 还包括: 将所述至少一个虚拟节点对应的数据同步到所述至少一个处理节点 上。  The method according to any one of claims 1 or 2, wherein the migration of at least one virtual node distributed on the first processing node to the distributed processing system is less than After the at least one processing node of the average load, the method further includes: synchronizing data corresponding to the at least one virtual node to the at least one processing node.
6、 一种负载均衡处理装置, 其特征在于, 包括:  6. A load balancing processing device, comprising:
获取模块, 用于获取分布式处理系统中的第一处理节点的第一负载 以及所述分布式处理系统中所有处理节点的平均负载;  An obtaining module, configured to acquire a first load of a first processing node in the distributed processing system and an average load of all processing nodes in the distributed processing system;
处理模块, 若所述第一负载大于所述平均负载, 则将分布在所述第 一处理节点上的至少一个虚拟节点迁移到所述分布式处理系统中负载小 于所述平均负载的至少一个处理节点上。  a processing module, if the first load is greater than the average load, migrating at least one virtual node distributed on the first processing node to at least one processing in the distributed processing system that has a load less than the average load On the node.
7、 根据权利要求 6所述的装置, 其特征在于, 所述处理模块, 具体 用于将分布在所述第一处理节点上负载总量小于等于过载量的至少一个 虚拟节点迁移到所述分布式处理系统中欠载总量大于等于所述负载总量 的至少一个处理节点上, 所述过载量为所述第一负载超过所述平均负载 的负载量, 所述欠载总量为所述至少一个处理节点中的每个处理节点的 负载低于所述平均负载的负载量之和。  The device according to claim 6, wherein the processing module is configured to migrate at least one virtual node distributed on the first processing node to a total amount of load less than or equal to an overload amount to the distribution In the processing system, the total amount of underload is greater than or equal to the total load of the at least one processing node, the overload amount is the load of the first load exceeding the average load, and the total amount of the underload is the The load of each of the at least one processing node is lower than the sum of the load of the average load.
8、 根据权利要求 6或 7中任一项所述的装置, 其特征在于, 还包括 确定模块、 发送模块和接收模块;  The device according to any one of claims 6 or 7, further comprising a determining module, a sending module and a receiving module;
所述获取模块, 还用于获取所述分布式处理系统中各处理节点的负 载信息, 所述负载信息包括分布在所述各处理节点上的各虚拟节点的负 载信息;  The acquiring module is further configured to acquire load information of each processing node in the distributed processing system, where the load information includes load information of each virtual node distributed on each processing node;
所述确定模块, 用于根据所述各处理节点的负载信息, 确定所述至 少一个处理节点; The determining module is configured to determine, according to load information of each processing node, the One less processing node;
所述发送模块, 用于向所述至少一个处理节点发送迁移请求消息, 所述迁移请求消息携带所述至少一个虚拟节点的信息;  The sending module is configured to send a migration request message to the at least one processing node, where the migration request message carries information of the at least one virtual node;
所述接收模块, 用于接收所述至少一个处理节点根据所述迁移请求 消息反馈的迁移请求响应消息;  The receiving module is configured to receive a migration request response message that is sent by the at least one processing node according to the migration request message;
所述处理模块具体用于若所述迁移请求响应消息为成功响应消息, 则将分布在所述第一处理节点上的至少一个虚拟节点迁移到所述至少一 个处理节点上。  The processing module is specifically configured to: if the migration request response message is a success response message, migrate at least one virtual node distributed on the first processing node to the at least one processing node.
9、 根据权利要求 6或 7中任一项所述的装置, 其特征在于, 还包 括:  The apparatus according to any one of claims 6 or 7, further comprising:
更新模块, 用于更新所述第一处理节点与所述至少一个虚拟节点之 间的映射关系表;  And an update module, configured to update a mapping relationship table between the first processing node and the at least one virtual node;
所述发送模块, 还用于向所述分布式处理系统中的其他处理节点发 送更新信息, 以使所述分布式处理系统中的其他处理节点根据所述更新 信息更新本地存储的处理节点与虚拟节点之间的映射关系表。  The sending module is further configured to send update information to other processing nodes in the distributed processing system, so that other processing nodes in the distributed processing system update the locally stored processing node and the virtual according to the update information. A mapping table between nodes.
10、 根据权利要求 6或 7中任一项所述的装置, 其特征在于, 还包 括:  10. Apparatus according to any one of claims 6 or 7 further comprising:
同步模块, 用于将所述至少一个虚拟节点对应数据同步到所述至少 一个处理节点上。  And a synchronization module, configured to synchronize the at least one virtual node corresponding data to the at least one processing node.
1 1、 根据权利要求 6或 7任一项所述的装置, 其特征在于, 所述装置 为处理节点或者主控中心。  The device according to any one of claims 6 or 7, wherein the device is a processing node or a master control center.
12、 一种处理节点, 其特征在于, 包括处理器和存储器, 所述存储 器存储执行指令, 当所述装置运行时, 所述处理器与所述存储器之间通 信, 所述处理器执行所述执行指令使得所述装置执行如权利要求 1至 5所 述的方法。  12. A processing node, comprising: a processor and a memory, the memory storing execution instructions, when the device is in operation, the processor is in communication with the memory, the processor executing the Executing the instructions causes the apparatus to perform the method of claims 1 to 5.
13、 一种主控中心, 其特征在于, 包括处理器和存储器, 所述存储 器存储执行指令, 当所述装置运行时, 所述处理器与所述存储器之间通 信, 所述处理器执行所述执行指令使得所述装置执行如权利要求 1至 5所 述的方法。  13. A master control center, comprising: a processor and a memory, wherein the memory stores execution instructions, when the device is in operation, the processor communicates with the memory, and the processor executes Executing the instructions causes the apparatus to perform the method of claims 1 to 5.
14、 一种分布式处理系统, 其特征在于, 包括: 至少两个如权利要 求 11所述的处理节点。 14. A distributed processing system, comprising: at least two Find the processing node described in 11.
15、 一种分布式处理系统, 其特征在于, 包括: 至少两个处理节点 以及如权利要求 11所述的主控中心。  A distributed processing system, comprising: at least two processing nodes and a master control center according to claim 11.
16、 一种分布式处理系统, 其特征在于, 包括至少两个如权利要求 12所述的处理节点。  16. A distributed processing system, comprising at least two processing nodes as claimed in claim 12.
17、 一种分布式处理系统, 其特征在于, 包括: 至少两个处理节点 以及如权利要求 13所述的主控中心。  A distributed processing system, comprising: at least two processing nodes and a master control center according to claim 13.
18、 一种计算机可读介质, 其特征在于, 包含计算机执行指令, 所 述计算机执行指令用于使处理节点执行权利要求 1至 5任一项所述的方 法。  18. A computer readable medium, comprising computer executed instructions for causing a processing node to perform the method of any one of claims 1 to 5.
19、 一种计算机可读介质, 其特征在于, 包含计算机执行指令, 所 述计算机执行指令用于使主控中心执行权利要求 1至 5任一项所述的方 法。  A computer readable medium, comprising: computer-executable instructions for causing a master control center to perform the method of any one of claims 1 to 5.
PCT/CN2012/082382 2012-09-28 2012-09-28 Load balancing method, device, system and computer readable medium WO2014047902A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2012/082382 WO2014047902A1 (en) 2012-09-28 2012-09-28 Load balancing method, device, system and computer readable medium
CN201280001746.3A CN103918239A (en) 2012-09-28 2012-09-28 Load balancing method, device, system and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2012/082382 WO2014047902A1 (en) 2012-09-28 2012-09-28 Load balancing method, device, system and computer readable medium

Publications (1)

Publication Number Publication Date
WO2014047902A1 true WO2014047902A1 (en) 2014-04-03

Family

ID=50386874

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/082382 WO2014047902A1 (en) 2012-09-28 2012-09-28 Load balancing method, device, system and computer readable medium

Country Status (2)

Country Link
CN (1) CN103918239A (en)
WO (1) WO2014047902A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106897116A (en) * 2017-02-27 2017-06-27 郑州云海信息技术有限公司 A kind of virtual machine migration method and device
CN109617989A (en) * 2018-12-28 2019-04-12 浙江省公众信息产业有限公司 For loading method, apparatus, system and the computer-readable medium of distribution

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104301243B (en) * 2014-09-22 2018-06-15 华为技术有限公司 A kind of load control method and device
CN104702691B (en) * 2015-03-13 2017-12-01 华为技术有限公司 Distributed load equalizing method and device
CN107656813A (en) * 2017-09-29 2018-02-02 上海联影医疗科技有限公司 The method, apparatus and terminal of a kind of load dispatch
CN110753372B (en) * 2018-07-24 2023-05-30 中兴通讯股份有限公司 Information processing method, device and storage medium in baseband processing separation architecture
CN110633151B (en) * 2019-09-20 2022-09-02 北京小米移动软件有限公司 Method, device and storage medium for balancing distributed message issuing cluster partitions
CN111580968B (en) * 2020-05-07 2023-04-18 广西大学 Medical cloud platform load automatic balancing method, system and medium based on fog computing
CN114666335B (en) * 2022-03-21 2023-06-02 北京计算机技术及应用研究所 Distributed system load balancing device based on data distribution service DDS

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101504620A (en) * 2009-03-03 2009-08-12 华为技术有限公司 Load balancing method, apparatus and system of virtual cluster system
CN101883113A (en) * 2010-06-25 2010-11-10 中兴通讯股份有限公司 Method and physical nodes for realizing overlay network load balance
WO2012121736A1 (en) * 2011-03-09 2012-09-13 Unisys Corporation Runtime virtual process creation for load sharing

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102480502B (en) * 2010-11-26 2014-10-01 联想(北京)有限公司 I/O load equilibrium method and I/O server

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101504620A (en) * 2009-03-03 2009-08-12 华为技术有限公司 Load balancing method, apparatus and system of virtual cluster system
CN101883113A (en) * 2010-06-25 2010-11-10 中兴通讯股份有限公司 Method and physical nodes for realizing overlay network load balance
WO2012121736A1 (en) * 2011-03-09 2012-09-13 Unisys Corporation Runtime virtual process creation for load sharing

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106897116A (en) * 2017-02-27 2017-06-27 郑州云海信息技术有限公司 A kind of virtual machine migration method and device
CN109617989A (en) * 2018-12-28 2019-04-12 浙江省公众信息产业有限公司 For loading method, apparatus, system and the computer-readable medium of distribution
CN109617989B (en) * 2018-12-28 2021-11-26 浙江省公众信息产业有限公司 Method, apparatus, system, and computer readable medium for load distribution

Also Published As

Publication number Publication date
CN103918239A (en) 2014-07-09

Similar Documents

Publication Publication Date Title
WO2014047902A1 (en) Load balancing method, device, system and computer readable medium
US9823842B2 (en) Gang migration of virtual machines using cluster-wide deduplication
CN110737442B (en) Edge application management method and system
US10013189B1 (en) Storage volume backup management for multi-tenant environments
TWI739804B (en) Data migration method and device
US11474874B2 (en) Systems and methods for auto-scaling a big data system
WO2015143983A1 (en) Method and apparatus for implementing acceleration processing on vnf
US11057471B2 (en) Edge application management method and system
US9489230B1 (en) Handling of virtual machine migration while performing clustering operations
US10552080B2 (en) Multi-target post-copy guest migration
JP2012528402A (en) Swarm-based synchronization over the object store network
WO2017092505A1 (en) Method, system and device for elastic scaling of virtual resources in cloud computing environment
US20100138540A1 (en) Method of managing organization of a computer system, computer system, and program for managing organization
US11809901B2 (en) Migrating the runtime state of a container between two nodes
US20150100826A1 (en) Fault domains on modern hardware
EP3039844B1 (en) System and method for supporting partition level journaling for synchronizing data in a distributed data grid
US20210081287A1 (en) Data service failover in shared storage clusters
Malik et al. An optimistic parallel simulation protocol for cloud computing environments
Singh et al. Survey on various load balancing techniques in cloud computing
WO2019153880A1 (en) Method for downloading mirror file in cluster, node, and query server
Malik et al. Optimistic synchronization of parallel simulations in cloud computing environments
JP5969315B2 (en) Data migration processing system and data migration processing method
CN105373563B (en) Database switching method and device
US20150365474A1 (en) Computer-readable recording medium, task assignment method, and task assignment apparatus
JP2013543169A (en) System including middleware machine environment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12885468

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12885468

Country of ref document: EP

Kind code of ref document: A1