CN106357726B - Load-balancing method and device - Google Patents

Load-balancing method and device Download PDF

Info

Publication number
CN106357726B
CN106357726B CN201610718285.1A CN201610718285A CN106357726B CN 106357726 B CN106357726 B CN 106357726B CN 201610718285 A CN201610718285 A CN 201610718285A CN 106357726 B CN106357726 B CN 106357726B
Authority
CN
China
Prior art keywords
session
data processing
processing unit
information
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.)
Active
Application number
CN201610718285.1A
Other languages
Chinese (zh)
Other versions
CN106357726A (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.)
Neusoft Corp
Original Assignee
Neusoft Corp
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 Neusoft Corp filed Critical Neusoft Corp
Priority to CN201610718285.1A priority Critical patent/CN106357726B/en
Publication of CN106357726A publication Critical patent/CN106357726A/en
Application granted granted Critical
Publication of CN106357726B publication Critical patent/CN106357726B/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
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

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)

Abstract

The invention discloses a kind of load-balancing method and devices, are related to field of communication technology, and the load balancing in data processor between data processing unit may be implemented.The described method includes: the session for obtaining data processing unit in data processor distributes information;Information and default load balance scheduling rule are distributed according to the session, generates the conversation dispatching information of load balancing between data processing unit;The conversation shift in the data processor between different data processing units is carried out according to the conversation dispatching information.The present invention is suitable for load balance process.

Description

