Communication method, system, device and readable medium

By introducing a first intermediary server into the SIP access system, analyzing and forwarding SIP messages, the problem of load imbalance in the existing SIP access service is solved, and a more stable and reliable SIP access service is achieved.

CN120151330APending Publication Date: 2025-06-13ZTE CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311710599.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-13
Publication Date
2025-06-13

AI Technical Summary

Technical Problem

The existing SIP access server software cannot provide stable and reliable SIP access services, resulting in unbalanced load when connecting multiple SIP servers, affecting service stability and reliability.

Method used

By setting up a first intermediary server, the first SIP message from the target terminal is received, the first SIP message from the target terminal is parsed and forwarded to the target SIP server, and the second SIP message from the target SIP server is received and forwarded, thereby realizing stateless load balancing of the terminal and the SIP server.

Benefits of technology

It realizes load balancing of multiple SIP servers, provides a more stable and reliable foundation for SIP access services, does not need to record the status of SIP sessions, and supports fast response and high reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120151330A_ABST
    Figure CN120151330A_ABST
Patent Text Reader

Abstract

The invention provides a communication method, system and device and a readable medium, and belongs to the technical field of communication. The method applied to a first intermediary server comprises the following steps: receiving a first initial session protocol (SIP) message from a target terminal, analyzing the first SIP message to determine a target SIP server, and forwarding the first SIP message to the target SIP server; and receiving a second SIP message from the target SIP server, analyzing the second SIP message to determine the target terminal, and forwarding the second SIP message to the target terminal. The method is used for improving the stability and reliability of SIP access service, and provides a basis for realizing stateless load balancing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of communication technologies, and in particular, to a communication method, system, device, and readable medium. Background Art

[0002] The Session Initiation Protocol (SIP) access technology refers to the technology by which a terminal device establishes, modifies, and terminates a multimedia session by adopting the SIP protocol. SIP is an application layer signaling control protocol, and the sessions it represents can be Internet multimedia conferences, Internet Protocol (IP) telephones, multimedia distribution, etc. Compared with protocols such as the H323 protocol and the H248 (MGCP) protocol, the advantages of adopting the SIP protocol for access include:

[0003] (1) It has scalability and can be easily embedded in various embedded terminal devices;

[0004] (2) It ensures interoperability and can communicate using different devices;

[0005] (3) It has strong flexibility. When integrated with other software systems, it can build a unified and complete communication solution and can be applied to various multimedia access scenarios, including but not limited to video conferencing, video surveillance, etc.

[0006] In view of the great advantages of SIP access, a large number of corresponding SIP server software has emerged. However, at present, these solutions (software products) cannot provide stable and reliable SIP access services. Summary of the Invention

[0007] Embodiments of the present disclosure provide a communication method, system, device, and readable medium.

[0008] In a first aspect of an embodiment of the present disclosure, a communication method is provided, which is applied to a first mediation server. The method includes:

[0009] Receiving a first Session Initiation 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;

[0010] 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.

[0011] In a second aspect of an embodiment of the present disclosure, a communication method is provided, which is applied to an SIP server. The method includes:

[0012] Receive a first SIP message from a target terminal forwarded by a first intermediary server;

[0013] Send a second SIP message for the target terminal to the first intermediary server for forwarding to the target terminal through the first intermediary server.

[0014] A third aspect of the embodiments of the present disclosure provides a communication system, including:

[0015] A target terminal, configured to send a first Session Initiation Protocol (SIP) message to a first intermediary server;

[0016] A target SIP server, configured to send a second SIP message to the first intermediary server;

[0017] A 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; and 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;

[0018] A second intermediary server, configured to act as a backup server for the first intermediary server.

[0019] A fourth aspect of the embodiments of the present disclosure provides an electronic device, including:

[0020] At least one processor;

[0021] A memory, storing at least one program thereon, and when the at least one program is executed by the at least one processor, enabling the at least one processor to implement the method according to the first aspect;

[0022] At least one I / O interface, connected between the processor and the memory, and configured to implement information interaction between the processor and the memory.

[0023] A fifth aspect of the embodiments of the present disclosure provides a computer-readable medium, storing a computer program thereon, and when the program is executed by a processor, implementing the method according to the first aspect.

[0024] The embodiments of the present disclosure have the following advantages:

[0025] By setting up a first mediation server, receiving a first SIP message from a target terminal through the first mediation server, parsing the first SIP message to determine the target SIP server, forwarding the first SIP message to the target SIP server, and 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, it is possible to allocate a corresponding SIP server for the terminal through the first mediation server, thereby providing a basis for the load balancing of multiple connected SIP servers, providing the possibility of improving the stability and reliability of the SIP access service, and not needing to record the state of the SIP session, providing a basis for realizing stateless load balancing. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 It is a schematic diagram of the architecture of a communication system provided in an embodiment of the present disclosure;

