Efficient internal and external network remote control method based on SIP protocol and WebSocket communication protocol
By integrating the SIP protocol with the WebSocket communication protocol, the scalability limitations of the standard SIP protocol in device access and control are solved, real-time data interaction and efficient remote control of internal and external network devices are realized, and the accessibility and scalability of intranet devices are improved.
Patent Information
- Application Number
- CN202411766123.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-04-15
AI Technical Summary
The standard SIP protocol lacks scalability in accessing and controlling GB28181 devices, and is limited to accessing devices that meet specific standards, limiting the accessibility and scalability of intranet devices.
By integrating the SIP protocol with the WebSocket communication protocol, external network access, control and information display of intranet devices are realized, and real-time data interaction is used to overcome the scalability limitations of the SIP protocol.
It significantly improves the accessibility and scalability of intranet devices, realizes real-time data interaction between internal and external network devices, and reduces network operation and maintenance costs.
Smart Images

Figure CN119835256A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of video monitoring, and in particular relates to a high-efficiency internal and external network remote control method based on SIP protocol and WebSocket communication protocol. Background Art
[0002] In the field of video surveillance, the standard Session Initiation Protocol (SIP) has shown excellent performance in accessing and controlling GB28181 devices. However, a major limitation of the SIP protocol is its lack of scalability, which is limited to accessing devices that meet specific standards. Summary of the invention
[0003] In view of the above problems, the present invention provides an efficient intranet and extranet remote control method based on the SIP protocol and the WebSocket communication protocol, which is used to realize extranet access, control and information display of intranet devices by integrating the SIP protocol with the WebSocket technology, solves the limitations of the traditional SIP protocol and HTTP request API interface, and significantly improves the accessibility and scalability of intranet devices.
[0004] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0005] An efficient intranet and extranet remote control method based on SIP protocol and WebSocket communication protocol comprises the following steps:
[0006] The stage of establishing a connection between the external network device and the internal network device: the internal network device actively initiates SIP registration to the external network SIP service of the external network device through the internal network SIP service, so that the external network device can obtain the IP address and port of the internal network device after NAT; the internal network device sends SIP heartbeats to the external network SIP service of the external network device at regular intervals through the internal network SIP service, so that the internal network device can always notify the external network device of the dynamic adjustment of the address and port; the external network device constructs a SIP request to the internal network device through the external network SIP service, carrying the required information and parameters;
[0007] Real-time data interaction stage between external network devices and internal network devices: the front-end page of the external network device assembles WebSocketJSON format commands and sends them to the server of the external network device; the server of the external network device parses the WebSocket command, assembles the data into SIP signaling, and forwards it to the internal network device; the internal network device intelligently receives and processes the SIP signaling, calls the internal network http service, and performs process business logic processing. The internal network device requests the HTTP interface of the external network device through HTTP callback to realize two-way data interaction.
[0008] In a possible implementation, the intranet device is an edge computing box; and the server end of the extranet device is a convergence platform server.
[0009] In a possible implementation manner, the User-Agent field is used to identify a device during SIP registration.
[0010] In a possible implementation manner, the intranet device adds a DeviceUniqueId field identifier when sending a SIP heartbeat to the extranet SIP service of the extranet device via the intranet SIP service at regular intervals.
[0011] In a possible implementation manner, when the external network device constructs a SIP request to the internal network device through the external network SIP service, the field "from" is included to identify the SIP request.
[0012] The present invention has the following beneficial effects: it overcomes some limitations of the standard SIP protocol and uses WebSockets technology to make communication more real-time and efficient. Without changing the network structure, the intranet device can be easily accessed by the external network, saving the cost of network operation and maintenance. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 A flowchart of the steps of an efficient intranet and extranet remote control method based on the SIP protocol and the WebSocket communication protocol according to an embodiment of the present invention;
[0014] Figure 2 A schematic diagram of the construction of internal and external network devices in one embodiment of the present invention;
[0015] Figure 3 The present invention is a schematic diagram of equipment construction in a highly efficient intranet and extranet remote control method based on the SIP protocol and the WebSocket communication protocol in a specific application example of the present invention. DETAILED DESCRIPTION
[0016] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0017] Reference Figure 1 , which is a flowchart of a method for efficient remote control of an intranet and an extranet based on the SIP protocol and the WebSocket communication protocol according to an embodiment of the present invention, comprising the following steps:
[0018] S10, the stage of establishing a connection between the external network device and the internal network device: the internal network device actively initiates SIP registration to the external network SIP service of the external network device through the internal network SIP service, so that the external network device can obtain the IP address and port of the internal network device after NAT; the internal network device sends SIP heartbeats to the external network SIP service of the external network device at regular intervals through the internal network SIP service, so that the internal network device can always notify the external network device of the dynamic adjustment of the address and port; the external network device constructs a SIP request to the internal network device through the external network SIP service, carrying the required information and parameters;
[0019] S20, real-time data interaction stage between external network devices and internal network devices: the front-end page of the external network device assembles WebSocket JSON format commands and sends them to the server of the external network device (i.e., the external network http service); the server of the external network device parses the WebSocket command, assembles the data into SIP signaling, and forwards it to the internal network device; the internal network device intelligently receives and processes the SIP signaling, calls the internal network http service, and performs process business logic processing. The internal network device requests the HTTP interface of the external network device through HTTP callback to realize two-way data interaction.
[0020] Specifically, in this process, the intranet device actively initiates an HTTP request, and the external network device receives and processes the data and returns the result to the intranet device. In order to ensure the real-time and accuracy of the data, both parties agree on a unified communication protocol and data format, and handle the serialization and deserialization of the data. At the same time, considering the security of the data transmission process, authentication mechanisms (such as Token verification) and encryption technologies (such as HTTPS) are used to ensure the secure transmission of data.
[0021] For further procedures, see Figure 2 As shown, the User-Agent field is used to identify the device during SIP registration. In a specific example, after successful registration, the content of the SIP 200OK reply is as follows:
[0022] {"httpPort":80,"httpIp":"101.xxx.xxx.xxx"}
[0023] When the intranet device sends SIP heartbeats to the extranet device's extranet SIP service periodically through the intranet SIP service, the DeviceUniqueId field identifier is added to maintain the connectivity of the NAT link, because dynamic NAT may cause the NAT address and port of the intranet device to change.
[0024] When an external network device constructs a SIP request to an internal network device through an external network SIP service, the field "from" is included to identify the SIP request.
[0025] In specific application examples, such as Figure 3As shown in the figure, the intranet device can be an edge computing box; the server of the extranet device can be a convergence platform server. Based on the SIP protocol and callback mechanism, it provides powerful functional operation capabilities for the convergence platform of the extranet. Through this connection method, the extranet platform can easily implement multiple operations on the edge computing box, including core functions such as real-time video preview, channel information acquisition, and upgrade and restart of the edge computing box. These functions ensure the stability and efficiency of the system in various environments by processing video streams in real time, dynamically acquiring device channel status information, and remotely controlling edge computing devices for software upgrades and restarts. The real-time video preview function not only ensures that the system can display and analyze video source data in real time, but also responds quickly when an abnormality occurs, improving monitoring and security capabilities. The channel information acquisition function provides comprehensive monitoring of key data such as device status and network performance, enabling system administrators to quickly locate problems, reduce downtime, and optimize resource allocation. Remote upgrade and restart of the edge computing box ensures that the device is always in the latest and optimal operating state, avoiding manual intervention and improving maintenance efficiency. The synergy of these functions not only improves the automation and intelligence level of the system, but also significantly reduces operation and maintenance costs, ensuring the stable operation and continuous optimization of the system in complex scenarios.
[0026] It should be understood that the exemplary embodiments described herein are illustrative rather than restrictive. Although one or more embodiments of the present invention have been described in conjunction with the accompanying drawings, it should be understood by those skilled in the art that various changes in form and detail may be made without departing from the spirit and scope of the present invention as defined by the appended claims.
Claims
1. An efficient intranet and extranet remote control method based on SIP protocol and WebSocket communication protocol, characterized in that: The following steps are involved: The stage of establishing a connection between the external network device and the internal network device: the internal network device actively initiates SIP registration to the external network SIP service of the external network device through the internal network SIP service, so that the external network device can obtain the IP address and port of the internal network device after NAT; The intranet device sends SIP heartbeats to the external network device's external network SIP service at regular intervals through the intranet SIP service, which is used for the intranet device to constantly notify the external network device of the dynamic adjustment of the address and port; The external network device constructs a SIP request to the internal network device through the external network SIP service, carrying the required information and parameters; Real-time data interaction stage between external network devices and internal network devices: the front-end page of the external network device assembles WebSocket JSON format commands and sends them to the server of the external network device; the server of the external network device parses the WebSocket command, assembles the data into SIP signaling, and forwards it to the internal network device; The intranet device intelligently receives and processes SIP signaling, calls the intranet http service, and performs process business logic processing. The intranet device requests the HTTP interface of the external network device through HTTP callback to achieve two-way data interaction.
2. The efficient intranet and extranet remote control method based on SIP protocol and WebSocket communication protocol as claimed in claim 1, characterized in that: The intranet device is an edge computing box; the server end of the extranet device is a convergence platform server.
3. The efficient intranet and extranet remote control method based on SIP protocol and WebSocket communication protocol as claimed in claim 2, characterized in that: The User-Agent field during SIP registration is used to identify the device.
4. The efficient intranet and extranet remote control method based on SIP protocol and WebSocket communication protocol as claimed in claim 2, characterized in that: When the intranet device sends SIP heartbeats to the extranet SIP service of the extranet device through the intranet SIP service at regular intervals, the DeviceUniqueId field identifier is added.
5. The efficient intranet and extranet remote control method based on SIP protocol and WebSocket communication protocol as claimed in claim 2, characterized in that: When an external network device constructs a SIP request to an internal network device through an external network SIP service, the field "from" is included to identify the SIP request.
Citation Information
Patent Citations
Intranet and extranet intercommunication method and device based on SIP protocol, equipment and storage medium
CN113489717A
Method and system for accessing intranet by extranet
CN116192813A
Video call method based on traffic-free network
CN117411991A
HTTP interaction method and system based on WebSocket protocol
CN118055105A
Method and system for providing registration-based SIP NAT traversal
US7411917B1