Load-balancing method and device
Technical field
The present invention relates to a kind of fields of communication technology, more particularly to a kind of load-balancing method and device.
Background technique
With the continuous development of the communication technology, network interface card technology is more and more mature.Network interface card is group of networks of the work in link layer Part is the interface that computer and transmission medium are connected in local area network, the physics being not only able to achieve between local network transport medium Connection and electric signal matching, further relate to the sending and receiving of frame, the encapsulation of frame and opening, medium access control, data coding With decoding and the function of data buffer storage etc..
Currently, a new generation network interface card usually support it is multiple send and receive queue, i.e., more queue network interface cards.The network interface card can incite somebody to action Received network packet is distributed to different queues, so that network flow can be in a data processor at different data Manage parallel processing between unit.Specifically, for network interface card by packet classification algorithm, which point be Lai Zhiding network packet belong to Class, the data packet of each classification are sent in a specified receiving queue, and data processor can be to the data in each queue Packet is handled, the data packet in one queue of each data processing unit alignment processing, so that each data processing list Member handles respective session task.
However, it is non-uniform to have data stream distribution when carrying out packet delivery by above-mentioned packet classification algorithm Situation, for example, the input parameter as hash function carries out Hash operation, and according to meter according to data packet respective field is extracted The function result of calculating is distributed data packet, and session task can be distributed to different data processing units at random, will lead to number According to existing simultaneously the excessive data processing unit of session task and the very few data processing units of session task in processor.In turn Will cause the unbalanced problem of the number of sessions handled between data processing unit, so as to cause different data processing units it Between load imbalance, affect the treatment effeciency of data processor.
Summary of the invention
In view of this, main purpose is can be real the embodiment of the invention provides a kind of load-balancing method and device Load balancing between existing different data processing units, can be improved the treatment effeciency of data processor.
According to an embodiment of the present invention on one side, a kind of load-balancing method is provided, this method comprises:
The session for obtaining data processing unit in data processor distributes information;
Information and default load balance scheduling rule are distributed according to the session, it is equal to generate load between data processing unit The conversation dispatching information of weighing apparatus;
It is moved according to the session that the conversation dispatching information carries out in the data processor between different data processing units It moves.
Further, the number comprising data processing unit in the data processor in the session distribution information, with And the currently processed number of sessions of each data processing unit in the data processor, it is described to distribute information according to the session With default load balance scheduling rule, the conversation dispatching information of load balancing between data processing unit is generated, is specifically included:
According to the number of sessions, the number of data processing unit and default load balance scheduling rule, every number is determined According to the session for needing to migrate in processing unit and former data processing unit corresponding with the session for needing to migrate and target data Processing unit;
The session migrated and former data processing unit corresponding with the session for needing to migrate and target are needed according to described Data processing unit generates the conversation dispatching information of load balancing between data processing unit.
Further, described that different data processing units in the data processor are carried out according to the conversation dispatching information Between conversation shift, specifically include:
In the data accepted packet after treatment for the session that former data processing unit migrates needs, according to the session Scheduling information, by the conversation shift for needing to migrate to target data processing unit.
Further, described that different data processing units in the data processor are carried out according to the conversation dispatching information Between conversation shift after, the method also includes:
Record the identification information of the corresponding target data processing unit of session of migration;
When receiving data packet corresponding with the session of the migration, according to the identification information, by the data packet It is assigned in the target data processing unit and is handled.
Further, described if the currently employed session Hash table of the data processor is local session Hash table Method further include:
The session information data field that will be migrated session is copied to be migrated at the corresponding target data of session with described In the session Hash table for managing unit.
Further, the method also includes:
After the completion of conversation shift or when establishing new Dialog processing task, to data processing list in the data processor The session distribution information of member is updated.
Further, the session for obtaining data processing unit in data processor distributes information, specifically includes:
Information is distributed according to the session that prefixed time interval obtains data processing unit in the data processor.
According to an embodiment of the present invention on the other hand, a kind of load balancing apparatus is provided, which includes:
Acquiring unit, the session for obtaining data processing unit in data processor distribute information;
Generation unit, session distribution information and default load balance scheduling rule for being obtained according to the acquiring unit Then, the conversation dispatching information of load balancing between data processing unit is generated;
Migration units, the conversation dispatching information for being generated according to the generation unit carry out in the data processor not With the conversation shift between data processing unit.
Further, the number comprising data processing unit in the data processor in the session distribution information, with And the currently processed number of sessions of each data processing unit in the data processor, the generation unit specifically include:
Determining module, for according to the number of the number of sessions, data processing unit and default load balance scheduling rule Then, the session for needing to migrate in each data processing unit and former data processing list corresponding with the session for needing to migrate are determined Member and target data processing unit;
Generation module, the session that the needs for being determined according to the determining module migrate and the session migrated with needs Corresponding original data processing unit and target data processing unit, generate the conversation dispatching of load balancing between data processing unit Information.
The migration units, specifically at the data accepted packet for the session that former data processing unit migrates needs After reason, according to the conversation dispatching information, by the conversation shift for needing to migrate to target data processing unit.
Further, described device further include:
Recording unit, the identification information of the corresponding target data processing unit of session for recording migration;
Allocation unit, for when receiving data packet corresponding with the session of the migration, according to the recording unit The identification information of record handles the allocation of packets into the target data processing unit.
Further, described device further include:
Copied cells, if the session Hash table currently employed for the data processor is local session Hash table, The session information data field that will be migrated session copies to and the session corresponding target data processing unit of being migrated In session Hash table.
Further, described device further include:
Updating unit, for after the completion of conversation shift or when establishing new Dialog processing task, to the data processing The session distribution information of data processing unit is updated in device.
The acquiring unit is specifically used for obtaining data processing unit in the data processor according to prefixed time interval Session distribute information.
By above-mentioned technical proposal, technical solution provided in an embodiment of the present invention is at least had the advantage that
A kind of load-balancing method and device provided in an embodiment of the present invention, first data processing in acquisition data processor The session of unit distributes information;Then information and default load balance scheduling rule are distributed according to the session, generated at data Manage the conversation dispatching information of load balancing between unit;Finally carried out in the data processor according to the conversation dispatching information Conversation shift between different data processing units.Session of the embodiment of the present invention according to data processing unit in data processor Information and default load balance scheduling rule are distributed, generates conversation dispatching information, and session is executed according to the conversation dispatching information Migration operation, the number of sessions to realize each data processing unit in data processor is balanced, and then difference may be implemented Load balancing between data processing unit, so as to improve the treatment effeciency of data processor.
The above description is only an overview of the technical scheme of the present invention, in order to better understand the technical means of the present invention, And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can It is clearer and more comprehensible, the followings are specific embodiments of the present invention.
Detailed description of the invention
By reading the following detailed description of the preferred embodiment, various other advantages and benefits are common for this field Technical staff will become clear.The drawings are only for the purpose of illustrating a preferred embodiment, and is not considered as to the present invention Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 shows a kind of load-balancing method flow diagram provided in an embodiment of the present invention;
Fig. 2 shows another load-balancing method flow diagrams provided in an embodiment of the present invention;
Fig. 3 shows a kind of specific processing flow schematic diagram provided in an embodiment of the present invention;
Fig. 4 shows a kind of load balancing apparatus structural schematic diagram provided in an embodiment of the present invention;
Fig. 5 shows another load balancing apparatus structural schematic diagram provided in an embodiment of the present invention;
Fig. 6 shows a kind of schematic diagram of SiteServer LBS framework provided in an embodiment of the present invention.
Specific embodiment
Exemplary embodiments of the present disclosure are described in more detail below with reference to accompanying drawings.Although showing the disclosure in attached drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure It is fully disclosed to those skilled in the art.
The embodiment of the invention provides a kind of load-balancing method, the load between different data processing units may be implemented Equilibrium, as shown in Figure 1, which comprises
101, the session for obtaining data processing unit in data processor distributes information.
Wherein, the processing for network packet main security business, safety service may be implemented in the data processor Not only have a basic connectivity energy function, such as exchange, routing, agency, can also include function of safety protection, as access control, Attack defending, anti-virus, application control etc..The data processor may include multiple data processing units, for example, X86 frame Multi-core CPU (Central Processing Unit, central processing unit), ASIC (the Application Specific of structure Integrated Circuit, integrated circuit) framework packet processing chip group etc., each data processing unit is according to business demand Network data stream, can specifically execute and establish the operations such as session, forwarding data packet, and each data processing unit storage is respective Session information data.
The session, which distributes in information, may include total sessions currently processed in data processor, in data processor The currently processed number of sessions etc. of each data processing unit in the number and data processor of data processing unit.
In embodiments of the present invention, the meeting of data processing unit in data processor can be obtained from monitoring log information Words distribute information, have recorded the currently processed session task distribution condition of data processor in the monitoring log information.For example, from Conversation analysis information is acquired in monitoring log information, which distributes in information comprising in data processor currently processed 10 A session task, the data processor have 3 data processing units, respectively No. 1 unit, No. 2 units, No. 3 units, No. 1 list The currently processed 4 session tasks of member, the currently processed 1 Dialog processing task of No. 2 units, currently processed 5 sessions of No. 3 units are appointed Business.
102, information and default load balance scheduling rule are distributed according to session, it is equal generates load between data processing unit The conversation dispatching information of weighing apparatus.
Wherein, may include in the conversation dispatching information need migrate session, with the needs migrate session it is corresponding Former data processing unit and the information such as target data processing unit.For example, the form that can use data mapping tables saves life At conversation dispatching information, every a line in the data mapping tables includes a session for needing to migrate, and with this session The corresponding original fields such as data processing unit and target data processing unit.
The default load balance scheduling rule can be carried out writing configuration by technical staff in advance.In the embodiment of the present invention In, based on default load balance scheduling rule, using current session distribution condition as parameter, corresponding scheduling can be executed and calculated Method generates the conversation dispatching information of load balancing between data processing unit.It should be noted that for the embodiment of the present invention, It can support a variety of dispatching algorithms, and since conversation shift process expense is larger, dispatching algorithm needs to consider migration overhead, with Just guarantee whole conversation shift efficiency.
For example, 10 session tasks currently processed comprising data processor in the session distribution information acquired, it should Data processor has 3 data processing units, respectively No. 1 unit, No. 2 units, No. 3 units, and No. 1 unit currently processed 6 Session task, the currently processed 3 Dialog processing tasks of No. 2 units, the currently processed 1 session task of No. 3 units, at this time 3 numbers It is unbalanced according to the number of sessions handled between processing unit, it will lead to load imbalance between 3 data processing units.To understand The certainly above problem, using current sessions distribution condition as parameter, executes load balancing according to default load balance scheduling rule Dispatching algorithm calculates the session for needing to migrate and target data processing unit etc., and generates conversation dispatching information, the session tune Include two session tasks for needing to migrate in No. 1 unit, and former data corresponding with the two session tasks in degree information Processing unit (i.e. No. 1 unit) and target data processing unit (i.e. No. 3 units), to realize two meetings in No. 1 unit Words task immigration is handled into No. 3 units, and then realizes the load balancing between 3 data processing units.
It in embodiments of the present invention, can also include: to distribute information determination according to session to work as before executing step 102 The least data processing unit of pre-treatment session task amount is executed the behaviour for generating conversation dispatching information by the data processing unit Make, avoids executing the operation for generating conversation dispatching information in the more data processing unit of currently processed session task amount, into And the load pressure of data processor can be mitigated.
103, the conversation shift in data processor between different data processing units is carried out according to conversation dispatching information.
For the embodiment of the present invention, during conversation shift, session information data can be migrated, wherein It may include five-tuple information, data packet count information, disengaging port information, session state information in the session information data Deng.
In embodiments of the present invention, according to conversation dispatching information, the session of data processing unit in data processor is manipulated Task, it will words task moves to another data processing unit from a data processing unit.
A kind of load-balancing method provided in an embodiment of the present invention, data processing unit first in acquisition data processor Session distributes information;Then information and default load balance scheduling rule are distributed according to the session, generates data processing unit Between load balancing conversation dispatching information;Different numbers in the data processor are finally carried out according to the conversation dispatching information According to the conversation shift between processing unit.The embodiment of the present invention distributes letter according to the session of data processing unit in data processor Breath and default load balance scheduling rule generate conversation dispatching information, and execute conversation shift behaviour according to the conversation dispatching information Make, the number of sessions to realize each data processing unit in data processor is balanced, and then may be implemented at different data Load balancing between unit is managed, so as to improve the treatment effeciency of data processor.
In order to preferably understand above-mentioned method shown in FIG. 1, as the refinement and extension to above embodiment, The embodiment of the invention provides another load-balancing methods, as shown in Figure 2, which comprises
201, the session for obtaining data processing unit in data processor distributes information.
After more queue network interface cards receive data packet from network, all network packets are classified, different classes of data Stream is sent to the different data processing units in data processor.In order to realize load balancing between different data processing units, The session of data processing unit distributes information in available data processor, and conversates and move according to session distribution information It moves.
202, according to the currently processed number of sessions of each data processing unit, the number of data processing unit and preset negative Balance dispatching rule is carried, determines the session for needing to migrate in each data processing unit and corresponding with the session that migrates is needed Former data processing unit and target data processing unit.
For example, 10 session tasks currently processed comprising data processor in the session distribution information acquired, it should Data processor has 3 data processing units, respectively No. 1 unit, No. 2 units, No. 3 units, and No. 1 unit currently processed 5 Session task, the currently processed 0 session task of No. 2 units, the currently processed 5 session tasks of No. 3 units, at this time at 3 data The number of sessions handled between reason unit is unbalanced, will lead to load imbalance between 3 data processing units.On solving Problem is stated, according to default load balance scheduling rule, with the currently processed number of sessions of each data processing unit, data processing The sessions such as number of unit distribution condition executes the dispatching algorithm of load balancing as parameter, calculate need migrate session, Former data processing unit, target data processing unit.Specifically, it is determined that a session task for needing to migrate in No. 1 unit, and Original data processing unit (i.e. No. 1 unit) corresponding with this session task and target data processing unit (i.e. No. 2 units);Really Two session tasks for needing to migrate in fixed No. 3 units, and former data processing unit (i.e. 3 corresponding with the two session tasks Number unit) and target data processing unit (i.e. No. 2 units).
203, the session and former data processing unit corresponding with the session for needing to migrate that migrate as needed and target Data processing unit generates the conversation dispatching information of load balancing between data processing unit.
For example, 16 session tasks that data processor is currently processed, the data processor have 4 data processing units, Respectively No. 1 unit, No. 2 units, No. 3 units, No. 4 units, the currently processed 7 session tasks of No. 1 unit, No. 2 units are current Handle 4 session tasks, the currently processed 5 session tasks of No. 3 units, the currently processed 0 session task of No. 4 units, for reality The number of sessions handled between this existing 4 data processing units is balanced, according to default load balance scheduling rule, with current sessions Distribution condition executes the dispatching algorithm of load balancing as parameter, calculates the session for needing to migrate and target data processing is single Member etc., and conversation dispatching information is generated, it include three session tasks for needing to migrate in No. 1 unit in the conversation dispatching information, And former data processing unit (i.e. No. 1 unit) corresponding with these three session tasks and target data processing unit (i.e. No. 4 lists Member), also comprising a session task for needing to migrate in No. 3 units, and former data processing list corresponding with this session task First (i.e. No. 3 units) and target data processing unit (i.e. No. 4 units).
204, the conversation shift in data processor between different data processing units is carried out according to conversation dispatching information.
Further, in order to which the number of sessions for realizing each data processing unit in data processor is balanced and then right The distribution processor of data flow reaches relatively uniform state, gives full play to the processing energy of all data processing units of data processor Power maximizes the treatment effeciency of data processor.
During conversation shift, session information saves complete, the process phase with process migration, virtual machine (vm) migration etc. Than transition process is simple, and transport efficiency is high, and there is no data processing units to handle stationary problem.For example, conversation shift Process is the operation in data processor between data processing unit, be not data processing unit jointly from memory etc. otherly Side obtains data and is handled, and there is no data processing units to handle stationary problem.
Specifically, the step 204 can specifically include: in having connect for the session that former data processing unit migrates needs Data packet after treatment is received, according to the conversation dispatching information, needs the conversation shift migrated at target data for described Manage unit.In conversation procedure, session task is usually made of continuous data packet stream, these data packets can according to generation when Sequence is distributed serially to be handled to the data processing unit of the corresponding session task.In the present embodiment, when the migration that conversates When, data packet is had been received for former data processing unit, still by former data processing unit before conversation shift to its into Row processing, after by session task immigration to target data processing unit, the subsequent new data packet generated again of the session task Then by target data processing unit processes.In the prior art, after session task is assigned to some data processing unit, the meeting All data packets of words task are handled by the corresponding data processing unit.The present embodiment can be in processing session data Session task is migrated during packet, and transition process not will cause the interruption of session traffic.
It should be noted that in data accepted packet of the former data processing unit to the session for needing to migrate, processing terminate Afterwards, then the migration operation of the session is carried out, this migration operation may be implemented under the premise of not interrupting session traffic processing, will Session moves to another data processing unit from a data processing unit, during conversation shift, corresponding session Data packet is not in stream packet, postpones the problems such as excessive, synchronous, so that forwarding data flow is unaffected in transition process.
In embodiments of the present invention, it can be carried out according to the classification information for the session Hash table that data processor uses specific Conversation shift operation, wherein the classification information can be global session Hash table classification, local session Hash table classification. If the currently employed session Hash table of data processor is global session Hash table, illustrate in the data processor at each data The session Hash table content for managing unit use is identical, and the session information data field for being migrated session is not necessarily to from former data It manages and is copied in the session Hash table of target data processing unit in the session Hash table of unit, because there are identical session letters Data field is ceased, therefore, directly conversate migration step.
If the currently employed session Hash table of data processor is local session Hash table, illustrate every in the data processor The session Hash table content that a data processing unit uses is not identical.Further, in order to guarantee target data processing unit There is the session information data field for being migrated session in session Hash table, the method can also include: that will be migrated session Session information data field copy to in the session Hash table for being migrated the corresponding target data processing unit of session. So that target data processing unit is according to the session information data field of the duplication, continue with that be migrated session corresponding with this Data packet.It should be noted that the mode of copy session information data field is without being limited thereto, the meeting of session can also be will be migrated Words information data field, which is clipped to, to be migrated in the session Hash table of the corresponding target data processing unit of session with this.
Further, after in order to guarantee conversation shift, data processor receives network packet again and is able to carry out accordingly Processing, after step 204, the method can also include: the corresponding target data processing unit of session of record migration Identification information, wherein the identification information can be title, the ID (Identity, identity number) of data processing unit Number etc.;When receiving data packet corresponding with the session of the migration, according to the identification information, by the allocation of packets It is handled into the target data processing unit.
Specifically, described according to the identification information, by the allocation of packets into the target data processing unit The step of being handled can specifically include: pass through preset distributor or former data processing list corresponding with the session of the migration Member handles the allocation of packets into the target data processing unit.Wherein, the preset distributor can be With the device that the session data newly received is forwarded a packet to corresponding data processing unit function.
In embodiments of the present invention, when receiving data packet corresponding with the session of migration, if there is no above-mentioned pre- Distributor is set, it can also be according to the identification information of the target data processing unit of record, by former data corresponding with the session Unit forwards are managed to being handled in target data processing unit, will not influence the processing of session task.
Further, in order to guarantee the real-time of load balancing between data processing unit in data processor, the side When method can also include: after the completion of conversation shift or establish new Dialog processing task, to data in the data processor The session distribution information of processing unit is updated.
The newest session of data processing unit in the data processor, which is obtained, according to prefixed time interval distributes information.Its In, the prefixed time interval can be configured in actual demand according to, for example, prefixed time interval can be set as 1 second, 2 seconds etc..It should be noted that by obtaining the newest session of data processing unit in data processor according to prefixed time interval Information is distributed, may be implemented to obtain the newest session distribution information of data processing unit in data processor in real time, and according to this Newest session distribution information executes conversation shift operation, so can with data processing unit in real-time ensuring data processor it Between load balancing, maximize the treatment effeciency of data processor.
In embodiments of the present invention, for some special scenes, when such as carrying out properties of product assessment, it is desirable that assessment system is most Bigization processing capacity can directly carry out packet delivery by network interface card, then execute the embodiment of the present invention in order to realize the purpose The step 201 of offer is to process described in step 204, so that the session task quantity of each data processing unit is identical, Jin Erke To carry out the assessment that system maximizes processing capacity under conditions of load balancing between data processing unit, set with passing through at present The mode for setting the address pair specific network protocol (Internet Protocol, IP), which carries out data flow, uniformly distributes and compares, and is not required to IP address pair is manually set, the balanced adjustment of the number of sessions between different data processing units can be realized automatically, improve Convenience.
Process flow specific for the embodiment of the present invention can with as shown in figure 3,
Data packet receives: after network interface card receives data packet, according to the content information of data packet, data packet is pressed into flow point class, it will Packet delivery is handled to different data processing units.
Data packet processing: each data processing unit can parse data packet, carry out corresponding every safety inspection, And session information is saved, finally execute corresponding safe action.
Conversation dispatching: information is distributed according to the session of each data processing unit summarized, executes the scheduling of load balancing Algorithm calculates the session for needing to migrate and former data processing unit corresponding with the session and target data processing unit.
Conversation shift: by the session of required migration, in the case where guaranteeing the unbroken situation of regular traffic, it will talk about from former number According to processing unit dynamic migration to target data processing unit, entire transition process only influences two data processing units, to meeting It is transparent for words.
Data packet is sent: data processing unit is after having carried out data packet processing, according to the information of the affiliated session of data packet, It sends data packet in network by network interface card.
Another kind load-balancing method provided in an embodiment of the present invention, first data processing unit in acquisition data processor Session distribute information;Then according to session distribute information and default load balance scheduling rule, generate data processing unit it Between load balancing conversation dispatching information;Last foundation conversation dispatching information, in the meeting that former data processing unit migrates needs The data accepted packet after treatment of words, then the migration operation of the session is carried out, it may be implemented do not interrupting at session traffic Under the premise of reason, the load balancing between different data processing units, during conversation shift, the number of corresponding session are realized The problems such as according to packet be not in packet loss, delay is excessive, synchronous, forwarding data flow is unaffected in transition process;It may be implemented The newest session of data processing unit in data processor is obtained in real time and distributes information, and distributes information according to the newest session Conversation shift operation is executed, and then can be maximum with the load balancing between data processing unit in real-time ensuring data processor Change the treatment effeciency of data processor.
Further, the specific implementation as Fig. 1 the method, the embodiment of the invention provides a kind of load balancing dresses It sets, as shown in figure 4, described device includes: acquiring unit 31, generation unit 32, migration units 33.
The acquiring unit 31 can be used for obtaining the session distribution information of data processing unit in data processor.Institute The session that stating acquiring unit 31 can obtain in data processor from monitoring log information distributes information.The acquiring unit 31 It can be for session distributes the main functional modules of information in acquisition data processor in the present apparatus.Meeting is got in acquiring unit 31 After words distribution information, the generation unit 32 can be passed it to, and trigger the generation unit 32 and work.
The generation unit 32, the session distribution information and default load that can be used for being obtained according to the acquiring unit 31 Balance dispatching rule, generates the conversation dispatching information of load balancing between data processing unit.The generation unit 32 can be Using current session distribution condition as parameter in the present apparatus, the dispatching algorithm of load balancing is executed, generates conversation dispatching information Main functional modules.After generation unit 32 generates conversation dispatching information, the migration units 33 can be passed it to, and touch It sends out migration units 33 described and carries out relevant work.
The migration units 33 can be used for carrying out the number according to the conversation dispatching information that the generation unit 32 generates According to the conversation shift between different data processing units in processor.Further, each in data processor in order to realize The number of sessions of data processing unit is balanced, and then reaches relatively uniform state to the distribution processor of data flow, gives full play to The processing capacity of all data processing units of data processor, maximizes the treatment effeciency of data processor.The migration units 33 is conversate the main functional modules of migration operation in the present apparatus according to conversation dispatching information.Specifically, it will need to migrate Session moved in target data processing unit from former data processing unit.
It should be noted that other of each functional unit involved by a kind of load balancing apparatus provided in an embodiment of the present invention Corresponding description, can be with reference to the corresponding description in Fig. 1, and details are not described herein.
A kind of load balancing apparatus provided in an embodiment of the present invention, can be only fitted in terminal device, can be used for controlling Conversation shift between data processing unit, specifically includes: acquiring unit, generation unit, migration units, single by obtaining first The session that member obtains data processing unit in data processor distributes information;Then it is distributed by generation unit according to the session Information and default load balance scheduling rule, generate the conversation dispatching information of load balancing between data processing unit;Finally lead to It crosses migration units and carries out session in the data processor between different data processing units according to the conversation dispatching information Migration.Session distribution information and default load balance scheduling of the embodiment of the present invention according to data processing unit in data processor Rule generates conversation dispatching information, and executes conversation shift operation according to the conversation dispatching information, to realize data processor In each data processing unit number of sessions it is balanced, and then load balancing between different data processing units may be implemented, from And the treatment effeciency of data processor can be improved.
Further, the specific implementation as Fig. 5 the method, the embodiment of the invention provides another load balancing dresses It sets, as shown in figure 5, described device includes: acquiring unit 41, generation unit 42, migration units 43.
The acquiring unit 41 can be used for obtaining the session distribution information of data processing unit in data processor.Institute The session that stating acquiring unit 41 can obtain in data processor from monitoring log information distributes information.The acquiring unit 41 It can be for session distributes the main functional modules of information in acquisition data processor in the present apparatus.Meeting is got in acquiring unit 41 After words distribution information, the generation unit 42 can be passed it to, and trigger the generation unit 42 and work.
The generation unit 42, the session distribution information and default load that can be used for being obtained according to the acquiring unit 41 Balance dispatching rule, generates the conversation dispatching information of load balancing between data processing unit.The generation unit 42 can be Using current session distribution condition as parameter in the present apparatus, the dispatching algorithm of load balancing is executed, generates conversation dispatching information Main functional modules.After generation unit 42 generates conversation dispatching information, the migration units 43 can be passed it to, and touch It sends out migration units 43 described and carries out relevant work.
The migration units 43 can be used for carrying out the number according to the conversation dispatching information that the generation unit 42 generates According to the conversation shift between different data processing units in processor.The migration units 43 are in the present apparatus according to conversation dispatching Information conversates the main functional modules of migration operation.Specifically, the session migrated will be needed to move from former data processing unit It moves on in target data processing unit.
Optionally, it may include the number of data processing unit in the data processor in the session distribution information, And the currently processed number of sessions of each data processing unit in the data processor.
Specifically, the generation unit 42 can specifically include: determining module 421, generation module 422.
The determining module 421 can be used for according to the number of sessions, the number of data processing unit and default load Balance dispatching rule determines the session for needing to migrate in each data processing unit and original corresponding with the session for needing to migrate Data processing unit and target data processing unit.
The generation module 422, the session that migrates of needs that can be used for being determined according to the determining module and with need The corresponding former data processing unit of the session to be migrated and target data processing unit, it is equal to generate load between data processing unit The conversation dispatching information of weighing apparatus.
The migration units 43, the reception number for the session that specifically can be used for migrating needs in former data processing unit It is according to the conversation dispatching information, the conversation shift for needing to migrate is single to target data processing according to packet after treatment Member.This migration operation may be implemented under the premise of not interrupting session traffic processing, it will talk about from a data processing unit Move to another data processing unit.
Further, described device can also include: recording unit 44, allocation unit 45.
The recording unit 44 can be used for recording the mark letter of the corresponding target data processing unit of session of migration Breath.
The allocation unit 45 can be used for when receiving data packet corresponding with the session of the migration, according to institute The identification information for stating recording unit records handles the allocation of packets into the target data processing unit.Into And after can guaranteeing conversation shift, data processor receives network packet again and is able to carry out respective handling.
Further, described device can also include: copied cells 46.
The copied cells 46, if can be used for the currently employed session Hash table of the data processor for local session Hash table, then the session information data field that will be migrated session is copied to be migrated at the corresponding target data of session with described In the session Hash table for managing unit.It can guarantee to exist in the session Hash table of target data processing unit in turn and be migrated session Session information data field continued with so that target data processing unit is according to the session information data field of the duplication The corresponding data packet of session is migrated with this.
Further, described device can also include: updating unit 47.
The updating unit 47, when can be used for after the completion of conversation shift or establishing new Dialog processing task, to institute The session distribution information for stating data processing unit in data processor is updated.
The acquiring unit 41 specifically can be used for obtaining according to prefixed time interval in the data processor at data The session for managing unit distributes information.And then it can be with the load balancing between data processing unit in real-time ensuring data processor.
It should be noted that its of each functional unit involved by another kind load balancing apparatus provided in an embodiment of the present invention He accordingly describes, can be with reference to the corresponding description in Fig. 2, and details are not described herein.
Another kind load balancing apparatus provided in an embodiment of the present invention, can be only fitted in terminal device, can be used for controlling Conversation shift between data processing unit processed, specifically includes: acquiring unit, migration units, recording unit, is divided at generation unit With unit, copied cells, updating unit etc., the session of data processing unit in data processor is obtained by acquiring unit first Distribute information;Then information and default load balance scheduling rule are distributed according to session by generation unit, generates data processing The conversation dispatching information of load balancing between unit;Finally by migration units according to conversation dispatching information, in former data processing The data accepted packet after treatment for the session that unit migrates needs, then the migration operation of the session is carried out, it may be implemented Under the premise of not interrupting session traffic processing, the load balancing between different data processing units is realized, in conversation shift mistake The problems such as Cheng Zhong, the data packet of corresponding session is not in packet loss, delay is excessive, synchronous, forwarding data flow is in transition process In it is unaffected;It may be implemented to obtain the newest session distribution information of data processing unit in data processor in real time, and according to The newest session distribution information executes conversation shift operation, and then can be with data processing unit in real-time ensuring data processor Between load balancing, maximize the treatment effeciency of data processor.
Based on above-mentioned method and apparatus embodiment, the embodiment of the invention provides a kind of showing for SiteServer LBS framework It is intended to, as shown in fig. 6, the system includes: distributor, data processor, scheduler, transference apparatus.Distributor may include can By packet delivery to the function of different data processing units, it is specifically as follows the function of hardware view realization, such as part network interface card RSS (Receive Side Scaling) function, FlowDirector function of hardware internal etc. is also possible to software view reality Existing function, such as RPS (receive packet steering) function that linux kernel network module packet receiving mechanism provides, Packet delivery is gone out using different classification methods by preset configuration parameter.Needle may be implemented in data processor Processing to network packet main security business.Scheduler can be according to the session of data processing unit in data processor point With information, the dispatching algorithm of load balancing is executed, generates the conversation dispatching information of load balancing between data processing unit;Migration Device carries out the conversation shift in data processor between different data processing units according to the conversation dispatching information that scheduler generates, So that the number of sessions of each data processing unit is balanced, and then load balancing between different data processing units may be implemented.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, there is no the portion being described in detail in some embodiment Point, reference can be made to the related descriptions of other embodiments.
It is understood that the correlated characteristic in the above method and device can be referred to mutually.In addition, in above-described embodiment " first ", " second " etc. be and not represent the superiority and inferiority of each embodiment for distinguishing each embodiment.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
Algorithm and display are not inherently related to any particular computer, virtual system, or other device provided herein. Various general-purpose systems can also be used together with teachings based herein.As described above, it constructs required by this kind of system Structure be obvious.In addition, the present invention is also not directed to any particular programming language.It should be understood that can use various Programming language realizes summary of the invention described herein, and the description done above to language-specific is to disclose this hair Bright preferred forms.
In the instructions provided here, numerous specific details are set forth.It is to be appreciated, however, that implementation of the invention Example can be practiced without these specific details.In some instances, well known method, structure is not been shown in detail And technology, so as not to obscure the understanding of this specification.
Similarly, it should be understood that in order to simplify the disclosure and help to understand one or more of the various inventive aspects, Above in the description of exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes In example, figure or descriptions thereof.However, the disclosed method should not be interpreted as reflecting the following intention: i.e. required to protect Shield the present invention claims features more more than feature expressly recited in each claim.More precisely, as following Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore, Thus the claims for following specific embodiment are expressly incorporated in the specific embodiment, wherein each claim itself All as a separate embodiment of the present invention.
Those skilled in the art will understand that can be carried out adaptively to the module in the equipment in embodiment Change and they are arranged in one or more devices different from this embodiment.It can be the module or list in embodiment Member or component are combined into a module or unit or component, and furthermore they can be divided into multiple submodule or subelement or Sub-component.Other than such feature and/or at least some of process or unit exclude each other, it can use any Combination is to all features disclosed in this specification (including adjoint claim, abstract and attached drawing) and so disclosed All process or units of what method or apparatus are combined.Unless expressly stated otherwise, this specification is (including adjoint power Benefit require, abstract and attached drawing) disclosed in each feature can carry out generation with an alternative feature that provides the same, equivalent, or similar purpose It replaces.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments In included certain features rather than other feature, but the combination of the feature of different embodiments mean it is of the invention Within the scope of and form different embodiments.For example, in the following claims, embodiment claimed is appointed Meaning one of can in any combination mode come using.
Various component embodiments of the invention can be implemented in hardware, or to run on one or more processors Software module realize, or be implemented in a combination thereof.It will be understood by those of skill in the art that can be used in practice Microprocessor or digital signal processor (DSP) realize a kind of load-balancing method and device according to an embodiment of the present invention In some or all components some or all functions.The present invention is also implemented as described herein for executing Some or all device or device programs (for example, computer program and computer program product) of method.In this way Realization program of the invention can store on a computer-readable medium, or can have the shape of one or more signal Formula.Such signal can be downloaded from an internet website to obtain, and perhaps be provided on the carrier signal or with any other shape Formula provides.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and ability Field technique personnel can be designed alternative embodiment without departing from the scope of the appended claims.In the claims, Any reference symbol between parentheses should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not Element or step listed in the claims.Word "a" or "an" located in front of the element does not exclude the presence of multiple such Element.The present invention can be realized by means of including the hardware of several different elements and by means of properly programmed computer. In the unit claims listing several devices, several in these devices, which can be through the same hardware branch, has Body embodies.The use of word first, second, and third does not indicate any sequence.These words can be construed to title.