[0027] Figure 2 It is a schematic diagram of the communication method flow executed by a first mediation server provided in an embodiment of the present disclosure;

[0028] Figure 3 It is a schematic diagram of the normal process of SIP communication provided in an embodiment of the present disclosure;

[0029] Figure 4 It is a schematic diagram of the processing flow when a SIP server fails provided in an embodiment of the present disclosure;

[0030] Figure 5 It is a schematic diagram of the processing flow when a mediation server fails provided in an embodiment of the present disclosure;

[0031] Figure 6 It is a schematic diagram of the method flow for a SIP server to communicate provided in an embodiment of the present disclosure;

[0032] Figure 7 It is a schematic diagram of the structure of a communication device applied to a first mediation server provided in an embodiment of the present disclosure;

[0033] Figure 8 It is a schematic diagram of the structure of a communication device applied to a SIP server provided in an embodiment of the present disclosure;

[0034] Figure 9 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0035] 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 for the purpose of illustrating and explaining the present disclosure, and are not intended to limit the present disclosure.

[0036] As used in the present disclosure, the term "and / or" includes any and all combinations of one or more of the associated listed items.

[0037] The terms used in the present disclosure are only for describing specific embodiments and are not intended to limit the present disclosure. As used in the present disclosure, the singular forms "a" and "the" are also intended to include the plural forms unless the context clearly indicates otherwise.

[0038] When the terms "comprising" and / or "made of" are used in the present disclosure, it is specified that the described features, wholes, steps, operations, elements and / or components exist, but do not exclude the existence or addition of one or more other features, wholes, steps, operations, elements, components and / or their groups.

[0039] Unless otherwise defined, the meanings of all terms (including technical and scientific terms) used in the present disclosure are the same as those commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in common dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning unless the present disclosure clearly defines so.

[0040] The application scenarios of the communication system and communication method provided by the embodiments of the present disclosure include, but are not limited to, video conferencing, video surveillance, and SIP terminal access scenarios in call centers, and support various SIP types of terminals to access through audio or video.

[0041] The embodiments of the present disclosure provide a communication system, which can be applied to SIP communication services. Figure 1 The following shows a schematic diagram of the architecture of the communication system for SIP communication provided by the embodiments of the present disclosure, which mainly includes:

[0042] The target terminal 10 is used to send a first Session Initiation Protocol (SIP) message to the first mediation server;

[0043] The target SIP server 11 is used to send a second SIP message to the first mediation server;

[0044] The first mediation server 12 is used to receive the first SIP message from the target terminal, parse the first SIP message to determine the target SIP server, and forward the first SIP message to the target SIP server; and 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.

[0045] The second mediation server 13 is used as a standby server for the first mediation server.

[0046] Among them, the first mediation server 12 and the second mediation server 13 form a hot standby mechanism. Hot standby is a solution applied to servers. Under normal circumstances, the primary server is in the working state and the standby server is in the monitoring state. Once the standby server detects that the primary server is abnormal, the standby server will replace the primary server within a very short time and fully implement the functions of the primary server.

[0047] Among them, the first mediation server 12 mainly completes the following processing including but not limited to:

[0048] (1) As the SIP message entry, it transparently transmits the SIP message, and other network elements responsible for processing the SIP message are unaware of the first mediation server 12.

[0049] (2) It has a lightweight SIP protocol stack and can complete the distribution and load balancing of SIP messages according to the load balancing algorithm.

[0050] (3) It has no state distinction and has two modes: primary-standby and single machine. In the primary-standby mode, the forwarding of SIP messages is not affected after the primary-standby switch occurs. In the single machine mode, the forwarding of SIP messages is not affected after restart.

[0051] Among them, the target SIP server is any one server in the set of SIP servers on the network side docked by the first mediation server.

[0052] The target SIP server mainly completes the following processing including but not limited to:

[0053] (1) As a SIP message server, it has a complete SIP protocol stack and can parse SIP request messages.

[0054] (2) It can process registration messages such as registration, deregistration, registration keep-alive, registration authentication, and registration preemption initiated by the terminal.

[0055] (3) It can process call messages such as calls, number regularization, special service number calls, and routing addressing initiated by the terminal.

