CN108737255B - Load balancing method, load balancing device and server - Google Patents

Load balancing method, load balancing device and server Download PDF

Info

Publication number
CN108737255B
CN108737255B CN201810548859.4A CN201810548859A CN108737255B CN 108737255 B CN108737255 B CN 108737255B CN 201810548859 A CN201810548859 A CN 201810548859A CN 108737255 B CN108737255 B CN 108737255B
Authority
CN
China
Prior art keywords
mail
information
load
gateway
mail gateway
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
CN201810548859.4A
Other languages
Chinese (zh)
Other versions
CN108737255A (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 Wondersoft Technology Co Ltd
Original Assignee
Beijing Wondersoft 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 Wondersoft Technology Co Ltd filed Critical Beijing Wondersoft Technology Co Ltd
Priority to CN201810548859.4A priority Critical patent/CN108737255B/en
Publication of CN108737255A publication Critical patent/CN108737255A/en
Application granted granted Critical
Publication of CN108737255B publication Critical patent/CN108737255B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • 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
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/42Mailbox-related aspects, e.g. synchronisation of mailboxes

Abstract

The invention provides a load balancing method, a device and a server, wherein the method comprises the following steps: receiving multiple groups of heartbeat information from a plurality of mail gateways, wherein each group of heartbeat information comprises load information of the mail gateways; calculating the load weight of each mail gateway according to the load information in the heartbeat information of each mail gateway; and if receiving a mail to be sent from a mail sending server, forwarding the mail to be sent to a target mail gateway corresponding to the maximum load weight so that the target mail gateway processes the mail to be sent. The invention ensures that each mail gateway is in a working state and forwards the mail to be sent to the mail gateway with the maximum load weight for processing, thereby improving the efficiency of mail processing of the mail gateways and ensuring that a plurality of mail gateways can work in a balanced manner.

Description

Load balancing method, load balancing device and server
Technical Field
The present invention relates to the field of network communication technologies, and in particular, to a load balancing method, a load balancing apparatus, and a server.
Background
In large enterprises, because of the large amount of mails, in order to process the mails in time and safely deliver the mails, two or more mail gateways are generally erected for mail processing. And how to exert the advantages of a plurality of gateways for a plurality of mail gateways, namely, the mail is processed in parallel, which becomes a difficult problem of a cluster deployment mode.
A common deployment of a cluster is a master-slave mode (i.e., one master gateway, one slave gateway). When the gateway in the main-standby mode processes the mail, only one main gateway works at the same time, namely the mail is processed, and when the main gateway breaks down, the other standby gateway equipment can be continuously used for working, so that the normal mail service requirement of a user is not influenced. However, this method is a waste of resources from the efficient perspective, which cannot make each gateway device operate efficiently, and the concurrent processing capability for the mails is not high, which is likely to cause problems such as mail transmission delay, mail transmission failure, and mail blocking.
Therefore, the prior art scheme for processing the mails by the gateway generally has the problem of low efficiency of processing the mails by the mail gateway.
Disclosure of Invention
The invention provides a load balancing method, a load balancing device and a server, which are used for solving the problem of low mail processing efficiency of a mail gateway in the scheme of processing mails by the gateway in the prior art.
In order to solve the above problem, according to an aspect of the present invention, the present invention discloses a load balancing method, including:
receiving multiple groups of heartbeat information from a plurality of mail gateways, wherein each group of heartbeat information comprises load information of the mail gateways;
calculating the load weight of each mail gateway according to the load information in the heartbeat information of each mail gateway;
and if receiving a mail to be sent from a mail sending server, forwarding the mail to be sent to a target mail gateway corresponding to the maximum load weight so that the target mail gateway processes the mail to be sent.
According to another aspect of the present invention, the present invention also discloses a load balancing apparatus, including:
the receiving module is used for receiving a plurality of groups of heartbeat information from a plurality of mail gateways, wherein each group of heartbeat information comprises load information of the mail gateways;
the calculation module is used for calculating the load weight of each mail gateway according to the load information in the heartbeat information of each mail gateway;
and the forwarding module is used for forwarding the mail to be sent to a target mail gateway corresponding to the maximum load weight if the mail to be sent from the mail sending server is received, so that the target mail gateway processes the mail to be sent.
According to another aspect of the present invention, the present invention also discloses a server, which includes the above load balancing apparatus.
Compared with the prior art, the invention has the following advantages:
therefore, each mail gateway is in a working state, and the mail to be sent is forwarded to the mail gateway with the maximum load weight for processing, so that the efficiency of mail processing of the mail gateways is improved, a plurality of mail gateways can work uniformly, and the problems of mail sending delay, mail sending failure, mail blocking and the like are avoided; in addition, for the determination of the mail gateway for processing the mail, the embodiment of the invention receives the heartbeat information of the plurality of mail gateways and calculates the load weight of each mail gateway based on the heartbeat information, so that the load condition of each mail gateway can be determined, the mail to be sent is forwarded to the mail gateway with the minimum load for processing, and the concurrent processing capability and the mail delivery efficiency of the mail gateway are improved.
Drawings
FIG. 1 is a block diagram of the architecture of one embodiment of a mail system of the present invention;
FIG. 2 is a flow chart of steps of an embodiment of a load balancing method of the present invention;
fig. 3 is a block diagram of a load balancing apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Referring to fig. 1, a block diagram of an embodiment of a mail system of the present invention is shown.
As shown in fig. 1, the mail system of the embodiment of the present invention may include a mail sending server, a load balancing server, a plurality of mail gateways (including mail gateway 1, mail gateway 2 … …, mail gateway n), and a mail receiving server.
The mail sending server in the embodiment of the present invention is preset with a mail forwarding function, that is, when receiving a mail to be sent, the mail is not directly sent to the mail receiving server, but is forwarded to the load balancing server in the embodiment of the present invention. In this way, the load balancing server can receive one or more mails to be sent forwarded by one or more mail sending servers. And the load balancing server is responsible for distributing the received one or more mails to be sent to each mail gateway.
In order to enable the load balancing server to improve the efficiency of processing the mails of the mail gateways and balance the loads of the mail gateways, each mail gateway can report the load information of the mail gateway to the load balancing server in a heartbeat information mode, so that the load balancing server can calculate the best mail gateway capable of receiving the mails at present according to the received heartbeat information of each mail gateway and send one or more received mails to be sent from the mail sending server to the best mail gateway for mail processing.
Each mail gateway can send heartbeat information periodically, for example, once every 30 seconds, and when the load balancing server calculates the optimal mail gateway, the load balancing server can also calculate periodically, for example, the optimal mail gateway is calculated every minute, so that the optimal mail gateway can be dynamically determined and the received mails to be sent are sent to the optimal mail gateway for processing, thereby avoiding the problem that the processing pressure of the optimal mail gateway is too high because a plurality of mails to be sent are sent to the same optimal mail gateway, and ensuring that each mail gateway is load balanced.
Referring to fig. 2, a flowchart illustrating steps of an embodiment of a load balancing method of the present invention is shown. The following describes a flow of the load balancing method shown in fig. 2 with reference to the mail system shown in fig. 1, where the method may specifically include the following steps:
step 101, receiving multiple groups of heartbeat information from multiple mail gateways;
when the mail gateway is connected with the load balancing server, the mail gateway can carry the load information of the mail gateway in the heartbeat information and send the heartbeat information to the load balancing server as soon as the mail gateway is started. Thus, the load balancer of the embodiment of the present invention can receive multiple sets of heartbeat information from multiple mail gateways, wherein each set of heartbeat information includes load information of a corresponding mail gateway.
Optionally, in an embodiment, the load information of the mail gateway may include at least one of: CPU load information, remaining memory information, mail queue information (i.e., the total amount of mail waiting to be processed in the queue).
Therefore, the load information of the mail gateways can be received to accurately determine the load condition of each mail gateway, and the accuracy of selecting the optimal mail gateway by the load balancing server is improved.
Of course, the load information of the mail gateway of the present invention is not limited to the above three types, and may also include other known information capable of representing the load condition of the mail gateway, which is not described herein again.
Optionally, in one embodiment, in executing step 101, multiple sets of heartbeat information from multiple mail gateways may be received according to a first preset time period.
In this way, each mail gateway may report the latest heartbeat information to the load balancing server periodically, for example, every 1 minute. The heartbeat information of each mail gateway is reported regularly by each mail gateway, so that the load balancing server can know the condition of processing the mail of each mail gateway, and can know that the mail gateway has a fault in time when the heartbeat information of a certain mail gateway is not received in an overdue mode.
And the first preset time periods corresponding to the heartbeat information of different mail gateways are the same or different.
That is, when the heartbeat information is reported regularly, the reporting periods (i.e., the first preset time periods) of the mail gateways may be the same or different.
Preferably, the reporting periods of the heartbeat messages of different mail gateways are the same, so that if the starting time of each mail gateway is consistent, the load balancing server can receive the latest load information of each mail gateway at the same time, and thus, the optimal mail gateway with the largest current load weight can be accurately calculated according to the latest load information of each mail gateway.
The load weight may vary according to the load size, and if the load is always increased, the load weight may be always decreased, and when the load weight of a certain mail gateway is not the maximum load weight among the n mail gateways, the load balancing server according to the embodiment of the present invention may not re-distribute the mail to be sent to the certain mail gateway, but instead, distribute the mail to be sent to a new mail gateway with the maximum load weight.
Optionally, the reporting periods of the heartbeat information of different mail gateways may also be different, so that the load balancing server does not need to receive the heartbeat information of a plurality of mail gateways at the same time, the receiving pressure of the heartbeat information of the load balancing server is reduced, and the system performance is improved.
Optionally, after step 101, the method according to the embodiment of the present invention may further include:
and for any second target mail gateway, if a group of heartbeat information from the second target mail gateway is not received within a first preset time period corresponding to the second target mail gateway, deleting a group of heartbeat information from the second target mail gateway, which is received in advance.
After step 101, that is, for any mail gateway that has reported heartbeat information (i.e. a second target mail gateway, such as the mail gateway 1), if the load balancing server has not received heartbeat information of the mail gateway for an extended period (for example, the reporting period of the heartbeat information of the mail gateway 1 is 1 minute, the reporting period of the heartbeat information of the mail gateway 2 is 1.5 minutes, and the extended period here refers to that the time from the last time of receiving the heartbeat information of the mail gateway 1 has exceeded 1 minute), it indicates that the mail gateway has a fault. In order to determine the optimal mail gateway, the mail gateway is no longer used as an alternative, that is, when the load weight is calculated, the load weight can no longer be calculated according to the previously received load information of the mail gateway with the fault, so that the problem that the mail to be sent is forwarded to the mail gateway with the fault due to the fact that the receiving time of the heartbeat information is different from the time of calculating the load weight is avoided. In this embodiment, the group of heartbeat messages from the failed device received in step 101 may be deleted.
103, calculating the load weight of each mail gateway according to the load information in the heartbeat information of each mail gateway;
the load weight of each mail gateway can be calculated by any method in the known art according to the above load information of each mail gateway, such as CPU load information, remaining memory information, mail queue information, and the like.
The explanation of the load weight is detailed above and will not be repeated here.
Optionally, in an embodiment, in executing step 103, the load information in the heartbeat information of each mail gateway may be calculated according to a preset load balancing algorithm, so as to determine the load weight of each mail gateway.
In one example, the preset load balancing algorithm may be:
WEIGHT=(1-CPU_LOAD_AVERAGE)*100+MEM_FREE-MAIL_NUMB ERS。
wherein, WEIGHT represents load WEIGHT, CPU _ L OAD _ AVERAGE represents CPU load information, MEM _ FREE represents residual memory, MAI L _ NUMBERS represents total number of mails waiting for processing in the queue.
For example, the load balancing server receives heartbeat information for 3 mail gateways.
Wherein, the CPU load of the mail gateway 1 is 0.5, the residual memory is 20, and the total number of mails waiting for processing in the queue is 10; the CPU load of the mail gateway 2 is 0.6, the residual memory is 25, and the total number of mails waiting for processing in the queue is 8; the CPU load of the mail gateway 3 is 0.7, the remaining memory is 10, and the total number of mails waiting for processing in the queue is 9.
Then when calculating the load weights of the three mail gateways according to the preset load balancing algorithm in the above example, the load weight of the mail gateway 1 is (1-0.5) × 100+20-10 ═ 60; the load weight of the mail gateway 2 is (1-0.6) × 100+25-8 ═ 57; the load weight of the mail gateway 3 is (1-0.7) × 100+10-9 ═ 31.
Thus, the load weight 60 of the mail gateway 1 is the largest, indicating that the mail gateway 1 is the least loaded compared to the other two mail gateways.
Of course, the preset load balancing algorithm according to the embodiment of the present invention is not limited to the algorithm in the above example, and may also be other known or future developed algorithms that perform load weight calculation by using the load information, which is not limited in the present invention.
For example, the preset load balancing algorithm may further include:
WEIGHT=(1-CPU_LOAD_AVERAGE)*50+MEM_FREE-MAIL_NUMBE RS。
therefore, the embodiment of the invention utilizes the preset load balancing algorithm to calculate the load weight of each item of load information in the heartbeat information of each mail gateway, can improve the accuracy of the load weight, ensures the reasonable distribution of the mail to be sent, and ensures the load balancing of each mail gateway.
Optionally, in an embodiment, when step 103 is executed, the load weight of each mail gateway may be further calculated according to the load information in the heartbeat information of each mail gateway and according to a second preset time period.
That is to say, after receiving the load information in the heartbeat information sent by each mail gateway, the load balancing server in the embodiment of the present invention, when calculating the load weight of each mail gateway, may calculate the load weight of each mail gateway periodically according to the load information in the received heartbeat information of each mail gateway, in order to avoid the problem that the load balancing server is under heavy processing pressure and the load weight calculation timing is disordered when calculating the load weight in real time when receiving the load information.
For example, the load weight calculation is performed once every minute, so that the load weight of each mail gateway calculated by the load balancing server can be ensured to be continuously updated, so that the optimal mail gateway with the maximum load weight is dynamically changed along with the load condition of the mail gateway, rather than being fixed.
Step 105, if receiving a mail to be sent from a mail sending server, forwarding the mail to be sent to a target mail gateway corresponding to the maximum load weight, so that the target mail gateway processes the mail to be sent.
The receiving time of the mail to be sent by the mail sending server by the load balancing server and the receiving time of the heartbeat information reported by each mail gateway by the load balancing server do not have relevance. The embodiment of the present invention does not limit the receiving sequence of the load balancing server for the heartbeat information and the mail to be sent.
That is to say, the load balancing server may receive the mail to be sent by the mail sending server first, may also receive the heartbeat information reported by each mail gateway first, may also perform interspersed reception on the mail to be sent and the heartbeat information (for example, first receive the mail 1 to be sent by the mail sending server 1, then receive the heartbeat information reported by the mail gateway 2, then receive the mail 2 to be sent by the mail sending server 2), and may also receive the mail to be sent and the heartbeat information at the same time.
Therefore, each mail gateway is in a working state, and the mail to be sent is forwarded to the mail gateway with the maximum load weight for processing, so that the efficiency of mail processing of the mail gateways is improved, a plurality of mail gateways can work uniformly, and the problems of mail sending delay, mail sending failure, mail blocking and the like are avoided; in addition, for the determination of the mail gateway for processing the mail, the embodiment of the invention receives the heartbeat information of the plurality of mail gateways and calculates the load weight of each mail gateway based on the heartbeat information, so that the load condition of each mail gateway can be determined, the mail to be sent is forwarded to the mail gateway with the minimum load for processing, and the concurrent processing capability and the mail delivery efficiency of the mail gateway are improved.
In addition, in this step 105, when receiving the mail to be sent from the mail sending server, the number of the mail to be sent may be one or more.
When the mail to be sent is forwarded to the mail gateway, the mail to be sent needs to be forwarded to the optimal mail gateway, i.e. the target mail gateway.
The best mail gateway is the mail gateway with the largest load weight at the time point when the mail to be sent needs to be forwarded after the load weight calculation of step 103.
Then, by processing the mail to be sent by the optimal mail gateway, the mail to be sent can be sent to the mail gateway with the smallest load obtained by the last calculation, that is, the mail with the largest load weight for mail processing, regardless of whether the number of the mail to be sent is one or more.
Optionally, in an embodiment, after calculating the load weight of each mail gateway according to a second preset time period, the load balancing server ranks the mail gateways according to the sequence of the load weights from large to small, so as to obtain an optimal mail gateway.
In this way, the optimal mail gateway can be determined directly without having to make a comparison of the load weights of the various mail gateways when performing step 105.
After step 105, the load balancing server forwards the mail to be sent to the optimal mail gateway for processing. When the optimal mail gateway processes the mail to be sent, the information such as the mail text, the attachment and the like can be extracted; and the extracted information is deeply analyzed; then, carrying out fuzzy matching and accurate matching on the analyzed data according to a set rule, wherein the preset keywords can comprise keywords of various levels, so that the keywords of which levels correspond to the mail data can be determined through matching; and correspondingly processing the mails matched with the keywords (namely, meeting the rules) according to the risk level.
In the embodiment of the present invention, different risk levels may be preset, each risk level may correspond to one or more levels of keywords, and then according to a corresponding relationship between the risk level and the keyword level, which risk level the mail meeting the rule belongs to may be determined, and each risk level may correspond to a mail processing method, so that the mail meeting the rule may be processed according to the corresponding mail processing method — for example, when processing, an administrator may be informed to track the illegal mail (for example, high risk level) by methods such as approval and blocking.
And finally, the optimal mail gateway sends the processed mail to a corresponding mail receiving server, wherein the mail receiving server can determine the mail receiving server according to an addressee mailbox written in the mail to be sent.
Therefore, the mail to be sent is processed through the optimal mail gateway, so that the sent mail can be controlled through the gateway, the mail carrying sensitive information is prevented from being sent out without permission, and information leakage is avoided. And the outgoing, approval, external attack and the like of the mail are fundamentally strictly controlled, and the safety of an internal mail server and data is ensured. The security and the reliability of the whole mail system are improved, and the protection of the mail system is improved to a new security height.
By means of the technical scheme of the embodiment of the invention, the embodiment of the invention carries out heartbeat connection with a plurality of mail gateways, and the mail gateways report load information such as self memory, CPU use condition, mail queue information and the like to the load balancing server through heartbeat information in the process of reporting the heartbeat; and the load balancing server selects the proper optimal mail gateway according to the collected load information of the plurality of mail gateway devices and the load balancing algorithm, and forwards the mail to the mail gateway. Therefore, a plurality of mail gateways can work at the same time and are in an optimal state efficiently.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Corresponding to the method provided by the embodiment of the present invention, referring to fig. 3, a structural block diagram of an embodiment of a load balancing apparatus according to the present invention is shown, and specifically, the structural block diagram may include the following modules:
a receiving module 31, configured to receive multiple sets of heartbeat information from multiple mail gateways, where each set of heartbeat information includes load information of a mail gateway;
a calculating module 32, configured to calculate a load weight of each mail gateway according to the load information in the heartbeat information of each mail gateway;
the forwarding module 33 is configured to, if a to-be-sent mail from the mail sending server is received, forward the to-be-sent mail to a target mail gateway corresponding to the maximum load weight, so that the target mail gateway processes the to-be-sent mail.
Optionally, the receiving module 31 includes:
the receiving submodule is used for receiving a plurality of groups of heartbeat information from a plurality of mail gateways according to a first preset time period;
and the first preset time periods corresponding to the heartbeat information of different mail gateways are the same or different.
Optionally, the apparatus further comprises:
and the deleting module is used for deleting a group of heartbeat information from the second target mail gateway which is received in advance if a group of heartbeat information from the second target mail gateway is not received in a first preset time period corresponding to the second target mail gateway aiming at any second target mail gateway.
Optionally, the load information of the mail gateway includes at least one of:
CPU load information, residual memory information, and mail queue information.
Optionally, the calculating module 32 is further configured to calculate the load information in the heartbeat information of each mail gateway according to a preset load balancing algorithm, and determine a load weight of each mail gateway.
Optionally, the calculating module 32 is further configured to calculate a load weight of each mail gateway according to a second preset time period according to the load information in the heartbeat information of each mail gateway.
Optionally, the number of the mails to be sent is one or more.
In an embodiment, the present invention further provides a server, where the server may include the load balancing apparatus according to any one of the above embodiments.
For the device and server embodiments, since they are basically similar to the method embodiments, the description is simple, and for the relevant points, refer to the partial description of the method embodiments.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The load balancing method, the load balancing device and the server provided by the invention are described in detail, and a specific example is applied in the text to explain the principle and the implementation of the invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A load balancing method is applied to a load balancing server and comprises the following steps:
receiving multiple groups of heartbeat information from a plurality of mail gateways, wherein each group of heartbeat information comprises load information of the mail gateways, and the heartbeat information is as follows: the latest heartbeat information reported by each mail gateway periodically comprises at least one of the following: CPU load information, residual memory information and mail queue information;
calculating the load weight of each mail gateway according to the load information in the heartbeat information of each mail gateway;
if receiving a mail to be sent from a mail sending server, forwarding the mail to be sent to a target mail gateway corresponding to the maximum load weight so that the target mail gateway processes the mail to be sent, and sending the processed mail to a corresponding mail receiving server by the target mail gateway;
wherein, the target mail gateway processes the mail to be sent, including:
extracting mail text and attachment information; carrying out deep analysis on the extracted information; carrying out fuzzy matching and accurate matching of preset keywords on the analyzed data according to a set rule, and carrying out corresponding processing on the mails matched with the keywords according to risk levels;
after receiving multiple sets of heartbeat information from multiple mail gateways according to a first preset time period, the method further comprises:
for any second target mail gateway, if a group of heartbeat information from the second target mail gateway is not received within a first preset time period corresponding to the second target mail gateway, deleting a group of heartbeat information from the second target mail gateway received in advance; when the load weight of each mail gateway is calculated, the load weight of each mail gateway is not calculated according to the previously received load information of the second target mail gateway.
2. The method of claim 1, wherein receiving multiple sets of heartbeat information from multiple mail gateways comprises:
receiving a plurality of groups of heartbeat information from a plurality of mail gateways according to a first preset time period;
and the first preset time periods corresponding to the heartbeat information of different mail gateways are the same or different.
3. The method of claim 1, wherein the load information of the mail gateway comprises at least one of:
CPU load information, residual memory information, and mail queue information.
4. The method of claim 1, wherein the calculating the load weight of each mail gateway according to the load information in the heartbeat information of each mail gateway comprises:
and calculating the load information in the heartbeat information of each mail gateway according to a preset load balancing algorithm, and determining the load weight of each mail gateway.
5. The method of claim 1, wherein the calculating the load weight of each mail gateway according to the load information in the heartbeat information of each mail gateway further comprises:
and calculating the load weight of each mail gateway according to the load information in the heartbeat information of each mail gateway and a second preset time period.
6. A load balancing device applied to a load balancing server comprises:
a receiving module, configured to receive multiple sets of heartbeat information from multiple mail gateways, where each set of heartbeat information includes load information of the mail gateway, and the heartbeat information is: the latest heartbeat information reported by each mail gateway periodically comprises at least one of the following: CPU load information, residual memory information and mail queue information;
the calculation module is used for calculating the load weight of each mail gateway according to the load information in the heartbeat information of each mail gateway;
the forwarding module is used for forwarding the mail to be sent to a target mail gateway corresponding to the maximum load weight if the mail to be sent from the mail sending server is received, so that the target mail gateway processes the mail to be sent, and the target mail gateway sends the processed mail to a corresponding mail receiving server;
wherein the forwarding module comprises:
the risk processing submodule is used for extracting the mail text and the attachment information; carrying out deep analysis on the extracted information; carrying out fuzzy matching and accurate matching of preset keywords on the analyzed data according to a set rule, and carrying out corresponding processing on the mails matched with the keywords according to risk levels;
the device further comprises:
a deleting module, configured to delete, for any second target mail gateway, a group of heartbeat information from the second target mail gateway received in advance if the group of heartbeat information is not received within a first preset time period corresponding to the second target mail gateway; when the load weight of each mail gateway is calculated, the load weight of each mail gateway is not calculated according to the previously received load information of the second target mail gateway.
7. The apparatus of claim 6, wherein the receiving module comprises:
the receiving submodule is used for receiving a plurality of groups of heartbeat information from a plurality of mail gateways according to a first preset time period;
and the first preset time periods corresponding to the heartbeat information of different mail gateways are the same or different.
8. The apparatus of claim 6, wherein the load information of the mail gateway comprises at least one of:
CPU load information, residual memory information, and mail queue information.
9. The apparatus of claim 6,
the calculation module is further configured to calculate the load information in the heartbeat information of each mail gateway according to a preset load balancing algorithm, and determine a load weight of each mail gateway;
the calculation module is further configured to calculate a load weight of each mail gateway according to a second preset time period and according to the load information in the heartbeat information of each mail gateway.
10. A server, comprising: a load balancing device as claimed in any one of claims 6 to 9.
CN201810548859.4A 2018-05-31 2018-05-31 Load balancing method, load balancing device and server Active CN108737255B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810548859.4A CN108737255B (en) 2018-05-31 2018-05-31 Load balancing method, load balancing device and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810548859.4A CN108737255B (en) 2018-05-31 2018-05-31 Load balancing method, load balancing device and server

Publications (2)

Publication Number Publication Date
CN108737255A CN108737255A (en) 2018-11-02
CN108737255B true CN108737255B (en) 2020-07-10

Family

ID=63931460

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810548859.4A Active CN108737255B (en) 2018-05-31 2018-05-31 Load balancing method, load balancing device and server

Country Status (1)

Country Link
CN (1) CN108737255B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111866040B (en) * 2019-04-28 2023-09-26 深圳长城开发科技股份有限公司 Gateway load balancing method and device for LoRa server
CN111212109A (en) * 2019-12-13 2020-05-29 东软集团股份有限公司 Internet of things communication method, server, terminal and equipment
CN114003371B (en) * 2021-09-28 2023-03-07 中汽创智科技有限公司 Automatic driving load balancing method and device, electronic equipment and storage medium
CN114710499A (en) * 2022-03-30 2022-07-05 重庆川仪自动化股份有限公司 Load balancing method, device and medium for edge computing gateway based on computational power routing

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102377690A (en) * 2011-10-10 2012-03-14 网易(杭州)网络有限公司 Anti-spam gateway system and method
CN102480492A (en) * 2010-11-22 2012-05-30 中国电信股份有限公司 Method and device for monitoring input/output of sensitive file
CN104702487A (en) * 2013-12-04 2015-06-10 北京千橡网景科技发展有限公司 Mail sending method and device
CN104954277A (en) * 2015-06-17 2015-09-30 深圳市创梦天地科技有限公司 Load balancing method, gateway server and related system
CN107172081A (en) * 2017-06-28 2017-09-15 北京明朝万达科技股份有限公司 A kind of method and apparatus of data check

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101179532B (en) * 2007-12-13 2011-06-22 腾讯科技(深圳)有限公司 Mail server system and mail distributing method
CN101753478A (en) * 2008-12-05 2010-06-23 中国移动通信集团公司 Distributed E-mail system and service method thereof
CN101984632A (en) * 2010-11-15 2011-03-09 中兴通讯股份有限公司 Load distributing method, device and server in distributed cache system
JP5584312B2 (en) * 2010-11-18 2014-09-03 京セラ株式会社 Mobile communication system, base station, and communication method
CN102611735B (en) * 2011-12-21 2015-12-09 北京奇虎科技有限公司 A kind of load-balancing method of application service and system
CN104168326B (en) * 2014-08-27 2018-01-30 福建星网视易信息系统有限公司 A kind of method and system of server equally loaded
CN107846457A (en) * 2017-10-26 2018-03-27 广州市雷军游乐设备有限公司 Load-balancing method, device, storage medium and the system of server cluster

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102480492A (en) * 2010-11-22 2012-05-30 中国电信股份有限公司 Method and device for monitoring input/output of sensitive file
CN102377690A (en) * 2011-10-10 2012-03-14 网易(杭州)网络有限公司 Anti-spam gateway system and method
CN104702487A (en) * 2013-12-04 2015-06-10 北京千橡网景科技发展有限公司 Mail sending method and device
CN104954277A (en) * 2015-06-17 2015-09-30 深圳市创梦天地科技有限公司 Load balancing method, gateway server and related system
CN107172081A (en) * 2017-06-28 2017-09-15 北京明朝万达科技股份有限公司 A kind of method and apparatus of data check

Also Published As

Publication number Publication date
CN108737255A (en) 2018-11-02

Similar Documents

Publication Publication Date Title
CN108737255B (en) Load balancing method, load balancing device and server
US10079879B2 (en) Weighted rendezvous hashing
CN110233860B (en) Load balancing method, device and system
CN110209492B (en) Data processing method and device
CN107545338B (en) Service data processing method and service data processing system
RU2017111477A (en) Methods and systems for determining non-standard user activity
JP5664098B2 (en) Composite event distribution apparatus, composite event distribution method, and composite event distribution program
CN103391312B (en) Resource offline method for down loading and device
US20200242604A1 (en) Transaction selection device for selecting blockchain transactions
CN105306300A (en) Real-time network cluster monitoring method and system
JP7103705B1 (en) Cluster-based capacity reduction processing method and equipment
CN109597800B (en) Log distribution method and device
CN101803340A (en) System and method for balancing information loads
CN104077188A (en) Method and device for scheduling tasks
CN103309723A (en) Virtual machine resource integration system and method
CN104615486A (en) Multi-task scheduling and executing method, device and system for search promotion platform
CN104125294A (en) Method and system for big data safety management
CN106991070A (en) Real-time computing technique and device
CN102394833A (en) Adaptively selecting electronic message scanning rules
JP6059558B2 (en) Load balancing judgment system
CN109302300A (en) Data distributing method and device, data processing method and server
CN105978939A (en) Data downloading method and data downloading device
CN105025042A (en) Method of determining data information, system and proxy servers
CN106161542A (en) A kind of data download method and device
CN105827418B (en) A kind of communication network warning correlating method and device

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