Claims (12)

1. a kind of load-balancing method characterized by comprising
The session for obtaining data processing unit in data processor distributes information;
Information and default load balance scheduling rule are distributed according to the session, generates load balancing between data processing unit Conversation dispatching information;
The conversation shift in the data processor between different data processing units is carried out according to the conversation dispatching information;
If the currently employed session Hash table of the data processor is local session Hash table, the method also includes:
The session information data field that will be migrated session copies to and described to be migrated session corresponding target data processing single In the session Hash table of member.
2. load-balancing method according to claim 1, which is characterized in that include the number in the session distribution information According to the currently processed meeting of each data processing unit in the number of data processing unit in processor and the data processor Quantity is talked about, it is described to distribute information and default load balance scheduling rule according to the session, it generates and is born between data processing unit Balanced conversation dispatching information is carried, is specifically included:
According to the number of sessions, the number of data processing unit and default load balance scheduling rule, determine at each data The session and former data processing unit corresponding with the session for needing to migrate that need to migrate in reason unit and target data are handled Unit;
The session migrated and former data processing unit corresponding with the session for needing to migrate and target data are needed according to described Processing unit generates the conversation dispatching information of load balancing between data processing unit.
3. load-balancing method according to claim 1 or 2, which is characterized in that described according to the conversation dispatching information The conversation shift in the data processor between different data processing units is carried out, is specifically included:
In the data accepted packet after treatment for the session that former data processing unit migrates needs, according to the conversation dispatching Information, by the conversation shift for needing to migrate to target data processing unit.
4. load-balancing method according to claim 1, which is characterized in that described to be carried out according to the conversation dispatching information After conversation shift in the data processor between different data processing units, the method also includes:
Record the identification information of the corresponding target data processing unit of session of migration;
When receiving data packet corresponding with the session of the migration, according to the identification information, by the allocation of packets It is handled into the target data processing unit.
5. load-balancing method according to claim 1, which is characterized in that the method also includes:
After the completion of conversation shift or when establishing new Dialog processing task, to data processing unit in the data processor Session distribution information is updated.
6. load-balancing method according to claim 5, which is characterized in that data processing in the acquisition data processor The session of unit distributes information, specifically includes:
Information is distributed according to the session that prefixed time interval obtains data processing unit in the data processor.
7. a kind of load balancing apparatus characterized by comprising
Acquiring unit, the session for obtaining data processing unit in data processor distribute information;
Generation unit, session distribution information and default load balance scheduling rule for being obtained according to the acquiring unit are raw At the conversation dispatching information of load balancing between data processing unit;
Migration units, the conversation dispatching information for being generated according to the generation unit carry out different numbers in the data processor According to the conversation shift between processing unit;
Described device further include:
Copied cells will be by if the session Hash table currently employed for the data processor is local session Hash table The session information data field of migration session copies to and the session for being migrated the corresponding target data processing unit of session In Hash table.
8. load balancing apparatus according to claim 7, which is characterized in that include the number in the session distribution information According to the currently processed meeting of each data processing unit in the number of data processing unit in processor and the data processor Quantity is talked about, the generation unit specifically includes:
Determining module, for regular according to the number of the number of sessions, data processing unit and default load balance scheduling, really The session and former data processing unit corresponding with the session for needing to migrate that need to migrate in fixed each data processing unit and Target data processing unit;
Generation module, the session that migrates of needs for being determined according to the determining module and corresponding with the session that needs migrate Former data processing unit and target data processing unit, generate data processing unit between load balancing conversation dispatching letter Breath.
9. load balancing apparatus according to claim 7 or 8, which is characterized in that
The migration units, specifically for the data accepted packet processing knot of the session migrated in former data processing unit to needs Shu Hou, according to the conversation dispatching information, by the conversation shift for needing to migrate to target data processing unit.
10. load balancing apparatus according to claim 7, which is characterized in that described device further include:
Recording unit, the identification information of the corresponding target data processing unit of session for recording migration;
Allocation unit, for when receiving data packet corresponding with the session of the migration, according to the recording unit records Identification information, the allocation of packets is handled into the target data processing unit.
11. load balancing apparatus according to claim 7, which is characterized in that described device further include:
Updating unit, for after the completion of conversation shift or when establishing new Dialog processing task, in the data processor The session distribution information of data processing unit is updated.
12. load balancing apparatus according to claim 7, which is characterized in that
The acquiring unit, specifically for obtaining the meeting of data processing unit in the data processor according to prefixed time interval Words distribution information.
CN201610718285.1A 2016-08-24 2016-08-24 Load-balancing method and device Active CN106357726B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610718285.1A CN106357726B (en) 2016-08-24 2016-08-24 Load-balancing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610718285.1A CN106357726B (en) 2016-08-24 2016-08-24 Load-balancing method and device

Publications (2)

Publication Number Publication Date
CN106357726A CN106357726A (en) 2017-01-25
CN106357726B true CN106357726B (en) 2019-08-20

Family

ID=57844960

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610718285.1A Active CN106357726B (en) 2016-08-24 2016-08-24 Load-balancing method and device

Country Status (1)

Country Link
CN (1) CN106357726B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108696557B (en) * 2017-04-11 2021-08-10 北京京东尚科信息技术有限公司 Information processing system, method and device
CN109714269B (en) * 2018-12-19 2022-05-17 迈普通信技术股份有限公司 Data processing method and network equipment
CN109495504B (en) * 2018-12-21 2021-05-25 东软集团股份有限公司 Firewall equipment and message processing method and medium thereof
CN110531931B (en) * 2019-08-22 2022-03-22 济南浪潮数据技术有限公司 Storage device selection method and device and computer readable storage medium
CN111628941A (en) * 2020-05-27 2020-09-04 广东浪潮大数据研究有限公司 Network traffic classification processing method, device, equipment and medium
CN112311876B (en) * 2020-10-30 2022-08-16 武汉绿色网络信息服务有限责任公司 Method and device for determining back-end device of current session through load balancing device
CN115150448B (en) * 2022-06-14 2023-08-25 北京车网科技发展有限公司 Session data processing method, system, storage medium and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102495857A (en) * 2011-11-21 2012-06-13 北京新媒传信科技有限公司 Load balancing method for distributed database
CN102662763A (en) * 2012-04-11 2012-09-12 华中科技大学 Virtual machine resource scheduling method based on service quality
CN103002038A (en) * 2012-12-13 2013-03-27 华为技术有限公司 Processing method and device for elastic load balancing
CN103259740A (en) * 2013-04-27 2013-08-21 杭州华三通信技术有限公司 Load balancing processing method and device
CN104901898A (en) * 2015-06-08 2015-09-09 东软集团股份有限公司 Load balancing method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102495857A (en) * 2011-11-21 2012-06-13 北京新媒传信科技有限公司 Load balancing method for distributed database
CN102662763A (en) * 2012-04-11 2012-09-12 华中科技大学 Virtual machine resource scheduling method based on service quality
CN103002038A (en) * 2012-12-13 2013-03-27 华为技术有限公司 Processing method and device for elastic load balancing
CN103259740A (en) * 2013-04-27 2013-08-21 杭州华三通信技术有限公司 Load balancing processing method and device
CN104901898A (en) * 2015-06-08 2015-09-09 东软集团股份有限公司 Load balancing method and device

Also Published As

Publication number Publication date
CN106357726A (en) 2017-01-25

Similar Documents

Publication Publication Date Title
CN106357726B (en) Load-balancing method and device
CN114189571B (en) Apparatus and method for implementing accelerated network packet processing
CN105721535B (en) For carrying out calculating equipment, method and the machine readable storage medium of parallel processing to the service function in service function chain
RU2643626C1 (en) Method of distributing acceptable packages, queue selector, package processing device and information media
US11394649B2 (en) Non-random flowlet-based routing
US20200007445A1 (en) Enhanced service function chain
US20190104022A1 (en) Policy-based network service fingerprinting
EP3407563B1 (en) Method, apparatus and machine readable medium for accelerating network security monitoring
US9910687B2 (en) Data flow affinity for heterogenous virtual machines
US10616099B2 (en) Hypervisor support for network functions virtualization
WO2015114473A1 (en) Method and apparatus for locality sensitive hash-based load balancing
Hu et al. Towards" full containerization" in containerized network function virtualization
CN112437023B (en) Virtualized security network element data processing method, system, medium and cloud platform
JP5900352B2 (en) Packet processing apparatus, packet processing method and program
CN106603409B (en) Data processing system, method and equipment
US20210034546A1 (en) Transparent encryption
US9491098B1 (en) Transparent network multipath utilization through encapsulation
US10616116B1 (en) Network traffic load balancing using rotating hash
Miguel-Alonso A research review of OpenFlow for datacenter networking
EP4199427A1 (en) Ai-supported network telemetry using data processing unit
US20160261526A1 (en) Communication apparatus and processor allocation method for the same
US9736080B2 (en) Determination method, device and storage medium
Chen et al. Evolving switch architecture toward accommodating in-network intelligence
CN106549815B (en) Apparatus and method for real-time deep application recognition in a network
Zhang et al. Efficient and verifiable service function chaining in NFV: Current solutions and emerging challenges

Legal Events

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