[0056] The embodiments of the present disclosure adopt a networking mode of 1+1(HA)+N, where two mediation servers are in a primary-backup relationship with each other, followed by N (N is an integer greater than 1) SIP servers to process SIP signaling. It supports users to access through the SIP protocol and provides a stable and reliable video conferencing access service for users. When some SIP servers fail or a certain SIP mediation server fails, the SIP access system can still continue to work normally, and can establish stable real-time communication between different terminal devices, including voice, video, messages, etc., and can be used for call control and call management.

[0057] The embodiments of the present disclosure also provide a communication method, which is applied to the first mediation server 11 described in the above system architecture. A virtual IP address is pre-configured in the first mediation server 11, and the virtual IP address is configured in the target terminal and the target SIP server respectively, so as to send the SIP message to the first mediation server corresponding to the virtual IP address for transit. Among them, the virtual IP address, also known as Virtual IP, VIP, is an IP address that is not connected to a specific computer or a network interface card (NIC) in the computer. All data packets sent to this VIP address still pass through the real network interface.

[0058] Figure 2 The following is a schematic flowchart of the communication method executed by the first mediation server, which mainly includes the following steps:

[0059] Step 201, receive a first Session Initiation Protocol (SIP) message from the target terminal, parse the first SIP message to determine the target SIP server, and forward the first SIP message to the target SIP server.

[0060] In some embodiments, the parsing the first SIP message to determine the target SIP server includes:

[0061] Parse the first SIP message to determine the type of the first SIP message, and allocate the target SIP server for the target terminal according to the type of the first SIP message.

[0062] In some embodiments, the allocating the target SIP server for the target terminal according to the type of the first SIP message includes:

[0063] When the type of the first SIP message is a registration message and it is a new SIP registration request message, re-allocate the target SIP server for the target terminal;

[0064] When the type of the first SIP message is a registration message and not a new SIP registration request message, parse the content of the first target field of the first SIP message, and determine the target server based on the content of the first target field;

[0065] When the type of the first SIP message is a SIP call message initiated by the target terminal and is a new SIP call access request message, re-allocate the target SIP server for the target terminal;

[0066] 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, obtain the content of the second target field of the first SIP message, and determine the target SIP server based on the content of the second target field;

[0067] When the type of the first SIP message is a call message for calling the target terminal, obtain the content of the second target field of the first SIP message, and determine the target SIP server based on the content of the second target field.

[0068] It should be noted that for each stage in the SIP communication process, the method of parsing the first SIP message to determine the target SIP server is also different. The processing processes for each stage are described below respectively.

[0069] Among them, each stage in the SIP communication process includes: a registration stage, a SIP upcall stage initiated by the terminal to the server, and a SIP downcall stage initiated by the server to the terminal.

[0070] Among them, the SIP message in the registration stage is called a registration message, the SIP message in the SIP upcall stage is called a SIP call message initiated by the terminal, and the SIP message in the SIP downcall stage is called a call message for calling the terminal.

[0071] First, the registration stage

[0072] In some embodiments, the parsing the first SIP message to determine the target server includes:

[0073] When parsing the first SIP message to determine that the first SIP message belongs to a registration message and is a new SIP registration request message, re-allocate the target SIP server for the target terminal.

[0074] In some embodiments, the allocating the target SIP server for the target terminal includes:

[0075] Parse to obtain the unique identifier of the target terminal included in the first SIP message, and select the target SIP server from the set of SIP servers based on the unique identifier of the target terminal through a load balancing algorithm.

[0076] In an exemplary embodiment, after the first mediation server receives the first SIP message from the target terminal, it parses the first SIP message and determines that it is an initial registration request, that is, it belongs to the registration class of messages and is a new SIP registration request message. It uses the calling number in the first SIP message as the unique identifier of the target terminal, takes the calling number as the input parameter of the load balancing algorithm, 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 this address.

[0077] According to the load balancing algorithm, the points on the Hash ring are evenly distributed among the SIP servers in the normal operating state, so that the results after load balancing of different SIP messages will evenly point to each SIP server in the normal operating state.

[0078] According to the characteristics of the load balancing algorithm, the output corresponding to the same input parameter is always the same. This makes it possible to use the same unique identifier (such as the calling number) of the target terminal as the input parameter of the load balancing algorithm, and the selected target SIP server is the same SIP server. While ensuring load balancing, it can also ensure that the registration class SIP messages of the same terminal will be assigned to the same SIP server for processing, ensuring the consistency of the SIP session.

[0079] It should be noted that the unique identifier of the target terminal can also be other parameters other than the calling number, as long as it can uniquely identify the target terminal, it can be used as the input parameter of the load balancing algorithm.

[0080] In some embodiments, the parsing the first SIP message to determine the target server includes:

