A method and apparatus for dynamic load balancing for SIP signaling
Patent Information
- Application Number
- CN202310229693.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-10
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2043-03-10
AI Technical Summary
[0005]本发明的目的是提供一种面向SIP信令的动态负载均衡的方法和装置,解决负载服务器信令负载量不均衡的问题,提升装置稳定性,优化用户体验
[0016] The dynamic load balancing method for SIP signaling of this invention obtains and counts the message volume of signaling messages transmitted between SIP access servers and terminals via TCP long connections, and modifies the weight of SIP access servers within an IP virtual server. This allows the IP virtual server to preferentially assign SIP access servers with lower signaling loads when allocating terminal connections to SIP access servers, preventing situations where some SIP access servers with high signaling loads are assigned to new terminals but cannot handle the signaling messages transmitted by the terminals. This balances the signaling load of SIP access servers, improves the stability of SIP access servers, enhances the performance of server cluster devices, and optimizes the user experience.
Smart Images

Figure CN116437392B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communications, and more particularly to a method and apparatus for dynamic load balancing for SIP signaling. Background Technology
[0002] In the 5G messaging platform device, the terminal registration and login platform device transmits messages with the server via a long TCP connection and controls the server's load status through a load balancer. The 5G messaging platform device can only send rich text messages to the terminal after verifying the correctness of the terminal registration and login data. The more suitable the load balancer, the more evenly the traffic is distributed across the server cluster, and the more stable the server becomes.
[0003] However, current load balancing algorithms cannot balance the signaling load on load servers. While the number of users on each SIP access server may be relatively balanced, it cannot guarantee that the signaling load on each server will also be relatively balanced. This can easily lead to overload on some load servers, increasing the risk of downtime and reducing the quality of 5G user messaging services.
[0004] Therefore, there is a need to provide a method and apparatus for dynamic load balancing of SIP signaling to solve the problem of uneven signaling load on load servers, improve device stability, and optimize user experience. Summary of the Invention
[0005] The purpose of this invention is to provide a method and apparatus for dynamic load balancing for SIP signaling, which solves the problem of uneven signaling load on load servers, improves device stability, and optimizes user experience.
[0006] To achieve the above objectives, the present invention provides a method for dynamic load balancing for SIP signaling, comprising: establishing a data transmission connection between a terminal and a SIP access server; acquiring in real time the message volume of signaling messages transmitted by the terminal to the SIP access server; periodically counting the message volume and generating traffic statistics results; modifying the weight of the SIP access server according to the traffic statistics results and writing it to an IP virtual server; and allocating the SIP access server according to the weight.
[0007] Optionally, the data transmission connection is a TCP long connection.
[0008] Optionally, the number of messages can be counted using a counter to generate traffic statistics results.
[0009] Optionally, the counter is restored to its initial value when the data transmission connection is re-established.
[0010] Optionally, it also includes: setting a statistical time value, and periodically counting the number of messages based on the statistical time value.
[0011] Optionally, the traffic statistics results are stored in a dynamic cache.
[0012] Optionally, it may also include: the SIP access server processing the signaling message.
[0013] The present invention also provides a dynamic load balancing device for SIP signaling, comprising: a SIP access module for receiving and forwarding signaling messages; a counter located within the SIP access module for acquiring and periodically counting the number of messages forwarded by the SIP access module and generating traffic statistics results; and a dynamic load module for modifying the weights of SIP access servers within an IP virtual server based on the traffic statistics results.
[0014] Optionally, it also includes: LVS load balancing, connected to the dynamic load module and the SIP access module, for allocating the SIP access server according to the weight.
[0015] Optionally, it may also include a dynamic caching module for storing the traffic statistics results.
[0016] The dynamic load balancing method for SIP signaling of this invention obtains and counts the message volume of signaling messages transmitted between SIP access servers and terminals via TCP long connections, and modifies the weight of SIP access servers within an IP virtual server. This allows the IP virtual server to preferentially assign SIP access servers with lower signaling loads when allocating terminal connections to SIP access servers, preventing situations where some SIP access servers with high signaling loads are assigned to new terminals but cannot handle the signaling messages transmitted by the terminals. This balances the signaling load of SIP access servers, improves the stability of SIP access servers, enhances the performance of server cluster devices, and optimizes the user experience. Attached Figure Description
[0017] Figure 1 This is a flowchart of a dynamic load balancing method for SIP signaling in a specific embodiment of the present invention.
[0018] Figure 2 This is a block diagram of a dynamic load balancing device for SIP signaling according to a specific embodiment of the present invention. Detailed Implementation
[0019] The method and apparatus for dynamic load balancing of SIP signaling according to the present invention will now be described in more detail with reference to the accompanying drawings, which illustrate preferred embodiments of the invention. It should be understood that those skilled in the art can modify the invention described herein while still achieving its advantageous effects. Therefore, the following description should be understood as being of general knowledge to those skilled in the art and is not intended to limit the invention.
[0020] Please refer to Figure 1 This is a flowchart of a dynamic load balancing method for SIP signaling in a specific embodiment of the present invention.
[0021] The dynamic load balancing method for SIP signaling in this embodiment includes:
[0022] Step S101: The terminal establishes a data transmission connection with the SIP access server.
[0023] Step S102: Real-time acquisition of the message volume of signaling messages transmitted by the terminal to the SIP access server.
[0024] Step S103: Periodically count the number of messages and generate traffic statistics results.
[0025] Step S104: Modify the weight of the SIP access server according to the traffic statistics results and write the weight to the IP virtual server.
[0026] Step S105: The IP virtual server allocates the SIP access server according to the weight value.
[0027] Specifically, in step S101, the terminal establishes a data transmission connection with the SIP access server. The data transmission connection is a TCP long connection. Through the TCP long connection, the SIP access server can receive signaling messages sent by the terminal.
[0028] In step S102, the message volume of signaling messages received by the SIP access server is obtained in real time. Regardless of whether it is a long message or a short message, the counter will automatically increase the count value when the message receiving module in the SIP access server forwards it to the message processing module, thereby obtaining the total amount of signaling messages that the SIP access server needs to process within a certain period of time.
[0029] Different terminals send different amounts of signaling messages through TCP long connections. Allocating the weight of SIP access servers based on the number of terminals connected to them would obviously risk some SIP access servers crashing due to the excessive amount of signaling messages they process. Acquiring the amount of signaling messages would more accurately balance the signaling load of SIP access servers.
[0030] In step S103, the message volume is counted periodically, for example, the message volume received by the SIP access server is counted every ten minutes. The count time value can be set by the user or staff, and it can be 3 minutes, 5 minutes or 15 minutes, etc., and traffic statistics results are generated to determine the current load status of the SIP access server.
[0031] Furthermore, since traffic statistics are dynamically changing data, storing them in a dynamic cache makes data retrieval easier and does not consume excessive server resources.
[0032] In step S104, based on the traffic statistics, the current message processing volume of the SIP access server is determined, and the weight of the SIP access server within the IP virtual server is modified. The smaller the message processing volume of the SIP access server, the more signaling messages it can handle, and the higher its weight in the IP virtual server. The IP virtual server will then prioritize assigning servers with higher weights to receive and process new SIP signaling.
[0033] In step S105, the IP virtual server allocates SIP access servers according to weights. SIP access servers with low load will be allocated more terminals, while SIP access servers with high load will be allocated fewer terminals or no terminals. This is to balance the load of each SIP access server, prevent some SIP access servers from crashing due to overload, and improve the stability of SIP access servers and the performance of the server cluster device.
[0034] Furthermore, when the SIP access server is assigned to a new terminal by the IP virtual server, that is, when a new data transmission connection is established with the terminal, the counter is restored to its initial value, thereby accurately calculating the amount of signaling messages in a data transmission connection.
[0035] Furthermore, after the signaling message is transmitted to the SIP access server, the SIP access server will receive the signaling message and process it, including forwarding or replying to the registration request, call control request and SIP message initiated during terminal registration.
[0036] The dynamic load balancing method for SIP signaling of this invention obtains and counts the message volume of signaling messages transmitted between SIP access servers and terminals via TCP long connections, and modifies the weight of SIP access servers within an IP virtual server. This allows the IP virtual server to preferentially assign SIP access servers with lower signaling loads when allocating terminal connections to SIP access servers, preventing situations where some SIP access servers with high signaling loads are assigned to new terminals but cannot handle the signaling messages transmitted by the terminals. This balances the signaling load of SIP access servers, improves the stability of SIP access servers, enhances the performance of server cluster devices, and optimizes the user experience.
[0037] Please refer to Figure 2 This is a block diagram of a dynamic load balancing device for SIP signaling according to a specific embodiment of the present invention.
[0038] The present invention also provides a dynamic load balancing device for SIP signaling, comprising: a SIP access module 201 for receiving and forwarding signaling messages; a counter 202 located within the SIP access module for acquiring and periodically counting the number of messages forwarded by the SIP access module and generating traffic statistics results; and a dynamic load module 203 for modifying the weights of the SIP access servers within the IP virtual server according to the traffic statistics results.
[0039] The SIP access module 201 establishes a long TCP connection with the terminal, can receive signaling messages sent by the terminal, and forward the signaling messages to the message processing center of the SIP access server.
[0040] The counter 202 is located in the SIP access module 201. When the terminal sends SIP signaling to the SIP access module 201, the counter can obtain the amount of messages forwarded to the message processing center, thereby being able to count the traffic volume of the SIP access server over a period of time and determine the load status of the SIP access server.
[0041] The dynamic load module 203 is connected to the counter 202 and can obtain the traffic results statistically analyzed by the counter 202. Based on the traffic results, it can dynamically adjust the weight of the SIP access server to achieve dynamic balancing of the load status of the SIP access server, avoid overloading of the SIP access server, and improve the stability of the SIP access server.
[0042] Furthermore, the device for dynamic load balancing for SIP signaling also includes:
[0043] LVS load balancer 204 is connected to the dynamic load module 203 and the SIP access module 201. The dynamic load module 203 writes the weights of the SIP access server into the LVS load balancer 204. When a new terminal sends a data transmission connection request, the LVS load balancer 204 is responsible for allocating the SIP access server to process the terminal signaling message.
[0044] The dynamic caching module 205 is used to store the traffic statistics results. The traffic statistics results are dynamically changing data, and storing them in the dynamic caching module 205 facilitates data retrieval by the dynamic load module 203.
[0045] The present invention provides a dynamic load balancing device for SIP signaling. Through a SIP access module, a counter, and a dynamic load module, it can effectively balance the load traffic of SIP access servers and allocate load balancing resources to SIP access servers through LVS load balancing, thereby reducing the overload situation of SIP access servers, improving the stability of SIP access servers, enhancing the performance of server cluster devices, and optimizing user experience.
[0046] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A method for dynamic load balancing oriented towards SIP signaling, characterized in that, include: The terminal establishes a long TCP connection with the SIP access server, and the SIP access server receives signaling messages sent by the terminal through the long TCP connection; Inside the SIP access server, a counter located on the message forwarding path of the SIP access server is used to acquire and accumulate the message volume of the signaling message in real time during the process of the signaling message being forwarded from the message receiving module to the message processing module. Periodically count the number of messages and generate traffic statistics results; Based on the traffic statistics results, the current message processing volume of the SIP access server is determined. According to the negative correlation between the current message processing volume and the weight, the weight of the SIP access server is dynamically modified and written to the IP virtual server. The smaller the current message processing volume, the higher the weight. The IP virtual server allocates the SIP access server according to the weight, and prioritizes allocating new terminal connection requests to the SIP access server with a higher weight. When the SIP access server is assigned a new terminal and a new data transmission connection is established by the IP virtual server, the counter is restored to its initial value to calculate the signaling message volume in a data transmission connection.
2. The method for dynamic load balancing oriented towards SIP signaling according to claim 1, characterized in that, Also includes: Set a statistical time value, and periodically count the number of messages based on the statistical time value.
3. The method for dynamic load balancing oriented towards SIP signaling according to claim 1, characterized in that, The traffic statistics results are stored in a dynamic cache.
4. The method for dynamic load balancing oriented towards SIP signaling according to claim 1, characterized in that, Also includes: The SIP access server processes the signaling messages.
5. A device for dynamic load balancing for SIP signaling, characterized in that, include: The SIP access module is used to receive signaling messages sent by the terminal through a TCP long connection and forward the signaling messages to the message processing module. The counter, located on the message forwarding path of the SIP access module, is used to acquire and accumulate the message volume in real time during the process of the signaling message being forwarded from the message receiving module to the message processing module, and to periodically count the message volume to generate traffic statistics results; The dynamic load module is used to determine the current message processing volume of the SIP access server based on the traffic statistics results, and dynamically modify the weight of the SIP access server in the IP virtual server according to the negative correlation between the current message processing volume and the weight. The smaller the current message processing volume, the higher the weight. When the SIP access module is assigned a new terminal by the IP virtual server and a new data transmission connection is established, the counter is restored to its initial value to calculate the signaling message volume in a data transmission connection.
6. The apparatus for dynamic load balancing for SIP signaling according to claim 5, characterized in that, Also includes: LVS load balancing, connected to the dynamic load module and the SIP access module, is used to allocate the SIP access server according to the weight.
7. The apparatus for dynamic load balancing for SIP signaling according to claim 5, characterized in that, It also includes a dynamic caching module for storing the traffic statistics results.
Citation Information
Patent Citations
Short message center platform and calling method
CN102958085A
Dynamic load balancing method for unified communication system
CN104683253A
Load balancing method and device, equipment and computer storage medium
CN113810304A
Load balancing configuration method and device based on cluster, equipment and medium
CN115460212A