CN108200218A - A kind of method, apparatus and electronic equipment for realizing load balancing - Google Patents

A kind of method, apparatus and electronic equipment for realizing load balancing Download PDF

Info

Publication number
CN108200218A
CN108200218A CN201810193187.XA CN201810193187A CN108200218A CN 108200218 A CN108200218 A CN 108200218A CN 201810193187 A CN201810193187 A CN 201810193187A CN 108200218 A CN108200218 A CN 108200218A
Authority
CN
China
Prior art keywords
server
data connection
reached
standard grade
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201810193187.XA
Other languages
Chinese (zh)
Other versions
CN108200218B (en
Inventor
陈后根
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201810193187.XA priority Critical patent/CN108200218B/en
Publication of CN108200218A publication Critical patent/CN108200218A/en
Application granted granted Critical
Publication of CN108200218B publication Critical patent/CN108200218B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1023Server selection for load balancing based on a hash applied to IP addresses or costs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1008Server selection for load balancing based on parameters of servers, e.g. available memory or workload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/148Migration or transfer of sessions

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer And Data Communications (AREA)

Abstract

An embodiment of the present invention provides a kind of method, apparatus and electronic equipment for realizing load balancing, belong to computer realm.The present invention is by receiving the login request message of server to be reached the standard grade, then the free time of the data connection in server cluster between each server and each client is obtained, then in data connection, determine that free time is more than the candidate data connection of predetermined threshold value, further according to preset migration strategy, target data connection is determined in candidate data connection, finally by target data connection migration to server to be reached the standard grade.It, can be in time by the load migration in servers other in server cluster to server to be reached the standard grade, so as to the load of balanced each server when the server reached the standard grade comes into operation using method provided by the invention.

Description

A kind of method, apparatus and electronic equipment for realizing load balancing
Technical field
The present invention relates to computer realm, more particularly to a kind of method, apparatus and electronic equipment for realizing load balancing.
Background technology
In network communications, multiple servers are generally comprised in server cluster, for the load of balanced each server, led to It often needs to use load equalizer.Load equalizer can be distributed to the network request of client available in server cluster On server, with the load of this balanced each server.
At present, typically when client and server establish data connection, load equalizer is calculated by preset scheduling Method (for example, polling dispatching algorithm and minimum connection dispatching algorithm), chooses the server for meeting the algorithm, then by client with The server establishes data connection.However, when the server for needing to be reached the standard grade in server cluster comes into operation, for example, in order to The total capacity of expansion service device cluster and when adding server or when the server of offline repair is reached the standard grade again, load balancing Device can not be by the load migration in servers other in server cluster to server to be reached the standard grade by existing dispatching algorithm In.
It during due to just coming into operation wait the server reached the standard grade, does not load in server to be reached the standard grade, particularly connects long It connects in scene, for example, in RPC (Remote Procedure Call, remote procedure call) connection scenes, causes to take in this way The load of each server does not reach balanced state in business device cluster.
Invention content
The embodiment of the present invention is designed to provide a kind of method, apparatus and electronic equipment for realizing load balancing, can be with In time by the load migration in servers other in server cluster to server to be reached the standard grade, so as to balanced each server Load.Specific technical solution is as follows:
In a first aspect, a kind of method for realizing load balancing is provided, the method includes:
Receive the login request message that server to be reached the standard grade is sent;
Obtain the free time of the data connection in server cluster between each server and each client;
In the data connection, determine that free time is more than the candidate data connection of predetermined threshold value;
According to preset migration strategy, target data connection is determined in candidate data connection;
By the target data connection migration to the server to be reached the standard grade.
Optionally, it is described according to preset migration strategy, target data connection, packet are determined in candidate data connection It includes:
The total number and the candidate data that the data connection of corresponding each server is connected according to the candidate data connect The total number of corresponding each server and server to be reached the standard grade is connect, calculates average data linking number;
Determine that the candidate data connects the target data connection in corresponding each server respectively, the target data connects The total number connect is equal to the average data linking number.
Optionally, it is described according to preset migration strategy, target data connection, packet are determined in candidate data connection It includes:
The total data flow that corresponding each server is connected according to the candidate data connects correspondence with the candidate data Each server and server to be reached the standard grade total number, calculate average data flow;
Determine that the candidate data connects the target data connection in corresponding each server respectively, the target data connects Corresponding total data flow is connect equal to the average data flow.
Optionally, it is described by after the target data connection migration to the server to be reached the standard grade, it further includes:
Corresponding client is connected to the target data and the server previously connected sends reconnection instruction, so that described Target data connects corresponding client and establishes data connection with the server to be reached the standard grade.
Optionally, it after the login request message for receiving server to be reached the standard grade, further includes:
Registration probe message is sent to the server to be reached the standard grade, is returned if receiving the server to be reached the standard grade Registration reply message, then perform the sky of data connection between each server and each client in the acquisition server cluster The step of between idle;
If not receiving the registration reply message that the server to be reached the standard grade returns, terminate this location registration process.
Second aspect, provides a kind of device for realizing load balancing, and described device includes:
Receiving module, for receiving the login request message that server to be reached the standard grade is sent;
Acquisition module, during for obtaining the free time of the data connection in server cluster between each server and each client Between;
First determining module, in the data connection, determining that free time is more than the candidate data of predetermined threshold value Connection;
Second determining module, for according to preset migration strategy, target data to be determined in candidate data connection Connection;
Transferring module, for by the target data connection migration to the server to be reached the standard grade.
Optionally, second determining module, including:
First computing module, for connecting the total number of the data connection of corresponding each server according to the candidate data The total number of corresponding each server and server to be reached the standard grade is connected with the candidate data, calculates average data connection number Mesh;
Third determining module connects for determining that the candidate data connects the target data in corresponding each server respectively It connects, the total number of the target data connection is equal to the average data linking number.
Optionally, second determining module, including:
First computing module, for connecting the total data flow of corresponding each server and described according to the candidate data Candidate data connects the total number of corresponding each server and server to be reached the standard grade, and calculates average data flow;
4th determining module connects for determining that the candidate data connects the target data in corresponding each server respectively It connects, the target data connects corresponding total data flow and is equal to the average data flow.
Optionally, the transferring module, is additionally operable to:
Corresponding client is connected to the target data and the server previously connected sends reconnection instruction, so that described Target data connects corresponding client and establishes data connection with the server to be reached the standard grade.
Optionally, the receiving module, is additionally operable to:
Registration probe message is sent to the server to be reached the standard grade, is returned if receiving the server to be reached the standard grade Registration reply message, then perform the sky of data connection between each server and each client in the acquisition server cluster The step of between idle;
If not receiving the registration reply message that the server to be reached the standard grade returns, terminate this location registration process.
The third aspect, provides a kind of electronic equipment, the electronic equipment include processor, communication interface, memory and Communication bus, wherein, the processor, the communication interface, the memory is completed mutual by the communication bus Communication;
The memory, for storing computer program;
The processor during for performing the program stored on the memory, is realized described in above-mentioned first aspect Any method and step for realizing load balancing.
Fourth aspect, in order to achieve the above object, the embodiment of the invention also discloses a kind of computer readable storage medium, The computer readable storage medium memory contains computer program, when the computer program is executed by processor, realizes such as The method and step of realization load balancing described in above-mentioned first aspect.
An embodiment of the present invention provides a kind of method, apparatus and electronic equipment for realizing load balancing, can receive and treat Then the login request message of the server of line obtains the data connection in server cluster between each server and each client Free time, then in data connection, determine that free time is more than the candidate data of predetermined threshold value and connects, further according to default Migration strategy, target data connection is determined in candidate data connection, finally by target data connection migration to be reached the standard grade Server.It, can be in time by server cluster when the server reached the standard grade comes into operation using method provided by the invention In load migration in other servers to server to be reached the standard grade, so as to the load of balanced each server.The embodiment of the present invention The method of offer can be adapted in long connection scene.Certainly, it implements any of the products of the present invention or method is not necessarily required to together When reach all the above advantage.
Description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, to embodiment or will show below There is attached drawing needed in technology description to be briefly described.
Fig. 1 is a kind of method flow diagram for realizing load balancing provided in an embodiment of the present invention;
Fig. 2 is a kind of apparatus structure schematic diagram for realizing load balancing provided in an embodiment of the present invention;
Fig. 3 is the structure diagram of a kind of electronic equipment provided in an embodiment of the present invention.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present invention, the technical solution in the embodiment of the present invention is described.
The embodiment of the invention discloses a kind of method, apparatus and electronic equipment for realizing load balancing, the embodiment of the present invention Executive agent can be load equalizer, be described in detail separately below.
As shown in FIG. 1, FIG. 1 is a kind of method flow diagram for realizing load balancing of the embodiment of the present invention, including walking as follows Suddenly:
Step 101, the login request message that server to be reached the standard grade is sent is received.
In force, technical staff can add service for the total capacity of expansion service device cluster in server cluster It after device or the offline repair of certain server, can reach the standard grade again, at this moment, these servers to be reached the standard grade can be to load equalizer Login request message is sent, the IP (Internet for the server for needing to be reached the standard grade can be carried in login request message Protocol, Internet protocol) information such as address and service port number.Load equalizer can receive server hair to be reached the standard grade The login request message sent, then parses login request message, obtains IP address and the service of server to be reached the standard grade The information such as port numbers.
Step 102, the free time of the data connection in server cluster between each server and each client is obtained.
Wherein, free time refers to that data connection is kept for connected state, and the period of non-transmission services data.
In force, the server in server cluster and client are before business data transmission is carried out, it usually needs Data connection is established by load equalizer and client.During data connection and business data transmission is established, load Balanced device has the function of transfer.After the completion of data connection foundation, server can send business datum to load equalizer, Then these business datums are transmitted to client by load equalizer.When there is no business to need to transmit between client and server When, the data connection originally established may remain in interior holding connected state of preset period, this period is properly termed as Free time.Load equalizer can obtain the number of the data connection between each server and each client in server cluster The free time of mesh and each data connection.
Step 103, in data connection, determine that free time is more than the candidate data connection of predetermined threshold value.
In force, the free time of each data connection can be compared by load equalizer with predetermined threshold value, obtain Free time is more than the data connection (being properly termed as candidate data connection) of predetermined threshold value.
Step 104, according to preset migration strategy, target data connection is determined in candidate data connection.
In force, migration strategy can be prestored in load equalizer, for example, preset according to data connection number Migration strategy, alternatively, according to the preset migration strategy of data traffic.Load equalizer can be counted according to preset migration strategy A transfer parameter (for example, average data linking number or average data flow) is calculated, then according to the original of load balancing Then, the server for first determining load more than transfer parameter and including candidate data connection, then by the time in these servers Data connection is selected to migrate to server to be reached the standard grade, until the load of server that band is reached the standard grade is equal or close to transfer parameter, quilt The data connection of migration is target data connection.
Step 105, by target data connection migration to server to be reached the standard grade.
In force, load equalizer can be with the data connection of migration server, after target data connection is determined, can be with By target data connection migration to server to be reached the standard grade, so as to the load of each server in equalization server cluster.
Optionally, load equalizer can connect the total number of the data connection of corresponding each server according to candidate data The total number of corresponding each server and server to be reached the standard grade is connected with candidate data, calculates average data linking number, so Determine that candidate data connects the target data connection in corresponding each server respectively afterwards.
Wherein, the total number of target data connection is equal to average data linking number.
In force, load equalizer can first calculate average data linking number, then determine target data connection number Mesh.For example, the number that candidate data connects corresponding server is 5, the data connection number of every server is 10000 A, the number of server to be reached the standard grade is 1, then average data linking number is 10000*5/6 ≈ 8334;Then, it bears It carries balanced device and the sum for determining that target data connects, and target data connects in corresponding 5 servers is then connected from candidate data Mesh is equal or close to 8334, so as to which the data that candidate data is made to connect corresponding 5 servers and 1 server to be reached the standard grade connect The number connect is all close to 8334, the i.e. purpose of realization load balancing.
In scheme provided in an embodiment of the present invention, realize that load is equal by the number of the data connection of balanced each server Weighing apparatus can improve the rate for completing load balancing in this way.
Optionally, load equalizer can connect total data flow and the candidate of corresponding each server according to candidate data The total number of the corresponding each server of data connection and server to be reached the standard grade calculates average data flow, then determines respectively Candidate data connects the target data connection in corresponding each server, wherein, target data connects corresponding total data flow Equal to average data flow.
In force, load equalizer can obtain the data traffic that candidate data connects corresponding each server, then The total number of corresponding each server and server to be reached the standard grade is connected according to total data flow and candidate data, calculates average According to flow.For example, the number that candidate data connects corresponding server is 5, the data traffic of every server is 10000bps (bits per second, bits per second), the number of server to be reached the standard grade is 1, then average data flow For 10000*5/6 ≈ 8334bps;Then, load equalizer then connects from candidate data and target is determined in corresponding 5 servers Data connection, target data connects corresponding total data flow equal or close to 8334bps, so as to correspond to candidate data connection 5 servers and to be reached the standard grade 1 server data traffic all close to 8334bps, that is, realize the purpose of load balancing.
In scheme provided in an embodiment of the present invention, load balancing is realized by the data traffic of balanced each server, this Sample can improve the load of more accurate each server of equilibrium.
Optionally, load equalizer, can also be to target by after target data connection migration to server to be reached the standard grade The corresponding client of data connection and the server previously connected send reconnection instruction, so that target data connects corresponding client It holds and server to be reached the standard grade establishes data connection.
In force, load equalizer, can also be to mesh by after target data connection migration to server to be reached the standard grade The corresponding client of mark data connection and the server previously connected send reconnection instruction (i.e. reset (resetting) request message), Inform that target data connects corresponding client and the server previously connected disconnects previous data connection with this.Then, it bears Carrying balanced device makes the client re-establish data connection with server to be reached the standard grade, and server to be reached the standard grade can pass through the number Corresponding client is connected to target data send business datum according to connection.
In scheme provided in an embodiment of the present invention, load equalizer can be connected to target data corresponding client and Server to be reached the standard grade sends reconnection instruction, be used to ensure the data connection before transmission services data in this way it has been established that from And improve the safety of transmission services data.
Optionally, load equalizer, can also be on treating after the login request message for receiving server to be reached the standard grade The server of line sends registration probe message, if receiving the registration reply message that server to be reached the standard grade returns, performs The step of obtaining the free time of the data connection in server cluster between each server and each client;If it does not receive The registration reply message that server to be reached the standard grade returns, then terminate this location registration process.
In force, load equalizer is after the login request message for receiving server to be reached the standard grade, can also be to treating The server reached the standard grade sends registration probe message, and whether the port that registration probe message can detect server to be reached the standard grade is beaten It opens, if the port of server to be reached the standard grade has already turned on, sends registration reply to load equalizer if server to be reached the standard grade Message after load equalizer receives registration reply message, then performs and obtains each server and each client in server cluster The step of free time of data connection between end;If server to be reached the standard grade is faulty or port is not switched on, treat The server of line then will not send registration reply message to load equalizer, and load equalizer is not receiving registration reply message When, then terminate this location registration process.
In scheme provided in an embodiment of the present invention, load equalizer first judges to treat before migration target data connection The server of line whether normal operation, when determining wait the server normal operation reached the standard grade, just migrates target data connection, in this way The safety of migrating data connection can be improved.
An embodiment of the present invention provides a kind of methods for realizing load balancing, can receive the registration of server to be reached the standard grade Then request message obtains the free time of the data connection in server cluster between each server and each client, then In data connection, determine that free time is more than the candidate data connection of predetermined threshold value, further according to preset migration strategy, waiting It selects and target data connection is determined in data connection, finally by target data connection migration to server to be reached the standard grade.Using this hair The method of bright offer, can in time will be in servers other in server cluster when the server reached the standard grade comes into operation Load migration to server to be reached the standard grade, so as to the load of balanced each server.
Based on identical technical concept, corresponding to embodiment of the method shown in Fig. 1, the embodiment of the present invention additionally provides a kind of reality The device of existing load balancing, as shown in Fig. 2, the device includes:
Receiving module 201, for receiving the login request message that server to be reached the standard grade is sent;
Acquisition module 202, for obtaining the sky of the data connection in server cluster between each server and each client Between idle;
First determining module 203, in the data connection, determining that free time is more than the candidate number of predetermined threshold value According to connection;
Second determining module 204, for according to preset migration strategy, number of targets to be determined in candidate data connection According to connection;
Transferring module 205, for by the target data connection migration to the server to be reached the standard grade.
Optionally, second determining module, including:
First computing module, for connecting the total number of the data connection of corresponding each server according to the candidate data The total number of corresponding each server and server to be reached the standard grade is connected with the candidate data, calculates average data connection number Mesh;
Third determining module connects for determining that the candidate data connects the target data in corresponding each server respectively It connects, the total number of the target data connection is equal to the average data linking number.
In scheme provided in an embodiment of the present invention, realize that load is equal by the number of the data connection of balanced each server Weighing apparatus can improve the rate for completing load balancing in this way.
Optionally, second determining module, including:
First computing module, for connecting the total data flow of corresponding each server and described according to the candidate data Candidate data connects the total number of corresponding each server and server to be reached the standard grade, and calculates average data flow;
4th determining module connects for determining that the candidate data connects the target data in corresponding each server respectively It connects, the target data connects corresponding total data flow and is equal to the average data flow.
In scheme provided in an embodiment of the present invention, load balancing is realized by the data traffic of balanced each server, this Sample can improve the load of more accurate each server of equilibrium.
Optionally, the transferring module, is additionally operable to:
Corresponding client is connected to the target data and the server previously connected sends reconnection instruction, so that described Target data connects corresponding client and establishes data connection with the server to be reached the standard grade.
In scheme provided in an embodiment of the present invention, load equalizer can be connected to target data corresponding client and Server to be reached the standard grade sends reconnection instruction, be used to ensure the data connection before transmission services data in this way it has been established that from And improve the safety of transmission services data.
Optionally, the receiving module, is additionally operable to:
Registration probe message is sent to the server to be reached the standard grade, is returned if receiving the server to be reached the standard grade Registration reply message, then perform the sky of data connection between each server and each client in the acquisition server cluster The step of between idle;
If not receiving the registration reply message that the server to be reached the standard grade returns, terminate this location registration process.
In scheme provided in an embodiment of the present invention, load equalizer first judges to treat before migration target data connection The server of line whether normal operation, when determining wait the server normal operation reached the standard grade, just migrates target data connection, in this way The safety of migrating data connection can be improved.
An embodiment of the present invention provides a kind of devices for realizing load balancing, can receive the registration of server to be reached the standard grade Then request message obtains the free time of the data connection in server cluster between each server and each client, then In data connection, determine that free time is more than the candidate data connection of predetermined threshold value, further according to preset migration strategy, waiting It selects and target data connection is determined in data connection, finally by target data connection migration to server to be reached the standard grade.Using this hair The method of bright offer, can in time will be in servers other in server cluster when the server reached the standard grade comes into operation Load migration to server to be reached the standard grade, so as to the load of balanced each server.
The embodiment of the present invention additionally provides a kind of electronic equipment, as shown in figure 3, including processor 301, communication interface 302, Memory 303 and communication bus 304, wherein, processor 301, communication interface 302, memory 303 is complete by communication bus 304 Into mutual communication,
Memory 303, for storing computer program;
Processor 301 during for performing the program stored on memory 303, realizes reality provided in an embodiment of the present invention The method of existing load balancing.
Specifically, the method for above-mentioned realization load balancing, including:
Receive the login request message that server to be reached the standard grade is sent;
Obtain the free time of the data connection in server cluster between each server and each client;
In the data connection, determine that free time is more than the candidate data connection of predetermined threshold value;
According to preset migration strategy, target data connection is determined in candidate data connection;
By the target data connection migration to the server to be reached the standard grade.
It should be noted that other realization methods of the method for above-mentioned realization load balancing and preceding method embodiment part Identical, which is not described herein again.
The communication bus of above-mentioned electronic equipment can be Peripheral Component Interconnect standard (Peripheral Component Interconnect, abbreviation PCI) bus or expanding the industrial standard structure (Extended Industry Standard Architecture, abbreviation EISA) bus etc..The communication bus can be divided into address bus, data/address bus, controlling bus etc.. For ease of representing, only represented in figure with a thick line, it is not intended that an only bus or a type of bus.
Communication interface is for the communication between above-mentioned electronic equipment and other equipment.
Memory can include random access memory (Random Access Memory, abbreviation RAM), can also include Nonvolatile memory (non-volatile memory), for example, at least a magnetic disk storage.Optionally, memory may be used also To be at least one storage device for being located remotely from aforementioned processor.
Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit, Abbreviation CPU), network processing unit (Network Processor, abbreviation NP) etc.;It can also be digital signal processor (Digital Signal Processing, abbreviation DSP), application-specific integrated circuit (Application Specific Integrated Circuit, abbreviation ASIC), field programmable gate array (Field Programmable Gate Array, Abbreviation FPGA) either other programmable logic device, discrete gate or transistor logic, discrete hardware components.
In another embodiment provided by the invention, a kind of computer readable storage medium is additionally provided, which can It reads to be stored with instruction in storage medium, when run on a computer so that computer performs any institute in above-described embodiment The method of realization load balancing stated.
In another embodiment provided by the invention, a kind of computer program product for including instruction is additionally provided, when it When running on computers so that the method that computer performs any realization load balancing in above-described embodiment.
In the above-described embodiments, can come wholly or partly by software, hardware, firmware or its arbitrary combination real It is existing.When implemented in software, it can entirely or partly realize in the form of a computer program product.The computer program Product includes one or more computer instructions.When loading on computers and performing the computer program instructions, all or It partly generates according to the flow or function described in the embodiment of the present invention.The computer can be all-purpose computer, special meter Calculation machine, computer network or other programmable devices.The computer instruction can be stored in computer readable storage medium In or from a computer readable storage medium to another computer readable storage medium transmit, for example, the computer Instruction can pass through wired (such as coaxial cable, optical fiber, number from a web-site, computer, server or data center User's line (DSL)) or wireless (such as infrared, wireless, microwave etc.) mode to another web-site, computer, server or Data center is transmitted.The computer readable storage medium can be any usable medium that computer can access or It is the data storage devices such as server, the data center integrated comprising one or more usable mediums.The usable medium can be with It is magnetic medium, (for example, floppy disk, hard disk, tape), optical medium (for example, DVD) or semiconductor medium (such as solid state disk Solid State Disk (SSD)) etc..
An embodiment of the present invention provides a kind of method, apparatus and electronic equipment for realizing load balancing, can receive and treat Then the login request message of the server of line obtains the data connection in server cluster between each server and each client Free time, then in data connection, determine that free time is more than the candidate data of predetermined threshold value and connects, further according to default Migration strategy, target data connection is determined in candidate data connection, finally by target data connection migration to be reached the standard grade Server.It, can be in time by server cluster when the server reached the standard grade comes into operation using method provided by the invention In load migration in other servers to server to be reached the standard grade, so as to the load of balanced each server.
It should be noted that herein, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any this practical relationship or sequence.Moreover, term " comprising ", "comprising" or its any other variant are intended to Non-exclusive inclusion, so that process, method, article or equipment including a series of elements not only will including those Element, but also including other elements that are not explicitly listed or further include as this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that Also there are other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is described using relevant mode, identical similar portion between each embodiment Point just to refer each other, and the highlights of each of the examples are difference from other examples.Especially for system reality For applying example, since it is substantially similar to embodiment of the method, so description is fairly simple, related part is referring to embodiment of the method Part explanation.

Claims (11)

  1. A kind of 1. method for realizing load balancing, which is characterized in that the method includes:
    Receive the login request message that server to be reached the standard grade is sent;
    Obtain the free time of the data connection in server cluster between each server and each client;
    In the data connection, determine that free time is more than the candidate data connection of predetermined threshold value;
    According to preset migration strategy, target data connection is determined in candidate data connection;
    By the target data connection migration to the server to be reached the standard grade.
  2. 2. according to the method described in claim 1, it is characterized in that, described according to preset migration strategy, in the candidate number It is connected according to target data determining in connection, including:
    The total number that the data connection of corresponding each server is connected according to the candidate data connects pair with the candidate data The total number of each server answered and server to be reached the standard grade calculates average data linking number;
    Determine that the candidate data connects the target data connection in corresponding each server respectively, the target data connection Total number is equal to the average data linking number.
  3. 3. according to the method described in claim 1, it is characterized in that, described according to preset migration strategy, in the candidate number It is connected according to target data determining in connection, including:
    According to the candidate data connect the total data flow of corresponding each server connect with the candidate data it is corresponding respectively The total number of server and server to be reached the standard grade calculates average data flow;
    Determine that the candidate data connects the target data connection in corresponding each server, the target data connection pair respectively The total data flow answered is equal to the average data flow.
  4. 4. according to the method described in claim 1, it is characterized in that, described will be on the target data connection migration to described treat After the server of line, further include:
    Corresponding client is connected to the target data and the server previously connected sends reconnection instruction, so that the target The corresponding client of data connection establishes data connection with the server to be reached the standard grade.
  5. 5. the according to the method described in claim 1, it is characterized in that, login request message for receiving server to be reached the standard grade Later, it further includes:
    Registration probe message is sent to the server to be reached the standard grade, if receiving the note that the server to be reached the standard grade returns Volume response message, then when performing the free time of data connection between each server and each client in the acquisition server cluster Between the step of;
    If not receiving the registration reply message that the server to be reached the standard grade returns, terminate this location registration process.
  6. 6. a kind of device for realizing load balancing, which is characterized in that described device includes:
    Receiving module, for receiving the login request message that server to be reached the standard grade is sent;
    Acquisition module, for obtaining the free time of the data connection in server cluster between each server and each client;
    First determining module, in the data connection, determining that free time is more than the candidate data connection of predetermined threshold value;
    Second determining module, for according to preset migration strategy, target data connection to be determined in candidate data connection;
    Transferring module, for by the target data connection migration to the server to be reached the standard grade.
  7. 7. device according to claim 6, which is characterized in that second determining module, including:
    First computing module, for connecting the total number of the data connection of corresponding each server and institute according to the candidate data The total number that candidate data connects corresponding each server and server to be reached the standard grade is stated, calculates average data linking number;
    Third determining module, for determining that the candidate data connects the target data connection in corresponding each server respectively, The total number of the target data connection is equal to the average data linking number.
  8. 8. device according to claim 6, which is characterized in that second determining module, including:
    First computing module, for connecting the total data flow of corresponding each server and the candidate according to the candidate data The total number of the corresponding each server of data connection and server to be reached the standard grade calculates average data flow;
    4th determining module, for determining that the candidate data connects the target data connection in corresponding each server respectively, The target data connects corresponding total data flow and is equal to the average data flow.
  9. 9. device according to claim 6, which is characterized in that the transferring module is additionally operable to:
    Corresponding client is connected to the target data and the server previously connected sends reconnection instruction, so that the target The corresponding client of data connection establishes data connection with the server to be reached the standard grade.
  10. 10. device according to claim 6, which is characterized in that the receiving module is additionally operable to:
    Registration probe message is sent to the server to be reached the standard grade, if receiving the note that the server to be reached the standard grade returns Volume response message, then when performing the free time of data connection between each server and each client in the acquisition server cluster Between the step of;
    If not receiving the registration reply message that the server to be reached the standard grade returns, terminate this location registration process.
  11. 11. a kind of electronic equipment, which is characterized in that it is total that the electronic equipment includes processor, communication interface, memory and communication Line, wherein, the processor, the communication interface, the memory passes through the communication bus and completes mutual communication;
    The memory, for storing computer program;
    The processor during for performing the program stored on the memory, realizes any sides of claim 1-5 Method step.
CN201810193187.XA 2018-03-09 2018-03-09 Method and device for realizing load balance and electronic equipment Active CN108200218B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810193187.XA CN108200218B (en) 2018-03-09 2018-03-09 Method and device for realizing load balance and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810193187.XA CN108200218B (en) 2018-03-09 2018-03-09 Method and device for realizing load balance and electronic equipment

Publications (2)

Publication Number Publication Date
CN108200218A true CN108200218A (en) 2018-06-22
CN108200218B CN108200218B (en) 2021-11-26

Family

ID=62595411

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810193187.XA Active CN108200218B (en) 2018-03-09 2018-03-09 Method and device for realizing load balance and electronic equipment

Country Status (1)

Country Link
CN (1) CN108200218B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110941513A (en) * 2019-11-22 2020-03-31 浪潮电子信息产业股份有限公司 Data reconstruction method and related device
CN111444008A (en) * 2018-12-29 2020-07-24 北京奇虎科技有限公司 Inter-cluster service migration method and device
CN112882714A (en) * 2021-02-04 2021-06-01 中国工商银行股份有限公司 SonarQube server cluster capacity expansion method and device
CN113177179A (en) * 2021-04-30 2021-07-27 平安证券股份有限公司 Data request connection management method, device, equipment and storage medium
CN113608870A (en) * 2021-07-28 2021-11-05 北京金山云网络技术有限公司 Load balancing method and device of message queue, electronic equipment and storage medium
CN114900526A (en) * 2022-04-28 2022-08-12 京东科技信息技术有限公司 Load balancing method and system, computer storage medium and electronic device
CN115442382A (en) * 2022-08-23 2022-12-06 中国银联股份有限公司 Method and device for eliminating hot spot data
CN116055565A (en) * 2023-01-28 2023-05-02 北京蓝色星际科技股份有限公司 Data transmission method, system, device, electronic equipment and storage medium

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1665206A (en) * 2004-03-03 2005-09-07 华为技术有限公司 Method for implementing long connection changeover of network
US20060018329A1 (en) * 2004-07-26 2006-01-26 Enigma Semiconductor Network interconnect crosspoint switching architecture and method
CN1852502A (en) * 2006-05-29 2006-10-25 杭州华为三康技术有限公司 Method for realizing load uniform in clustering system, system and storage controller
US20060294184A1 (en) * 2002-02-15 2006-12-28 Agnoli Giovanni M System, method, and computer program product for media publishing request processing
CN101599982A (en) * 2008-06-06 2009-12-09 广东宇天信通通信科技有限公司 Cellphone information browsing apparatus, system and implementation method
CN102571991A (en) * 2012-03-27 2012-07-11 电子科技大学 Multistage-mapping-based large-scale multi-copy distributed storage system and application method thereof
CN103974140A (en) * 2013-02-06 2014-08-06 中国科学院声学研究所 Management method and management system of TR069 protocol based large-scale interactive TV terminal
US20150358402A1 (en) * 2014-06-10 2015-12-10 Alcatel-Lucent Usa, Inc. Efficient and scalable pull-based load distribution
CN106612296A (en) * 2015-10-21 2017-05-03 阿里巴巴集团控股有限公司 A method and apparatus for assigning user equipment connection requests
CN107135279A (en) * 2017-07-07 2017-09-05 网宿科技股份有限公司 It is a kind of to handle the method and apparatus that request is set up in long connection
CN107483350A (en) * 2017-07-11 2017-12-15 北京潘达互娱科技有限公司 A kind of gateway distribution method and device

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060294184A1 (en) * 2002-02-15 2006-12-28 Agnoli Giovanni M System, method, and computer program product for media publishing request processing
CN1665206A (en) * 2004-03-03 2005-09-07 华为技术有限公司 Method for implementing long connection changeover of network
US20060018329A1 (en) * 2004-07-26 2006-01-26 Enigma Semiconductor Network interconnect crosspoint switching architecture and method
CN1852502A (en) * 2006-05-29 2006-10-25 杭州华为三康技术有限公司 Method for realizing load uniform in clustering system, system and storage controller
CN101599982A (en) * 2008-06-06 2009-12-09 广东宇天信通通信科技有限公司 Cellphone information browsing apparatus, system and implementation method
CN102571991A (en) * 2012-03-27 2012-07-11 电子科技大学 Multistage-mapping-based large-scale multi-copy distributed storage system and application method thereof
CN103974140A (en) * 2013-02-06 2014-08-06 中国科学院声学研究所 Management method and management system of TR069 protocol based large-scale interactive TV terminal
US20150358402A1 (en) * 2014-06-10 2015-12-10 Alcatel-Lucent Usa, Inc. Efficient and scalable pull-based load distribution
CN106612296A (en) * 2015-10-21 2017-05-03 阿里巴巴集团控股有限公司 A method and apparatus for assigning user equipment connection requests
CN107135279A (en) * 2017-07-07 2017-09-05 网宿科技股份有限公司 It is a kind of to handle the method and apparatus that request is set up in long connection
CN107483350A (en) * 2017-07-11 2017-12-15 北京潘达互娱科技有限公司 A kind of gateway distribution method and device

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111444008A (en) * 2018-12-29 2020-07-24 北京奇虎科技有限公司 Inter-cluster service migration method and device
CN111444008B (en) * 2018-12-29 2024-04-16 北京奇虎科技有限公司 Inter-cluster service migration method and device
CN110941513B (en) * 2019-11-22 2022-03-22 浪潮电子信息产业股份有限公司 Data reconstruction method and related device
CN110941513A (en) * 2019-11-22 2020-03-31 浪潮电子信息产业股份有限公司 Data reconstruction method and related device
CN112882714A (en) * 2021-02-04 2021-06-01 中国工商银行股份有限公司 SonarQube server cluster capacity expansion method and device
CN112882714B (en) * 2021-02-04 2024-01-30 中国工商银行股份有限公司 SonarQube server cluster capacity expansion method and device
CN113177179B (en) * 2021-04-30 2023-11-21 平安证券股份有限公司 Data request connection management method, device, equipment and storage medium
CN113177179A (en) * 2021-04-30 2021-07-27 平安证券股份有限公司 Data request connection management method, device, equipment and storage medium
CN113608870A (en) * 2021-07-28 2021-11-05 北京金山云网络技术有限公司 Load balancing method and device of message queue, electronic equipment and storage medium
CN114900526A (en) * 2022-04-28 2022-08-12 京东科技信息技术有限公司 Load balancing method and system, computer storage medium and electronic device
CN114900526B (en) * 2022-04-28 2024-04-16 京东科技信息技术有限公司 Load balancing method and system, computer storage medium and electronic equipment
CN115442382A (en) * 2022-08-23 2022-12-06 中国银联股份有限公司 Method and device for eliminating hot spot data
CN116055565B (en) * 2023-01-28 2023-06-06 北京蓝色星际科技股份有限公司 Data transmission method, system, device, electronic equipment and storage medium
CN116055565A (en) * 2023-01-28 2023-05-02 北京蓝色星际科技股份有限公司 Data transmission method, system, device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN108200218B (en) 2021-11-26

Similar Documents

Publication Publication Date Title
CN108200218A (en) A kind of method, apparatus and electronic equipment for realizing load balancing
CN108418884A (en) A kind of method, apparatus and electronic equipment of transmission services data
CN111163130B (en) Network service system and data transmission method thereof
CN105262698A (en) Load sharing method, device and system
JP4190455B2 (en) Load balancing apparatus and program
CN101815033A (en) Method, device and system for load balancing
CN109510878A (en) A kind of long connection session keeping method and device
US20220046028A1 (en) Method and system for determining a state of an account in a network device running a light client protocol of a distributed ledger technology network
CN108055338A (en) A kind of ISCSI accesses load-balancing method
US8416754B2 (en) Network location based processing of data communication connection requests
CN108829526A (en) A kind of inter-process communication methods, electronic equipment and readable storage medium storing program for executing
US20240291883A1 (en) Http type connectivity detection using parallel probes for preferred protocol selection
CN109618004A (en) A kind of message forwarding method and device
CN108366102A (en) A kind of service discovery method, device and electronic equipment based on Consul
US9692685B2 (en) Heterogeneous network system, network apparatus, and rendezvous path selection method thereof
CN110535959A (en) A kind of method, apparatus and computer readable storage medium for transmitting data
CN113726881B (en) Communication connection establishment method, related device and computer readable storage medium
CN110838967B (en) Virtual private network connection method, server, client and storage medium
CN108111431A (en) Business datum sending method and device
CN111416852A (en) Method for session synchronization among multiple load balancers and load balancer
WO2024187893A1 (en) Load balancing method, apparatus, device, storage medium and computer program
CN116260855B (en) Communication method, communication device, electronic equipment and storage medium
CN116938598B (en) Information transmission method, apparatus, electronic device, and computer-readable medium
CN112532699B (en) Data port updating method and device, electronic equipment and readable storage medium
CN112511603B (en) Data port updating method and device, electronic equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant