



技术领域technical field
本发明涉及设备集成技术领域,尤其涉及一种负载均衡的方法、装置及系统。The present invention relates to the technical field of equipment integration, in particular to a load balancing method, device and system.
背景技术Background technique
随着电信设备集成度的提高,电信设备的处理能力和计算能力也相应地增大。处理能力和计算能力的增大使得电信设备难以承担。如果抛弃现有电信设备去做大量的硬件升级显然是不现实的,会造成资源的严重浪费。在这种情况下,负载均衡技术应运而生。With the improvement of the integration degree of the telecommunication equipment, the processing capability and computing capability of the telecommunication equipment also increase accordingly. The increase in processing power and computing power has made telecommunications equipment unaffordable. It is obviously unrealistic to abandon the existing telecommunication equipment and do a large number of hardware upgrades, which will cause a serious waste of resources. In this case, load balancing technology emerges as the times require.
负载均衡技术采用多个处理单元构成资源池,由分发单元对资源池中的处理单元统一进行控制。具体为:各处理单元将自身负载状况上报至分发单元,当有服务请求时,分发单元根据一定的算法为该服务请求分配一个处理单元,然后将该服务请求转给相应的处理单元进行处理。分发单元还要更新各处理单元的负载状况,以便为后续的服务请求分配处理单元。The load balancing technology uses multiple processing units to form a resource pool, and the distribution unit uniformly controls the processing units in the resource pool. Specifically: each processing unit reports its own load status to the distribution unit. When there is a service request, the distribution unit allocates a processing unit for the service request according to a certain algorithm, and then transfers the service request to the corresponding processing unit for processing. The distribution unit also updates the load status of each processing unit, so as to allocate processing units for subsequent service requests.
发明人在研究过程中,发现现有负载均衡技术至少存在以下缺点:不易进行扩展,并且,可靠性不强。具体为:若用户希望电信设备具有更大的处理能力或者计算能力,需要增加处理单元的个数,而分发单元的能力是有限的,其所能控制的处理单元的个数也是有限的,因此,很难再增加处理单元的个数,意即不易进行扩展。During the research process, the inventor found that the existing load balancing technology has at least the following disadvantages: it is not easy to expand, and the reliability is not strong. Specifically: if the user wants the telecommunication equipment to have greater processing power or computing power, the number of processing units needs to be increased, but the ability of the distribution unit is limited, and the number of processing units it can control is also limited, so , it is difficult to increase the number of processing units, which means that it is not easy to expand.
分发单元是现有负载均衡技术的核心,一旦分发单元发生故障,负载均衡技术将无法实施,因此,现有负载均衡技术的可靠性不强。The distribution unit is the core of the existing load balancing technology. Once the distribution unit fails, the load balancing technology will not be implemented. Therefore, the reliability of the existing load balancing technology is not strong.
发明内容Contents of the invention
有鉴于此,本发明提供了一种负载均衡的方法、装置及系统,使其易于扩展,并且具有较强的可靠性。In view of this, the present invention provides a load balancing method, device and system, which are easy to expand and have strong reliability.
一种负载均衡的方法,包括:A load balancing method, comprising:
当接收到n个服务请求时,第一分发处理单元判断此次周期内,当前负载是否小于预设的负载门限,n为正数;When n service requests are received, the first distribution processing unit judges whether the current load is less than a preset load threshold in this period, and n is a positive number;
若当前负载小于预设的负载门限,并且所述第一分发处理单元容许对所述n个服务请求中的m个服务请求执行操作,或者,若当前负载大于等于预设的负载门限,选择候选分发处理单元,m为正数并且小于n;If the current load is less than the preset load threshold, and the first distribution processing unit is allowed to perform operations on m service requests in the n service requests, or, if the current load is greater than or equal to the preset load threshold, select a candidate Distribution processing unit, m is a positive number and less than n;
将所述n个服务请求中除m个服务请求以外的服务请求,或者,所述n个服务请求转发至所述候选分发处理单元。Forward the service requests except the m service requests among the n service requests, or forward the n service requests to the candidate distribution processing unit.
一种负载均衡的装置,包括:A load balancing device, comprising:
第一判断单元,用于当接收到n个服务请求时,判断此次周期内,当前负载是否小于预设的负载门限,n为正数;The first judging unit is used to judge whether the current load is less than a preset load threshold in this cycle when n service requests are received, and n is a positive number;
选择单元,用于若所述第一判断单元判断出当前负载小于预设的负载门限,并且所述装置容许对所述n个服务请求中的m个服务请求执行操作,或者,若当前负载大于等于预设的负载门限,选择候选分发处理单元,m为正数并且小于n;a selection unit, configured to determine that the current load is smaller than a preset load threshold by the first judging unit, and the device allows operations to be performed on m service requests among the n service requests; or, if the current load is greater than Equal to the preset load threshold, select a candidate distribution processing unit, m is a positive number and less than n;
转发单元,用于将所述n个服务请求中除m个服务请求以外的服务请求,或者,所述n个服务请求转发至所述候选分发处理单元。A forwarding unit, configured to forward service requests other than the m service requests among the n service requests, or forward the n service requests to the candidate distribution processing unit.
一种负载均衡的系统,所述系统包括:A load balancing system, the system comprising:
q个分发处理单元,所述q个分发处理单元用于相互上报负载更新消息,当所述q个分发处理单元中的第一分发处理单元容许自身对接收到的n个服务请求执行操作时,或者,当所述第一分发处理单元容许自身对所述n个服务请求中的m个服务请求执行操作时,所述第一分发处理单元对所述n个服务请求或者m个服务请求执行操作;q distribution processing units, the q distribution processing units are used to report load update messages to each other, when the first distribution processing unit in the q distribution processing units allows itself to perform operations on the received n service requests, Or, when the first distribution processing unit allows itself to perform operations on m service requests among the n service requests, the first distribution processing unit performs operations on the n service requests or the m service requests ;
当所述第一分发处理单元拒绝对所述n个服务请求或者允许对n个服务请求中的m个服务请求执行操作时,根据所述负载更新消息选择候选分发处理单元,将所述n个服务请求,或者所述n个服务请求中除m个服务请求以外的服务请求转发至所述候选分发处理单元;When the first distribution processing unit refuses to perform operations on the n service requests or allows operations on m service requests in the n service requests, select a candidate distribution processing unit according to the load update message, and send the n service requests to Service requests, or service requests other than the m service requests among the n service requests are forwarded to the candidate distribution processing unit;
其中,q为大于1的自然数,m、n为正数。Wherein, q is a natural number greater than 1, and m and n are positive numbers.
可以看出,在本发明实施例中,各分发处理单元均可以执行分发与处理操作,可以根据需要增加分发处理单元的个数,无需考虑某个分发处理单元的处理能力,容易扩展。若某个分发处理单元发生故障,不会对其它分发处理单元造成影响,可靠性较强。It can be seen that in the embodiment of the present invention, each distribution processing unit can perform distribution and processing operations, and the number of distribution processing units can be increased as required without considering the processing capability of a distribution processing unit, which is easy to expand. If a distribution processing unit fails, it will not affect other distribution processing units, and the reliability is strong.
附图说明Description of drawings
图1为本发明方法实施例流程图;Fig. 1 is the flow chart of method embodiment of the present invention;
图2为本发明方法实施例具体流程图;Fig. 2 is the specific flowchart of the method embodiment of the present invention;
图3为本发明装置实施例结构图;Fig. 3 is a structural diagram of a device embodiment of the present invention;
图4为本发明系统实施例结构图。Fig. 4 is a structural diagram of a system embodiment of the present invention.
具体实施方式Detailed ways
为使本发明的上述特征、优点更加明显易懂,下面结合具体实施方式对本发明进行详细说明。In order to make the above features and advantages of the present invention more comprehensible, the present invention will be described in detail below in conjunction with specific embodiments.
请参考图1,为本发明方法实施例流程图,可以包括:Please refer to Fig. 1, which is a flowchart of a method embodiment of the present invention, which may include:
步骤101:当接收到n个服务请求时,第一分发处理单元判断此次周期内,当前负载是否小于预设的负载门限,n为正数;Step 101: When n service requests are received, the first distribution processing unit judges whether the current load is less than a preset load threshold in this period, and n is a positive number;
步骤102:若当前负载小于预设的负载门限,并且所述第一分发处理单元容许对所述n个服务请求中的m个服务请求执行操作,或者,若当前负载大于等于预设的负载门限,选择候选分发处理单元,m为正数并且小于n;Step 102: If the current load is less than the preset load threshold, and the first distribution processing unit is allowed to perform operations on m service requests in the n service requests, or if the current load is greater than or equal to the preset load threshold , select a candidate distribution processing unit, m is a positive number and less than n;
步骤103:将所述n个服务请求中除m个服务请求以外的服务请求,或者,所述n个服务请求转发至所述候选分发处理单元。Step 103: Forward the service requests except the m service requests among the n service requests, or forward the n service requests to the candidate distribution processing unit.
下面结合具体实施例对图1所示步骤进行详细说明。The steps shown in FIG. 1 will be described in detail below in conjunction with specific embodiments.
在具体实施例中,有q个分发处理单元(DPU,Dispatch Process Unit),q为自然数,各DPU具有的功能相同,既可以由自身对接收到的服务请求进行处理,又可以将接收到的服务请求转至其它DPU进行处理,为了描述方便,在下文中,仅以第一DPU的视角为例进行说明,并且,假设共有4个DPU,分别为第一DPU、第二DPU、第三DPU以及第四DPU。In a specific embodiment, there are q distribution processing units (DPU, Dispatch Process Unit), q is a natural number, and each DPU has the same function, which can process the service request received by itself, and can also process the received service request The service request is transferred to other DPUs for processing. For the convenience of description, in the following, only the perspective of the first DPU is used as an example for illustration, and it is assumed that there are 4 DPUs in total, namely the first DPU, the second DPU, the third DPU and Fourth DPU.
还需要说明的是,第一DPU、第二DPU、第三DPU以及第四DPU的负载门限可以相同,也可以不同,并且,各个DPU还可以具有多个负载门限,在具体实施例中,仅以第一DPU、第二DPU、第三DPU以及第四DPU的负载门限相同为例进行说明。It should also be noted that the load thresholds of the first DPU, the second DPU, the third DPU, and the fourth DPU can be the same or different, and each DPU can also have multiple load thresholds. In a specific embodiment, only The load thresholds of the first DPU, the second DPU, the third DPU and the fourth DPU are the same as an example for illustration.
请参考图2所示,该具体实施例可以包括以下步骤:Please refer to shown in Figure 2, this specific embodiment may include the following steps:
步骤201:当前周期内,当第一DPU接收到n个服务请求时,判断自身的负载是否小于预设的负载门限LoadThd,如果小于,转入步骤202,否则,转入步骤203;Step 201: In the current period, when the first DPU receives n service requests, it judges whether its own load is less than the preset load threshold LoadThd, if it is less, go to
步骤201中,n为正数,负载可以是中央处理器CPU占用率、带宽占用率、内存占用率或者这些占用率的综合信息等。In
步骤202:第一DPU对接收到的服务请求执行相关操作,流程结束;Step 202: the first DPU performs related operations on the received service request, and the process ends;
第一DPU自身的负载小于负载门限,说明第一DPU自身有能力处理接收到的服务请求,因此,由自身进行处理。The load of the first DPU itself is less than the load threshold, indicating that the first DPU itself is capable of processing the received service request, and therefore, the first DPU handles it by itself.
若第一DPU当前处理能力可以处理全部n个接收到的服务请求,则由第一DPU处理全部接收到的服务请求,流程结束。若第一DPU当前处理能力只能处理n个服务请求中m(m为正数)个服务请求,则对于第一DPU无法处理的服务请求,转入步骤203。If the current processing capability of the first DPU can process all n received service requests, then the first DPU processes all the received service requests, and the process ends. If the current processing capability of the first DPU can only handle m (m is a positive number) service requests among the n service requests, then go to
步骤203:第一DPU在第二DPU、第三DPU以及第四DPU中选择一个候选DPU;Step 203: the first DPU selects a candidate DPU from the second DPU, the third DPU and the fourth DPU;
其中,候选DPU是负载低于负载门限,并且在第二DPU、第三DPU以及第四DPU中,负载最低的DPU。Wherein, the candidate DPU is a DPU whose load is lower than a load threshold, and among the second DPU, the third DPU, and the fourth DPU, the lowest load.
步骤204:第一DPU计算候选DPU可以接受的服务请求个数,并计算4个DPU中,除候选DPU以外的DPU可能向候选DPU转发服务请求的个数;Step 204: the first DPU calculates the number of service requests that the candidate DPU can accept, and calculates the number of service requests that DPUs other than the candidate DPU may forward to the candidate DPU among the 4 DPUs;
若4个DPU中,除候选DPU以外的任一DPU的负载大于负载门限,则4个DPU中,除候选DPU以外的任一DPU将向候选DPU转发自己接收到的服务请求。If the load of any DPU except the candidate DPU among the 4 DPUs is greater than the load threshold, any DPU except the candidate DPU will forward the service request received by itself to the candidate DPU.
根据公式(1)计算候选DPU可以接受的服务请求个数:Calculate the number of service requests that the candidate DPU can accept according to formula (1):
A1=负载门限/候选DPU的单位服务请求占用的负载LoadUnit-候选DPU向第一DPU上报的负载更新消息中的服务请求个数 (1)A1=load threshold/the load occupied by the unit service request of the candidate DPU LoadUnit-the number of service requests in the load update message reported by the candidate DPU to the first DPU (1)
公式(1)中,A1为候选DPU可以接受的服务请求个数。LoadUnit为预设数值。负载门限/候选DPU的LoadUnit为候选DPU在负载不大于负载门限的情况下,总共可以处理的服务请求个数。In the formula (1), A1 is the number of service requests that the candidate DPU can accept. LoadUnit is a default value. The load threshold/LoadUnit of the candidate DPU is the total number of service requests that the candidate DPU can handle when the load is not greater than the load threshold.
需要指出的是,第一DPU、第二DPU、第三DPU以及第四DPU会周期性相互上报负载更新消息,包括当前负载、当前接收到的服务请求个数等。It should be pointed out that the first DPU, the second DPU, the third DPU, and the fourth DPU will periodically report load update messages to each other, including the current load, the number of currently received service requests, and the like.
根据公式(2)计算4个DPU中,除候选DPU以外的DPU中,负载大于负载门限的DPU可能向第二DPU转发的服务请求个数:According to the formula (2), among the 4 DPUs, among the DPUs except the candidate DPU, the number of service requests that the DPU whose load is greater than the load threshold may be forwarded to the second DPU:
公式(2)中,T1为4个DPU中,除候选DPU以外的DPU中,负载大于负载门限的DPU可能向第二DPU转发的服务请求个数。In formula (2), T1 is the number of service requests that may be forwarded to the second DPU by a DPU whose load is greater than a load threshold among the 4 DPUs except the candidate DPU.
步骤205:判断T1是否大于A1,若大于,进入步骤206,否则,进入步骤208;Step 205: Determine whether T1 is greater than A1, if greater, go to step 206, otherwise, go to step 208;
若T1大于A1,则说明若4个DPU中,除候选DPU以外的DPU中,负载大于负载门限的DPU会将各自接收到的服务请求转至候选DPU,将有可能导致候选DPU的负载大于预设负载门限,所以,需要保证4个DPU中,除候选DPU以外的DPU中,负载大于负载门限的DPU向候选DPU转发的服务请求在候选DPU可接受的范围内。If T1 is greater than A1, it means that among the 4 DPUs, among the DPUs except the candidate DPU, the DPUs whose load is greater than the load threshold will transfer the service requests they receive to the candidate DPU, which may cause the load of the candidate DPU to be greater than the expected load. A load threshold is set. Therefore, it is necessary to ensure that among the 4 DPUs, among the DPUs other than the candidate DPU, the service requests forwarded by the DPU whose load is greater than the load threshold to the candidate DPU are within the acceptable range of the candidate DPU.
步骤206:第一DPU将保存的候选DPU的负载进行更新,将候选DPU的负载更新为负载门限;Step 206: The first DPU updates the saved load of the candidate DPU, and updates the load of the candidate DPU to a load threshold;
步骤206保证了在候选DPU的负载再次发生变化之前,第一DPU不会再将此次选择的候选DPU作为候选DPU。Step 206 ensures that the first DPU will not use the candidate DPU selected this time as the candidate DPU before the load of the candidate DPU changes again.
步骤207:第一DPU根据(T1-A1)/T1,计算出概率值,当任取的随机数小于该概率值时,返回步骤203,当任取的随机数大于等于该概率值时,进入步骤208;Step 207: The first DPU calculates the probability value according to (T1-A1)/T1, and when the randomly selected random number is less than the probability value, return to step 203, and when the randomly selected random number is greater than or equal to the probability value, enter
当任取的随机数小于该概率值时,第一DPU需要重新选择一个候选DPU,因此,返回步骤203重新执行操作,当任选的随机数大于该概率值时,进入步骤208,第一DPU将服务请求转发至此次选择的候选DPU。When the randomly selected random number is less than the probability value, the first DPU needs to reselect a candidate DPU, therefore, return to step 203 to re-execute the operation, and when the random number selected is greater than the probability value, enter
步骤208:第一DPU将接收到的服务请求转至候选DPU,并更新候选DPU的负载。Step 208: the first DPU transfers the received service request to the candidate DPU, and updates the load of the candidate DPU.
候选DPU的负载更新为:候选DPU的负载=候选DPU当前负载+(T1×LoadUnit)。The load of the candidate DPU is updated as follows: the load of the candidate DPU=the current load of the candidate DPU+(T1×LoadUnit).
可以看出,在本发明具体实施例中各DPU均可以执行分发与处理操作,可以根据需要增加DPU的个数,无需考虑某个DPU的处理能力,容易扩展。若某个DPU发生故障,不会对其它DPU造成影响,可靠性较强。It can be seen that in the specific embodiment of the present invention, each DPU can perform distribution and processing operations, and the number of DPUs can be increased as required without considering the processing capability of a certain DPU, which is easy to expand. If a DPU fails, it will not affect other DPUs, and the reliability is strong.
以上对本发明具体实施例进行了详细说明,下面结合一个具体实施对本发明具体实施例进行说明。The specific embodiments of the present invention have been described in detail above, and the specific embodiments of the present invention will be described below in conjunction with a specific implementation.
在具体实例中,将CDMA2000基站控制器BSC中的呼叫信令处理单元(CSPU,Call Signal Process Unit)作为具体实施例中的DPU,将综合服务请求次数(ISRN,Integrate Service Request Number)作为具体实施例中的负载。一次语音服务请求为1个ISRN,一次短消息服务请求根据信令处理的复杂度折合为0.3个ISRN。In a specific example, the call signaling processing unit (CSPU, Call Signal Process Unit) in the CDMA2000 base station controller BSC is used as the DPU in the specific embodiment, and the integrated service request number of times (ISRN, Integrate Service Request Number) is used as the specific implementation example load. One voice service request is 1 ISRN, and one short message service request is equivalent to 0.3 ISRN according to the complexity of signaling processing.
为了提升BSC的容量,可以将若干个CSPU组成CSPU资源池。结合具体实施例,假设共有4个CSPU,分别为第一CSPU、第二CSPU、第三CSPU以及第四CSPU。并且,以各CSPU的负载门限均相同为例进行说明。In order to increase the capacity of the BSC, several CSPUs can be formed into a CSPU resource pool. With reference to the specific embodiment, it is assumed that there are 4 CSPUs in total, namely the first CSPU, the second CSPU, the third CSPU and the fourth CSPU. In addition, the load thresholds of all CSPUs are the same as an example for description.
具体实施例可以包括以下步骤:A specific embodiment may include the following steps:
步骤A1:当前周期内,当第一CSPU接收到n个服务请求时,判断自身的ISNR个数是否小于预设的ISRN门限ISRNThd,如果低于,转入步骤A2,否则,转入步骤A3;步骤A1中,n为正数。Step A1: In the current cycle, when the first CSPU receives n service requests, it judges whether its own ISNR number is less than the preset ISRN threshold ISRNThd, if it is lower, go to step A2, otherwise, go to step A3; In step A1, n is a positive number.
步骤A2:第一CSPU对接收到的服务请求执行相关操作,流程结束;Step A2: The first CSPU performs related operations on the received service request, and the process ends;
第一CSPU自身的ISNR个数小于ISNR门限,说明第一CSPU自身有能力处理接收到的服务请求,因此,由自身进行处理。The number of ISNRs of the first CSPU itself is less than the ISNR threshold, indicating that the first CSPU itself is capable of processing the received service request, and therefore, the first CSPU processes the received service request by itself.
若第一CSPU当前处理能力可以处理全部n个接收到的服务请求,则由第一CSPU处理全部接收到的服务请求,流程结束。若第一CSPU当前处理能力只能n个服务请求中m(m为正数)个服务请求,则对于第一CSPU无法处理的服务请求,转入步骤A3。If the current processing capability of the first CSPU can process all n received service requests, then the first CSPU processes all the received service requests, and the process ends. If the current processing capability of the first CSPU can only handle m (m is a positive number) service requests among the n service requests, then go to step A3 for the service requests that the first CSPU cannot handle.
步骤A3:第一CSPU在第二CSPU、第三CSPU以及第四CSPU中选择一个候选CSPU;Step A3: the first CSPU selects a candidate CSPU from the second CSPU, the third CSPU and the fourth CSPU;
其中,候选CSPU是ISNR低于ISNR门限,并且在第二CSPU、第三CSPU以及第四CSPU中,ISNR最小的CSPU。Wherein, the candidate CSPU is the CSPU whose ISNR is lower than the ISNR threshold, and among the second CSPU, the third CSPU and the fourth CSPU, the ISNR is the smallest.
步骤A4:第一CSPU计算候选CSPU可以接受的服务请求个数,并计算4个CSPU中,除候选CSPU以外的CSPU可能向候选CSPU转发服务请求的个数;Step A4: The first CSPU calculates the number of service requests that the candidate CSPU can accept, and calculates the number of service requests that CSPUs other than the candidate CSPU may forward to the candidate CSPU among the 4 CSPUs;
若4个CSPU中,除候选CSPU以外的任一CSPU的ISNR大于ISNR门限,则4个CSPU中,除候选CSPU以外的任一CSPU将向候选CSPU转发自己接收到的服务请求。If the ISNR of any CSPU except the candidate CSPU among the 4 CSPUs is greater than the ISNR threshold, any CSPU except the candidate CSPU will forward the service request it receives to the candidate CSPU.
根据公式(3)计算候选CSPU可以接受的服务请求个数:Calculate the number of service requests that the candidate CSPU can accept according to formula (3):
A2=候选CSPU在ISNR不大于ISNR门限情况下总共可以处理ISNR的个数-候选CSPU向第一CSPU上报的负载更新消息中的ISNR个数 (3)A2 = The total number of ISNRs that the candidate CSPU can handle when the ISNR is not greater than the ISNR threshold - the number of ISNRs in the load update message reported by the candidate CSPU to the first CSPU (3)
公式(3)中,A2为候选CSPU可以接受的服务请求个数。需要指出的是,第一CSPU、第二CSPU、第三CSPU以及第四CSPU会周期性(例如:1秒)相互上报ISNR更新消息,包括当前ISNR、当前接收到的服务请求个数等。In the formula (3), A2 is the number of service requests that the candidate CSPU can accept. It should be pointed out that the first CSPU, the second CSPU, the third CSPU and the fourth CSPU will periodically (for example: 1 second) report ISNR update messages to each other, including the current ISNR, the number of currently received service requests, and the like.
根据公式(4)计算4个CSPU中,除候选CSPU以外的CSPU中,ISNR个数大于ISNR门限的CSPU可能向第二CSPU转发的服务请求个数:Calculate the number of service requests that may be forwarded to the second CSPU by the CSPU whose ISNR number is greater than the ISNR threshold among the 4 CSPUs except the candidate CSPU according to the formula (4):
公式(4)中,T2为4个CSPU中,除候选CSPU以外的CSPU中,ISNR个数大于ISNR门限的CSPU可能向第二CSPU转发的服务请求个数。In the formula (4), T2 is the number of service requests that may be forwarded to the second CSPU by the CSPU whose ISNR is greater than the ISNR threshold among the 4 CSPUs except the candidate CSPU.
步骤A5:判断T2是否大于A2,若大于,进入步骤A6,否则,进入步骤A8;Step A5: Determine whether T2 is greater than A2, if greater, go to step A6, otherwise, go to step A8;
若T2大于A2,则说明4个CSPU中,除候选CSPU以外的CSPU中,ISNR个数大于ISNR门限的CSPU会将各自接收到的服务请求转至候选CSPU,将有可能导致候选CSPU的ISNR个数大于ISNR门限,所以,需要保证4个CSPU中,除候选CSPU以外的CSPU中,ISNR个数大于ISNR门限的CSPU向候选CSPU转发的服务请求在候选CSPU可接受的范围内。If T2 is greater than A2, it means that among the 4 CSPUs, among the CSPUs except the candidate CSPU, the CSPU whose ISNR number is greater than the ISNR threshold will transfer the service requests received to the candidate CSPU, which may cause the ISNR of the candidate CSPU The number is greater than the ISNR threshold. Therefore, it is necessary to ensure that among the 4 CSPUs, among the CSPUs other than the candidate CSPU, the service requests forwarded by the CSPU whose ISNR is greater than the ISNR threshold to the candidate CSPU are within the acceptable range of the candidate CSPU.
步骤A6:第一CSPU将保存的候选CSPU的ISNR进行更新,将候选CSPU的ISNR更新为ISNR门限;Step A6: The first CSPU updates the saved ISNR of the candidate CSPU, and updates the ISNR of the candidate CSPU to the ISNR threshold;
步骤A6保证了在候选CSPU的ISNR再次发生变化之前,第一CSPU不会再将此次选择的候选CSPU作为候选CSPU。Step A6 ensures that before the ISNR of the candidate CSPU changes again, the first CSPU will no longer use the candidate CSPU selected this time as the candidate CSPU.
步骤A7:第一CSPU根据(T2-A2)/T2,计算出概率值,当任取的随机数小于该概率值时,返回步骤203,当任取的随机数大于等于该概率值时,进入步骤A8;Step A7: The first CSPU calculates the probability value according to (T2-A2)/T2. When the randomly selected random number is less than the probability value, return to step 203. When the randomly selected random number is greater than or equal to the probability value, enter Step A8;
当任取的随机数小于该概率值时,第一CSPU需要重新选择一个候选CSPU,因此,返回步骤A3重新执行操作,当任取的随机数大于该概率值时,进入步骤A8,第一CSPU将服务请求转发至此次选择的候选CSPU。When the randomly selected random number is smaller than the probability value, the first CSPU needs to reselect a candidate CSPU, therefore, return to step A3 to perform the operation again, and when the randomly selected random number is greater than the probability value, enter step A8, the first CSPU Forward the service request to the candidate CSPU selected this time.
步骤A8:第一CSPU将接收到的服务请求转至候选CSPU,并更新候选CSPU的ISNR个数;Step A8: The first CSPU transfers the received service request to the candidate CSPU, and updates the number of ISNRs of the candidate CSPU;
候选CSPU的ISNR更新为:候选CSPU的ISNR个数=候选CSPU当前ISNR个数+T2。The ISNR of the candidate CSPU is updated as follows: the number of ISNRs of the candidate CSPU=the current number of ISNRs of the candidate CSPU+T2.
以上对具体实例进行了详细说明,需要指出的是,具体实施例中的BSC还可以是移动交换中心MSC、通用媒体网关UMG,DPU还可以是各种协议处理单元,例如:业务数据单元(SDU),负载还可以是中央处理器CPU占用率、宽带占用率、内存占用率等等。The specific examples have been described in detail above. It should be pointed out that the BSC in the specific embodiments can also be a mobile switching center MSC and a universal media gateway UMG, and the DPU can also be various protocol processing units, such as: service data unit (SDU ), the load may also be the CPU usage rate of the central processing unit, the bandwidth usage rate, the memory usage rate, and the like.
可以看出,在本发明具体实例中各CSPU均可以执行分发与处理操作,可以根据需要增加CSPU的个数时,无需考虑某个CSPU的处理能力,容易扩展。若某个CSPU发生故障,不会对其它CSPU造成影响,可靠性较强。It can be seen that in the specific example of the present invention, each CSPU can perform distribution and processing operations, and when the number of CSPUs can be increased as required, there is no need to consider the processing capability of a certain CSPU, and it is easy to expand. If a CSPU fails, it will not affect other CSPUs, and the reliability is strong.
请参考图3,为本发明提供的装置实施例结构图,可以包括:Please refer to Figure 3, which is a structural diagram of a device embodiment provided by the present invention, which may include:
第一判断单元301,用于当接收到n个服务请求时,判断此次周期内,当前负载是否小于预设的负载门限,n为正数;The
选择单元302,用于若所述第一判断单元301判断出当前负载小于预设的负载门限,并且所述装置容许对所述n个服务请求中的m个服务请求执行操作,或者,若当前负载大于等于预设的负载门限,选择候选分发处理单元,m为正数并且小于n;A
转发单元303,用于将所述n个服务请求中除m个服务请求以外的服务请求,或者,所述n个服务请求转发至所述候选分发处理单元。The
结合步骤201至步骤208,选择单元303可以包括:In conjunction with
确定单元,用于根据接收到的负载更新消息,确定负载小于各自负载门限值的k个分发处理单元,k为自然数;A determination unit, configured to determine k distribution processing units whose loads are less than their respective load thresholds according to the received load update message, where k is a natural number;
所述选择单元302在所述确定单元确定的k个分发处理单元中,选择负载为最小值的分发处理单元作为候选分发处理单元。The selecting
转发单元303可以包括:The
第二判断单元,用于判断是否将所述n个服务请求,或者,所述n个服务请求中除m个服务请求以外的服务请求,转发至所述选择单元当前选择的候选分发处理单元;A second judging unit, configured to judge whether to forward the n service requests, or service requests other than the m service requests among the n service requests, to the candidate distribution processing unit currently selected by the selection unit;
若所述第二判断单元判断出将所述n个服务请求,或者,所述n个服务请求中除m个服务请求以外的服务请求,转发至所述选择单元当前选择的候选分发处理单元,则转发单元将所述n个服务请求,或者,所述n个服务请求中除m个服务请求以外的服务请求转发至当前选择的候选分发处理单元;否则,所述第二判断单元通知所述选择单元重新选择候选分发处理单元。If the second judging unit judges that the n service requests, or service requests other than the m service requests among the n service requests, are forwarded to the candidate distribution processing unit currently selected by the selection unit, Then the forwarding unit forwards the n service requests, or service requests other than the m service requests among the n service requests, to the currently selected candidate distribution processing unit; otherwise, the second judging unit notifies the The selection unit reselects a candidate distribution processing unit.
其中,第二判断单元可以包括:Wherein, the second judging unit may include:
计算单元,用于计算第一数值以及第二数值,所述第一数值是当前选择的候选分发处理单元实际可接受的服务请求个数,所述第二数值是负载不低于各自负载门限的分发处理单元将向所述当前选择的候选分发处理单元转发服务请求的个数;A calculation unit, configured to calculate a first value and a second value, the first value is the number of service requests that the currently selected candidate distribution processing unit can actually accept, and the second value is that the load is not lower than the respective load threshold The distribution processing unit will forward the number of service requests to the currently selected candidate distribution processing unit;
比较单元,用于比较所述计算单元计算的所述第一数值以及所述第二数值的大小;a comparison unit, configured to compare the magnitudes of the first value and the second value calculated by the calculation unit;
所述第二判断单元根据所述比较单元进行的比较,判断是否将所述n个服务请求,或者,所述n个服务请求中除m个服务请求以外的服务请求转发至当前选择的候选分发处理单元。The second judging unit judges whether to forward the n service requests, or service requests other than the m service requests among the n service requests, to the currently selected candidate distribution according to the comparison performed by the comparing unit processing unit.
下面结合步骤201至步骤208,对本发明装置实施例提供的各单元执行的操作进行详细说明。The operations performed by each unit provided in the device embodiment of the present invention will be described in detail below in conjunction with
当第一DPU接收到n个服务请求时,第一PDU的第一判断单元301判断在本周期内,当前负载是否小于预设的负载门限,n为正数。若第一判断单元301判断出第一DPU的当前负载小于预设的负载门限,并且第一DPU可以处理全部n个服务请求,或者第一DPU可以处理其中的m个服务请求,则第一DPU对全部n个服务请求或者m个服务请求进行处理。When the first DPU receives n service requests, the
当第一DPU只能处理m个服务请求,或者,第一DPU的第一判断单元301判断出本周期内,当前负载大于等于预设的负载门限,则第一DPU的选择单元302在4个DPU中选择候选DPU。选择单元302进行选择具体为:确定单元确定4个DPU中,负载小于预设的负载门限的DPU,并从中选择负载最小的DPU作为当前选择的候选DPU。When the first DPU can only handle m service requests, or the
计算单元根据公式(1)计算A1,根据公式(2)计算T1,比较单元比较A1与T1的大小,当T1小于等于A1时,转发单元303将n个服务请求或者除m个服务请求以外的服务请求转发至当前选择的候选DPU。当T1大于A1时,并且,任取随机数小于步骤207中计算出的概率值,则选择单元302重新选择候选DPU。当T1大于A1时,并且任取随机数大于等于步骤207中计算出的概率值,则转发单元303将n个服务请求或者除m个服务请求以外的服务请求转发至当前选择的候选DPU。The calculation unit calculates A1 according to the formula (1), calculates T1 according to the formula (2), compares the size of A1 and T1 by the comparison unit, and when T1 is less than or equal to A1, the
可以看出,在本发明具体实施例中各DPU均可以执行分发与处理操作,可以根据需要增加DPU的个数,无需考虑某个DPU的处理能力,容易扩展。若某个DPU发生故障,不会对其它DPU造成影响,可靠性较强。It can be seen that in the specific embodiment of the present invention, each DPU can perform distribution and processing operations, and the number of DPUs can be increased as required without considering the processing capability of a certain DPU, which is easy to expand. If a DPU fails, it will not affect other DPUs, and the reliability is strong.
以上对本发明装置实施例进行了详细说明,结合方法具体实例,装置实施例中的DPU可以为CSPU,负载可以是ISRN,下面结合方法具体实例中,步骤A1至步骤A8对本发明装置实施例提供的各单元执行的操作进行详细说明。The device embodiment of the present invention has been described in detail above. In combination with the specific example of the method, the DPU in the device embodiment can be a CSPU, and the load can be an ISRN. In the following specific examples of the method, steps A1 to A8 are provided for the device embodiment of the present invention. The operations performed by each unit are described in detail.
当第一CSPU接收到n个服务请求时,第一CSDU的第一判断单元301判断在本周期内,当前ISNR个数是否小于预设的ISNR门限,n为正数。若第一判断单元301判断出第一CSPU的当前ISNR个数小于预设的ISNR门限,并且第一CSPU可以处理全部n个服务请求,或者第一CSPU可以处理其中的m个服务请求,则第一CSPU对全部n个服务请求或者m个服务请求进行处理。When the first CSPU receives n service requests, the
当第一CSPU只能处理m个服务请求,或者,第一CSPU的第一判断单元301判断出本周期内,当前负载大于等于预设的ISNR门限,则第一CSPU的选择单元302在4个CSPU中选择候选CSPU。选择单元302进行选择具体为:确定单元确定4个CSPU中,ISNR个数小于预设的ISNR门限的CSPU,并从中选择ISNR个数最小的CSPU作为当前选择的候选CSPU。When the first CSPU can only handle m service requests, or the
计算单元根据公式(3)计算A2,根据公式(4)计算T2,比较单元比较A2与T2的大小,当T2小于等于A2时,转发单元303将n个服务请求或者除m个服务请求以外的服务请求转发至当前选择的候选CSPU。当T2大于A2时,并且,任取随机数小于步骤A7中计算出的概率值,则选择单元302重新选择候选CSPU。当T2大于A2时,并且任取随机数大于等于步骤A7中计算出的概率值,则转发单元303将n个服务请求或者除m个服务请求以外的服务请求转发至当前选择的候选CSPU。The calculation unit calculates A2 according to formula (3), calculates T2 according to formula (4), compares the size of A2 and T2 by the comparison unit, and when T2 is less than or equal to A2, the
可以看出,在本发明具体实例中各CSPU均可以执行分发与处理操作,可以根据需要增加CSPU的个数时,无需考虑某个CSPU的处理能力,容易扩展。若某个CSPU发生故障,不会对其它CSPU造成影响,可靠性较强。It can be seen that in the specific example of the present invention, each CSPU can perform distribution and processing operations, and when the number of CSPUs can be increased as required, there is no need to consider the processing capability of a certain CSPU, and it is easy to expand. If a CSPU fails, it will not affect other CSPUs, and the reliability is strong.
本发明实施例还提供了一种负载均衡系统,参见图4,包括:The embodiment of the present invention also provides a load balancing system, see Figure 4, including:
q个分发处理单元,所述q个分发处理单元用于相互上报负载更新消息,当所述q个分发处理单元中的第一分发处理单元容许自身对接收到的n个服务请求执行操作时,或者,当所述第一分发处理单元容许自身对所述n个服务请求中的m个服务请求执行操作时,所述第一分发处理单元对所述n个服务请求或者m个服务请求执行操作;q distribution processing units, the q distribution processing units are used to report load update messages to each other, when the first distribution processing unit in the q distribution processing units allows itself to perform operations on the received n service requests, Or, when the first distribution processing unit allows itself to perform operations on m service requests among the n service requests, the first distribution processing unit performs operations on the n service requests or the m service requests ;
当所述第一分发处理单元拒绝对所述n个服务请求或者允许对n个服务请求中的m个服务请求执行操作时,根据所述负载更新消息选择候选分发处理单元,将所述n个服务请求,或者所述n个服务请求中除m个服务请求以外的服务请求转发至所述候选分发处理单元;When the first distribution processing unit refuses to perform operations on the n service requests or allows operations on m service requests in the n service requests, select a candidate distribution processing unit according to the load update message, and send the n service requests to Service requests, or service requests other than the m service requests among the n service requests are forwarded to the candidate distribution processing unit;
其中,q为大于1的自然数,m、n为正数。Wherein, q is a natural number greater than 1, and m and n are positive numbers.
假设q等于4,各分发处理单元执行的操作与方法实施例相同、当分发处理单元具体为CSPU,负载具体为ISNR时,各分发处理单元执行的操作方法具体实例相同。具体请参见方法实施例以及方法具体实例的描述。Assuming that q is equal to 4, the operations performed by each distribution processing unit are the same as those in the method embodiments. When the distribution processing unit is specifically a CSPU and the load is specifically an ISNR, the specific examples of the operation methods performed by each distribution processing unit are the same. For details, please refer to the description of the method embodiments and specific examples of the method.
通过本发明实施例提供的负载均衡方法、装置和系统,各分发处理单元均可以执行分发与处理操作,可以根据需要增加分发处理单元的个数,无需考虑某个分发处理单元的处理能力,容易扩展。若某个分发处理单元发生故障,不会对其它分发处理单元造成影响,可靠性较强。Through the load balancing method, device and system provided by the embodiments of the present invention, each distribution processing unit can perform distribution and processing operations, and the number of distribution processing units can be increased as needed without considering the processing capacity of a certain distribution processing unit, which is easy expand. If a distribution processing unit fails, it will not affect other distribution processing units, and the reliability is strong.
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个......”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。Finally, it should also be noted that in this text, relational terms such as first and second etc. are only used to distinguish one entity or operation from another, and do not necessarily require or imply that these entities or operations, any such actual relationship or order exists. Furthermore, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes elements not expressly listed. other elements of or also include elements inherent in such a process, method, article, or device. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到本发明可借助软件加必需的硬件平台的方式来实现,当然也可以全部通过硬件来实施,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案对背景技术做出贡献的全部或者部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例或者实施例的某些部分所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the present invention can be realized by means of software plus a necessary hardware platform, and of course all can be implemented by hardware, but in many cases the former is better implementation. Based on this understanding, all or part of the contribution made by the technical solution of the present invention to the background technology can be embodied in the form of software products, and the computer software products can be stored in storage media, such as ROM/RAM, magnetic disks, optical disks, etc. , including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute the methods described in various embodiments or some parts of the embodiments of the present invention.
以上对本发明所提供的一种负载均衡的方法、装置及系统进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。A load balancing method, device and system provided by the present invention has been introduced in detail above. In this paper, specific examples are used to illustrate the principle and implementation of the present invention. The description of the above embodiments is only used to help understand the present invention. The method of the invention and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation and scope of application. In summary, the content of this specification should not be understood To limit the present invention.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN2008102021204ACN101730145B (en) | 2008-10-29 | 2008-10-29 | Method, device and system of load balancing |
| PCT/CN2009/074666WO2010048886A1 (en) | 2008-10-29 | 2009-10-28 | Load balance method, apparatus and system |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN2008102021204ACN101730145B (en) | 2008-10-29 | 2008-10-29 | Method, device and system of load balancing |
| Publication Number | Publication Date |
|---|---|
| CN101730145Atrue CN101730145A (en) | 2010-06-09 |
| CN101730145B CN101730145B (en) | 2012-07-25 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN2008102021204AExpired - Fee RelatedCN101730145B (en) | 2008-10-29 | 2008-10-29 | Method, device and system of load balancing |
| Country | Link |
|---|---|
| CN (1) | CN101730145B (en) |
| WO (1) | WO2010048886A1 (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102143587A (en)* | 2010-12-31 | 2011-08-03 | 华为技术有限公司 | Resource-allocating method and equipment |
| CN102404786A (en)* | 2010-09-14 | 2012-04-04 | 中国移动通信集团江苏有限公司 | A method and device for controlling traffic congestion |
| WO2012159538A1 (en)* | 2011-05-24 | 2012-11-29 | 苏州阔地网络科技有限公司 | Instant messaging system and method for sharing information |
| CN104301243A (en)* | 2014-09-22 | 2015-01-21 | 华为技术有限公司 | A load control method and device |
| WO2018082709A1 (en)* | 2016-11-07 | 2018-05-11 | 北京佰才邦技术有限公司 | Method for sharing load of mobile edge computing application and controller |
| CN114201421A (en)* | 2022-02-17 | 2022-03-18 | 苏州浪潮智能科技有限公司 | A data stream processing method, storage control node and readable storage medium |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101119140B (en)* | 2006-08-03 | 2012-04-25 | 鼎桥通信技术有限公司 | Load stabilization method and apparatus for layered cell structure |
| CN101217558A (en)* | 2007-12-26 | 2008-07-09 | 中国移动通信集团湖北有限公司 | A business middleware service load balancing method |
| CN101541041A (en)* | 2009-04-23 | 2009-09-23 | 华为技术有限公司 | Method for sharing load, device and system thereof |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102404786A (en)* | 2010-09-14 | 2012-04-04 | 中国移动通信集团江苏有限公司 | A method and device for controlling traffic congestion |
| CN102404786B (en)* | 2010-09-14 | 2015-07-01 | 中国移动通信集团江苏有限公司 | Method and device for controlling service jam |
| CN102143587A (en)* | 2010-12-31 | 2011-08-03 | 华为技术有限公司 | Resource-allocating method and equipment |
| WO2012159538A1 (en)* | 2011-05-24 | 2012-11-29 | 苏州阔地网络科技有限公司 | Instant messaging system and method for sharing information |
| CN104301243A (en)* | 2014-09-22 | 2015-01-21 | 华为技术有限公司 | A load control method and device |
| CN104301243B (en)* | 2014-09-22 | 2018-06-15 | 华为技术有限公司 | A kind of load control method and device |
| WO2018082709A1 (en)* | 2016-11-07 | 2018-05-11 | 北京佰才邦技术有限公司 | Method for sharing load of mobile edge computing application and controller |
| CN114201421A (en)* | 2022-02-17 | 2022-03-18 | 苏州浪潮智能科技有限公司 | A data stream processing method, storage control node and readable storage medium |
| Publication number | Publication date |
|---|---|
| CN101730145B (en) | 2012-07-25 |
| WO2010048886A1 (en) | 2010-05-06 |
| Publication | Publication Date | Title |
|---|---|---|
| CN101730145B (en) | Method, device and system of load balancing | |
| TW424377B (en) | Method and apparatus for dynamically adapting a connection state in mobile communications system | |
| CN114303347B (en) | Methods, devices and machine-readable media related to machine learning in communication networks | |
| EP3577952B1 (en) | Method and system for selection of an access and mobility management function in an access network environment | |
| CN105279023B (en) | A kind of virtual machine migration method and device | |
| CN107743307A (en) | A location-based MEC processing method and device | |
| CN102273294A (en) | active switching strategy | |
| CN103731883A (en) | Load balancing method and device | |
| CN109462863B (en) | A method and device for a voice call | |
| WO2009092187A1 (en) | Method and equipment for generating user mobility model of gsm network | |
| CN113867946B (en) | Method, device, storage medium and electronic device for accessing resources | |
| EP3644646A1 (en) | Load-balancing method and apparatus | |
| WO2025077728A1 (en) | Object distribution method, system and device, and storage medium | |
| CN111198762A (en) | Server cluster system supporting high concurrency, control method and control device | |
| CN105138408A (en) | Virtual machine migration method and device based on Open Stack | |
| CN115842828A (en) | Gateway load balancing control method, device, equipment and readable storage medium | |
| CN109041255A (en) | A kind of cut-in method and UE | |
| JP4322094B2 (en) | Information processing method, service time deriving method, and processing unit number adjusting method | |
| KR102533866B1 (en) | Method for load balancing between mecs, and computer-readable recording medium including the same | |
| JP7138739B2 (en) | Communication system, communication device, and program | |
| CN105095315A (en) | Method, device and system for dynamically adjusting hash ring node number | |
| EP3850803B1 (en) | Method and ng-cu for call selection and migration in a ng-ran | |
| CN105828407A (en) | Service acceptance control method and base station | |
| CN108111431A (en) | Business datum sending method and device | |
| CN102387537A (en) | Wireless network system and its wireless access point |
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C14 | Grant of patent or utility model | ||
| GR01 | Patent grant | ||
| CF01 | Termination of patent right due to non-payment of annual fee | Granted publication date:20120725 Termination date:20181029 | |
| CF01 | Termination of patent right due to non-payment of annual fee |