SIP registration current limiting method and device medium based on cloud distributed activity
By adjusting the current limiting parameters according to the activity of terminal devices in a distributed cloud environment, the service avalanche problem in the IOT cloud intercom platform is solved, and an efficient current limiting strategy is realized, ensuring the stability of the cloud platform and the service of terminal devices is carried out. Experience.
Patent Information
- Application Number
- CN202410177830.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-08
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-02-08
Smart Images

Figure CN117729189B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cloud intercom services, and in particular to a SIP registration current limiting method and device medium based on cloud distributed activity. Background Art
[0002] In large-scale, high-concurrency IOT (Internet of Things) cloud intercom platforms, it is common to encounter sudden large-volume SIP (Session Initialization Protocol) terminal devices sending SIP registration requests to the cloud SIP service cluster. For example, after a period of abnormality in the cloud database, a large number of terminal devices accumulate SIP periodic registration requests, or because the network environment where the terminal devices are located recovers from a fault, a large number of terminal devices are triggered to instantly initiate a large number of SIP registration requests. Similar scenarios will have a huge instantaneous impact on the cloud SIP service cluster. If not handled properly, it will cause service failure, which will lead to a chain reaction and eventually form a service avalanche effect.
[0003] In order to ensure that service avalanche does not occur when a large number of SIP terminal devices suddenly send registration requests to the cloud SIP service cluster in batches, causing the cloud SIP service cluster and the back-end business service processing capacity to be exceeded, it is necessary to introduce the current limiting strategy commonly used in the industry's distributed system. When the service is overloaded, the external client request flow will be limited, that is, part of the request flow will be discarded to ensure that the existing cluster service processing capacity exceeds the request flow, so as to reduce the impact on the system.
[0004] The current flow limiting strategies commonly used in the industry are mainly the token bucket algorithm and the leaky bucket algorithm. Both algorithms can only randomly discard request traffic from the client indiscriminately, and cannot meet the industry demand of the cloud intercom platform to maximize the service experience of highly active terminal devices.
[0005] The Chinese invention with publication number CN115733803A provides a data flow limiting method, device, electronic device and storage medium, which relates to the field of cloud computing technology. The method includes: in response to a multimedia communication-related request for an audio-visual service platform, obtaining type information and feature information of the request method in the multimedia communication-related request; determining a first flow limiting strategy corresponding to the multimedia communication-related request based on the type information and feature information; and processing the multimedia communication-related request accordingly based on the first flow limiting strategy. This invention patent cannot meet the industry demand of the cloud intercom platform to maximize the service experience of highly active terminal devices. Summary of the invention
[0006] In view of this, the purpose of the present invention is to propose a SIP registration flow limiting method based on cloud-based distributed activity, which is a SIP registration request flow limiting method based on the activity of terminal devices in a cloud-based distributed environment, which solves the need to differentiate the discarding of client request traffic and ensures that the SIP function of active terminal IOT devices is met to the maximum extent; ensures that the IOT cloud platform SIP service cluster is stable and reliable and realizes the process of differentiated completion of periodic registration of terminal devices with different activity levels.
[0007] In order to achieve the above technical objectives, the technical solution adopted by the present invention is:
[0008] The present invention provides a SIP registration current limiting method based on cloud distributed activity, comprising the following steps:
[0009] Step 1: Multiple terminal devices initiate SIP registration requests to each service node of the cloud SIP service cluster;
[0010] Step 2: When the cloud SIP service cluster is in an overloaded state, the current limiting model coordination server adjusts the current limiting parameters and sends them to the current limiting model coordinator clients of all service nodes in the cloud SIP service cluster;
[0011] Step 3: The SIP signaling processing modules of all service nodes in the cloud SIP service cluster call the current limiter module, and the current limiter module obtains the activity and current limiting parameters of the terminal device according to the activity streaming server and the current limiting model coordinator client, and determines the current limiting state of the terminal device;
[0012] Step 4, the current limiter module returns the current limiting status of the terminal device to the SIP signaling processing module;
[0013] Step 5: The SIP signaling processing module processes the registration service according to the current limiting state;
[0014] Step 6: Determine whether the cloud SIP service cluster has recovered from the overload state to the normal state. If so, end the process; otherwise, return to step 2.
[0015] Furthermore, the step 1 specifically includes:
[0016] Step 11, multiple terminal devices initiate SIP registration requests in real time according to the set registration cycle;
[0017] Step 12: All SIP registration requests are evenly distributed to each service node of the cloud SIP service cluster according to the load balancing strategy.
[0018] Furthermore, the step 2 specifically includes:
[0019] Step 21: Establish a persistent connection between the current limiting model coordinator client and the current limiting model coordination server of all service nodes in the cloud SIP service cluster;
[0020] Step 22: When the cloud SIP service cluster is in an overload state, the operation and maintenance personnel coordinate the server to adjust the current limiting parameters according to the overload state of the cloud SIP service cluster through the current limiting model;
[0021] Step 23: The current limiting model coordination server sends the adjusted current limiting parameters to the current limiting model coordinator clients of all service nodes in the cloud SIP service cluster.
[0022] Furthermore, the step 22 specifically includes:
[0023] Step 221: Arrange the activity information of all terminal devices in a certain set time period in the past in descending order to obtain an activity distribution map;
[0024] Step 222, determine that the percentage point is m%, 0<m≤100 and m is an integer; determine whether there is corresponding activity information at the m%th position in the activity distribution map, and if so, set the activity information corresponding to the m%th position in the activity distribution map as the initial current limiting parameter; otherwise, set the activity information adjacent to the m%th position in the activity distribution map and with a high value as the initial current limiting parameter;
[0025] Step 223: determine whether the cloud SIP service cluster is in an overload state according to the load condition of the cloud SIP service cluster. If so, it means that the initial current limiting parameter or the last current limiting parameter needs to be adjusted; otherwise, end the process;
[0026] Step 224: If the current current limiting parameter is the initial current limiting parameter, the current limiting model coordination server adjusts downward from m% with an accuracy of 1 percentage point, and obtains the current limiting parameter corresponding to the new percentage point as the adjusted current limiting parameter; if the current current limiting parameter is not the initial current limiting parameter, the current limiting model coordination server adjusts downward from the percentage point corresponding to the previous current limiting parameter with an accuracy of 1 percentage point, and obtains the current limiting parameter corresponding to the new percentage point as the adjusted current limiting parameter.
[0027] Furthermore, the step 3 specifically includes:
[0028] Step 31: The SIP signaling processing modules of all service nodes in the cloud SIP service cluster receive the SIP registration request and determine whether the SIP account and password provided in the SIP registration request are correct. If so, proceed to step 32; otherwise, end the process.
[0029] Step 32, the SIP signaling processing module calls the current limiter module, and determines whether there is activity information of the SIP account in the memory of the process through the current limiter module. If not, the activity information of the SIP account is obtained through the activity streaming server and cached in the memory, and then the process goes to step 33; if yes, the process goes directly to step 33;
[0030] Step 33: Obtain the current current limiting parameters through the current limiting model coordinator client;
[0031] Step 34: Compare the activity information of the SIP account with the current current limiting parameters to determine whether the activity information of the SIP account is lower than the current current limiting parameters. If so, it indicates that the SIP registration request of the terminal device hits the current limiting policy; if not, it indicates that the SIP registration request of the terminal device does not hit the current limiting policy.
[0032] Furthermore, in step 32, obtaining the activity information of the SIP account through the activity streaming server specifically includes:
[0033] Step 321, the activity streaming server is used to calculate the number of calls of each SIP account in a certain set time period in the past in real time, and the activity streaming server provides a corresponding HTTP interface for each SIP account;
[0034] Step 322: After the first registration is successful, the terminal device has a SIP call function. During the SIP call, the party that actively initiates the SIP call is the calling terminal device, and the party called by the calling terminal device is the called terminal device. When the cloud SIP service cluster provides services to the outside world, each time a SIP call occurs between the calling terminal device and the called terminal device, steps 323 and 324 will be executed once.
[0035] Step 323: The cloud SIP service cluster sends the SIP accounts of the calling terminal device and the called terminal device to the activity streaming server respectively through the SIP signaling processing module;
[0036] Step 324: The activity streaming server receives the SIP accounts of the calling terminal device and the called terminal device through the HTTP interface, and adds 1 to the activity information of the SIP accounts of the calling terminal device and the called terminal device;
[0037] Step 325: Obtain activity information of the SIP account through the corresponding HTTP interface of the activity streaming server according to different SIP accounts.
[0038] Furthermore, the step 5 specifically includes:
[0039] Step 51, the SIP signaling processing module obtains the current limiting status of the terminal device;
[0040] Step 52: If the current limiting state is that the current SIP registration request of the terminal device hits the current limiting policy, the SIP signaling processing module discards the current SIP registration request;
[0041] Step 53: If the current limiting state is that the current SIP registration request of the terminal device does not hit the current limiting policy, the SIP signaling processing module performs normal registration according to the current SIP registration request.
[0042] Furthermore, the step 6 is specifically as follows:
[0043] Monitor the current limiting status of the cloud SIP service cluster in real time, and determine whether the cloud SIP service cluster has recovered from the overload state to the normal state. If so, delete the activity information of the SIP account cached in the memory, and adjust the current current limiting parameters to the initial current limiting parameters, and end the process; otherwise, return to step 2.
[0044] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, a SIP registration current limiting method based on cloud distributed activity as described above is implemented.
[0045] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned SIP registration current limiting method based on cloud-distributed activity.
[0046] By adopting the above technical solution, the present invention has the following beneficial effects compared with the prior art:
[0047] The present invention can realize differentiated flow limiting on the IOT cloud intercom platform according to the SIP call activity of the historical terminal device, ensuring that in a short period of time, when the cloud SIP service cluster is overloaded and enters the flow limiting state, the terminal device with high historical activity can make periodic SIP registration requests and restore SIP related services as soon as possible. It can effectively support the purpose of differentiated flow limiting, solve the need to differentiate the client request traffic, and ensure the purpose of maximizing the satisfaction of the SIP function of the active terminal IOT device; ensure the stability and reliability of the IOT cloud platform SIP service cluster and realize the process of differentiated completion of periodic registration of terminal devices with different activity levels. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0049] Figure 1 It is a structural diagram of a terminal device, a cloud SIP service cluster, a current limiting model coordination server and an activity streaming server provided in an embodiment of the present invention.
[0050] Figure 2 It is an execution flow chart of a SIP registration current limiting method based on cloud distributed activity provided by an embodiment of the present invention.
[0051] Figure 3 is a schematic diagram of an electronic device provided by an embodiment of the present invention.
[0052] Figure 4 It is a schematic diagram of a computer-readable storage medium provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0053] The present invention will be further described in detail below in conjunction with the accompanying drawings and examples. It is particularly noted that the following examples are only used to illustrate the present invention, but are not intended to limit the scope of the present invention. Similarly, the following examples are only partial embodiments of the present invention rather than all embodiments, and all other embodiments obtained by those of ordinary skill in the art without creative work are within the scope of protection of the present invention.
[0054] See also Figure 1 and Figure 2 , a SIP registration current limiting method based on cloud distributed activity of the present invention is applied to a terminal device, a cloud SIP service cluster, a current limiting model coordination server and an activity streaming server, wherein the cloud SIP service cluster includes a plurality of service nodes, each of which includes a SIP signaling processing module, a current limiting model coordinator client and a current limiter module; Figure 1 In the formula, s represents the total number of service nodes, and p represents the number of terminal devices connected to each service node. When the total number of terminal devices can be evenly distributed by s service nodes, the number of p is the same. When the total number of terminal devices cannot be evenly distributed by s service nodes, some service nodes will have the same number of terminal devices connected to them, while the number of terminal devices connected to other service nodes will differ by 1.
[0055] The steps include:
[0056] Step 1: Multiple terminal devices initiate SIP registration requests to each service node of the cloud SIP service cluster;
[0057] In this embodiment, the step 1 specifically includes:
[0058] Step 11. Multiple terminal devices initiate SIP registration requests in real time according to the set registration period; the set registration period can be set to 1 hour, 2 hours, 3 hours, etc., and the specific time can be set according to user needs; if the registration period is set to 2 hours, it means that the terminal device sends a SIP registration request every 2 hours, and the activity status of the corresponding terminal device can be obtained according to the SIP registration request.
[0059] Step 12: All SIP registration requests are evenly distributed to each service node of the cloud SIP service cluster according to the load balancing strategy. The load balancing strategy can make the number of SIP registration requests received by each service node the same or similar, so that multiple service nodes can serve multiple SIP registration requests at the same time, thereby improving registration efficiency.
[0060] The cloud SIP service cluster has two states: normal state and overload state. If the cloud SIP service cluster is in a normal state, each service node performs normal registration processing on the received SIP registration request, and no flow control is required. The cloud SIP service cluster can normally process the traffic of all SIP registration requests; if the cloud SIP service cluster is in an overload state (when a large number of terminal devices send SIP registration requests to the cloud SIP service cluster, the cloud SIP service cluster cannot completely process these request traffic normally), it is necessary to differentially discard a part of the request traffic to ensure that the cloud SIP service cluster service will not crash due to the restart of a large flow of SIP registration requests in a short period of time. At this time, step 2 will be entered for flow control.
[0061] Step 2: When the cloud SIP service cluster is in an overloaded state, the current limiting model coordination server adjusts the current limiting parameters and sends them to the current limiting model coordinator clients of all service nodes in the cloud SIP service cluster; the current limiting parameters refer to the basis for setting multiple steps for current limiting according to the activity information. For example, the current limiting parameters are set to n1 times / week, n2 times / week...nk times / week, which respectively indicate that when the activity information is lower than n1 times / week, n2 times / week...nk times / week, the current limiting strategy is hit, and n1, n2...nk represent the current limiting thresholds corresponding to the multiple steps. The collection time unit (week) of the current limiting parameters should be the same as the collection time unit of the activity information.
[0062] In this embodiment, step 2 specifically includes:
[0063] Step 21: Establish a long connection between the current limiting model coordinator client and the current limiting model coordination server of all service nodes in the cloud SIP service cluster. The long connection is connected using the TCP protocol to ensure that the current limiting parameters adjusted by the current limiting model coordination server can be sent to the current limiting model coordinator client at any time;
[0064] Step 22: When the cloud SIP service cluster is in an overload state, the operation and maintenance personnel coordinate the server to adjust the current limiting parameters according to the overload state of the cloud SIP service cluster through the current limiting model;
[0065] In this embodiment, the step 22 specifically includes:
[0066] Step 221, according to the activity information of all terminal devices in a certain set time period in the past, the activity information is arranged in descending order to obtain an activity distribution graph. For example, there are 100 terminal devices, and their activities are 100, 99, ... 6, 5, 4, 3, 2, 1 from large to small, and the activity corresponding to the value at the 95th position of the activity distribution graph is 6; the certain set time period in the past can be set to the past week, and the activity information is set to N times / week, where N represents the number of SIP calls made by the terminal device in the past week;
[0067] Step 222: Determine the percentage point as m%, 0<m≤100 and m is an integer. The specific value can be set according to the load of the cloud SIP service cluster. Here, m=95 is taken. Determine whether there is corresponding activity information at the m% position in the activity distribution map. If so, set the activity information corresponding to the m% (95%) position in the activity distribution map as the initial current limiting parameter; otherwise, set the activity information adjacent to the m% (95%) position in the activity distribution map and with a high value as the initial current limiting parameter (for example, there are 110 terminal devices, and their activities from large to small are 110, 109, 108, 107, 106, 105, 104, 103, 102, 101, 100, 99, ... 7, 6, 5, 4, 3, 2, 1, there is no value at the 95% position of the activity distribution graph, and the adjacent corresponding activities are 6 and 7. At this time, 7 is selected as the initial current limiting parameter); the initial current limiting parameter is automatically calculated based on the value of the 95% position of the activity distribution graph of all terminal devices within the time window (for example, one week), that is, at this time, the SIP registration requests of the terminal devices whose activity information is ranked in the last 5% position corresponding to the value will be discarded. The SIP registration requests sent by all terminal devices are selectively and differentially discarded. The SIP registration requests with low activity are discarded. The lower the activity, the lower the demand for SIP calls by the terminal device. Therefore, discarding SIP registration requests with low activity has a relatively small impact on the entire system.
[0068] Step 223: determine whether the cloud SIP service cluster is in an overload state according to the load condition of the cloud SIP service cluster. If so, it means that the initial current limiting parameter or the last current limiting parameter cannot guarantee that the cloud SIP service cluster can avoid overload or recover from the overload state, which proves that the current limiting parameter is too conservative. It is necessary to adjust the initial current limiting parameter or the last current limiting parameter to make it more aggressive; otherwise, end the process;
[0069] Step 224: If the current limiting parameter is the initial limiting parameter, the limiting model coordination server adjusts downward from m% with an accuracy of 1 percentage point to obtain the current limiting parameter corresponding to the new percentage point as the adjusted current limiting parameter (for example, the percentage point 95% corresponding to the initial current limiting parameter is adjusted to 94%, and the activity information corresponding to the 94th position is set as the adjusted current limiting parameter. If there is no corresponding activity information at the 94th position, the activity information adjacent to the 94th position and with a high value is set as the adjusted current limiting parameter, and the adjusted current limiting parameter is sent to all service nodes of the cloud SIP service cluster. Each service node can obtain the adjusted current limiting parameter and enter the next step); if the current If the current limiting parameter is not the initial current limiting parameter, the current limiting model coordination server adjusts downward from the percentage point corresponding to the previous current limiting parameter with an accuracy of 1 percentage point, and obtains the current limiting parameter corresponding to the new percentage point as the adjusted current limiting parameter (for example, the percentage point 94% corresponding to the previous current limiting parameter is adjusted to 93%, and the activity information corresponding to the 93% position is set as the adjusted current limiting parameter. If there is no corresponding activity information at the 93% position, the activity information adjacent to the 93% position and with a high value is set as the adjusted current limiting parameter, and the adjusted current limiting parameter is sent to all service nodes of the cloud SIP service cluster. Each service node can obtain the adjusted current limiting parameter and enter the next step). By analogy, the current limiting parameters are continuously adjusted with an accuracy of 1 percentage point, such as 95%, 94%, 93%, 92%, 91%, 90%, etc. Each time the current limiting parameters are adjusted, the subsequent steps are entered for processing to determine whether the cloud SIP service cluster has recovered from the overload state to the normal state, until the current limiting parameters corresponding to the final recovery to the normal state are obtained.
[0070] Step 23: The current limiting model coordination server sends the adjusted current limiting parameters to the current limiting model coordinator clients of all service nodes in the cloud SIP service cluster, so that each service node can obtain the latest current limiting parameters.
[0071] Step 3: The SIP signaling processing modules of all service nodes in the cloud SIP service cluster call the current limiter module, and the current limiter module obtains the activity and current limiting parameters of the terminal device according to the activity streaming server and the current limiting model coordinator client, and determines the current limiting state of the terminal device;
[0072] In this embodiment, step 3 specifically includes:
[0073] Step 31, the SIP signaling processing modules of all service nodes in the cloud SIP service cluster receive the SIP registration request, and determine whether the SIP account and password provided in the SIP registration request are correct. If so, proceed to step 32; otherwise, end the process; analyze the correctness of the SIP registration request through the SIP account and password, and proceed to the next step for the correct SIP registration request, and do not process the incorrect one, so as to avoid the time of processing the incorrect SIP registration request, save time and improve efficiency;
[0074] Step 32, the SIP signaling processing module calls the current limiter module, and the current limiter module determines whether there is activity information of the SIP account in the memory of the process. If not, the activity information of the SIP account is obtained through the activity streaming server and cached in the memory, and then goes to step 33; if so, directly go to step 33; in the entire current limiting process, the activity information of the SIP account is obtained through the activity streaming server for the first time and stored in the memory. When it is needed next time, it only needs to obtain the corresponding activity information from the memory, so that when implementing a current limiting process, it only needs to operate once to obtain the activity information of the SIP account from the activity streaming server, thereby improving the current limiting efficiency.
[0075] In this embodiment, the step 32 of obtaining the activity information of the SIP account through the activity streaming server specifically includes:
[0076] Step 321, the activity streaming server is used to calculate the number of calls of each SIP account in a certain set time period in the past (in the past week) in real time, and the activity streaming server provides a corresponding HTTP interface for each SIP account;
[0077] Step 322: After the first registration is successful, the terminal device has a SIP call function. During the SIP call, the party that actively initiates the SIP call is the calling terminal device, and the party called by the calling terminal device is the called terminal device. When the cloud SIP service cluster provides services to the outside world, each time a SIP call occurs between the calling terminal device and the called terminal device, steps 323 and 324 will be executed once.
[0078] Step 323: The cloud SIP service cluster sends the SIP accounts of the calling terminal device and the called terminal device to the activity streaming server respectively through the SIP signaling processing module;
[0079] Step 324: The activity streaming server receives the SIP accounts of the calling terminal device and the called terminal device through the HTTP interface, and adds 1 to the activity information of the SIP accounts of the calling terminal device and the called terminal device;
[0080] Step 325: Obtain activity information of the SIP account through the corresponding HTTP interface of the activity streaming server according to different SIP accounts.
[0081] Step 33: Obtain the current current limiting parameters through the current limiting model coordinator client;
[0082] Step 34: Compare the activity information of the SIP account with the current current limiting parameters to determine whether the activity information of the SIP account is lower than the current current limiting parameters. If so, it indicates that the SIP registration request of the terminal device hits the current limiting policy; if not, it indicates that the SIP registration request of the terminal device does not hit the current limiting policy.
[0083] Step 4, the current limiter module returns the current limiting status of the terminal device to the SIP signaling processing module;
[0084] Step 5: The SIP signaling processing module processes the registration service according to the current limiting state;
[0085] In this embodiment, step 5 specifically includes:
[0086] Step 51, the SIP signaling processing module obtains the current limiting status of the terminal device;
[0087] Step 52: If the current limiting state is that the current SIP registration request of the terminal device hits the current limiting policy, the SIP signaling processing module discards the current SIP registration request;
[0088] Step 53: If the current limiting state is that the current SIP registration request of the terminal device does not hit the current limiting strategy, the SIP signaling processing module performs normal registration according to the current SIP registration request. After the above current limiting operation, the cloud SIP service cluster will discard a part of the SIP registration request traffic. At the same time, as the abnormal situation is handled, the processing capacity of the cloud SIP service cluster and the actual SIP registration request traffic entering the real SIP registration service will become smaller, balanced, and finally surpassed. At this time, the processing capacity of the cloud SIP service cluster is greater than the actual SIP registration request traffic, and the performance pressure of the cloud SIP service cluster will gradually decrease.
[0089] Step 6: Determine whether the cloud SIP service cluster has recovered from the overload state to the normal state. If so, end the process; otherwise, return to step 2.
[0090] In this embodiment, step 6 is specifically as follows:
[0091] Monitor the current limiting state of the cloud SIP service cluster in real time to determine whether the cloud SIP service cluster has recovered from the overload state to the normal state. If so, it means that after the large batch of SIP registration request traffic in a short period of time is slowly digested, the cloud SIP service cluster will recover from the current limiting state to the normal state of fully processing SIP registration requests; at this time, delete the activity information of the SIP account cached in the memory, adjust the current current limiting parameters to the initial current limiting parameters, and end the process; otherwise, it means that the current limiting force is not enough and a higher adjustment sensitivity is required, and return to step 2.
[0092] like Figure 3 As shown, an embodiment of the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the above-mentioned SIP registration current limiting method based on cloud distributed activity is implemented.
[0093] like Figure 4 As shown, an embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the above-mentioned SIP registration current limiting method based on cloud distributed activity is implemented.
[0094] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0095] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0096] The above descriptions are only some embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any equivalent device or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A SIP registration current limiting method based on cloud distributed activity, characterized in that: The method is applied to a terminal device, a cloud SIP service cluster, a current limiting model coordination server and an activity streaming server. The cloud SIP service cluster includes a plurality of service nodes, each of which includes a SIP signaling processing module, a current limiting model coordinator client and a current limiter module; and includes the following steps: Step 1: Multiple terminal devices initiate SIP registration requests to each service node of the cloud SIP service cluster; Step 2: When the cloud SIP service cluster is in an overloaded state, the current limiting model coordination server adjusts the current limiting parameters and sends them to the current limiting model coordinator clients of all service nodes in the cloud SIP service cluster; specifically including: Step 21: Establish a persistent connection between the current limiting model coordinator client and the current limiting model coordination server of all service nodes in the cloud SIP service cluster; Step 22: When the cloud SIP service cluster is in an overload state, the operation and maintenance personnel coordinate the server to adjust the current limiting parameters according to the overload state of the cloud SIP service cluster through the current limiting model; specifically including: Step 221: Arrange the activity information of all terminal devices in a certain set time period in the past in descending order to obtain an activity distribution map; Step 222, determine that the percentage point is m%, 0<m≤100 and m is an integer; determine whether there is corresponding activity information at the m% position in the activity distribution map, and if so, set the activity information corresponding to the m% position in the activity distribution map as the initial current limiting parameter; otherwise, set the activity information adjacent to the m% position in the activity distribution map and with a high value as the initial current limiting parameter; Step 223: determine whether the cloud SIP service cluster is in an overload state according to the load condition of the cloud SIP service cluster. If so, it means that the initial current limiting parameter or the last current limiting parameter needs to be adjusted; otherwise, end the process; Step 224: If the current limiting parameter is the initial current limiting parameter, the current limiting model coordination server adjusts downward from m% with an accuracy of 1 percentage point, and obtains the current limiting parameter corresponding to the new percentage point as the adjusted current limiting parameter; if the current limiting parameter is not the initial current limiting parameter, the current limiting model coordination server adjusts downward from the percentage point corresponding to the previous current limiting parameter with an accuracy of 1 percentage point, and obtains the current limiting parameter corresponding to the new percentage point as the adjusted current limiting parameter; Step 23: The current limiting model coordination server sends the adjusted current limiting parameters to the current limiting model coordinator clients of all service nodes in the cloud SIP service cluster; Step 3: The SIP signaling processing modules of all service nodes in the cloud SIP service cluster call the current limiter module, and the current limiter module obtains the activity and current limiting parameters of the terminal device according to the activity streaming server and the current limiting model coordinator client, and determines the current limiting state of the terminal device; specifically including: Step 31: The SIP signaling processing modules of all service nodes in the cloud SIP service cluster receive the SIP registration request and determine whether the SIP account and password provided in the SIP registration request are correct. If so, proceed to step 32; otherwise, end the process. Step 32, the SIP signaling processing module calls the current limiter module, and determines whether there is activity information of the SIP account in the memory of the process through the current limiter module. If not, the activity information of the SIP account is obtained through the activity streaming server and cached in the memory, and then the process goes to step 33; if yes, the process goes directly to step 33; The step 32 of obtaining the activity information of the SIP account through the activity streaming server specifically includes: Step 321, the activity streaming server is used to calculate the number of calls of each SIP account in a certain set time period in the past in real time, and the activity streaming server provides a corresponding HTTP interface for each SIP account; Step 322: After the first registration is successful, the terminal device has a SIP call function. During the SIP call, the party that actively initiates the SIP call is the calling terminal device, and the party called by the calling terminal device is the called terminal device. When the cloud SIP service cluster provides services to the outside world, each time a SIP call occurs between the calling terminal device and the called terminal device, steps 323 and 324 will be executed once. Step 323: The cloud SIP service cluster sends the SIP accounts of the calling terminal device and the called terminal device to the activity streaming server respectively through the SIP signaling processing module; Step 324: The activity streaming server receives the SIP accounts of the calling terminal device and the called terminal device through the HTTP interface, and adds 1 to the activity information of the SIP accounts of the calling terminal device and the called terminal device; Step 325: Obtain activity information of the SIP account through the corresponding HTTP interface of the activity streaming server according to different SIP accounts; Step 33: Obtain the current current limiting parameters through the current limiting model coordinator client; Step 34: Compare the activity information of the SIP account with the current flow limiting parameters to determine whether the activity information of the SIP account is lower than the current flow limiting parameters. If so, it indicates that the current SIP registration request of the terminal device hits the flow limiting policy; if not, it indicates that the current SIP registration request of the terminal device does not hit the flow limiting policy; Step 4, the current limiter module returns the current limiting status of the terminal device to the SIP signaling processing module; Step 5: The SIP signaling processing module processes the registration service according to the current limiting state; Step 6: Determine whether the cloud SIP service cluster has recovered from the overload state to the normal state. If so, end the process; otherwise, return to step 2.
2. The SIP registration current limiting method based on cloud distributed activity as claimed in claim 1 is characterized in that: The step 1 specifically includes: Step 11, multiple terminal devices initiate SIP registration requests in real time according to the set registration cycle; Step 12: All SIP registration requests are evenly distributed to each service node of the cloud SIP service cluster according to the load balancing strategy.
3. The SIP registration current limiting method based on cloud distributed activity as claimed in claim 1, characterized in that: The step 5 specifically includes: Step 51, the SIP signaling processing module obtains the current limiting status of the terminal device; Step 52: If the current limiting state is that the current SIP registration request of the terminal device hits the current limiting policy, the SIP signaling processing module discards the current SIP registration request; Step 53: If the current limiting state is that the current SIP registration request of the terminal device does not hit the current limiting policy, the SIP signaling processing module performs normal registration according to the current SIP registration request.
4. The SIP registration current limiting method based on cloud distributed activity as claimed in claim 1, characterized in that: The step 6 is specifically as follows: Monitor the current limiting state of the cloud SIP service cluster in real time, determine whether the cloud SIP service cluster recovers from the overload state to the normal state, and if so, delete the activity information of the SIP account cached in the memory, adjust the current current limiting parameters to the initial current limiting parameters, and end the process; Otherwise, return to step 2.
5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the SIP registration current limiting method based on cloud distributed activity is implemented as described in any one of claims 1 to 4.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, a SIP registration current limiting method based on cloud distributed activity is implemented as described in any one of claims 1 to 4.