[0081] When parsing the first SIP message to determine that the first SIP message belongs to the registration class of messages and is not a new SIP registration request message, parse to obtain the content of the first target field of the first SIP message, and determine the target server based on the content of the first target field.

[0082] In an exemplary embodiment, the first target field is the Nonce field of the Authorization header field of the first SIP message.

[0083] In an exemplary embodiment, see Figure 3Schematic diagram of the normal process of SIP communication. When the target terminal registers with the server, the first intermediary server receives a new initial registration request (REGISTER) message sent by the target terminal on the user side and distributes it to the target SIP server on the network side according to the calling number in the message; the target SIP server embeds the address information of the target terminal in the private field XNEXTHOP. At the same time, the target SIP server carries the WWW-Authenticate header field in the response and embeds the address information of the SIP server in the Nonce field of this header field.

[0084] When the terminal sends subsequent REGISTER messages, the first intermediary server directly distributes the message to the corresponding target SIP server for processing according to the Nonce field in the Authorization header field of the terminal registration class message.

[0085] Second, the SIP upward call phase

[0086] In some embodiments, parsing the first SIP message to determine the target SIP server includes:

[0087] When it is parsed that the first SIP message belongs to a SIP call class message initiated by the target terminal and is a new SIP call access request message, reassign the target SIP server for the target terminal.

[0088] In some embodiments, assigning the target SIP server for the target terminal includes:

[0089] Parse to obtain the unique identifier of the target terminal included in the first SIP message, and select the target SIP server from the set of SIP servers based on the unique identifier of the target terminal through a load balancing algorithm.

[0090] In an exemplary embodiment, after the first intermediary server receives the first SIP message from the target terminal, it parses the first SIP message and determines that it is a new SIP call access request message, that is, it belongs to a SIP call class message and is a new SIP call access request message. It uses the calling number in the first SIP message as the unique identifier of the target terminal, takes this calling number as the input parameter of the load balancing algorithm, 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 this address.

[0091] According to the load balancing algorithm, the points on the hash ring are evenly divided by the SIP servers in the normal operating state, so that the results after load balancing of different SIP messages will evenly point to each SIP server in the normal operating state.

[0092] According to the characteristics of the load balancing algorithm, the output corresponding to the same input parameter is always the same. This enables the use of the same unique identifier (such as the calling number) of the target terminal as the input parameter of the load balancing algorithm, and the selected target SIP server is the same SIP server. While ensuring load balancing, it can also ensure that the registration class SIP messages of the same terminal are assigned to the same SIP server for processing, guaranteeing the consistency of the SIP session.

[0093] It should be noted that the unique identifier of the target terminal can also be other parameters other than the calling number, as long as it can uniquely identify the target terminal, it can be used as the input parameter of the load balancing algorithm.

[0094] In some embodiments, parsing the first SIP message to determine the target SIP server includes:

[0095] When it is parsed that the first SIP message belongs to the SIP call class message initiated by the target terminal and is not a new SIP call access request message, obtain the content of the second target field of the first SIP message, and determine the target SIP server based on the content of the second target field.

[0096] In an exemplary embodiment, the second target field is the Local tag field of the To header field of the first SIP message. Local tag is a random substring generated by the SIP server, which may include the nonce of the Register authentication message, the From tag of the requestor message, and the To tag of the responder message.

[0097] In an exemplary embodiment, referring to Figure 3 the schematic diagram of the normal process of SIP communication shown, when the target terminal initiates a SIP call to the server, the first intermediary server receives a new INVITE message sent by the target terminal on the user side, and distributes it to the target SIP server on the network side according to the calling number. The target SIP server embeds its own address information into the To tag and carries it in the response as the Local tag. When the target terminal makes subsequent requests or responses in the same session, the first intermediary server obtains the Local tag field from the To header field and the From header field respectively, and distributes the response or request message to the corresponding target SIP server for processing.

[0098] Third, the SIP downlink phase

[0099] In some embodiments, parsing the first SIP message to determine the target SIP server includes:

[0100] When it is determined by parsing the first SIP message that the first SIP message belongs to a call class message for calling the target terminal, obtain the content of the second target field of the first SIP message, and determine the target SIP server based on the content of the second target field.

[0101] In an exemplary embodiment, the second target field is the Local tag field in the From header field of the first SIP message.

[0102] In an exemplary embodiment, referring to Figure 3 the schematic diagram of the normal process of SIP communication shown, when the server side initiates a call to the target terminal, the SIP server embeds the address information of the target terminal in the private field XNEXTHOP, and at the same time embeds its own address information in the tag field of the From header field. The first intermediary server distributes it to the corresponding target terminal according to the address information in XNEXTHOP. When the target terminal makes subsequent responses or requests in the same session, the first intermediary server obtains the address of the target SIP server from the Local tag fields respectively obtained from the From header field and the To header field, and distributes the response or request message to the corresponding target SIP server for processing.

[0103] In some embodiments, for the load balancing algorithm used in the registration phase and the SIP uplink phase, each SIP server in the set of SIP servers used in the load balancing algorithm is in a normal working state to ensure that the SIP messages assigned to the SIP servers can be processed normally. Based on this, the method further includes: removing the any SIP server from the set of SIP servers when it is monitored that any SIP server for establishing a communication connection fails; adding the any SIP server to the set of SIP servers when it is monitored that the failure of the any SIP server is lifted.

[0104] Step 202, receive a 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.

[0105] In some embodiments, when it is determined by parsing the second SIP message that the second SIP message belongs to a specified type of message, obtain the content of the third target field of the second SIP message, and determine the target terminal based on the content of the third target field;

[0106] wherein, the specified type of message includes one of the following:

[0107] Registration class message;

[0108] Call class message initiated by the target terminal;

[0109] A call class message for calling the target terminal.

[0110] It should be noted that for each stage in the SIP communication process, the method of parsing the second SIP message to determine the target terminal is also different. The processing procedures for each stage are described below respectively.

[0111] First, the registration stage

[0112] In some embodiments, the parsing of the second SIP message to determine the target terminal includes:

[0113] When it is parsed that the second SIP message belongs to a registration class message, obtain the content of the third target field of the second SIP message, and determine the target terminal based on the content of the third target field.

[0114] In an exemplary embodiment, the third target field is the XNEXTHOP field in the header private field.

[0115] In an exemplary embodiment, referring to Figure 3 the schematic diagram of the normal process of SIP communication shown, 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 the WWW-Authenticate header field in the response and embeds the address information of the SIP server into the Nonce field of this header field.

[0116] Second, the SIP upward call stage

[0117] In some embodiments, the parsing of the second SIP message to determine the target terminal includes:

[0118] When it is parsed that the second SIP message belongs to a call class message initiated by the target terminal, obtain the content of the third target field of the second SIP message, and determine the target terminal based on the content of the third target field.

[0119] In an exemplary embodiment, the third target field is the XNEXTHOP field in the header private field.

[0120] Third, the SIP downward call stage

[0121] In some embodiments, the parsing of the second SIP message to determine the target terminal includes:

[0122] When it is determined by analyzing the second SIP message that the second SIP message belongs to a call class message for calling the target terminal, obtain the content of the third target field of the second SIP message, and determine the target terminal based on the content of the third target field.

[0123] In an exemplary embodiment, the third target field is the XNEXTHOP field in the header field private field.

[0124] Among them, for the process of the target SIP server sending the second SIP message in each stage of the SIP communication process, reference can be made to Figure 3 the schematic diagram of the normal process of SIP communication shown, which will not be elaborated here.

[0125] In some embodiments, the method further includes:

[0126] In the case of a failure of the target SIP server, re-determine a new target SIP server, and send the third SIP message of the current SIP session of the target terminal newly obtained to the new target SIP server; query the cached historical information of the current SIP session of the target terminal through the new target SIP server and return a response to the third SIP message according to the historical information.

[0127] In an exemplary embodiment, when some SIP servers fail, the failed SIP server no longer sends keep-alive messages to the first mediation server. After the first mediation server recognizes the failure of the corresponding SIP server node, it adjusts the load balancing algorithm, and no longer sends subsequent SIP messages to the failed SIP server, but distributes them to other normal-state SIP servers for processing.

[0128] In some embodiments, the method further includes:

[0129] In the case of the recovery of the failure of the target SIP server, send the fourth SIP message of the current SIP session of the target terminal newly obtained to the target SIP server, query the cached historical information of the current SIP session of the target terminal through the target SIP server and return a response to the fourth SIP message according to the historical information.

[0130] In an exemplary embodiment, refer to Figure 4The schematic diagram of the processing flow when the SIP server fails is shown. When the SIP server corresponding to the Localtag goes down, the first mediation server forwards it to the remaining SIP servers through the load balancing algorithm. Since the Local tag is carried, the SIP message at this time is a new and unfamiliar session request for the newly allocated SIP server. The newly allocated SIP server generates the corresponding correct response message according to the historical information of this session queried from the Redis cache database.

[0131] When the SIP server failure is recovered, the previous session information can be restored from the Redis cache database. The SIP server continues to send keep-alive messages to the first mediation server. The first mediation server recognizes that the corresponding SIP server node is normal, adjusts the load balancing algorithm, and continues to distribute messages to this recovered normal SIP server. After receiving the message, the SIP server continues to process according to the previous normal process steps.

[0132] In some embodiments, the method further includes:

[0133] In the case of a failure of the first mediation server, trigger the primary / standby switching mechanism, and pass the virtual network address of the first mediation server to the second mediation server through the primary / standby switching mechanism, so as to switch the second mediation server to the primary server and switch the first mediation server to the standby server;

[0134] In the case of the recovery of the failure of the first mediation server, trigger the primary / standby switching mechanism, and configure by obtaining the virtual network address of the second mediation server through the primary / standby switching mechanism, so as to switch the first mediation server to the primary server and switch the second mediation server to the standby server.

[0135] In an exemplary embodiment, Figure 5 The schematic diagram of the processing flow when the mediation server fails is shown. When the first mediation server fails, it will automatically trigger the primary / standby switching mechanism of the dual-machine hot standby component. The dual-machine hot standby component floats the virtual IP address to the standby second mediation server. The second mediation server becomes the primary, and the failed first mediation server becomes the standby. After the failed first mediation server is repaired, it continues to maintain the standby state and waits for the second switch, and the distribution of SIP messages is not affected.

[0136] The embodiments of the present disclosure also provide a communication method applied to a SIP server.

[0137] Figure 6 The schematic diagram of the method flow for communication by the SIP server provided by the embodiments of the present disclosure is shown. The method includes the following steps:

[0138] Step 601: Receive a first SIP message from a target terminal forwarded by a first mediation server.

[0139] In some embodiments, the SIP server sends a keep - alive message to the first mediation server to maintain the communication connection with the first mediation server.

[0140] Step 602: Send a second SIP message for the target terminal to the first mediation server for forwarding to the target terminal through the first mediation server.

[0141] In some embodiments, before sending the second SIP message for the target terminal to the first mediation server, the method further includes at least one of the following steps:

[0142] Write the address of the SIP server in the first target field of the second SIP message;

[0143] Write the address of the SIP server in the second target field of the second SIP message;

[0144] Write the address of the target terminal in the third target field of the second SIP message.

[0145] In some embodiments, the method further includes:

[0146] Query and obtain the historical information of the current SIP session of the target terminal from the cache database;

[0147] Respond to the first SIP message according to the historical information.

[0148] In the embodiments of the present disclosure, by setting a first mediation server, receiving a first SIP message from a target terminal through the first mediation server, parsing the first SIP message to determine the target SIP server, 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, it is possible to allocate a corresponding SIP server for the terminal through the first mediation server, thereby providing a basis for the load balancing of multiple connected SIP servers and providing a possibility for improving the stability and reliability of the SIP access service.

[0149] In the existing related technologies, in a few SIP access solutions, an NGINX proxy server is used to distribute SIP messages. This requires an additional status recording mechanism to record the status of SIP messages to ensure the consistency of SIP transactions. This results in: When distributing SIP messages through the NGNIX proxy server, it needs to cooperate with the status recording mechanism, and there is still a single point of risk in itself, which is not highly reliable in the true sense. When the NGINX server fails, after restarting NGINX, SIP messages with non-initial request status cannot be forwarded to the correct SIP server to ensure the consistency of SIP transactions. There is a lack of disaster recovery processing ability. For single-point SIP access solutions or solutions relying on NGINX, once their single-point SIP server or NGINX fails, manual recovery is required. Not only can it not continue to provide users with complete video conferencing access services, but also a large amount of system construction and human operation and maintenance resources are needed. The single-point SIP access solution lacks load balancing ability and cannot ensure the stable operation of the system under high traffic conditions. When the system is overloaded, it may not be able to respond to terminal requests in a timely manner. The NGNIX proxy server adopts a 4-layer proxy mode, that is, based on the TCP / UDP protocol, but NGINX does not know the specific content of the request and cannot achieve stateless forwarding. It needs to cooperate with the status cache mechanism, which results in its inability to implement a highly reliable mechanism such as master-slave switching.

[0150] However, the first mediation server and the second mediation server in the embodiments of the present disclosure belong to stateless forwarding, do not need to rely on the status recording mechanism to record the status of SIP sessions, can achieve stateless load balancing, and directly forward by parsing SIP messages.

[0151] In 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 SIP access users, which can improve the robustness and service bearing capacity of the video conferencing system and improve the SIP access performance. The embodiments of the present disclosure achieve a quick response when the SIP server fails, avoiding the situation where users 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, through the load balancing of SIP messages, the embodiments of the present disclosure can effectively alleviate the situation of slow response and non-response to terminals caused by the overload of a single-point SIP server during high concurrency.

