Communication method and system, device, and readable medium
By adopting 1+1(HA)+N networking method and load balancing algorithm in the SIP access system, the problem that the existing SIP access server software cannot provide stable and reliable services is solved, and the system can respond quickly and have high reliability in the event of failure.
Patent Information
- Application Number
- PCT/CN2024/134510
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-12-13
- Filing Date
- 2024-11-26
- Publication Date
- 2025-06-19
AI Technical Summary
The existing SIP access server software cannot provide stable and reliable SIP access services, especially when the SIP server or intermediary server fails, it is difficult for the system to maintain normal operation.
The networking method of 1+1(HA)+N is adopted, and two intermediary servers are the main backup of each other, and multiple SIP servers are used to process SIP signaling to achieve load balancing and failover, ensuring that the system can still work normally when some SIP servers or intermediary servers fail.
It realizes rapid response and system stability when SIP server or intermediary server fails, avoids the problem of users being unable to join the club or failing multiple times due to single point of failure, and improves the reliability and load carrying capacity of SIP access services.
Smart Images

Figure CN2024134510_19062025_PF_FP_ABST
Abstract
Description
Communication method, system, device and readable medium
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to Chinese patent application CN 202311710599.3, entitled “Communication Method, System, Device and Readable Medium,” filed on December 13, 2023, the entire contents of which are incorporated herein by reference. Technical Field
[0003] The present disclosure relates to the field of communication technologies, and in particular to a communication method, system, device, and readable medium. Background Art
[0004] Session Initiation Protocol (SIP) access technology refers to the technology that terminal devices use to establish, modify, and terminate multimedia sessions by adopting the SIP protocol. SIP is an application layer signaling control protocol. The sessions it represents can be Internet multimedia conferences, Internet Protocol (IP) telephones, and multimedia distribution. Compared with the H323 protocol, H248 (MGCP) protocol, etc., the advantages of using the SIP protocol access include: (1) scalability and can be easily embedded in various embedded terminal devices; (2) interoperability can be ensured, and different devices can be used for communication; (3) it has strong flexibility and can be integrated with other software systems to build a unified and complete communication solution. It can be applied to various multimedia access scenarios, including but not limited to video conferencing and video surveillance.
[0005] Given the huge advantages of SIP access, a large number of corresponding SIP server software have emerged, but currently these solutions (software products) cannot provide stable and reliable SIP access services. Summary of the Invention
[0006] Embodiments of the present disclosure provide a communication method, system, device, and readable medium.
[0007] An embodiment of the present disclosure provides a communication method, applied to a first intermediary server, the method comprising: receiving a first SIP message from a target terminal, parsing the first SIP message to determine a target SIP server, and forwarding the first SIP message to the target SIP server; receiving a second SIP message from the target SIP server, parsing the second SIP message to determine the target terminal, and forwarding the second SIP message to the target terminal.
[0008] An embodiment of the present disclosure also provides a communication method, applied to a SIP server, the method comprising: receiving a first SIP message from a target terminal forwarded by a first intermediary server; sending a second SIP message for the target terminal to the first intermediary server, so that the second SIP message is forwarded to the target terminal by the first intermediary server.
[0009] An embodiment of the present disclosure further provides a communication system, comprising: a target terminal, configured to send a first SIP message to a first intermediary server; a target SIP server, configured to send a second SIP message to the first intermediary server; the first intermediary server, configured to receive the first SIP message from the target terminal, parse the first SIP message to determine the target SIP server, forward the first SIP message to the target SIP server, receive the second SIP message from the target SIP server, parse the second SIP message to determine the target terminal, and forward the second SIP message to the target terminal; and a second intermediary server, configured to serve as a backup server for the first intermediary server.
[0010] An embodiment of the present disclosure also provides an electronic device, comprising: at least one processor; and a memory storing at least one program, wherein when the at least one program is executed by the at least one processor, the at least one processor implements the communication method according to the embodiment of the present disclosure.
[0011] The embodiment of the present disclosure further provides a computer-readable medium having a computer program stored thereon, and when the program is executed by a processor, the communication method according to the embodiment of the present disclosure is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] FIG1 is a schematic diagram of the architecture of a communication system according to an embodiment of the present disclosure;
[0013] FIG2 is a flow chart of a communication method performed by a first intermediary server according to an embodiment of the present disclosure;
[0014] FIG3 is a schematic diagram of a normal process of SIP communication according to an embodiment of the present disclosure;
[0015] FIG4 is a schematic diagram of a process flow when a SIP server fails according to an embodiment of the present disclosure;
[0016] FIG5 is a schematic diagram of a process flow when an intermediary server fails according to an embodiment of the present disclosure;
[0017] FIG6 is a flow chart of a communication method performed by a SIP server according to an embodiment of the present disclosure;
[0018] FIG7 is a schematic structural diagram of a communication device applied to a first intermediary server according to an embodiment of the present disclosure;
[0019] FIG8 is a schematic structural diagram of a communication device applied to a SIP server according to an embodiment of the present disclosure;
[0020] FIG9 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0021] The following describes the specific embodiments of the present disclosure in detail with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only used to illustrate and explain the present disclosure and are not intended to limit the present disclosure.
[0022] As used in this disclosure, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0023] The terms used in the present disclosure are only used to describe specific embodiments and are not intended to limit the present disclosure.As used in the present disclosure, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
[0024] When the terms “comprising” and / or “made of…” are used in the present disclosure, it specifies the existence of the stated features, integers, steps, operations, elements and / or components, but does not preclude the existence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0025] Unless otherwise defined, all terms (including technical and scientific terms) used in this disclosure have the same meanings as those commonly understood by those skilled in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this disclosure, and will not be interpreted as having an idealized or overly formal meaning unless expressly defined in this disclosure.
[0026] The application scenarios of the communication system and communication method provided by the embodiments of the present disclosure include but are not limited to SIP terminal access scenarios for video conferencing, video surveillance, and call centers, and support various SIP types of terminals to access via audio or video.
[0027] The communication system provided by the embodiments of the present disclosure can be applied to SIP communication services. Figure 1 shows a schematic diagram of the architecture of the communication system for SIP communication provided by the embodiments of the present disclosure. The system includes: a target terminal 10, configured to send a first SIP message to a first intermediary server 12; a target SIP server 11, configured to send a second SIP message to the first intermediary server 12; the first intermediary server 12, configured to receive the first SIP message from the target terminal 10, parse the first SIP message to determine the target SIP server 11, forward the first SIP message to the target SIP server 11, receive a second SIP message from the target SIP server 11, parse the second SIP message to determine the target terminal 10, and forward the second SIP message to the target terminal 10; and a second intermediary server 13, configured to serve as a backup server for the first intermediary server 12.
[0028] The first intermediary server 12 and the second intermediary server 13 form a dual-machine hot standby mechanism. Dual-machine hot standby is a solution applied to servers. Under normal circumstances, the host is in working state and the slave is in monitoring state. Once the slave detects that the host is abnormal, the slave will replace the host in a short time and fully realize the functions of the host.
[0029] The first intermediary server 12 mainly performs (but is not limited to) the following processing:
[0030] (1) As a SIP message entry, it transparently transmits SIP messages, and other network elements responsible for processing SIP messages are unaware of the first intermediary server 12;
[0031] (2) It has a lightweight SIP protocol stack and can distribute and load balance SIP messages based on the load balancing algorithm;
[0032] (3) Stateless distinction, with two modes: active-standby and stand-alone. In active-standby mode, the forwarding of SIP messages will not be affected after the active-standby switch occurs. In stand-alone mode, the forwarding of SIP messages will not be affected after the restart.
[0033] The target SIP server 11 is any one of the SIP server sets on the network side connected to the first mediation server 12 .
[0034] The target SIP server mainly performs (but is not limited to) the following processing:
[0035] (1) As a SIP message server, it has a complete SIP protocol stack and can parse SIP request messages;
[0036] (2) It can process registration messages such as registration, deregistration, registration keep-alive, registration authentication and registration preemption initiated by the terminal;
[0037] (3) It can handle call messages such as calls initiated by terminals, number regularization, special service number calls, routing addressing, etc.
[0038] This disclosed embodiment utilizes a 1+1 (HA)+N networking approach, with two intermediary servers acting as master and backup for each other. N (N is an integer greater than 1) SIP servers process SIP signaling, supporting user access via the SIP protocol and providing stable and reliable video conferencing access. Even if some SIP servers or a single SIP intermediary server fails, the SIP access system continues to operate normally, enabling stable real-time communication between different terminal devices, including voice, video, and messaging, and capable of call control and management.
[0039] The disclosed embodiments provide a communication method applicable to the first intermediary server 11 in the above system architecture. A virtual IP address is preconfigured in the first intermediary server 11. This virtual IP address is set in the target terminal 10 and the target SIP server 11, respectively, to route SIP messages to the first intermediary server 11 corresponding to the virtual IP address. A virtual IP (VIP) address is not the IP address of a specific computer or its network interface card (NIC). All packets sent to the VIP address must pass through a real network interface.
[0040] FIG2 is a flow chart showing a communication method executed by the first intermediary server, which includes the following steps 201 to 202 .
[0041] In step 201, a first SIP message is received from a target terminal, the first SIP message is parsed to determine a target SIP server, and the first SIP message is forwarded to the target SIP server.
[0042] In some embodiments, parsing the first SIP message to determine the target SIP server includes: parsing the first SIP message to determine the type of the first SIP message, and allocating the target SIP server to the target terminal according to the type of the first SIP message.
[0043] In some embodiments, allocating a target SIP server to a target terminal based on the type of a first SIP message includes: allocating a target SIP server to the target terminal if the first SIP message is a registration message and is a new SIP registration request message; parsing and obtaining content of a first target field of the first SIP message and determining a target SIP server based on the content of the first target field if the first SIP message is a registration message and is not a new SIP registration request message; allocating a target SIP server to the target terminal if the first SIP message is a SIP call message initiated by the target terminal and is a new SIP call access request message; obtaining content of a second target field of the first SIP message and determining a target SIP server based on the content of the second target field if the first SIP message is a SIP call message initiated by the target terminal and is not a new SIP call access request message; and obtaining content of a second target field of the first SIP message and determining a target SIP server based on the content of the second target field if the first SIP message is a call message for calling the target terminal.
[0044] It should be noted that, corresponding to each stage of the SIP communication process, the method of parsing the first SIP message to determine the target SIP server is also different. The processing process of each stage is described below.
[0045] The SIP communication process may include: a registration phase, a SIP upcall phase initiated by the terminal to the server, and a SIP downcall phase initiated by the server to the terminal.
[0046] The SIP message in the registration phase is called a registration message, the SIP message in the SIP upcall phase is called a SIP call message initiated by the terminal, and the SIP message in the SIP downcall phase is called a call message for the calling terminal.
[0047] Registration stage
[0048] In some embodiments, parsing the first SIP message to determine the target SIP server includes: when parsing the first SIP message and determining that the first SIP message is a registration message and is a new SIP registration request message, allocating the target SIP server to the target terminal.
[0049] In some embodiments, allocating a target SIP server to a target terminal includes: parsing and obtaining a unique identifier of the target terminal included in the first SIP message, and selecting a target SIP server from a set of SIP servers based on the unique identifier of the target terminal using a load balancing algorithm.
[0050] In an exemplary embodiment, after receiving the first SIP message from the target terminal 10, the first intermediary server 11 parses the first SIP message and determines that it is an initial registration request, that is, a registration-type message and a new SIP registration request message. The first intermediary server 11 uses the calling number in the first SIP message as the unique identifier of the target terminal and the calling number as an input parameter of the load balancing algorithm. The first intermediary server 11 obtains the address of the target SIP server output by the load balancing algorithm and sends the first SIP message to the target SIP server according to the address of the target SIP server.
[0051] According to the load balancing algorithm, the points on the hash ring are evenly divided by the SIP servers in normal operation, so that the results of load balancing of different SIP messages can be evenly directed to each SIP server in normal operation.
[0052] Due to the characteristics of the load balancing algorithm, the output obtained for the same input parameter is always the same. This means that by using the unique identifier of the target terminal (for example, the caller ID) as the input parameter of the load balancing algorithm, the target SIP server selected is always the same SIP server. While ensuring load balancing, it also ensures that registration-type SIP messages from the same terminal can be assigned to the same SIP server for processing, thereby ensuring the consistency of the SIP session.
[0053] It should be noted that the unique identifier of the target terminal may also be other parameters besides the calling number. As long as the parameter can uniquely identify the target terminal, it can be used as an input parameter of the load balancing algorithm.
[0054] In some embodiments, parsing the first SIP message to determine the target SIP server includes: if the first SIP message is parsed and it is determined that the first SIP message is a registration message and is not a new SIP registration request message, obtaining content of a first target field of the first SIP message, and determining the target SIP server based on the content of the first target field.
[0055] In an exemplary embodiment, the first target field is a Nonce field of an Authorization header field of the first SIP message.
[0056] In an exemplary embodiment, referring to the schematic diagram of a normal SIP communication process shown in FIG3 , when a target terminal registers with a server, a first intermediary server receives a new initial registration request (REGISTER) message from the target terminal on the user side and distributes the message to a target SIP server on the network side based on the calling number in the message. The target SIP server embeds the target terminal's address information into the private field XNEXTHOP. The target SIP server also includes a WWW-Authenticate header field in its response and embeds the SIP server's address information into the Nonce field of the header field.
[0057] When the terminal sends a subsequent REGISTER message, the first intermediary server directly distributes the message to the corresponding target SIP server for processing according to the Nonce field of the Authorization header field in the terminal registration message.
[0058] SIP call up stage
[0059] In some embodiments, parsing the first SIP message to determine the target SIP server includes: when parsing the first SIP message and determining that the first SIP message is a SIP call message initiated by the target terminal and is a new SIP call access request message, allocating the target SIP server to the target terminal.
[0060] In some embodiments, allocating a target SIP server to a target terminal includes: parsing and obtaining a unique identifier of the target terminal included in the first SIP message, and selecting a target SIP server from a set of SIP servers based on the unique identifier of the target terminal using a load balancing algorithm.
[0061] In an exemplary embodiment, after receiving the first SIP message from the target terminal 10, the first intermediary server 11 parses the first SIP message and determines that it is a new SIP call access request message, that is, a SIP call message and a new SIP call access request message. The first intermediary server 11 uses the caller number in the first SIP message as the unique identifier of the target terminal and the caller number as an input parameter of the load balancing algorithm to obtain the address of the target SIP server output by the load balancing algorithm, and sends the first SIP message to the target SIP server according to the address of the target SIP server.
[0062] According to the load balancing algorithm, the points on the hash ring are evenly divided by the SIP servers in normal operation, so that the results of load balancing of different SIP messages can be evenly directed to each SIP server in normal operation.
[0063] Due to the characteristics of the load balancing algorithm, the output obtained for the same input parameters is always the same. Therefore, by using the unique identifier of the target terminal (for example, the caller ID) as the input parameter of the load balancing algorithm, the target SIP server selected is always the same SIP server. While ensuring load balancing, it can also ensure that call access request SIP messages from the same terminal can be assigned to the same SIP server for processing, thereby ensuring the consistency of the SIP session.
[0064] It should be noted that the unique identifier of the target terminal may also be other parameters besides the calling number. As long as the parameter can uniquely identify the target terminal, it can be used as an input parameter of the load balancing algorithm.
[0065] In some embodiments, parsing the first SIP message to determine the target SIP server includes: when parsing the first SIP message and determining that the first SIP message is a SIP call message initiated by a target terminal and is not a new SIP call access request message, obtaining content of a second target field of the first SIP message, and determining the target SIP server based on the content of the second target field.
[0066] In an exemplary embodiment, the second target field is the Local tag field of the To header field of the first SIP message. The Local tag is a random string generated by the SIP server and may include the nonce of the Register authentication message, the From tag of the requester message, and the To tag of the responder message.
[0067] In an exemplary embodiment, referring to the schematic diagram of a normal SIP communication process shown in Figure 3, when a target terminal initiates a SIP call to a server, the first intermediary server receives a new INVITE message from the target terminal on the user side and, based on the calling number in the message, distributes it to the target SIP server on the network side. The target SIP server embeds its own address information in the To tag as a Local tag in the response. When the target terminal makes subsequent requests or responses within the same session, the first intermediary server retrieves the Local tag fields from the To and From headers, respectively, and distributes the response or request message to the corresponding target SIP server for processing.
[0068] SIP call-out stage
[0069] In some embodiments, parsing the first SIP message to determine the target SIP server includes: when parsing the first SIP message and determining that the first SIP message is a call-type message for calling a target terminal, obtaining content of a second target field of the first SIP message, and determining the target SIP server based on the content of the second target field.
[0070] In an exemplary embodiment, the second target field is a local tag field in a From header field of the first SIP message.
[0071] In an exemplary embodiment, referring to the schematic diagram of a normal SIP communication process shown in FIG3 , when a server initiates a call to a target terminal, the SIP server embeds the target terminal's address information in the private field XNEXTHOP and simultaneously embeds its own address information in the Local tag field of the From header field. Based on the address information in XNEXTHOP, the first intermediary server dispatches the message to the corresponding target terminal. When the target terminal subsequently responds or requests within the same session, the first intermediary server retrieves the address of the target SIP server from the Local tag fields obtained in the From and To header fields, respectively, and dispatches the response or request message to the corresponding target SIP server for processing.
[0072] In some embodiments, for the load balancing algorithm used during the registration and SIP call-up phases, each SIP server in the SIP server set used in the load balancing algorithm must be in normal operation to ensure that SIP messages assigned to the SIP server can be properly processed. Based on this, the method further includes: upon detecting a failure of any SIP server used to establish a communication connection, removing that SIP server from the SIP server set; and upon detecting that the failure of any failed SIP server has been resolved, adding that SIP server to the SIP server set.
[0073] In step 202, a second SIP message is received from a target SIP server, the second SIP message is parsed to determine a target terminal, and the second SIP message is forwarded to the target terminal.
[0074] In some embodiments, when the second SIP message is parsed and it is determined that the second SIP message belongs to a specified type of message, the content of the third target field of the second SIP message is obtained, and the target terminal is determined based on the content of the third target field.
[0075] The designated type message includes one of the following: a registration message; a call message initiated by a target terminal; or a call message for calling a target terminal.
[0076] It should be noted that, corresponding to each stage of the SIP communication process, the method of parsing the second SIP message to determine the target terminal is different. The processing process of each stage is described below.
[0077] Registration stage
[0078] In some embodiments, parsing the second SIP message to determine the target terminal includes: parsing the second SIP message and determining that the second SIP message is a registration message, obtaining content of a third target field of the second SIP message, and determining the target terminal based on the content of the third target field.
[0079] In an exemplary embodiment, the third target field is an XNEXTHOP field in a private field of the header field.
[0080] In an exemplary embodiment, referring to the schematic diagram of a normal SIP communication process shown in FIG3 , the target SIP server embeds the address information of the target terminal into the private field XNEXTHOP. At the same time, the target SIP server carries a WWW-Authenticate header field in the response and embeds the address information of the SIP server into the Nonce field of the header field.
[0081] SIP call up stage
[0082] In some embodiments, parsing the second SIP message to determine the target terminal includes: parsing the second SIP message and determining that the second SIP message is a call-type message initiated by the target terminal, obtaining content of a third target field of the second SIP message, and determining the target terminal based on the content of the third target field.
[0083] In an exemplary embodiment, the third target field is an XNEXTHOP field in a private field of the header field.
[0084] SIP call-out stage
[0085] In some embodiments, parsing the second SIP message to determine the target terminal includes: parsing the second SIP message and determining that the second SIP message is a call-type message for calling the target terminal, obtaining content of a third target field of the second SIP message, and determining the target terminal based on the content of the third target field.
[0086] In an exemplary embodiment, the third target field is an XNEXTHOP field in a private field of the header field.
[0087] The process of the target SIP server sending the second SIP message in each stage of the SIP communication process can be referred to the normal flow diagram of SIP communication shown in FIG3 , which will not be described in detail here.
[0088] In some embodiments, the communication method according to the embodiments of the present disclosure further includes: in the event that a target SIP server fails, re-determining a new target SIP server, and sending a third SIP message of the newly acquired SIP session of the target terminal to the new target SIP server; querying the cached historical information of the SIP session of the target terminal through the new target SIP server, and returning a response to the third SIP message based on the historical information.
[0089] In an exemplary embodiment, when some SIP servers fail, the failed SIP servers no longer send keepalive messages to the first intermediary server. After the first intermediary server recognizes the failure of the corresponding SIP server node, it adjusts the load balancing algorithm. Subsequently, SIP messages will no longer be sent to the failed SIP server and will instead be distributed to other SIP servers in normal status for processing.
[0090] In some embodiments, the communication method according to the embodiment of the present disclosure further includes: when the target SIP server is restored, sending a newly acquired fourth SIP message of the SIP session of the target terminal to the target SIP server; querying the cached historical information of the SIP session of the target terminal through the target SIP server, and returning a response to the fourth SIP message based on the historical information.
[0091] In an exemplary embodiment, as shown in FIG4 , which illustrates the processing flow for a SIP server failure, when the SIP server associated with the Local tag fails, the first intermediary server forwards the SIP message to another SIP server using a load balancing algorithm. Because the SIP message carries the Local tag, it appears to the newly assigned SIP server as a new, unfamiliar in-session request. Therefore, the newly assigned SIP server generates a corresponding response message based on session history information retrieved from the Redis cache database.
[0092] When the failed SIP server recovers, it can restore the previous session information from the Redis cache database, and the SIP server will continue to send keepalive messages to the first intermediary server. The first intermediary server recognizes that the corresponding SIP server node has returned to normal operation, adjusts the load balancing algorithm, and continues to distribute messages to the restored SIP server. After receiving the message, the SIP server continues to process it according to the normal process steps.
[0093] In some embodiments, the communication method according to the embodiment of the present disclosure also includes: in the event that a failure occurs in the first intermediary server, triggering the master-slave switching mechanism, and passing the virtual network address of the first intermediary server to the second intermediary server through the master-slave switching mechanism, so as to switch the second intermediary server to the master server and the first intermediary server to the backup server; in the event that the first intermediary server recovers, triggering the master-slave switching mechanism, and obtaining the virtual network address of the second intermediary server through the master-slave switching mechanism for configuration, so as to switch the first intermediary server to the master server and the second intermediary server to the backup server.
[0094] In an exemplary embodiment, Figure 5 illustrates the process flow for handling a mediator server failure. When the first mediator server fails, the hot standby component automatically triggers a master-slave switchover mechanism. The hot standby component assigns the virtual IP address to the backup second mediator server, making the second server the master and the failed first server the backup. Once the failed first mediator server is repaired, it remains in standby mode, awaiting a second switchover. SIP message delivery remains unaffected.
[0095] The embodiment of the present disclosure also provides a communication method, which is applied to a SIP server.
[0096] FIG6 is a flow chart showing a communication method executed by a SIP server, which includes the following steps 601 to 602 .
[0097] In step 601, a first SIP message forwarded by a first mediation server from a target terminal is received.
[0098] In some embodiments, the SIP server sends a keep-alive message to the first intermediary server to maintain a communication connection with the first intermediary server.
[0099] In step 602, a second SIP message targeting the target terminal is sent to the first intermediary server, so that the second SIP message is forwarded to the target terminal through the first intermediary server.
[0100] In some embodiments, before sending the second SIP message for the target terminal to the first intermediary server, the communication method according to an embodiment of the present disclosure further includes at least one of the following steps: writing the address of the SIP server in the first destination field of the second SIP message; writing the address of the SIP server in the second destination field of the second SIP message; and writing the address of the target terminal in the third destination field of the second SIP message.
[0101] In some embodiments, the communication method according to the embodiment of the present disclosure further includes: querying and obtaining historical information of the SIP session of the target terminal from a cache database; and responding to the first SIP message according to the historical information.
[0102] In the embodiment of the present disclosure, a first intermediary server is provided, and a first SIP message from a target terminal is received through the first intermediary server, the first SIP message is parsed to determine a target SIP server, and the first SIP message is forwarded to the target SIP server. Furthermore, a second SIP message is received from the target SIP server, the second SIP message is parsed to determine a target terminal, and the second SIP message is forwarded to the target terminal. This enables the first intermediary server to allocate a corresponding SIP server to the terminal, provides a basis for load balancing of multiple connected SIP servers, and provides a possibility for improving the stability and reliability of SIP access services.
[0103] In the related art, some SIP access solutions use NGINX proxy servers to distribute SIP messages. This requires an additional status recording mechanism to record the status of SIP messages in order to ensure the consistency of SIP transactions. The NGINX proxy server needs to cooperate with the status recording mechanism to distribute SIP messages, so there is still a single point risk and it is not truly highly reliable. When the NGINX server fails, after restarting NGINX, SIP messages that are not in the initial request state cannot be forwarded to the correct SIP server, that is, the consistency of SIP transactions cannot be guaranteed. Single-point SIP access solutions or solutions that rely on NGINX require manual recovery once their single-point SIP server or NGINX fails. Not only can they no longer provide users with complete video conferencing access services, but they also require a large amount of system construction and human operation and maintenance resources, and lack disaster recovery capabilities. Single-point SIP access solutions lack load balancing capabilities and cannot ensure smooth system operation under high call volume. When the system is overloaded, it may not be able to respond to terminal requests in a timely manner. The NGNIX proxy server uses a Layer 4 proxy mode, that is, based on the TCP / UDP protocol. However, NGINIX does not know the specific content of the request and cannot implement stateless forwarding. It needs to cooperate with the state caching mechanism, which makes it impossible to implement a highly reliable mechanism such as active-standby switching.
[0104] According to the embodiment of the present disclosure, the first intermediary server and the second intermediary server are stateless forwarding, which does not need to rely on a state recording mechanism to record the state of the SIP session, can achieve stateless load balancing, and forward directly by parsing the SIP message.
[0105] According to the embodiments of the present disclosure, for the access of SIP type terminals in video conferencing, relying on the development of 5G communication technology and the high bandwidth of network transmission, a more stable and reliable video conferencing access experience is provided for users of SIP access, which can improve the robustness and service carrying capacity of the video conferencing system and improve the SIP access performance. According to the embodiments of the present disclosure, a rapid response is achieved when a SIP server fails, avoiding the situation where a user cannot join the meeting or can only join the meeting after multiple failed attempts due to a single point of failure. At the same time, according to the embodiments of the present disclosure, through the load balancing of SIP messages, the situation of slow or no response to the terminal caused by overloading of a single-point SIP server during high concurrency can be effectively alleviated.
[0106] According to the embodiments of the present disclosure, a hot standby deployment method that does not rely on a cache can be implemented to achieve high reliability. Moreover, by simply ensuring that the intermediary server that distributes SIP messages adopts a stateless design, a legal load balancing algorithm and hot standby method can be selected according to different business scenarios and security requirements to achieve highly reliable SIP access.
[0107] Those skilled in the art should realize that the step division of the above various methods is only for clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this disclosure; adding insignificant modifications to the algorithm or process or introducing insignificant designs without changing the core design of the algorithm and process are all within the scope of protection of this disclosure.
[0108] The present disclosure also provides a communication device. The specific implementation of this device can be found in the description of the first intermediary server in the communication method according to the present disclosure, and will not be repeated here. FIG7 shows a schematic diagram of the structure of the communication device applied to the first intermediary server according to the present disclosure. The communication device according to the present disclosure includes a first processing module 701 and a second processing module 702.
[0109] The first processing module 701 is configured to receive a first SIP message from a target terminal, parse the first SIP message to determine a target SIP server, and forward the first SIP message to the target SIP server.
[0110] The second processing module 702 is configured to receive a second SIP message from a target SIP server, parse the second SIP message to determine a target terminal, and forward the second SIP message to the target terminal.
[0111] The present disclosure also provides a communication device. The specific implementation of this device can be found in the description of the SIP server in the communication method according to the present disclosure, and will not be repeated here. Figure 8 shows a schematic diagram of the structure of a communication device applied to a SIP server according to an embodiment of the present disclosure. The communication device according to the present disclosure includes a receiving module 801 and a sending module 802.
[0112] The receiving module 801 is configured to receive a first SIP message from a target terminal that is forwarded by a first intermediary server.
[0113] The sending module 802 is configured to send a second SIP message targeting the target terminal to the first intermediary server, so that the second SIP message is forwarded to the target terminal through the first intermediary server.
[0114] The functions or modules included in the communication device provided in the embodiments of the present disclosure can be used to execute the communication method according to the embodiments of the present disclosure. Its specific implementation and technical effects can be referred to the description of the above method embodiments. For the sake of brevity, they will not be repeated here.
[0115] It should be noted that all modules involved in this embodiment are logical modules. In actual applications, a logical unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. In addition, to highlight the innovations of this disclosure, this embodiment does not include units that are not closely related to solving the technical problems proposed by this disclosure. However, this does not mean that other units do not exist in this embodiment.
[0116] 9 , an embodiment of the present disclosure further provides an electronic device, comprising: at least one processor 901 ; a memory 902 on which at least one program is stored, and when the at least one program is executed by the at least one processor 901 , the at least one processor 901 implements the communication method according to each embodiment of the present disclosure.
[0117] As shown in FIG. 9 , the electronic device according to an embodiment of the present disclosure may further include at least one I / O interface 903 connected between the processor 901 and the memory 902 and configured to implement information interaction between the processor 901 and the memory 902 .
[0118] The processor 901 is a device with data processing capabilities, including but not limited to a central processing unit (CPU); the memory 902 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH); the I / O interface (read-write interface) 903 is connected between the processor 901 and the memory 902, and can realize information exchange between the processor 901 and the memory 902, including but not limited to a data bus (Bus), etc.
[0119] In some embodiments, the processor 901 , the memory 902 , and the I / O interface 903 are connected to each other via a bus, and further connected to other components of the computing device.
[0120] This embodiment also provides a computer-readable medium on which a computer program is stored. When the program is executed by a processor, the communication method according to each embodiment of the present disclosure is implemented. To avoid repeated description, the specific steps of the method are not repeated here.
[0121] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods applied for above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As is well known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable, and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media typically embodies computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0122] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0123] Those skilled in the art will understand that although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features from different embodiments is meant to be within the scope of the present embodiment and to form different embodiments.
[0124] It is understood that the above embodiments are merely exemplary embodiments for illustrating the principles of the present disclosure, and the present disclosure is not limited thereto. Those skilled in the art may make various modifications and improvements without departing from the spirit and substance of the present disclosure, and such modifications and improvements are also considered to be within the scope of protection of the present disclosure.
Claims
1. A communication method, applied to a first intermediary server, the method comprising: Receiving a first initial session protocol (SIP) message from a target terminal, parsing the first SIP message to determine a target SIP server, and forwarding the first SIP message to the target SIP server; A second SIP message is received from the target SIP server, the second SIP message is parsed to determine the target terminal, and the second SIP message is forwarded to the target terminal.
2. The method according to claim 1, wherein: Parsing the first SIP message to determine a target SIP server includes: The first SIP message is parsed to determine the type of the first SIP message, and the target SIP server is allocated to the target terminal according to the type of the first SIP message.
3. The method according to claim 2, wherein: Allocating the target SIP server to the target terminal according to the type of the first SIP message includes: In a case where the type of the first SIP message is a registration message and is a new SIP registration request message, allocating the target SIP server to the target terminal; When the type of the first SIP message is a registration message and is not a new SIP registration request message, obtaining content of a first target field of the first SIP message, and determining the target SIP server based on the content of the first target field; When the type of the first SIP message is a SIP call class message initiated by the target terminal and is a new SIP call access request message, allocating the target SIP server to the target terminal; When the type of the first SIP message is a SIP call message initiated by the target terminal and is not a new SIP call access request message, obtaining content of a second target field of the first SIP message, and determining the target SIP server based on the content of the second target field; In the case that the type of the first SIP message is a call type message for calling the target terminal, the content of the second target field of the first SIP message is obtained, and the target SIP server is determined based on the content of the second target field.
4. The method according to claim 1, wherein: Parsing the second SIP message to determine the target terminal includes: When parsing the second SIP message and determining that the second SIP message belongs to a specified type of message, obtaining content of a third target field of the second SIP message, and determining the target terminal based on the content of the third target field, The specified type of message includes one of the following: Registration messages; A call message initiated by the target terminal; A calling message for calling the target terminal.
5. The method according to claim 3, wherein: Allocating the target SIP server to the target terminal includes: The unique identifier of the target terminal included in the first SIP message is parsed and obtained, and the target SIP server is selected from a set of SIP servers based on the unique identifier of the target terminal through a load balancing algorithm.
6. The method according to claim 5, further comprising: When any SIP server for establishing a communication connection is detected to be faulty, the faulty SIP server is removed from the set of SIP servers; When it is detected that the fault of any faulty SIP server is rectified, the SIP server is added to the SIP server set.
7. The method according to claim 1, further comprising: In the case that the target SIP server fails, re-determine a new target SIP server, and send the third SIP message of the newly acquired SIP session of the target terminal to the new target SIP server; The cached history information of the SIP session of the target terminal is queried through the new target SIP server, and a response to the third SIP message is returned according to the history information.
8. The method according to claim 7, further comprising: When the target SIP server is restored, sending the newly acquired fourth SIP message of the SIP session of the target terminal to the target SIP server; The target SIP server queries the cached history information of the SIP session of the target terminal, and returns a response to the fourth SIP message according to the history information.
9. The method according to claim 1, further comprising: In the event of a failure of the first intermediary server, triggering a primary-backup switching mechanism, passing the virtual network address of the first intermediary server to the second intermediary server through the primary-backup switching mechanism, so as to switch the second intermediary server to the primary server and the first intermediary server to the backup server; When the first intermediary server is restored, the active-standby switching mechanism is triggered, and the virtual network address of the second intermediary server is obtained through the active-standby switching mechanism for configuration, so as to switch the first intermediary server to the active server and the second intermediary server to the standby server.
10. A communication method, applied to a SIP server, the method comprising: Receiving a first SIP message from a target terminal forwarded by a first intermediary server; A second SIP message for the target terminal is sent to the first intermediary server, so that the second SIP message is forwarded to the target terminal through the first intermediary server.
11. The method according to claim 10, wherein: Before sending the second SIP message for the target terminal to the first intermediary server, the method further includes at least one of the following steps: Writing the address of the SIP server into the first target field of the second SIP message; Writing the address of the SIP server into the second target field of the second SIP message; The address of the target terminal is written into the third target field of the second SIP message.
12. The method according to claim 10, further comprising: Query and obtain historical information of the SIP session of the target terminal from a cache database; The first SIP message is responded to according to the historical information.
13. A communication system comprising: The target terminal is used to send a first SIP message to the first intermediary server; The target SIP server is used to send a second SIP message to the first intermediary server; The first intermediary server is used to: receiving the first SIP message from the target terminal, parsing the first SIP message to determine the target SIP server, and forwarding the first SIP message to the target SIP server; as well as receiving the second SIP message from the target SIP server, parsing the second SIP message to determine the target terminal, and forwarding the second SIP message to the target terminal; The second intermediary server is used to serve as a backup server for the first intermediary server.
14. An electronic device, comprising: at least one processor; A memory having at least one program stored thereon, wherein when the at least one program is executed by the at least one processor, the at least one processor implements the communication method according to any one of claims 1 to 12.
15. A computer-readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the communication method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Optimized Signaling Protocol, Including Session Initiation Protocol (SIP), in a Communications Environment
US20090013078A1
Message distribution server, sip server, and message distribution method
US20130151586A1
Policy-based forwarding to a load balancer of a load balancing cluster
US20220030060A1