WO2016173133A1 - 一种实现负荷分担的方法、接口机、业务处理机及系统 - Google Patents
一种实现负荷分担的方法、接口机、业务处理机及系统 Download PDFInfo
- Publication number
- WO2016173133A1 WO2016173133A1 PCT/CN2015/084831 CN2015084831W WO2016173133A1 WO 2016173133 A1 WO2016173133 A1 WO 2016173133A1 CN 2015084831 W CN2015084831 W CN 2015084831W WO 2016173133 A1 WO2016173133 A1 WO 2016173133A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- value
- service processor
- capability value
- service
- maximum
- Prior art date
Links
Images
Definitions
- This document relates to, but is not limited to, converged communication technologies, and in particular, but not limited to, a method for implementing load sharing, an interface machine, a service processor, and a system.
- the function of the converged communication is opened, the requirements for the mobile terminal and the developer can be reduced, and the rich application can be developed by utilizing the advantages of the developer.
- the processing capability of the converged communication capability gateway is becoming higher and higher, and the single node can no longer meet the requirements, so it needs to be distributed and multi-nodes can be satisfied.
- multi-node one of the important issues is how to effectively distribute the load to each business processor, so that each business processor can fully utilize its processing capabilities and complete the processing of massive services.
- the short message gateway combines the processing of the service processor with the feature string (such as the source number) in the message.
- the feature string such as the source number
- the message has a message service in the session, such as a session-based message such as a 1-to-1 chat, a group chat, etc., and the message of the session service needs to be allocated to the same service processor for establishing a session with the core network, due to the message of the session service message.
- the number is different, and the session transmission also has a large difference in processing capability requirements; therefore, if the service is distributed according to the feature string, the traffic of the service processor is uneven.
- the embodiments of the present invention provide a method and system for implementing load sharing to solve the technical problem that load sharing can be performed according to the service demand and processing capability of the service.
- the embodiment of the invention provides a method for implementing load sharing, which includes:
- the interface machine receives the processing capability value calculated by each service processor according to the timing interval;
- the interface machine performs load sharing of the session service according to the processing capability values of all the service processors received.
- the timing interval is determined by a pre-set service processor equalization parameter.
- the processing capability value is calculated by accumulating the session capability value, and/or the message capability value, and/or the central processor CPU capability value, and/or the memory capability value, and/or the disk capability value.
- the method further includes: when obtaining the session capability value in the processing capability value of the service processor, the interface machine receives the processing capability value calculated by each service processor according to the timing interval, and the interface device Get the session ability value:
- the number of available ports of the service processor is used as the maximum number of sessions of the service processor, and the current number of sessions of the service processor is obtained, and the maximum number of sessions is subtracted from the current number of sessions to obtain the number of available sessions, and the number of available sessions is obtained.
- the session capability value is obtained by dividing the maximum number of sessions by a preset session weight value;
- the interface machine obtains the processing capability value calculated by each service processor according to the timing interval, and obtains the message.
- Force value determining the corresponding maximum backlog message number according to the service processor configuration, and subtracting the current backlog message number from the maximum backlog message number to obtain the number of processable messages according to the current backlog message number obtained by reading, and processing the message The number is divided by the maximum backlog message number multiplied by a preset message weight value to obtain the message capability value;
- the interface machine obtains the CPU capability value before receiving the processing capability value calculated by each service processor according to the timing interval:
- Predetermining the maximum CPU usage of the service processor reading the current CPU usage, subtracting the current CPU usage from the CPU usage, obtaining the CPU availability, and dividing the CPU availability by the CPU maximum occupancy. Obtaining the CPU capability value with a preset CPU weight value;
- the interface device obtains the memory capability value before receiving the processing capability value calculated by each service processor according to the timing interval:
- Predetermining the maximum memory usage of the service processor reading the current memory usage rate, subtracting the current memory usage from the maximum memory usage rate, obtaining a memory availability rate, and dividing the memory available rate by the maximum memory usage rate. Multiplying the preset memory weight value to obtain the memory capability value;
- the interface device acquiring the disk capacity value before receiving the processing capability value calculated by each service processor according to the timing interval:
- Predetermining the maximum disk usage of the service processor reading the current disk occupancy rate, subtracting the current disk usage rate from the maximum disk usage rate, obtaining the disk availability rate, and dividing the disk availability rate by the maximum disk usage rate.
- the disk capacity value is obtained by multiplying by a preset disk weight value.
- the method further comprises: calculating a session capability value, and/or a message capability value, and/or a central processor CPU capability value, and/or a memory capability value in a processing capability value of the service processor.
- the disk capability value has one or more values less than or equal to 0, and the value of the processing capability of the service processor is 0.
- the method further includes: the interface machine acquires working states of all service processors, when When the service processor is down, the processing capability of the service processor of the assignment is 0.
- the load balancing of the session service performed by the interface device according to the received processing capability value of all the service processors includes:
- the service received by the interface machine is evenly distributed according to the value ratio of the processing capability value of each service processor.
- uniformly sharing the services received by the interface device includes:
- the obtained feature values are accumulated and modulo with the obtained capabilities to obtain a load sharing reference value
- the load sharing determination value is greater than the load sharing reference value, determining that the first service processor corresponding to the load sharing determination value is a service processor shared by the service;
- I is a service processor value greater than 1 that is less than a processing capability value of the service processor greater than zero.
- the method further includes: before the interface machine receives the processing capability value calculated by each service processor according to the timing interval, the interface machine receives, from the capability gateway server, a message that loads the session service to the service processor.
- the present application further provides an interface device for implementing load sharing, including: a receiving unit 200 and a load sharing unit 201;
- the receiving unit 200 is configured to receive a processing capability value calculated by each service processor according to a timing interval;
- the load sharing unit 201 is configured to perform load sharing of the session service based on the received processing capability values of all the service processors.
- the interface device further includes an evaluation unit 202 configured to obtain an operating state of all the service processors.
- an evaluation unit 202 configured to obtain an operating state of all the service processors. When the service processor is down, the processing capability of the service processor assigned to the machine is 0.
- the load sharing unit 201 is configured to
- the service received by the interface machine is evenly distributed according to the value ratio of the processing capability value of each service processor.
- the interface device further includes a receiving service unit 203, configured to receive, from the capability gateway server, a message that the load service is shared with the service processor.
- the present application further provides a service processor for implementing load sharing, which includes a calculation reporting unit 300 configured to report its processing capability value to the interface device according to the timing interval.
- the computing reporting unit 300 is configured to accumulate the session capability value, and/or the message capability value, and/or the CPU capability value, and/or the memory capability value, and/or the disk capability value according to the timing interval. Calculate the processing power value.
- the service processor further includes an acquisition capability value unit 301, configured to
- the number of available ports of the service processor is used as the maximum number of sessions of the service processor, and the reading is obtained.
- the current number of sessions of the service processor, the maximum number of sessions is subtracted from the current number of sessions to obtain the number of available sessions, and the number of available sessions is divided by the maximum number of sessions multiplied by a preset session weight value to obtain the session capability value;
- the processing capability value of the service processor includes the message capability value
- acquiring the message capability value determining a corresponding maximum backlog message number according to the service processor configuration, and obtaining a current backlog according to the reading The number of messages, the number of the maximum backlog message is subtracted from the current backlog message number to obtain the number of treatable messages, and the number of treatable messages is divided by the maximum backlog message number multiplied by a preset message weight value to obtain the message capability value;
- Obtaining the CPU capability value when the CPU capability value is included in the processing capability value of the service processor predetermining a CPU maximum occupancy rate of the service processor, and reading the obtained current CPU usage rate, The CPU usage is subtracted from the current CPU usage, and the CPU availability is obtained. The CPU availability is divided by the CPU maximum occupancy multiplied by a preset CPU weight value to obtain the CPU capability value.
- the memory usage rate is obtained by subtracting the current memory usage from the current memory usage, and dividing the memory availability rate by the maximum memory usage multiplied by a preset memory weight value to obtain the memory capability value;
- the disk capacity value when the value of the processing capability of the service processor is obtained, the disk capacity value is determined: the maximum disk usage of the service processor is determined, the current disk usage rate is read, and the maximum disk is read.
- the disk usage rate is obtained by subtracting the current disk usage from the current disk usage rate, and the disk capacity value is obtained by dividing the disk availability rate by the maximum disk occupancy rate by a preset disk weight value.
- the calculation reporting unit 300 is further configured to: when calculating the session capability value, the message capability value, the CPU capability value, the memory capability value, or the disk capability value in the processing capability value of the service processor, one or more When the value is less than or equal to 0, the processing capacity of the assigned service processor is 0.
- the application further provides a system for implementing load sharing, including: an interface machine and a plurality of service processors; wherein
- the service processor includes at least a calculation reporting unit 300, configured to report its processing capability value to the interface device according to the timing interval;
- the interface machine includes at least a load sharing unit 201, and is configured to perform load sharing of the session service according to the processing capability value of each service processor.
- a computer storage medium having stored therein computer executable instructions for performing the methods described above.
- the technical solution of the present application includes: the interface device receives the processing capability value calculated by each service processor according to the timing interval; and according to the received processing capability value of all the service processors, the interface device performs load sharing of the session service.
- the load capacity of the session service is calculated based on the processing capability value of the service processor, and the load balancing of the service processor in the system is ensured.
- FIG. 1 is a flowchart of a method for implementing load sharing according to an embodiment of the present invention
- FIG. 2 is a structural block diagram of an interface device for implementing load sharing according to an embodiment of the present invention
- FIG. 3 is a structural block diagram of a service processor for implementing load sharing according to an embodiment of the present invention
- FIG. 4 is a structural diagram of a system for implementing load sharing according to an embodiment of the present invention.
- FIG. 1 is a flowchart of a method for implementing load sharing according to an embodiment of the present invention. As shown in FIG. 1 , the method includes:
- Step 100 The interface machine receives a processing capability value calculated by each service processor according to a timing interval.
- the timing interval for calculating the processing capability value of the service processor is determined by a preset service processor equalization parameter; here, the system load of the node in the service processor may be determined to determine the equalization parameter; for example, reading the service processor
- the percentage of the reporting interval is set according to a certain ratio. For example, the system load of the busiest node is higher than the set equilibrium of the system load of the most idle node.
- the timing interval is reduced by 10%.
- system load can be obtained through related commands.
- the processing capability value of the service processor is calculated by accumulating the session capability value, and/or the message capability value, and/or the CPU capability value, and/or the memory capability value, and/or the disk capability value.
- the method in the embodiment of the present invention further includes: acquiring the session capability value:
- the number of available ports of the service processor is used as the maximum number of sessions of the service processor, the current session number of the service processor is read, the maximum number of sessions is subtracted from the current number of sessions to obtain the number of available sessions, and the number of available sessions is divided by the maximum session. Multiply the number by a preset session weight value to obtain the session ability value.
- the method of the embodiment of the present invention further includes: acquiring a message capability value: when the process capability value of the service processor is included in the message capability value:
- the method in the embodiment of the present invention further includes: acquiring the CPU capability value:
- Predetermine the maximum CPU usage of the service processor read the current CPU usage, subtract the current CPU usage from the CPU usage, and obtain the CPU availability. Divide the CPU availability by the CPU usage multiplied by the advance. Set the CPU weight value to obtain the CPU capability value.
- the method of the embodiment of the present invention further includes: obtaining the memory capability value:
- Predetermine the maximum memory usage of the service processor read the current memory usage, subtract the current memory usage from the maximum memory usage, and obtain the memory availability rate.
- the memory availability rate is divided by the maximum memory usage multiplied by a preset amount. Memory weight value, get the memory capacity value.
- the method of the embodiment of the present invention further includes: obtaining a disk capacity value: when the value of the disk capacity is included in the process capability value of the service processor:
- Predetermine the maximum disk usage of the service processor read the current disk usage, subtract the current disk usage from the maximum disk usage to obtain disk availability, and divide the disk availability rate by the maximum disk usage multiplied by a preset amount.
- the disk weight value which is the disk capacity value.
- the processing required for the service can be realized by setting the session weight value, and/or the message weight value, and/or the CPU weight value, and/or the memory weight value, and/or the value of the disk weight value.
- the capability size is displayed. For example, if the CPU availability of the service processor is the main consideration when the service is processed, the CPU weight value should be set larger than other weight values.
- the specific size can be set according to the experience of those skilled in the art.
- the processing capability value of the service processor can be calculated by adding the relevant parameters in addition to the session capability value, and/or the message capability value, and/or the CPU capability value, and/or the memory capability value, and/or the disk capability value.
- the calculation for example, is introduced into the core memory of the service processor to calculate the processing capability value of the service processor. If the impact on the service load sharing is small, the calculation can be performed by setting a smaller weight value.
- the method of the embodiment of the present invention further includes :
- the processing capability of the assigned service processor is 0;
- the method of the embodiment of the present invention further includes: the interface machine obtains the working state of the service processor, and when the service processor is down, the processing capability value of the service processor of the assigned machine is 0.
- Step 101 The interface device performs load sharing of the session service according to the processing capability value of all the received service processors.
- the step includes: uniformly sharing the services received by the interface machine according to the value ratio of the processing capability value of each service processor.
- the obtained feature values are accumulated and modulo with the obtained capabilities to obtain a load sharing reference value
- the processing capability values of the service processor are arranged from small to large, starting from the minimum value of the processing capability value of the service processor, respectively, the cumulative sum of the processing capability values of the first to the first business processors is calculated, and each is obtained.
- the load sharing determination value is greater than the load sharing reference value, it is determined that the first service processor corresponding to the load sharing determination value is a service processor shared by the service.
- I is a service processor value greater than 1 that is less than a processing capability value of the service processor greater than zero.
- the method of the embodiment of the present invention further includes: the interface machine receives, from the capability gateway server, a message that loads the session service that is shared by the service processor.
- the embodiment of the invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the above method.
- FIG. 2 is a structural block diagram of an interface device for implementing load sharing according to an embodiment of the present invention, including: a receiving unit 200 and a load sharing unit 201;
- the receiving unit 200 is configured to receive a processing capability value calculated by each service processor according to a timing interval;
- the load sharing unit 201 is configured to perform load sharing of the session service based on the received processing capability values of all the service processors.
- the load sharing unit 201 is configured to
- the service received by the interface machine is evenly distributed according to the value ratio of the processing capability value of each service processor.
- the interface device of the embodiment of the present invention further includes an evaluation unit 202 configured to acquire the working state of all the service processors. When the service processor is down, the processing capability of the service processor assigned to the machine is 0.
- the interface machine further includes a receiving service unit 203 configured to receive a message from the capability gateway server to load the session service to the service processor.
- FIG. 3 is a structural block diagram of a service processor for implementing load sharing according to an embodiment of the present invention. As shown in FIG. 3, the calculation reporting unit 300 is configured to report its processing capability value to the interface device according to the timing interval.
- the calculation reporting unit 300 is configured to calculate the processing capability by accumulating the session capability value, and/or the message capability value, and/or the CPU capability value, and/or the memory capability value, and/or the disk capability value according to the timing interval. value.
- the service processor of the embodiment of the present invention further includes an acquisition capability value unit 301, which is set to
- the session capability value is obtained: the number of available ports of the service processor is used as the maximum number of sessions of the service processor, and the current number of sessions of the service processor is read. The maximum number of sessions minus the current number of sessions to get the number of available sessions will be available The number of sessions is divided by the maximum number of sessions multiplied by a preset session weight value to obtain a session ability value;
- the message capability value is obtained: the corresponding maximum backlog message number is determined according to the service processor configuration, and the maximum backlog message number is obtained according to the current backlog message number obtained by the reading. Subtracting the current number of backlog messages to obtain the number of treatable messages, dividing the number of treatable messages by the maximum number of backlog messages multiplied by a preset message weight value to obtain a message capability value;
- the CPU capability value When the CPU capability value is included in the processing capability value of the service processor, the CPU capability value is obtained: the CPU usage of the service processor is determined in advance, the current CPU usage is read, and the CPU usage is subtracted from the current CPU. Occupancy rate, obtain CPU availability, and divide the CPU availability rate by the CPU maximum occupancy multiplied by a preset CPU weight value to obtain the CPU capability value;
- the memory capacity value is obtained: the maximum memory usage of the service processor is determined in advance, the current memory usage is read, and the maximum memory usage is subtracted from the current memory usage. Obtain the memory availability rate, and divide the memory availability rate by the maximum memory usage multiplied by the preset memory weight value to obtain the memory capacity value;
- the disk capacity value is obtained: the maximum disk usage of the service processor is determined, the current disk usage is read, and the maximum disk usage is subtracted from the current disk usage. Obtain the disk availability rate by dividing the disk availability rate by the maximum disk usage multiplied by the pre-set disk weight value.
- the calculation reporting unit 300 is further configured to: when one or more values of the session capability value, the message capability value, the CPU capability value, the memory capability value, or the disk capability value in the processing capability value of the computing service processor are less than or equal to 0 The value of the processing capability of the assigned service processor is 0.
- FIG. 4 is a structural diagram of a system for implementing load sharing according to an embodiment of the present invention. As shown in FIG. 4, the method includes: an interface machine and a plurality of service processors;
- the service processor includes a calculation reporting unit 300, configured to report the processing capability value of the device to the interface device according to the timing interval;
- the interface machine includes a load sharing unit 201 configured to perform load sharing of the session service according to the processing capability value of each service processor.
- the present embodiment is described by taking a message of applying a downlink-to-terminal service as an example.
- the maximum processing capability value of the service processor is set to 1000, and the weight value is set according to the maximum value of the processing capability value.
- the capability gateway server receives the message of the application service, and sends the message of the service to the interface machine;
- the interface device performs the load sharing of the service processing by reporting the processing capability value of the service processor according to the timing interval.
- the service processor that performs the service sharing sends the service message to the core network, and the core network sends the message to the destination terminal.
- the processing capability value of the service processor and the load sharing of the service are implemented in the following manner.
- the service processor calculates its processing capability value and reports it to the interface device according to the timing interval;
- the timing interval is set and adjusted by a preset node equalization parameter. For example, when the system load of the busiest node in the service processor is read to be higher than a certain percentage of the system load of the most idle node, the reporting interval is adjusted according to a certain ratio. The percentage, for example, when the system load of the busiest node is higher than 30% than the system load of the most busy node, the timing interval is reduced by 10%, and the timing interval is preferably 1 second to 60 seconds.
- system load can be obtained through related commands.
- the processing capability value of the service processor is calculated from the session capability value, and/or the message capability value, and/or the CPU capability value, and/or the memory capability value, and/or the disk capability value.
- the number of available ports of the service processor is used as the maximum number of sessions of the service processor, and the current number of sessions of the service processor is read, and the maximum number of sessions is subtracted from the current number of sessions to obtain the number of available sessions, and the number of available sessions is obtained.
- the session ability value is obtained by multiplying the maximum number of sessions by a predetermined session weight value.
- the number of available ports of the service processor is less than 65535.
- the session establishment of the service needs to use the port of the service processor, and the number of sessions of the service. Will be subject to this limitation, in general, the business processor
- the number of available ports can be set to 60000.
- the port usage can be adjusted according to the system and related applications. Because the number of sessions of the service is mainly affected by the port resources, it has little effect on the system CPU and memory, so the weight can be lowered a little, for example, 100.
- the message capability value is an important reference for the service load sharing of the service processor in the embodiment of the present invention. Therefore, a larger weight value needs to be set, for example, the message weight value is 300.
- the service processor is fully loaded, at this time, the message capability value is 0.
- Predetermine the maximum CPU usage of the service processor read the current CPU usage, subtract the current CPU usage from the CPU usage, and obtain the CPU availability. Divide the CPU availability by the CPU usage multiplied by the advance. Set the CPU weight value to obtain the CPU capability value.
- the CPU capability value is an important reference for the service load sharing of the service processor in the embodiment of the present invention. Therefore, it is necessary to set a larger weight value, for example, setting the CPU weight value to 300.
- the CPU capacity of the service processor is determined to be 80%, the CPU weight is 300, and the current CPU usage is 60%.
- Predetermine the maximum memory usage of the service processor read the current memory usage, subtract the current memory usage from the maximum memory usage, and obtain the memory availability rate.
- the memory availability rate is divided by the maximum memory usage multiplied by a preset amount. Memory weight value, get the memory capacity value.
- the memory capacity value is a reference for the service load sharing of the service processor in the embodiment of the present invention, and the setting weight is greater than the medium low level, for example, the memory weight value is set to 200.
- the maximum memory usage of the service processor is 80%, and the memory weight value is 200.
- Predetermine the maximum disk usage of the service processor read the current disk usage, subtract the current disk usage from the maximum disk usage to obtain disk availability, and divide the disk availability rate by the maximum disk usage multiplied by a preset amount.
- the disk weight value which is the disk capacity value.
- the value of the processing power of the disk to the service processor is slightly less important, so the disk weight value can be set to 100.
- the maximum disk usage of the service processor is determined to be 80%, the disk weight is 100, and the current disk usage is 40%.
- the load balancing of the session service is performed by the interface device according to the processing capability value of each service processor, including: accumulating the sum of the processing capability values of each service processor;
- the obtained feature values are accumulated and modulo with the obtained capabilities to obtain a load sharing reference value
- the processing capability values of the service processor are arranged from small to large, starting from the minimum value of the processing capability value of the service processor, respectively, the cumulative sum of the processing capability values of the first to the first business processors is calculated, and each is obtained.
- the load sharing determination value is greater than the load sharing reference value, it is determined that the first service processor corresponding to the load sharing determination value is a service processor shared by the service.
- I is a service processor value greater than 1 that is less than a processing capability value of the service processor greater than zero.
- processing capability values of the service processor of the computing service processor are 500, 700, 811, and 0, respectively;
- the obtained feature values are accumulated and modulo with the obtained capabilities to obtain a load sharing reference value
- the obtained feature values are accumulated and modulo obtained by the obtaining ability: 7912 is obtained by taking the model in 2011 and obtaining 1879.
- the processing capability value of the first service processor is cumulatively summed with the processing capability values of the service processors of the first to second service processors, and the service processors for the first to third service processors are The processing capacity values are summed and summed; the obtained values are 500, 1200, 2011,
- the load sharing determination value is greater than the load sharing reference value, it is determined that the first service processor corresponding to the load sharing determination value is a service processor shared by the service.
- the third service processor corresponding to the load sharing determination value is a service processor shared by the service. That is, the interface machine shares the traffic load to the third service processor.
- the message is not fixedly allocated to a service processor, but is adjusted according to the processing capability value of the service processor reported at the set interval, thereby achieving the service.
- the load sharing of the processor By obtaining the processing power value of the service processor, the load unevenness caused by the fixed proportional distribution is avoided.
- the embodiment further includes: if the service processor is down, the processor capability value of the downtime service processor is assigned a value of 0, and the distributed service processor is reselected according to the updated processor capability value. Therefore, the interface machine can also perform load adjustment well and improve the smooth operation of the system.
- all or part of the steps of the above embodiments may also be implemented by using an integrated circuit. These steps may be separately fabricated into individual integrated circuit modules, or multiple modules or steps may be fabricated into a single integrated circuit module. achieve.
- the devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
- each device/function module/functional unit in the above embodiment When each device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium.
- the above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
- the above technical solution ensures load balancing of the service processor in the system.
Landscapes
- Debugging And Monitoring (AREA)
Abstract
一种实现负荷分担的方法、接口机、业务处理机及系统,包括:接口机接收每个业务处理机按照定时间隔计算的处理能力值;根据接收的所有业务处理机的处理能力值,接口机进行会话业务的负荷分担。上述技术方案通过计算业务处理机的处理能力值,以处理能力值为依据进行会话业务的负荷分担,保证了系统内业务处理机的负荷均衡。
Description
本文涉及但不限于融合通信技术,尤其涉及但不限于一种实现负荷分担的方法、接口机、业务处理机及系统。
随着移动互联网的快速发展,通过互联网向用户提供多种应用服务(OTT)业务大步向前进,强烈冲击着电信传统的语音和短消息业务。全球移动通信系统协会(GSMA)在2009年公布了融合通信(RCS)计划,得到了多家欧洲运营商的响应。2010年,由西班牙的西班牙电话公司(Telefonica)、英国沃达丰、法国Orange(法国的移动营运商)、意大利电信及德国电信在内的欧洲五大电信巨头,决定联合推出自有即时通信系统,并命名为“Joyn”,以此正式向OTT应用宣战。
通过融合通信能力网关将融合通信的功能开放,可以降低对移动终端和开发者的要求,同时可以利用开发者自身优势开发出丰富的应用。随着移动互联网业务和融合通信的发展,对融合通信能力网关的处理能力要求越来越高,单节点已经不能满足要求,因此需要分布式,多节点才能满足。对于分布式、多节点,其中有一个重要的问题就是如何有效的将负荷分担到每个业务处理机上,从而让每个业务处理机能够充分发挥自己的处理能力,完成海量业务的处理。
由于每个业务处理机的硬件配置和操作系统及安装的应用可能不同,操作系统和安装的应用程序对系统资源占用会存在差异,同时融合通信的不同业务对业务处理机的资源占用不同,因此,需要确定如何将业务分配给合适的业务处理机,进行负荷分担。相关技术中,按照中国专利“一种多模块短消息系统的负荷分担方法”,公开号CN 1937787 A,所示,短消息网关以消息中的特征串(如源号码)结合业务处理机的处理能力,按照HASH算法实现业务的均分。由于融合通信业务上的差异,短消息是相对独立的,而融合通
信有会话内的消息业务,例如1对1聊天、群聊等基于会话业务的消息,会话业务的消息需要分配到同一个业务处理机,用于与核心网建立会话,由于会话业务消息的消息数不同,且会话传输也存在较大的处理能力需求差异;因此,如果按照特征串进行业务分发则会造成业务处理机负荷不均。
发明内容
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。(The following is a brief summary of subject matter that is described in greater detail herein.This summary is not intended to be limiting as to the scope of the claims.)
本发明实施例提供一种实现负荷分担的方法及系统,以解决能够根据业务对处理能力的需求及处理能力进行负荷分担的技术问题。
本发明实施例提供了一种实现负荷分担的方法,包括:
接口机接收每个业务处理机按照定时间隔计算的处理能力值;
根据接收的所有业务处理机的处理能力值,接口机进行会话业务的负荷分担。
可选地,定时间隔由预先设定的业务处理机均衡参数确定。
可选地,处理能力值由会话能力值、和/或消息能力值、和/或中央处理器CPU能力值、和/或内存能力值、和/或磁盘能力值进行累加后计算获得。
可选地,所述方法还包括:当获得所述业务处理机的处理能力值中包含所述会话能力值时,接口机接收每个业务处理机按照定时间隔计算的处理能力值之前,接口机获取所述会话能力值:
以所述业务处理机的可用端口数作为业务处理机的最大会话数,读取获得所述业务处理机的当前会话数,将最大会话数减去当前会话数获得可用会话数,将可用会话数除以最大会话数乘以预先设定的会话权重值,获得所述会话能力值;
当获得所述业务处理机的处理能力值中包含所述消息能力值时,接口机接收每个业务处理机按照定时间隔计算的处理能力值之前,获取所述消息能
力值:根据所述业务处理机配置确定其相应的最大积压消息数,根据读取获得的当前积压消息数,将最大积压消息数减去当前积压消息数获得可处理消息数,将可处理消息数除以最大积压消息数乘以预先设定的消息权重值,获得所述消息能力值;
当获得所述业务处理机的处理能力值中包含所述CPU能力值时,接口机接收每个业务处理机按照定时间隔计算的处理能力值之前,获取所述CPU能力值:
预先确定所述业务处理机的CPU最大占用率,读取获得的当前CPU占用率,将CPU最大占用率减去当前CPU占用率,获得CPU可用率,将CPU可用率除以CPU最大占用率乘以预先设定的CPU权重值,获得所述CPU能力值;
当获得所述业务处理机的处理能力值中包含所述内存能力值时,接口机接收每个业务处理机按照定时间隔计算的处理能力值之前,获取所述内存能力值:
预先确定所述业务处理机的内存最大占用率,读取当前内存占用率,将所述内存最大占用率减去所述当前内存占用率获得内存可用率,将内存可用率除以内存最大占用率乘以预先设定的内存权重值,获得所述内存能力值;
当获得所述业务处理机的处理能力值中包含所述磁盘能力值时,接口机接收每个业务处理机按照定时间隔计算的处理能力值之前,获取所述磁盘能力值:
预先确定所述业务处理机的最大磁盘占用率,读取当前磁盘占用率,将所述最大磁盘占用率减去所述当前磁盘占用率获得磁盘可用率,将磁盘可用率除以最大磁盘占用率乘以预先设定的磁盘权重值,获得所述磁盘能力值。
可选地,所述方法还包括:当计算所述业务处理机的处理能力值中的会话能力值、和/或消息能力值、和/或中央处理器CPU能力值、和/或内存能力值、和/或磁盘能力值存在一个或一个以上值小于或等于0时,赋值所述业务处理机的处理能力值为0。
可选地,该方法还包括:所述接口机获取所有业务处理机工作状态,当
业务处理机宕机时,赋值宕机的所述业务处理机的处理能力值为0。
可选地,根据接收的所有业务处理机的处理能力值,接口机进行会话业务的负荷分担包括:
根据每个业务处理机的处理能力值的数值大小比例,均匀分担接口机接收到的业务。
可选地,根据每个业务处理机的处理能力值的数值大小比例,均匀分担接口机接收到的业务包括:
将每个业务处理机的处理能力值累加获得能力累加和;
取非会话业务的消息的特征串中发起者号码的后四位加上特征串中任一接收者号码的后四位获得特征数值;
将获得的特征数值用获得的能力累加和取模,获得负荷分担参考值;
将所有所述业务处理机的处理能力值按照由小到大排列后,从业务处理机的处理能力值最小值开始,分别计算第1个到第I个业务处理机的处理能力值的累加和,获得每个业务处理机相应的负荷分担确定值;
当出现所述负荷分担确定值大于所述负荷分担参考值时,确定该负荷分担确定值对应的第I个业务处理机为业务分担的业务处理机;
其中,I为大于1小于业务处理机的处理能力值大于0的业务处理机个数值。
可选地,该方法还包括:接口机接收每个业务处理机按照定时间隔计算的处理能力值之前,所述接口机从能力网关服务器接收负荷分担给业务处理机的会话业务的消息。
另一方面,本申请还提供一种实现负荷分担的接口机,包括:接收单元200及负荷分担单元201;其中,
接收单元200,设置为接收每个业务处理机按照定时间隔计算的处理能力值;
负荷分担单元201,设置为根据接收的所有业务处理机的处理能力值,进行会话业务的负荷分担。
可选地,接口机还包括赋值单元202,设置为获取所有业务处理机工作状态,当业务处理机宕机时,赋值宕机的所述业务处理机的处理能力值为0。
可选地,负荷分担单元201是设置为,
根据每个业务处理机的处理能力值的数值大小比例,均匀分担接口机接收到的业务。
可选地,接口机还包括接收业务单元203,设置为从能力网关服务器接收负荷分担给业务处理机的会话业务的消息。
再一方面,本申请还提供一种实现负荷分担的业务处理机,包括计算上报单元300,设置为按照定时间隔计算自身的处理能力值上报给接口机。
可选地,计算上报单元300是设置为,按照定时间隔由会话能力值、和/或消息能力值、和/或CPU能力值、和/或内存能力值、和/或磁盘能力值进行累加后计算获得处理能力值。
可选地,该业务处理机还包括获取能力值单元301,设置为
当获得所述业务处理机的处理能力值中包含所述会话能力值时,获取所述会话能力值:以所述业务处理机的可用端口数作为业务处理机的最大会话数,读取获得所述业务处理机的当前会话数,将最大会话数减去当前会话数获得可用会话数,将可用会话数除以最大会话数乘以预先设定的会话权重值,获得所述会话能力值;
当获得所述业务处理机的处理能力值中包含所述消息能力值时,获取所述消息能力值:根据所述业务处理机配置确定其相应的最大积压消息数,根据读取获得的当前积压消息数,将最大积压消息数减去当前积压消息数获得可处理消息数,将可处理消息数除以最大积压消息数乘以预先设定的消息权重值,获得所述消息能力值;
当获得所述业务处理机的处理能力值中包含所述CPU能力值时,获取所述CPU能力值:预先确定所述业务处理机的CPU最大占用率,读取获得的当前CPU占用率,将CPU最大占用率减去当前CPU占用率,获得CPU可用率,将CPU可用率除以CPU最大占用率乘以预先设定的CPU权重值,获得所述CPU能力值;
当获得所述业务处理机的处理能力值中包含所述内存能力值时,获取所述内存能力值:预先确定所述业务处理机的内存最大占用率,读取当前内存占用率,将所述内存最大占用率减去所述当前内存占用率获得内存可用率,将内存可用率除以内存最大占用率乘以预先设定的内存权重值,获得所述内存能力值;
当获得业务处理机的处理能力值中包含所述磁盘能力值时,获取所述磁盘能力值:预先确定所述业务处理机的最大磁盘占用率,读取当前磁盘占用率,将所述最大磁盘占用率减去所述当前磁盘占用率获得磁盘可用率,将磁盘可用率除以最大磁盘占用率乘以预先设定的磁盘权重值,获得所述磁盘能力值。
可选地,计算上报单元300还设置为,当计算所述业务处理机的处理能力值中的会话能力值、消息能力值、CPU能力值、内存能力值、或磁盘能力值存在一个或一个以上值小于或等于0时,赋值业务处理机的处理能力值为0。
又一方面,本申请还提供一种实现负荷分担的系统,包括:接口机及若干业务处理机;其中,
业务处理机至少包含计算上报单元300,设置为按照定时间隔计算自身的处理能力值上报给接口机;
接口机至少包含负荷分担单元201,设置为根据每个业务处理机的处理能力值,进行会话业务的负荷分担。
一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行上述的方法。
与相关技术相比,本申请技术方案包括:接口机接收每个业务处理机按照定时间隔计算的处理能力值;根据接收的所有业务处理机的处理能力值,接口机进行会话业务的负荷分担。本发明实施例方法通过计算业务处理机的处理能力值,以处理能力值为依据进行会话业务的负荷分担,保证了系统内业务处理机的负荷均衡。
在阅读并理解了附图和详细描述后,可以明白其他方面。(Other aspects will be appreciated upon reading and understanding the attached figures and detailed description)
附图概述
图1为本发明实施例实现负荷分担的方法的流程图;
图2为本发明实施例实现负荷分担的接口机的结构框图;
图3为本发明实施例实现负荷分担的业务处理机的结构框图;
图4为本发明实施例实现负荷分担的系统的结构程图。
本发明的较佳实施方式
下文中将结合附图对本发明实施例进行详细说明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。
图1为本发明实施例实现负荷分担的方法的流程图,如图1所示,包括:
步骤100、接口机接收每个业务处理机按照定时间隔计算的处理能力值。
本步骤中,业务处理机计算处理能力值的定时间隔由预先设定的业务处理机均衡参数确定;这里,可以取业务处理机中节点的系统负荷确定均衡参数;例如,读取业务处理机中最忙节点的系统负荷比最闲节点的系统负荷高于一定百分比时,设定按照一定比例调整上报间隔的百分比,例如最忙节点的系统负荷比最闲节点的系统负荷高于设定的均衡参数30%时,定时间隔减少10个百分比。
需要说明的是,系统负荷可以通过相关命令查看获得,例如,在Linux系统中,可以用w或uptime或procinfo或top命令查看每个节点的系统负荷。
本步骤中,业务处理机的处理能力值由会话能力值、和/或消息能力值、和/或CPU能力值、和/或内存能力值、和/或磁盘能力值进行累加后计算获得。
可选的,当获得业务处理机的处理能力值中包含会话能力值时,本发明实施例方法之前还包括:获取会话能力值:
以业务处理机的可用端口数作为业务处理机的最大会话数,读取获得业务处理机的当前会话数,将最大会话数减去当前会话数获得可用会话数,将可用会话数除以最大会话数乘以预先设定的会话权重值,获得会话能力值。
当获得业务处理机的处理能力值中包含消息能力值时,本发明实施例方法之前还包括:获取消息能力值:
根据业务处理机配置确定其相应的最大积压消息数,根据读取获得的当前积压消息数,将最大积压消息数减去当前积压消息数获得可处理消息数,将可处理消息数除以最大积压消息数乘以预先设定的消息权重值,获得消息能力值。
当获得业务处理机的处理能力值中包含CPU能力值时,本发明实施例方法之前还包括:获取CPU能力值:
预先确定业务处理机的CPU最大占用率,读取获得的当前CPU占用率,将CPU最大占用率减去当前CPU占用率,获得CPU可用率,将CPU可用率除以CPU最大占用率乘以预先设定的CPU权重值,获得CPU能力值。
当获得业务处理机的处理能力值中包含内存能力值时,本发明实施例方法之前还包括:获取内存能力值:
预先确定业务处理机的内存最大占用率,读取当前内存占用率,将内存最大占用率减去当前内存占用率获得内存可用率,将内存可用率除以内存最大占用率乘以预先设定的内存权重值,获得内存能力值。
当获得业务处理机的处理能力值中包含磁盘能力值时,本发明实施例方法之前还包括:获取磁盘能力值:
预先确定业务处理机的最大磁盘占用率,读取当前磁盘占用率,将最大磁盘占用率减去当前磁盘占用率获得磁盘可用率,将磁盘可用率除以最大磁盘占用率乘以预先设定的磁盘权重值,获得磁盘能力值。
需要说明的是,通过设定会话权重值、和/或消息权重值、和/或CPU权重值、和/或内存权重值、和/或磁盘权重值的数值大小,可以实现对业务所需处理能力大小进行显示,例如、如果业务处理时,业务处理机的CPU可用率为业务负荷时主要考虑因素,则CPU权重值应当设定比其他权重值数值大,
具体大小可以根据本领域技术人员的经验进行设定。
业务处理机的处理能力值除了由会话能力值、和/或消息能力值、和/或CPU能力值、和/或内存能力值、和/或磁盘能力值计算获得外,还可以引入相关参数进行计算,例如、引入业务处理机的核心显存进行业务处理机的处理能力值计算,如果对业务负荷分担影响较小,则可以通过设置较小的权重值进行计算。
当计算业务处理机的处理能力值中的会话能力值、消息能力值、CPU能力值、内存能力值、或磁盘能力值存在一个或一个以上值小于或等于0时,本发明实施例方法还包括:赋值业务处理机的处理能力值为0;
本发明实施例方法还包括:接口机获取业务处理机工作状态,当业务处理机宕机时,赋值宕机的业务处理机的处理能力值为0。
步骤101、根据接收的所有业务处理机的处理能力值,接口机进行会话业务的负荷分担。
本步骤包括:根据每个业务处理机的处理能力值的数值大小比例,均匀分担接口机接收到的业务。
可选的,将每个业务处理机的处理能力值累加获得能力累加和;
取非会话业务的消息的特征串中发起者号码的后四位加上特征串中任一接收者号码的后四位获得特征数值;
将获得的特征数值用获得的能力累加和取模,获得负荷分担参考值;
将业务处理机的处理能力值按照由小到大排列后,从业务处理机的处理能力值最小值开始,分别计算第1到第I个业务处理机的处理能力值的累加和,获得每个业务处理机相应的负荷分担确定值;
当出现负荷分担确定值大于负荷分担参考值时,确定该负荷分担确定值对应的第I个业务处理机为业务分担的业务处理机。
I为大于1小于业务处理机的处理能力值大于0的业务处理机个数值。
本发明实施例方法之前还包括:接口机从能力网关服务器接收负荷分担给业务处理机的会话业务的消息。
本发明实施例还提供了一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行上述方法。
图2为本发明实施例实现负荷分担的接口机的结构框图,包括:接收单元200及负荷分担单元201;其中,
接收单元200,设置为接收每个业务处理机按照定时间隔计算的处理能力值;
负荷分担单元201,设置为根据接收的所有业务处理机的处理能力值,进行会话业务的负荷分担。
负荷分担单元201是设置为,
根据每个业务处理机的处理能力值的数值大小比例,均匀分担接口机接收到的业务。
本发明实施例接口机还包括赋值单元202,设置为获取所有业务处理机工作状态,当业务处理机宕机时,赋值宕机的业务处理机的处理能力值为0。
接口机还包括接收业务单元203,设置为从能力网关服务器接收负荷分担给业务处理机的会话业务的消息。
图3为本发明实施例实现负荷分担的业务处理机的结构框图,如图3所示,包括计算上报单元300,设置为按照定时间隔计算自身的处理能力值上报给接口机。
计算上报单元300是设置为,按照定时间隔由会话能力值、和/或消息能力值、和/或CPU能力值、和/或内存能力值、和/或磁盘能力值进行累加后计算获得处理能力值。
本发明实施例业务处理机还包括获取能力值单元301,设置为
当获得业务处理机的处理能力值中包含会话能力值时,获取会话能力值:以业务处理机的可用端口数作为业务处理机的最大会话数,读取获得业务处理机的当前会话数,将最大会话数减去当前会话数获得可用会话数,将可用
会话数除以最大会话数乘以预先设定的会话权重值,获得会话能力值;
当获得业务处理机的处理能力值中包含消息能力值时,获取消息能力值:根据业务处理机配置确定其相应的最大积压消息数,根据读取获得的当前积压消息数,将最大积压消息数减去当前积压消息数获得可处理消息数,将可处理消息数除以最大积压消息数乘以预先设定的消息权重值,获得消息能力值;
当获得业务处理机的处理能力值中包含CPU能力值时,获取CPU能力值:预先确定业务处理机的CPU最大占用率,读取获得的当前CPU占用率,将CPU最大占用率减去当前CPU占用率,获得CPU可用率,将CPU可用率除以CPU最大占用率乘以预先设定的CPU权重值,获得CPU能力值;
当获得业务处理机的处理能力值中包含内存能力值时,获取内存能力值:预先确定业务处理机的内存最大占用率,读取当前内存占用率,将内存最大占用率减去当前内存占用率获得内存可用率,将内存可用率除以内存最大占用率乘以预先设定的内存权重值,获得内存能力值;
当获得业务处理机的处理能力值中包含磁盘能力值时,获取磁盘能力值:预先确定业务处理机的最大磁盘占用率,读取当前磁盘占用率,将最大磁盘占用率减去当前磁盘占用率获得磁盘可用率,将磁盘可用率除以最大磁盘占用率乘以预先设定的磁盘权重值,获得磁盘能力值。
计算上报单元300还设置为,当计算业务处理机的处理能力值中的会话能力值、消息能力值、CPU能力值、内存能力值、或磁盘能力值存在一个或一个以上值小于或等于0时,赋值业务处理机的处理能力值为0。
图4为本发明实施例实现负荷分担的系统的结构程图,如图4所示,包括:接口机及若干业务处理机;其中,
业务处理机包含计算上报单元300,设置为按照定时间隔计算自身的处理能力值上报给接口机;
接口机包含负荷分担单元201,设置为根据每个业务处理机的处理能力值,进行会话业务的负荷分担。
以下通过具体实施例对本发明实施例方法进行清楚详细的说明,实施例
仅用于陈述本申请,并不用于限制本申请方法的保护范围。
实施例1
本实施以应用下行到终端的业务的消息为例进行说明,本实施例设定业务处理机的处理能力值最大值为1000,根据处理能力值的最大值进行权重值的设定。
能力网关服务器接收到应用业务的消息,将业务的消息发送到接口机;
接口机根据定时间隔进行业务处理机的处理能力值上报确定业务的负荷分担。
进行业务分担的业务处理机将业务的消息发送到核心网,核心网将消息发往目的终端。其中,业务处理机的处理能力值及业务的负荷分担通过以下方式实现。
业务处理机按照定时间隔计算自身的处理能力值上报给接口机;其中,
定时间隔由预先设定的节点均衡参数设定及调整,例如,读取业务处理机中最忙节点的系统负荷比最闲节点的系统负荷高于一定百分比时,设定按照一定比例调整上报间隔的百分比,例如最忙节点的系统负荷比最闲节点的系统负荷高于30%时,定时间隔减少10个百分比,定时间隔以1秒到60秒为优选值。
需要说明的是,系统负荷可以通过相关命令查看获得,例如,在Linux系统中,可以用w或uptime或procinfo或top命令查看每个节点的系统负荷。
本步骤中,业务处理机的处理能力值由会话能力值、和/或消息能力值、和/或CPU能力值、和/或内存能力值、和/或磁盘能力值计算获得。
可选的,以业务处理机的可用端口数作为业务处理机的最大会话数,读取获得业务处理机的当前会话数,将最大会话数减去当前会话数获得可用会话数,将可用会话数除以最大会话数乘以预先设定的会话权重值,获得会话能力值。
由于业务处理机的端口数最大限制为65535,需要预留部分给系统和相关应用使用,业务处理机的可用端口数小于65535,业务的会话建立需要用到业务处理机的端口,业务的会话数会受此限制,一般来说,业务处理机的
可用端口数可以设定为60000,当然,可以根据系统和相关应用对端口的使用情况进行调整。由于,业务的会话数主要受端口资源的影响,对系统CPU,内存影响不大,因此权重可以调低一点,例如、100。
假定,业务处理机的最大会话数为60000,当前会话数10000,会话权重值为100,则获得会话能力值为:(60000-10000)/60000*100=83
根据业务处理机配置确定其相应的最大积压消息数,根据读取获得的当前积压消息数,将最大积压消息数减去当前积压消息数获得可处理消息数,将可处理消息数除以最大积压消息数乘以预先设定的消息权重值,获得消息能力值。
消息能力值是本发明实施例业务处理机业务负荷分担的重要参考依据,因此,需要设定较大的权重值,如、设定消息权重值为300。
假定最大积压消息数为1000,设定消息权重值为300,当前积压消息数为100,则消息能力值为:(1000-100)/1000*300=270。这里,如果当前积压消息数已超过最大积压消息数说明业务处理机已满负荷,此时,消息能力值为0。
预先确定业务处理机的CPU最大占用率,读取获得的当前CPU占用率,将CPU最大占用率减去当前CPU占用率,获得CPU可用率,将CPU可用率除以CPU最大占用率乘以预先设定的CPU权重值,获得CPU能力值。
CPU能力值是本发明实施例业务处理机业务负荷分担的重要参考依据,因此,需要设定较大的权重值,如、设定CPU权重值为300。
预先确定业务处理机的CPU最大占用率为80%,CPU权重值为300,当前CPU占用率为60%,则CPU能力值为:(80-60)/80*300=75。
预先确定业务处理机的内存最大占用率,读取当前内存占用率,将内存最大占用率减去当前内存占用率获得内存可用率,将内存可用率除以内存最大占用率乘以预先设定的内存权重值,获得内存能力值。
内存能力值是本发明实施例业务处理机业务负荷分担的一个参考依据,设定权重大于处于中等低位,如、设定内存权重值为200。
预先确定业务处理机的内存最大占用率为80%,内存权重值为200,当
前内存占用率为60%,则内存能力值为(80-60)/80*200=50。
预先确定业务处理机的最大磁盘占用率,读取当前磁盘占用率,将最大磁盘占用率减去当前磁盘占用率获得磁盘可用率,将磁盘可用率除以最大磁盘占用率乘以预先设定的磁盘权重值,获得磁盘能力值。
磁盘对业务处理机的处理能力值计算其重要性略低,因此可以设定磁盘权重值为100。
预先确定业务处理机的最大磁盘占用率为80%,磁盘权重值为100,当前磁盘占用率为40%,则磁盘能力值为(80-40)/80*100=50。
接口机根据每个业务处理机的处理能力值,进行会话业务的负荷分担包括:将每个业务处理机的处理能力值累加获得能力累加和;
取非会话业务的消息的特征串中发起者号码的后四位加上特征串中任一接收者号码的后四位获得特征数值;
将获得的特征数值用获得的能力累加和取模,获得负荷分担参考值;
将业务处理机的处理能力值按照由小到大排列后,从业务处理机的处理能力值最小值开始,分别计算第1到第I个业务处理机的处理能力值的累加和,获得每个业务处理机相应的负荷分担确定值;
当出现负荷分担确定值大于负荷分担参考值时,确定该负荷分担确定值对应的第I个业务处理机为业务分担的业务处理机。
I为大于1小于业务处理机的处理能力值大于0的业务处理机个数值。
假设计算业务处理机的业务处理机的处理能力值分别为500、700、811、0;
将每个业务处理机的处理能力值累加获得能力累加和为500+700+811+0=2011。
取非会话业务的消息的特征串中发起者号码的后四位加上特征串中任一接收者号码的后四位获得特征数值;
假设接口机收到的非会话业务的消息的特征串,发起者号码为13612345678,任一接收者的号码为13956782234,则获得特征数值为
5678+2234=7912。
将获得的特征数值用获得的能力累加和取模,获得负荷分担参考值;
将获得特征数值用获得能力累加和取模得为:7912用2011取模得到1879。
从业务处理机的处理能力值最小值开始,分别计算第1到第I个业务处理机的处理能力值的累加和,获得每个业务处理机相应的负荷分担确定值;
即第1个业务处理机的处理能力值,对第1个到第2个业务处理机的业务处理机的处理能力值累加求和,对第1个到第3个业务处理机的业务处理机的处理能力值累加求和;获得的值为500、1200、2011,
当出现负荷分担确定值大于负荷分担参考值时,确定该负荷分担确定值对应的第I个业务处理机为业务分担的业务处理机。
即2011大于1879时,确定该负荷分担确定值对应的第3个业务处理机为业务分担的业务处理机。即,接口机将业务负荷分担给第三个业务处理机。
通过本实施方法,如果用户A发起多条非会话内业务的消息,不会固定分配到某个业务处理机,而是根据设定间隔上报的业务处理机的处理能力值进行调整,从而达到业务处理机的负荷分担。通过获取业务处理机的处理能力值,避免了固定按比例分发造成的负荷不均。
本实施例还包括:如果业务处理机出现宕机时,则宕机的业务处理机的处理机能力值被赋值为0,根据更新的处理机能力值重新选择分发的业务处理机。因此,接口机也能很好的进行负荷调整,提高系统的平稳运行。
虽然本申请所揭露的实施方式如上,但所述的内容仅为便于理解本申请而采用的实施方式,并非用以限定本申请。
本领域普通技术人员可以理解上述实施例的全部或部分步骤可以使用计算机程序流程来实现,所述计算机程序可以存储于一计算机可读存储介质中,所述计算机程序在相应的硬件平台上(如系统、设备、装置、器件等)执行,在执行时,包括方法实施例的步骤之一或其组合。
可选地,上述实施例的全部或部分步骤也可以使用集成电路来实现,这些步骤可以被分别制作成一个个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。
上述实施例中的各装置/功能模块/功能单元可以采用通用的计算装置来实现,它们可以集中在单个的计算装置上,也可以分布在多个计算装置所组成的网络上。
上述实施例中的各装置/功能模块/功能单元以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。上述提到的计算机可读取存储介质可以是只读存储器,磁盘或光盘等。
上述技术方案保证了系统内业务处理机的负荷均衡。
Claims (19)
- 一种实现负荷分担的方法,包括:接口机接收每个业务处理机按照定时间隔计算的处理能力值;根据接收的所有业务处理机的处理能力值,接口机进行会话业务的负荷分担。
- 根据权利要求1所述的方法,其中,所述定时间隔由预先设定的业务处理机均衡参数确定。
- 根据权利要求1所述的方法,其中,所述处理能力值由会话能力值、和/或消息能力值、和/或中央处理器CPU能力值、和/或内存能力值、和/或磁盘能力值进行累加后计算获得。
- 根据权利要求3所述的方法,所述方法还包括:当获得所述业务处理机的处理能力值中包含所述会话能力值时,接口机接收每个业务处理机按照定时间隔计算的处理能力值之前,接口机获取所述会话能力值:以所述业务处理机的可用端口数作为业务处理机的最大会话数,读取获得所述业务处理机的当前会话数,将最大会话数减去当前会话数获得可用会话数,将可用会话数除以最大会话数乘以预先设定的会话权重值,获得所述会话能力值;当获得所述业务处理机的处理能力值中包含所述消息能力值时,接口机接收每个业务处理机按照定时间隔计算的处理能力值之前,获取所述消息能力值:根据所述业务处理机配置确定其相应的最大积压消息数,根据读取获得的当前积压消息数,将最大积压消息数减去当前积压消息数获得可处理消息数,将可处理消息数除以最大积压消息数乘以预先设定的消息权重值,获得所述消息能力值;当获得所述业务处理机的处理能力值中包含所述CPU能力值时,接口机接收每个业务处理机按照定时间隔计算的处理能力值之前,获取所述CPU能 力值:预先确定所述业务处理机的CPU最大占用率,读取获得的当前CPU占用率,将CPU最大占用率减去当前CPU占用率,获得CPU可用率,将CPU可用率除以CPU最大占用率乘以预先设定的CPU权重值,获得所述CPU能力值;当获得所述业务处理机的处理能力值中包含所述内存能力值时,接口机接收每个业务处理机按照定时间隔计算的处理能力值之前,获取所述内存能力值:预先确定所述业务处理机的内存最大占用率,读取当前内存占用率,将所述内存最大占用率减去所述当前内存占用率获得内存可用率,将内存可用率除以内存最大占用率乘以预先设定的内存权重值,获得所述内存能力值;当获得所述业务处理机的处理能力值中包含所述磁盘能力值时,接口机接收每个业务处理机按照定时间隔计算的处理能力值之前还包括:获取所述磁盘能力值:预先确定所述业务处理机的最大磁盘占用率,读取当前磁盘占用率,将所述最大磁盘占用率减去所述当前磁盘占用率获得磁盘可用率,将磁盘可用率除以最大磁盘占用率乘以预先设定的磁盘权重值,获得所述磁盘能力值。
- 根据权利要求3所述的方法,所述方法还包括:当计算所述业务处理机的处理能力值中的会话能力值、和/或消息能力值、和/或中央处理器CPU能力值、和/或内存能力值、和/或磁盘能力值存在一个或一个以上值小于或等于0时,赋值所述业务处理机的处理能力值为0。
- 根据权利要求1所述的方法,该方法还包括:所述接口机获取所有业务处理机工作状态,当业务处理机宕机时,赋值宕机的所述业务处理机的处理能力值为0。
- 根据权利要求1所述的方法,其中,所述根据接收的所有业务处理机的处理能力值,接口机进行会话业务的负荷分担包括:根据每个业务处理机的处理能力值的数值大小比例,均匀分担接口机接收到的业务。
- 根据权利要求7所述的方法,其中,所述根据每个业务处理机的处理能力值的数值大小比例,均匀分担接口机接收到的业务包括:将每个业务处理机的处理能力值累加获得能力累加和;取非会话业务的消息的特征串中发起者号码的后四位加上特征串中任一接收者号码的后四位获得特征数值;将获得的特征数值用获得的能力累加和取模,获得负荷分担参考值;将所有所述业务处理机的处理能力值按照由小到大排列后,从业务处理机的处理能力值最小值开始,分别计算第1个到第I个业务处理机的处理能力值的累加和,获得每个业务处理机相应的负荷分担确定值;当出现所述负荷分担确定值大于所述负荷分担参考值时,确定该负荷分担确定值对应的第I个业务处理机为业务分担的业务处理机;其中,I为大于1小于业务处理机的处理能力值大于0的业务处理机个数值。
- 根据权利要求1所述的方法,所述方法还包括:接口机接收每个业务处理机按照定时间隔计算的处理能力值之前,所述接口机从能力网关服务器接收负荷分担给业务处理机的会话业务的消息。
- 一种实现负荷分担的接口机,包括:接收单元(200)及负荷分担单元(201);其中,接收单元(200),设置为接收每个业务处理机按照定时间隔计算的处理能力值;负荷分担单元(201),设置为根据接收的所有业务处理机的处理能力值,进行会话业务的负荷分担。
- 根据权利要求10所述的接口机,所述接口机还包括赋值单元(202),设置为获取所有业务处理机工作状态,当业务处理机宕机时,赋值宕机的所述业务处理机的处理能力值为0。
- 根据权利要求10所述的接口机,其中,所述负荷分担单元(201)是设置为,根据每个业务处理机的处理能力 值的数值大小比例,均匀分担接口机接收到的业务。
- 根据权利要求10所述的接口机,所述接口机还包括接收业务单元(203),设置为从能力网关服务器接收负荷分担给业务处理机的会话业务的消息。
- 一种实现负荷分担的业务处理机,包括计算上报单元(300),设置为按照定时间隔计算自身的处理能力值上报给接口机。
- 根据权利要求14所述的业务处理机,其中,所述计算上报单元(300)是设置为,按照定时间隔由会话能力值、和/或消息能力值、和/或中央处理器CPU能力值、和/或内存能力值、和/或磁盘能力值进行累加后计算获得处理能力值。
- 根据权利要求15所述的业务处理机,该业务处理机还包括获取能力值单元(301),设置为当获得所述业务处理机的处理能力值中包含所述会话能力值时,获取所述会话能力值:以所述业务处理机的可用端口数作为业务处理机的最大会话数,读取获得所述业务处理机的当前会话数,将最大会话数减去当前会话数获得可用会话数,将可用会话数除以最大会话数乘以预先设定的会话权重值,获得所述会话能力值;当获得所述业务处理机的处理能力值中包含所述消息能力值时,获取所述消息能力值:根据所述业务处理机配置确定其相应的最大积压消息数,根据读取获得的当前积压消息数,将最大积压消息数减去当前积压消息数获得可处理消息数,将可处理消息数除以最大积压消息数乘以预先设定的消息权重值,获得所述消息能力值;当获得所述业务处理机的处理能力值中包含所述CPU能力值时,获取所述CPU能力值:预先确定所述业务处理机的CPU最大占用率,读取获得的当前CPU占用率,将CPU最大占用率减去当前CPU占用率,获得CPU可用率,将CPU可用率除以CPU最大占用率乘以预先设定的CPU权重值,获得所述CPU能力值;当获得所述业务处理机的处理能力值中包含所述内存能力值时,获取所述内存能力值:预先确定所述业务处理机的内存最大占用率,读取当前内存 占用率,将所述内存最大占用率减去所述当前内存占用率获得内存可用率,将内存可用率除以内存最大占用率乘以预先设定的内存权重值,获得所述内存能力值;当获得业务处理机的处理能力值中包含所述磁盘能力值时,获取所述磁盘能力值:预先确定所述业务处理机的最大磁盘占用率,读取当前磁盘占用率,将所述最大磁盘占用率减去所述当前磁盘占用率获得磁盘可用率,将磁盘可用率除以最大磁盘占用率乘以预先设定的磁盘权重值,获得所述磁盘能力值。
- 根据权利要求14所述的业务处理机,所述计算上报单元(300)还设置为,当计算所述业务处理机的处理能力值中的会话能力值、消息能力值、CPU能力值、内存能力值、或磁盘能力值存在一个或一个以上值小于或等于0时,赋值业务处理机的处理能力值为0。
- 一种实现负荷分担的系统,包括:接口机及若干业务处理机;其中,所述接口机采用如权利要求10~13中任一项所述的接口机;所述业务处理机采用如权利要求14~17中任一项所述的业务处理器。
- 一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行权利要求1~9中任一项所述的方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510217814.5 | 2015-04-30 | ||
CN201510217814.5A CN106209665A (zh) | 2015-04-30 | 2015-04-30 | 一种实现负荷分担的方法、接口机、业务处理机及系统 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2016173133A1 true WO2016173133A1 (zh) | 2016-11-03 |
Family
ID=57198907
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2015/084831 WO2016173133A1 (zh) | 2015-04-30 | 2015-07-22 | 一种实现负荷分担的方法、接口机、业务处理机及系统 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN106209665A (zh) |
WO (1) | WO2016173133A1 (zh) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107196869B (zh) * | 2017-07-14 | 2019-11-15 | 北京知道创宇信息技术股份有限公司 | 基于主机实际负载的自适应负载均衡方法、设备和系统 |
CN107547429A (zh) * | 2017-07-28 | 2018-01-05 | 新华三信息安全技术有限公司 | 一种负载确定方法、装置及电子设备 |
CN110691140B (zh) * | 2019-10-18 | 2022-02-15 | 国家计算机网络与信息安全管理中心 | 一种通讯网络中的弹性数据下发方法 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101631008A (zh) * | 2008-07-15 | 2010-01-20 | 大唐移动通信设备有限公司 | 一种通知负荷状态的方法及装置 |
US20120231824A1 (en) * | 2011-03-10 | 2012-09-13 | Miroslav Budic | Load balancing in a cellular telecommunication network |
CN103401939A (zh) * | 2013-08-08 | 2013-11-20 | 中国航天科工集团第三研究院第八三五七研究所 | 一种采用混合调度策略的负载均衡方法 |
CN104221458A (zh) * | 2012-03-30 | 2014-12-17 | 日电(中国)有限公司 | 用于tdd系统中的动态dl-ul重新配置的方法和装置 |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102084705B (zh) * | 2008-11-17 | 2015-07-01 | 思科技术公司 | 通信网络中的动态负载平衡 |
CN101753444B (zh) * | 2009-12-31 | 2012-01-18 | 卓望数码技术(深圳)有限公司 | 一种负载均衡方法和负载均衡装置 |
CN103188345B (zh) * | 2013-03-01 | 2016-05-18 | 北京邮电大学 | 分布式动态负载管理系统和方法 |
-
2015
- 2015-04-30 CN CN201510217814.5A patent/CN106209665A/zh not_active Withdrawn
- 2015-07-22 WO PCT/CN2015/084831 patent/WO2016173133A1/zh active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101631008A (zh) * | 2008-07-15 | 2010-01-20 | 大唐移动通信设备有限公司 | 一种通知负荷状态的方法及装置 |
US20120231824A1 (en) * | 2011-03-10 | 2012-09-13 | Miroslav Budic | Load balancing in a cellular telecommunication network |
CN104221458A (zh) * | 2012-03-30 | 2014-12-17 | 日电(中国)有限公司 | 用于tdd系统中的动态dl-ul重新配置的方法和装置 |
CN103401939A (zh) * | 2013-08-08 | 2013-11-20 | 中国航天科工集团第三研究院第八三五七研究所 | 一种采用混合调度策略的负载均衡方法 |
Also Published As
Publication number | Publication date |
---|---|
CN106209665A (zh) | 2016-12-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104714851B (zh) | 一种实现资源分配的方法及装置 | |
CN114915593B (zh) | 基于Redis的流量控制方法、装置、电子设备及存储介质 | |
JPWO2018220708A1 (ja) | 資源割当システム、管理装置、方法およびプログラム | |
CN108933829A (zh) | 一种负载均衡方法及装置 | |
CN105493533B (zh) | 在线计费方法、网关设备及在线计费设备 | |
WO2016180188A1 (zh) | 分发建链方法、装置和系统 | |
WO2016173133A1 (zh) | 一种实现负荷分担的方法、接口机、业务处理机及系统 | |
JP6131203B2 (ja) | 装置選択ネットワークシステム、装置選択サーバおよびプログラム | |
CN104301241B (zh) | 一种soa动态负载分发方法与系统 | |
WO2012000455A1 (zh) | 一种客户端及负载均衡的方法 | |
CN105471762B (zh) | 一种电力通信网拓扑的时间感知服务降级方法 | |
CN110995802A (zh) | 任务的处理方法和装置、存储介质及电子装置 | |
US10154414B2 (en) | Resource allocation | |
CN114024968B (zh) | 一种基于中间设备的报文发送方法、装置和电子设备 | |
US7583647B2 (en) | Controller for controlling number of requests served by a server | |
WO2016206472A1 (zh) | 一种mac流量调度方法、装置、基站和计算机可读存储介质 | |
CN106899510A (zh) | 一种基于iSCSI协议的传输速率控制方法和装置 | |
WO2011003448A1 (en) | Method and device for distributing connections towards a receiving domain | |
JP6511006B2 (ja) | リソース割当管理装置および割当て先サーバ決定方法 | |
JP5952775B2 (ja) | トラヒック制御装置、トラヒック制御方法、及びトラヒック制御プログラム | |
WO2024116384A1 (ja) | 基地局、無線通信システム、通信制御方法、及びプログラム | |
JP2014103637A (ja) | 負荷分散制御方法およびシステム | |
JP6921795B2 (ja) | 移動通信ネットワーク及び管理装置 | |
CN106063372B (zh) | 一种业务策略的控制方法和设备 | |
JP2016042679A (ja) | 通信制御方法及び通信制御装置 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 15890510 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 15890510 Country of ref document: EP Kind code of ref document: A1 |