[0152] Moreover, the embodiments of the present disclosure can achieve a hot backup deployment method that does not rely on caching, achieve high reliability, and only need to ensure that the mediation server for distributing SIP messages adopts a stateless design, so that legal load balancing algorithms and hot backup methods can be selected according to different service scenarios and security requirements to achieve highly reliable SIP access.

[0153] The step divisions of the above various methods are only for clear description. When implemented, they can be combined into one step or some steps can be split into multiple steps. As long as the same logical relationships are included, they are all within the protection scope of the present disclosure; adding insignificant modifications to the algorithm or process or introducing insignificant designs, but without changing the core designs of the algorithm and process, are all within the protection scope of the present disclosure.

[0154] In an embodiment of the present disclosure, a communication device is provided. For the specific implementation of this device, reference can be made to the relevant description of the first mediation server in the method embodiment, and details will not be repeated here. Figure 7 The following is a schematic structural diagram of the device, which mainly includes:

[0155] A first processing module 701, configured to receive a first initial Session Initiation Protocol (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;

[0156] A second processing module 702, configured to receive a 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.

[0157] In an embodiment of the present disclosure, a communication device is provided. For the specific implementation of this device, reference can be made to the relevant description of the SIP server in the method embodiment, and details will not be repeated here. Figure 8 The following is a schematic structural diagram of the device, which mainly includes:

[0158] A receiving module 801, configured to receive a first SIP message from a target terminal forwarded by a first mediation server;

[0159] A sending module 802, configured to send a second SIP message for the target terminal to the first mediation server for forwarding to the target terminal.

[0160] The functions or modules included in the device provided in the embodiment of the present disclosure can be used to execute the methods described in the method embodiments. For the specific implementation and technical effects, reference can be made to the descriptions in the above method embodiments. For the sake of brevity, details will not be repeated here.

[0161] It should be noted that each module involved in this embodiment is a logical module. In practical applications, a logical unit can be a physical unit, a part of a physical unit, or can be implemented by a combination of multiple physical units. In addition, in order to highlight the innovative part of the present disclosure, units not closely related to solving the technical problems proposed by the present disclosure are not introduced in this embodiment, but this does not mean that there are no other units in this embodiment.

[0162] Referring to Figure 9 , an embodiment of the present disclosure provides an electronic device, which includes:

[0163] At least one processor 901;

[0164] A memory 902, on which at least one program is stored. When the at least one program is executed by the at least one processor, the at least one processor implements the above method;

[0165] At least one I / O interface 903, connected between the processor and the memory, configured to implement information interaction between the processor and the memory.

[0166] Among them, the processor 901 is a device with data processing capabilities, which includes but is not limited to a central processing unit (CPU), etc.; the memory 902 is a device with data storage capabilities, which includes but is not limited to a random access memory (RAM, more specifically such as SDRAM, DDR, etc.), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory (FLASH); the I / O interface (read / write interface) 903 is connected between the processor 901 and the memory 902 and can implement information interaction between the processor 901 and the memory 902, which includes but is not limited to a data bus (Bus), etc.

[0167] In some embodiments, the processor 901, the memory 902, and the I / O interface 903 are interconnected through a bus and then connected to other components of the computing device.

[0168] This embodiment also provides a computer-readable medium, on which a computer program is stored. When the program is executed by a processor, the method provided in this embodiment is implemented. To avoid repeated description, the specific steps of this method will not be elaborated here.

[0169] Those of ordinary skill in the art can understand that all or some of the steps in the methods, and the functional modules / units in the systems and devices described above can be implemented as software, firmware, hardware, and their appropriate combinations. In the hardware implementation, the division of the functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, one physical component can have multiple functions, or one function or step can be executed by several physical components in cooperation. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or can be implemented as hardware, or can be implemented as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include a computer storage medium (or non-transitory medium) and a communication medium (or transitory medium). As is well known to those of ordinary skill 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 include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, tapes, 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 of ordinary skill in the art that a communication medium generally contains computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and can include any information delivery medium.

[0170] It should be noted that in this article, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article or device including that element.

[0171] Those skilled in the art can understand that although some of the embodiments described herein include certain features included in other embodiments rather than other features, the combination of the features of different embodiments means that it is within the scope of this embodiment and forms different embodiments.

[0172] It is understood that the above embodiments are merely exemplary embodiments adopted to illustrate the principles of the present disclosure. However, the present disclosure is not limited thereto. For those of ordinary skill in the art, various modifications and improvements can be made without departing from the spirit and essence of the present disclosure, and these modifications and improvements are also regarded as the protection scope of the present disclosure.

Claims

1. A communication method, characterized in that, applied to a first intermediary server, the method includes: Receiving a first initial Session Initiation 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; 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.

2. The method according to claim 1, characterized in that, The 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 for the target terminal according to the type of the first SIP message.

3. The method according to claim 2, characterized in that, The allocating the target SIP server for the target terminal according to the type of the first SIP message includes: In the case where the type of the first SIP message is a registration class message and is a new SIP registration request message, re-allocating the target SIP server for the target terminal; In the case where the type of the first SIP message is a registration class message and is not a new SIP registration request message, parsing to obtain the content of the first target field of the first SIP message, and determining the target server based on the content of the first target field; In the case where 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, re-allocating the target SIP server for the target terminal; In the case where the type of the first SIP message is a SIP call class message initiated by the target terminal and is not a new SIP call access request message, obtaining the content of the 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 where the type of the first SIP message is a call class message for calling the target terminal, obtaining the content of the second target field of the first SIP message, and determining the target SIP server based on the content of the second target field.

4. The method according to claim 1, characterized in that, The parsing the second SIP message to determine the target terminal includes: In the case where parsing the second SIP message determines that the second SIP message belongs to a specified type of message, obtaining the content of the third target field of the second SIP message, and determining the target terminal based on the content of the third target field; wherein, the specified type of message includes one of the following: Registration class message; Call class message initiated by the target terminal; Call class message for calling the target terminal.

5. The method according to claim 3, characterized in that, The re-allocating the target SIP server for the target terminal includes: Parse to obtain the unique identifier of the target terminal included in the first SIP message, and select the target SIP server from the 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, wherein, the method further includes: in the case of detecting a failure of any one of the SIP servers for establishing a communication connection, removing the any one of the SIP servers from the set of SIP servers; in the case of detecting that the failure of the any one of the SIP servers is resolved, adding the any one of the SIP servers to the set of SIP servers.

7. The method according to claim 1, wherein, the method further includes: in the case of a failure of the target SIP server, re-determine a new target SIP server, and send a third SIP message of the current SIP session of the target terminal newly obtained to the new target SIP server; query the historical information of the current SIP session of the target terminal cached by the new target SIP server, and return a response to the third SIP message according to the historical information.

8. The method according to claim 7, wherein, the method further includes: in the case of the recovery of the failure of the target SIP server, send a fourth SIP message of the current SIP session of the target terminal newly obtained to the target SIP server, query the historical information of the current SIP session of the target terminal cached by the target SIP server, and return a response to the fourth SIP message according to the historical information.

9. The method according to claim 1, wherein, the method further includes: in the case of a failure of the first mediation server, trigger a primary / backup switching mechanism, and transmit the virtual network address of the first mediation server to a second mediation server through the primary / backup switching mechanism, so as to switch the second mediation server to the primary server and switch the first mediation server to the backup server; in the case of the recovery of the failure of the first mediation server, trigger the primary / backup switching mechanism, and obtain the virtual network address of the second mediation server through the primary / backup switching mechanism for configuration, so as to switch the first mediation server to the primary server and switch the second mediation server to the backup server.

10. A communication method, wherein, applied to a SIP server, the method includes: receive a first SIP message from a target terminal forwarded by a first mediation server; send a second SIP message for the target terminal to the first mediation server for forwarding to the target terminal.

11. The method according to claim 10, wherein, before sending the second SIP message for the target terminal to the first mediation server, the method further includes at least one of the following steps: write the address of the SIP server in a first target field of the second SIP message; Write the address of the SIP server in the second destination field of the second SIP message; Write the address of the target terminal in the third destination field of the second SIP message.

12. The method according to claim 10, characterized in that, the method further includes: Query and obtain the historical information of the current SIP session of the target terminal from the cache database; Respond to the first SIP message according to the historical information.

13. A communication system, characterized in that, comprises: A target terminal for sending a first Session Initiation Protocol (SIP) message to a first intermediary server; A target SIP server for sending a second SIP message to the first intermediary server; A first intermediary server for 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; and, 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; A second intermediary server for serving as a backup server of the first intermediary server.

14. An electronic device, characterized in that, comprises: At least one processor; A memory having stored thereon at least one program, which when executed by the at least one processor causes the at least one processor to implement the method according to any one of claims 1-9 or the method according to any one of claims 10-12; At least one I / O interface connected between the processor and the memory and configured to enable information interaction between the processor and the memory.

15. A computer-readable medium having stored thereon a computer program, which when executed by a processor implements the method according to any one of claims 1-9 or the method according to any one of claims 10-12.