Signaling proxy method and device, electronic equipment and readable storage medium
By using unified access and national standard coding routing lookup through the signaling proxy gateway, the problems of complex network configuration and resource exhaustion in the public security video surveillance network system have been solved, and more efficient network resource utilization has been achieved.
Patent Information
- Application Number
- CN202511844835.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-08
- Publication Date
- 2026-02-10
AI Technical Summary
In existing public safety video surveillance network systems, the traditional point-to-point architecture leads to problems such as high network configuration complexity, exhaustion of port resources, and low network resource utilization.
By using a unified access signaling proxy gateway and routing lookup based on national standard codes, signaling requests from multiple lower-level platforms are aggregated into a single entry point for proxy forwarding. Routing decisions are made using a pre-established mapping table between national standard codes and backend service addresses.
It reduces the network resource consumption of the signaling agent, improves the network resource utilization, simplifies network configuration, and reduces port resource requirements.
Smart Images

Figure CN121508740A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network communication technology, and in particular to a signaling proxy method, apparatus, electronic device, and readable storage medium. Background Technology
[0002] Currently, public security video surveillance network systems generally use the GB / T 28181 protocol to achieve platform cascading. Its typical application architecture establishes direct point-to-point signaling connections between the upper-level platform and each lower-level platform. Each lower-level platform needs to be configured with an independent access address and port of the upper-level platform to directly perform signaling registration and session maintenance, resulting in a complex mesh topology of the system.
[0003] However, this traditional point-to-point architecture has obvious shortcomings: on the one hand, each new subordinate platform requires repeated network configuration and signaling parameter settings, and the configuration complexity of platform integration increases linearly with the scale; on the other hand, the upper-level platform needs to maintain an independent signaling channel for each subordinate platform, and when N platforms are connected, N network port resources are required, resulting in rapid exhaustion of port resources and low network resource utilization. Summary of the Invention
[0004] In view of this, embodiments of this application provide at least one signaling proxy method, apparatus, electronic device, and readable storage medium. Through unified access of the signaling proxy gateway and routing query based on national standard codes, signaling requests based on national standard codes from multiple lower-level platforms are aggregated into a single entry point for proxy forwarding, thereby reducing the network resource occupation of the signaling proxy and improving the network resource utilization rate.
[0005] This application mainly includes the following aspects: In a first aspect, embodiments of this application provide a signaling proxy method applied to a signaling proxy gateway, the method comprising: Receive SIP request messages from lower-level platforms and extract the GB / T encoding of the SIP request messages; The forwarding routing table is queried according to the national standard code to determine the backend service address corresponding to the national standard code; the forwarding routing table is a pre-established mapping relationship table between national standard codes and backend service addresses based on the national standard codes; The SIP request message is forwarded to the backend service address.
[0006] Secondly, embodiments of this application also provide a signaling proxy device, applied to a signaling proxy gateway, the signaling proxy device comprising: The message receiving module is used to receive SIP request messages from the lower-level platform and extract the national standard code of the SIP request message; The routing query module is used to query the forwarding routing table based on the national standard code to determine the backend service address corresponding to the national standard code; the forwarding routing table is a pre-established mapping relationship table between national standard codes and backend service addresses based on the national standard code; The message forwarding module is used to forward the SIP request message to the backend service address.
[0007] Thirdly, embodiments of this application also provide an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory through the bus, and the machine-readable instructions are executed by the processor to perform the steps of the signaling proxy method as described above.
[0008] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the signaling proxy method described above.
[0009] This application provides a signaling proxy method, apparatus, electronic device, and readable storage medium. The method, applied to a signaling proxy gateway, includes: receiving SIP request messages from lower-level platforms and extracting the GB code of the SIP request messages; querying a forwarding routing table based on the GB code to determine the backend service address corresponding to the GB code; the forwarding routing table is a pre-established mapping table between GB codes and backend service addresses; and forwarding the SIP request messages to the backend service address. In this way, through unified access and GB code-based routing lookup by the signaling proxy gateway, signaling requests from multiple lower-level platforms based on GB codes are aggregated to a single entry point for proxy forwarding, reducing the network resource consumption of the signaling proxy.
[0010] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0011] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 A flowchart illustrating a signaling proxy method provided in an embodiment of this application; Figure 2This is one of the functional block diagrams of a signaling proxy device provided in an embodiment of this application; Figure 3 This is a second functional block diagram of a signaling proxy device provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0013] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0014] To facilitate understanding of this application, the technical solutions provided in this application will be described in detail below with reference to specific embodiments.
[0015] Please see Figure 1 , Figure 1 This is a flowchart illustrating a signaling proxy method provided in an embodiment of this application. Figure 1 As shown in the embodiments of this application, the signaling proxy method includes the following steps: S101, Receive SIP request messages from lower-level platforms and extract the national standard encoding of the SIP request messages.
[0016] The system architecture described in this application includes a signaling proxy gateway, multiple SIP backend gateways, and a message bus component. The signaling proxy gateway, as the unified entry point for the system, is responsible for receiving SIP requests from all lower-level platforms and forwarding them according to pre-established routing rules. The SIP backend gateways are responsible for specific business logic processing and report service status to the proxy gateway via the message bus. The message bus, as the infrastructure for internal system communication, carries internal communication data such as heartbeat messages. Here, the signaling proxy gateway, as the unified signaling entry point for this level of platform, listens to the configured IP address and port. When any lower-level platform needs to interact with this level of platform via signaling, its initiated SIP request messages (such as registration, heartbeat, or audio / video on-demand requests) are sent to the signaling proxy gateway. After receiving this raw message, the signaling proxy gateway parses the SIP protocol message structure and extracts key information for routing decisions, namely the GB code, from specific fields in its protocol header. SIP, or Session Initiation Protocol, is an application-layer control protocol defined by the Internet Engineering Task Force (IETF) for creating, modifying, and terminating multimedia sessions, including video, voice, instant messaging, and online games. The national standard code used in this embodiment corresponds to GB / T 28181, "Technical Requirements for Information Transmission, Exchange, and Control of Public Security Video Surveillance Network Systems." The appropriate national standard code can be selected based on the actual application scenario; no specific restrictions are imposed here.
[0017] S102, query the forwarding routing table according to the national standard code to determine the backend service address corresponding to the national standard code; the forwarding routing table is a mapping relationship table between national standard codes and backend service addresses pre-established based on national standard codes.
[0018] Here, the signaling proxy gateway maintains a core forwarding routing table internally. This table is pre-established through an independent mechanism during system operation, and its core structure maps different GB codes to the network addresses of backend service instances that handle the corresponding services. The signaling proxy gateway uses the GB code extracted in step S101 as a query key to perform an exact match query in this routing table, thereby determining the network location of a specific backend service instance deployed within its own platform that handles the request.
[0019] Furthermore, for SIP request messages that cannot be fully matched, the signaling proxy gateway discards them directly, ensuring that only requests that conform to the routing rules can be forwarded to the backend service.
[0020] S103, forward the SIP request message to the backend service address.
[0021] Here, after determining the destination of the message by querying the routing table, the signaling proxy gateway forwards the received raw SIP request message over the network to the backend service address determined in step S102. Subsequently, the backend service performs the specific business logic processing.
[0022] Specifically, the signaling proxy gateway converts the SIP request information into forwarding routes, which consist of: [service identifier, service listening address, service listening port, platform national standard code, subordinate platform national standard code]. Through this mechanism, the system only exposes the proxy gateway port to the outside world. All subordinate platforms interact with signaling through this unified entry point, which then distributes the information to different internal backend services. Externally, it presents a unified platform service entry point.
[0023] In this embodiment of the application, a specific application scenario is taken as an example: A district / county-level subordinate platform (GB code 44011200002000000002) needs to initiate a registration request to the municipal-level platform (GB code 44011200002000000001). This subordinate platform sends a SIP registration message to the only publicly announced signaling entry point of the municipal-level platform, namely the address of the signaling proxy gateway (e.g., 192.168.1.10:5060). The signaling proxy gateway receives this message and extracts the GB code information used for routing.
[0024] Subsequently, the signaling proxy gateway uses the national standard code to query the forwarding routing table and successfully finds the corresponding backend service address as 192.168.177.66:25060. The forwarding routing table consists of a service identifier, service listening address, service listening port, platform national standard code, and lower-level platform national standard code. For example, when the backend gateway service starts, the service information reported via heartbeat messages includes: a unique service identifier of 120000000001014, a service listening address of 192.168.177.66, a service listening port of 25060, a platform national standard code of 44011200002000000001, and a lower-level platform national standard code of 44011200002000000002. Based on this information, the signaling proxy gateway establishes a complete forwarding routing entry, enabling accurate multi-dimensional matching during route queries.
[0025] Finally, the signaling proxy gateway forwards the original registration request message to this address, thus completing a signaling proxy process. Throughout the process, the lower-level platform only interacts with the signaling proxy gateway and does not need to be aware of the network details of the actual backend processing services.
[0026] Furthermore, the method also includes: Step a1: Upon receiving the SIP request message, establish a temporary mapping relationship between the session identifier in the SIP request message and the signaling source information of the lower-level platform.
[0027] Here, when the signaling proxy gateway receives a SIP request message from any lower-level platform, in addition to performing a routing lookup, it also simultaneously creates a temporary mapping record. Specifically, the signaling proxy gateway obtains the true network source of the message, i.e., the signaling source address and signaling source port, from the received packet's IP / UDP / TCP header, and extracts the Call-ID field, which uniquely identifies this session, as the session identifier from the SIP message header. Subsequently, the signaling proxy gateway creates a temporary entry in its memory, associating this session identifier with the corresponding signaling source information to form a temporary mapping relationship. This step ensures that the signaling proxy gateway can remember where each request originally came from.
[0028] Specifically, the complete structure of a temporary session route is: [SIP Session ID, Signaling Source Address, Signaling Source Port]. This structure ensures that the original requester can be accurately located when responding to a response.
[0029] Step a2: Upon receiving a SIP response message from the backend service address to the SIP request message, query the temporary mapping relationship based on the session identifier in the SIP response message to obtain the signaling source information of the corresponding lower-level platform.
[0030] Here, after the backend service processes the request and generates a SIP response message, this response message is sent back to the signaling proxy gateway. Upon receiving this response message, the signaling proxy gateway first parses its SIP header to obtain the Call-ID field. Then, using this Call-ID as a key index, the signaling proxy gateway queries the previously established temporary mapping table to quickly retrieve the original signaling source information matching this session—that is, the IP address and port of the downstream platform that initially sent the corresponding request.
[0031] Step a3: Forward the SIP response message to the address indicated by the signaling source information.
[0032] Here, after successfully obtaining the exact network address of the lower-level platform through step a2, the signaling proxy gateway sends the SIP response message returned by the backend service as a new network packet to the IP address and port indicated by the signaling source information. This mechanism ensures that the response from the backend service is accurately sent back to the specific lower-level platform that initially initiated the request, thus completing the full closed loop of signaling interaction and achieving a transparent reverse proxy function for the lower-level platform.
[0033] In this embodiment, the aforementioned scenario continues: when the signaling proxy gateway forwards the registration request (Call-ID: abc123@domain.com) to the backend service (192.168.177.66:25060), it simultaneously records a temporary mapping relationship: Call-ID: abc123@domain.com, source address: 192.168.2.100:5060. When the backend service completes processing and returns a response (its Call-ID is also abc123@domain.com) to the signaling proxy gateway, the signaling proxy gateway can query this temporary mapping relationship to know that this response should be sent back to address 192.168.2.100:5060, thereby ensuring that the response is accurately returned to the correct downstream platform.
[0034] Furthermore, the method also includes: Step b1: Receive a heartbeat message containing the national standard code and the backend service address.
[0035] Here, the signaling proxy gateway continuously listens for and receives heartbeat messages from various backend service instances within the platform. These heartbeat messages are transmitted via the system's internal message bus or other communication mechanisms. Each heartbeat message is a structured data unit that must contain two key pieces of information: first, the national standard code corresponding to the service being handled by the backend service instance; and second, the service address (including IP address and port number) that the backend service instance is currently listening to.
[0036] In this embodiment, the heartbeat message is in XML format, containing the local platform's listening port, port type (UDP / TCP), local platform's national standard encoding, lower-level platform's national standard encoding, a list of network interface card (NIC) addresses for the service, service type (cascaded gateway service, direct-connected device access service), and a unique service identifier. This information serves as the basis for the SIP signaling proxy gateway to generate forwarding routes. Preferably, the heartbeat message is communicated via a bus module, with a sending interval of 5 seconds.
[0037] Step b2: Based on the heartbeat message, establish or update the mapping relationship between the GB code and the corresponding backend service address in the forwarding routing table.
[0038] Here, after successfully receiving and parsing the heartbeat message, the signaling proxy gateway uses the GB code and backend service address information contained within to maintain its core forwarding routing table. The signaling proxy gateway uses the GB code in the heartbeat message as an index to look up the corresponding existing entry in the forwarding routing table. If a corresponding mapping relationship does not yet exist for the GB code, the signaling proxy gateway creates a new record in the routing table, establishing a mapping between the GB code and the backend service address carried in the message. If a corresponding mapping relationship already exists for the GB code, the signaling proxy gateway updates the existing entry using the latest service address information from the heartbeat message, ensuring the timeliness and accuracy of the routing information. This mechanism allows the forwarding routing table to dynamically reflect the status and location of all currently available backend service instances.
[0039] In this embodiment, it is assumed that a backend cascading gateway service (service address 192.168.177.66:25060) responsible for handling services of a district / county platform (GB code 44011200002000000002) will periodically (e.g., every 5 seconds) send heartbeat messages to the signaling proxy gateway via the message bus after startup. This heartbeat message explicitly contains the GB code 44011200002000000002 and its own service address 192.168.177.66:25060. Upon receiving this message, the signaling proxy gateway immediately establishes or updates a mapping relationship in its forwarding routing table. That is, when signaling related to code 44011200002000000002 needs to be processed, it should be forwarded to address 192.168.177.66:25060. In this way, the routing table can be built dynamically and accurately.
[0040] Furthermore, the GB / T encoding of the SIP request message includes the GB / T encoding of the lower-level platform and the GB / T encoding of the current-level platform; the extraction of the GB / T encoding of the SIP request message includes: Step c1: Extract the lower-level platform national standard code from the From field of the SIP header field of the SIP request message.
[0041] Here, when parsing a SIP request message, the signaling proxy gateway first locates the From field in the SIP header. This field identifies the initiator of the request in the SIP protocol. The signaling proxy gateway extracts the complete GB / T coded string from this field, which uniquely identifies the lower-level platform that sent the current request. Regardless of whether the request type is registration, query, or control command, the From field always represents the source of the signaling, i.e., the lower-level platform.
[0042] Step c2: Extract the local platform national standard code from the To field of the SIP header field or the request start line of the SIP request message.
[0043] Here, the signaling proxy gateway also needs to determine the target of the request, i.e., the identity of the local platform. For most SIP request messages (such as on-demand and control commands), the target GB code is explicitly present in the To field of the SIP header. However, in specific registration request scenarios, the target information may be contained in the request-line or start-line. Therefore, the signaling proxy gateway will extract the complete target GB code string from the To field or the request-line according to the SIP protocol specifications. This code uniquely identifies the local platform to which the request is intended.
[0044] In this embodiment of the application, when the signaling proxy gateway receives a SIP request message, it performs the following specific operations: First, parse the SIP header field, from From:<sip:44011200002000000002@domain.com> Extract the national standard code of the lower-level platform 44011200002000000002 from the field.
[0045] Subsequently, from To:<sip:44011200002000000001@domain.com> The platform's national standard code 44011200002000000001 can be extracted from the field, or from the start line of a request like REGISTER sip:44011200002000000001@domain.com SIP / 2.0. By extracting these two codes, the signaling proxy gateway obtains the complete information necessary for making accurate routing decisions.
[0046] Furthermore, before forwarding the SIP request message to the backend service address, the method further includes: Step d1: When the network transport protocol of the SIP request message is inconsistent with the listening protocol of the corresponding backend service address, modify the transport protocol identifier in the Via header field of the SIP request message.
[0047] Here, after determining the target backend service address, the signaling proxy gateway checks whether the listening protocol type (such as TCP or UDP) of that address is consistent with the transport protocol of the received SIP request message. If they are inconsistent, the signaling proxy gateway will modify the transport protocol identifier in the Via header field of the SIP message to ensure protocol compatibility. Specifically, the signaling proxy gateway will find the Via header representing its own hostname or IP address in the Via header stack and modify the transport protocol parameter (such as "UDP" or "TCP") therein to match the type of the backend service's listening protocol. This modification ensures that the SIP message can be correctly received and processed by the backend service, achieving transparent conversion between different transport protocols.
[0048] Step d2: Modify the address information in the Contact header field of the SIP request message and replace it with the address information of the signaling proxy gateway.
[0049] Here, regardless of whether the transport protocol is consistent, the signaling proxy gateway modifies the Contact header field of the SIP request message. The signaling proxy gateway replaces the lower-level platform address and port information originally included in the Contact header field with its own service address and port. This modification ensures that all subsequent SIP requests initiated based on the Contact header field (such as ACK requests after call setup) are sent to the signaling proxy gateway, rather than directly to the lower-level platform. This guarantees that all signaling messages throughout the entire session are forwarded through the signaling proxy gateway, maintaining the integrity and consistency of the proxy architecture.
[0050] In this embodiment, it is assumed that the lower-level platform sends a SIP request to the signaling proxy gateway via the UDP protocol, while the backend service listens on a TCP port. The signaling proxy gateway will change "UDP" to "TCP" in the Via header field to ensure that the message can be received normally by the TCP service.
[0051] Simultaneously, the signaling proxy gateway modifies the original value of the address information in the Contact header field, "sip:44011200002000000002@192.168.2.100:5060", to the signaling proxy gateway's own address information, "sip:44011200002000000002@192.168.1.10:5060". This resolves the protocol compatibility issue while ensuring correct routing for subsequent requests.
[0052] Furthermore, the method also includes: Step e1: After establishing the temporary mapping relationship, record the non-response time for the temporary mapping relationship.
[0053] Here, once the signaling proxy gateway successfully establishes a temporary mapping relationship and completes request forwarding, it immediately initiates a time monitoring mechanism for that mapping relationship. Specifically, the signaling proxy gateway initializes a time record for this newly created mapping relationship. This record tracks the time elapsed from the last relevant signaling activity to the current time; this time elapsed is the non-response time. Initially, this non-response time is set to zero and begins to accumulate over time.
[0054] Step e2: If a SIP message matching the session identifier of the temporary mapping relationship is received, the non-response time of the temporary mapping relationship is reset.
[0055] Here, the signaling proxy gateway checks the call-ID of any SIP message it processes. If it receives a SIP message, whether a request or a response, and its call-ID matches the call-ID in an existing temporary mapping, the signaling proxy gateway considers this match a valid session activity. In response, the signaling proxy gateway resets the non-response timeout of the corresponding temporary mapping to zero and restarts the timer. This mechanism ensures that the corresponding temporary mapping is maintained as long as the session is still actively communicating.
[0056] Step e3: If the non-response time is greater than a preset response time threshold, then delete the temporary mapping relationship.
[0057] Here, the signaling proxy gateway continuously checks the non-response time of all temporary mappings. A configurable preset response time threshold (e.g., 5 minutes) is set for each mapping. When the system detects that the non-response time of a temporary mapping exceeds this preset threshold, it determines that the session has timed out or terminated abnormally. At this time, the signaling proxy gateway automatically deletes this temporary mapping, releasing the system resources it occupies. This timeout cleanup mechanism effectively prevents resource leakage caused by sessions failing to terminate normally, ensuring the long-term stable operation of the system.
[0058] In this embodiment, it is assumed that the signaling proxy gateway establishes a temporary mapping relationship for a session with Call-ID abc123@domain.com. Upon establishment, the non-response time begins to accumulate from 0. If, within the following 3 minutes, the signaling proxy gateway receives a 200 OK response matching this Call-ID, the non-response time is reset to 0. If no SIP messages related to this Call-ID arrive within the following 5 minutes (a preset threshold), the signaling proxy gateway will automatically delete this mapping record, completing resource reclamation.
[0059] Furthermore, the method also includes: Step f1: For any backend service address, if no heartbeat message is received from the backend service address within a preset fault determination time, the backend service address is determined to be unavailable, and all mapping relationships related to the backend service address in the forwarding routing table are cleared.
[0060] Here, the signaling proxy gateway maintains a status monitoring mechanism for each known backend service address. The system presets a fault determination time window (e.g., 60 seconds). The signaling proxy gateway continuously monitors the heartbeat message reception status of each backend service address. If, within a consecutive fault determination time window, the signaling proxy gateway does not receive any heartbeat messages from a specific backend service address, the system determines that the service instance corresponding to that backend service address has failed or is unavailable. Once this determination is made, the signaling proxy gateway immediately performs a cleanup operation, searching and deleting all mappings in the forwarding routing table that use that backend service address as the destination address, thereby ensuring that subsequent signaling is not incorrectly routed to the failed service instance.
[0061] Step f2: If a heartbeat message containing a cleared GB code is received from a new backend service address, the new backend service address is identified as the backup address, and a new mapping relationship between the GB code and the new backend service address is re-established in the forwarding routing table.
[0062] Here, after clearing invalid routing entries, if a backup service instance is enabled in the system, or the original service instance recovers and re-registers with a new network address, the signaling proxy gateway will receive a heartbeat message from a new backend service address. This message will contain the same GB code as the one in the previously cleared mapping. The signaling proxy gateway will recognize this situation and identify this new backend service address as the new valid processing node (i.e., the backup address) corresponding to the GB code. Subsequently, the signaling proxy gateway will recreate a mapping for this GB code in the forwarding routing table, pointing it to this new backend service address. Through this mechanism, the system achieves automatic isolation of faulty services and automatic activation of backup services, completing a high-availability failover.
[0063] It's important to note that the signaling proxy gateway's route update process doesn't involve actively redirecting the platform to the new service; rather, it's a passive update based on heartbeat messages. When the old gateway crashes, the new backup gateway is automatically started by the system and continues sending heartbeat messages. Upon receiving a new heartbeat message, the signaling proxy gateway determines that the backend service has changed based on the service's unique identifier (which is the same for both the old and new gateways). It then updates the backend address and port of the corresponding forwarding route, directing subsequent signaling to the new backend service.
[0064] In this embodiment, it is assumed that the original backend service (address 192.168.177.66:25060) stops sending heartbeats due to a failure. After a preset failure judgment time of 60 seconds, the signaling proxy gateway determines that it is unavailable and clears all mappings to 192.168.177.66:25060 from its routing table. Subsequently, a backup service instance (address 192.168.177.67:25060) starts up and sends a heartbeat to the signaling proxy gateway, containing the same GB code 44011200002000000002. Upon receiving this code, the signaling proxy gateway re-establishes a route to the new address 192.168.177.67:25060, thus achieving automatic service switching.
[0065] This application provides a signaling proxy method applied to a signaling proxy gateway, comprising: receiving SIP request messages from lower-level platforms and extracting the GB code of the SIP request messages; querying a forwarding routing table based on the GB code to determine the backend service address corresponding to the GB code; the forwarding routing table is a pre-established mapping table between GB codes and backend service addresses; and forwarding the SIP request messages to the backend service address. In this way, through unified access and GB code-based routing lookup by the signaling proxy gateway, signaling requests from multiple lower-level platforms based on GB codes are aggregated to a single entry point for proxy forwarding, reducing the network resource consumption of the signaling proxy and improving network resource utilization.
[0066] Based on the same application concept, this application also provides a signaling proxy device corresponding to the signaling proxy method provided in the above embodiments. Since the principle of the device in this application is similar to the signaling proxy method in the above embodiments of this application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0067] Please see Figure 2 , Figure 2 This is one of the functional block diagrams of a signaling proxy device provided in an embodiment of this application. Figure 2 As shown, the signaling proxy device 200 provided in this embodiment of the application is applied to a signaling proxy gateway and includes: The message receiving module 210 is used to receive SIP request messages from the lower-level platform and extract the national standard code of the SIP request message.
[0068] The routing query module 220 is used to query the forwarding routing table based on the national standard code to determine the backend service address corresponding to the national standard code; the forwarding routing table is a mapping relationship table between national standard codes and backend service addresses pre-established based on national standard codes.
[0069] The message forwarding module 230 is used to forward the SIP request message to the backend service address.
[0070] Further, please refer to Figure 3 , Figure 3 This is a second functional block diagram of a signaling proxy device provided in an embodiment of this application. For example... Figure 3 As shown, the signaling proxy device 200 provided in this embodiment of the application further includes: The temporary mapping module 240 is used to establish a temporary mapping relationship between the session identifier in the SIP request message and the signaling source information of the lower-level platform when the SIP request message is received.
[0071] The response query module 250 is used to query the temporary mapping relationship based on the session identifier in the SIP response message when it receives a SIP response message from the backend service address in response to the SIP request message, and obtain the signaling source information of the corresponding lower-level platform.
[0072] The response forwarding module 260 is used to forward the SIP response message to the address indicated by the signaling source information.
[0073] Furthermore, such as Figure 3 As shown, the signaling agent device 200 also includes: The message receiving module 270 is used to receive heartbeat messages containing national standard codes and backend service addresses.
[0074] The mapping adjustment module 280 is used to establish or update the mapping relationship between the national standard code and the corresponding backend service address in the forwarding routing table according to the heartbeat message.
[0075] Furthermore, the GB / T encoding of the SIP request message includes the GB / T encoding of the lower-level platform and the GB / T encoding of the current-level platform; when the message receiving module 210 extracts the GB / T encoding of the SIP request message, the message receiving module 210 is specifically used for: Extract the lower-level platform's national standard code from the From field of the SIP header field of the SIP request message; Extract the local platform national standard code from the To field of the SIP header field or the request start line of the SIP request message.
[0076] Furthermore, before forwarding the SIP request message to the backend service address, the message forwarding module 230 is also used to: When the network transport protocol of the SIP request message is inconsistent with the listening protocol of the corresponding backend service address, modify the transport protocol identifier in the Via header field of the SIP request message. Modify the address information in the Contact header field of the SIP request message and replace it with the address information of the signaling proxy gateway.
[0077] Furthermore, the temporary mapping module 240 is also used for: After establishing the temporary mapping relationship, record the non-response time for the temporary mapping relationship; If a SIP message matching the session identifier of the temporary mapping is received, the non-response time of the temporary mapping is reset; If the non-response time exceeds a preset response time threshold, the temporary mapping relationship is deleted.
[0078] Furthermore, the mapping adjustment module 280 is also used for: If no heartbeat message is received from any backend service address within a preset fault determination time, the backend service address is determined to be unavailable, and all mapping relationships related to the backend service address in the forwarding routing table are cleared. If a heartbeat message containing a cleared GB code is received from a new backend service address, the new backend service address is identified as the backup address, and the mapping relationship between the GB code and the new backend service address is re-established in the forwarding routing table.
[0079] This application provides a signaling proxy device applied to a signaling proxy gateway, comprising: a message receiving module for receiving SIP request messages from lower-level platforms and extracting the GB code of the SIP request messages; a routing query module for querying a forwarding routing table based on the GB code to determine the backend service address corresponding to the GB code; the forwarding routing table is a pre-established mapping table between GB codes and backend service addresses; and a message forwarding module for forwarding the SIP request messages to the backend service address. In this way, through unified access and GB code-based routing querying of the signaling proxy gateway, signaling requests based on GB codes from multiple lower-level platforms are aggregated to a single entry point for proxy forwarding, reducing the network resource consumption of the signaling proxy and improving network resource utilization.
[0080] Based on the same application concept, please refer to Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 4 As shown, the electronic device 400 includes a processor 410, a memory 420, and a bus 430.
[0081] The memory 420 stores machine-readable instructions executable by the processor 410. When the electronic device 400 is running, the processor 410 and the memory 420 communicate through the bus 430. When the machine-readable instructions are executed by the processor 410, the steps of the signaling proxy method provided in the above embodiment are executed. For specific implementation, please refer to the method embodiment, which will not be repeated here.
[0082] Based on the same concept, this application also provides a computer-readable storage medium storing a computer program. When the computer program is run by a processor, it executes the steps of the signaling proxy method provided in the above embodiments. For specific implementation details, please refer to the method embodiments, which will not be repeated here.
[0083] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described apparatus and unit can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0084] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0085] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0086] In addition, the functional units in the embodiments provided in this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0087] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0088] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0089] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The protection scope of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application. All should be covered within the protection scope of this application. Therefore, the protection scope of this application should be determined by the protection scope of the claims.
Claims
1. A signaling proxy method, characterized in that, Applied to a signaling proxy gateway, the method includes: Receive SIP request messages from lower-level platforms and extract the GB / T encoding of the SIP request messages; The forwarding routing table is queried according to the national standard code to determine the backend service address corresponding to the national standard code; the forwarding routing table is a pre-established mapping relationship table between national standard codes and backend service addresses based on the national standard codes; The SIP request message is forwarded to the backend service address.
2. The signaling proxy method according to claim 1, characterized in that, The method further includes: Upon receiving the SIP request message, a temporary mapping relationship is established between the session identifier in the SIP request message and the signaling source information of the lower-level platform; When a SIP response message is received from the backend service address in response to the SIP request message, the temporary mapping relationship is queried based on the session identifier in the SIP response message to obtain the signaling source information of the corresponding lower-level platform; The SIP response message is forwarded to the address indicated by the signaling source information.
3. The signaling proxy method according to claim 1, characterized in that, The method further includes: Receive heartbeat messages containing GB code and backend service address; Based on the heartbeat message, establish or update the mapping relationship between the GB code and the corresponding backend service address in the forwarding routing table.
4. The signaling proxy method according to claim 1, characterized in that, The GB / T encoding of the SIP request message includes the GB / T encoding of the lower-level platform and the GB / T encoding of the current-level platform; the extraction of the GB / T encoding of the SIP request message includes: Extract the lower-level platform's national standard code from the From field of the SIP header field of the SIP request message; Extract the local platform national standard code from the To field of the SIP header field or the request start line of the SIP request message.
5. The signaling proxy method according to claim 1, characterized in that, Before forwarding the SIP request message to the backend service address, the method further includes: When the network transport protocol of the SIP request message is inconsistent with the listening protocol of the corresponding backend service address, modify the transport protocol identifier in the Via header field of the SIP request message. Modify the address information in the Contact header field of the SIP request message and replace it with the address information of the signaling proxy gateway.
6. The signaling proxy method according to claim 2, characterized in that, The method further includes: After establishing the temporary mapping relationship, record the non-response time for the temporary mapping relationship; If a SIP message matching the session identifier of the temporary mapping is received, the non-response time of the temporary mapping is reset; If the non-response time exceeds a preset response time threshold, the temporary mapping relationship is deleted.
7. The signaling proxy method according to claim 3, characterized in that, The method further includes: If no heartbeat message is received from any backend service address within a preset fault determination time, the backend service address is determined to be unavailable, and all mapping relationships related to the backend service address in the forwarding routing table are cleared. If a heartbeat message containing a cleared GB code is received from a new backend service address, the new backend service address is identified as the backup address, and a new mapping relationship between the GB code and the new backend service address is re-established in the forwarding routing table.
8. A signaling proxy device, characterized in that, Applied to a signaling proxy gateway, the signaling proxy device includes: The message receiving module is used to receive SIP request messages from the lower-level platform and extract the national standard code of the SIP request message; The routing query module is used to query the forwarding routing table based on the national standard code to determine the backend service address corresponding to the national standard code; the forwarding routing table is a pre-established mapping relationship table between national standard codes and backend service addresses based on the national standard code; The message forwarding module is used to forward the SIP request message to the backend service address.
9. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and the machine-readable instructions are executed by the processor to perform the steps of the signaling proxy method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the signaling proxy method as described in any one of claims 1 to 7.