RTMP one-way proxy method, system and device based on one-way import device and medium
By introducing an RTMP one-way proxy system and method based on one-way import devices, the transmission bottleneck problem of VPN and RTMP protocols in scenarios with strict restrictions on one-way data flow is solved. This achieves one-way encapsulated data transmission and security assurance, and is suitable for fields such as live video streaming and enterprise-level real-time interaction.
Patent Information
- Application Number
- CN202511811914.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-04
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2045-12-04
AI Technical Summary
In scenarios where unidirectional data flow is strictly restricted, existing technologies require VPNs to establish tunnels through bidirectional communication. The RTMP protocol handshake process also relies on bidirectional transmission, which leads to the problem that internet camera data cannot enter the intranet for on-demand use through a unidirectional channel.
An RTMP one-way proxy system and method based on one-way import devices are adopted. Through the collaborative design of the streaming media service relay module and the one-way sending program, the one-way encapsulation and transmission of data streams is realized, avoiding the bidirectional communication requirement of the handshake phase of the traditional RTMP protocol. The simulated terminal subscription module actively pulls the data stream from the external network streaming media server, and performs one-way encapsulation through the one-way sending program. Finally, the simulated terminal publishing module on the internal network pushes the data to the internal network RTMP streaming media server.
It achieves seamless one-way proxy of the RTMP protocol, meets the security requirements of strict one-way data flow scenarios, ensures the transmission characteristic of data only entering and not exiting, is applicable to all current mainstream scenarios, requires no modification to the existing deployment topology, and is imperceptible to users.
Smart Images

Figure CN121239742A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the technical field of RTMP one-way proxy, in particular to an RTMP one-way proxy method, system, device and medium based on one-way import equipment. BACKGROUND
[0002] RTMP (Real-Time Messaging Protocol) protocol is currently widely used in live streaming, security monitoring, enterprise-level real-time interaction and other fields, and its core advantages are low delay, high stability and mature ecology. With the continuous improvement of informatization level of various units, higher security requirements are put forward for data entering and exiting the network, but at the same time, the convenience of daily use cannot be reduced.
[0003] Most units have the demand of accessing the Internet from the work intranet. In the scenario of allowing direct access to the Internet, users usually use the client to directly access Internet resources. Some units require the construction of a special streaming media service, and the streaming media server is built in the work intranet. The camera or recorder uses VPN (Virtual Private Network) technology to realize the connection between the streaming media server. By configuring the VPN connection, the Internet user uses the RTMP streaming client to push the video stream to the work intranet streaming media server through the VPN tunnel, and the work intranet user uses the RTMP player client to access the media stream pushed on the streaming media server, realizing the access to Internet video live streaming resources, and at the same time, ensuring a certain degree of security.
[0004] However, there are some units that require data from the Internet to enter the work intranet only to allow entry and not to allow any data to be output in the opposite direction, while also requiring the realization of Internet camera or recorder live video data to be on-demand in the office network, realizing the availability of office network to Internet video live data. However, the establishment of the existing VPN tunnel requires bidirectional data transmission, and the RTMP protocol also requires bidirectional transmission to establish a connection. In the scene of strictly limiting the unidirectional flow of data, the existing technology cannot be used and there is no means to avoid it, which is a fatal defect and cannot complete this task. SUMMARY
[0005] The application provides an RTMP one-way proxy method, system, device and medium based on one-way import equipment to solve the problem that the existing scheme cannot be used in the scene of strictly limiting the unidirectional flow of data (only allowing Internet to transmit to the intranet). The traditional scheme faces a fundamental contradiction: VPN needs bidirectional communication to establish a tunnel, and the RTMP protocol handshake process also depends on bidirectional transmission. The existing technology cannot avoid this defect, resulting in the problem that Internet camera data cannot enter the intranet through a one-way channel for on-demand use.
[0006] In a first aspect, the application provides an RTMP one-way proxy system based on a one-way import device, the system comprising: an RTMP publishing mode and an RTMP subscription mode; The RTMP publishing mode comprises: a stream media service relay module connected to the RTMP push streaming terminal device A, a one-way sending program connected to the stream media service relay module, a one-way receiving program connected to the one-way sending program through a one-way isolated transmission channel, and an analog terminal publishing module connected to the one-way receiving program. The one-way sending program is deployed in an external network unit of the one-way import device, the one-way receiving program is deployed in an internal network unit of the one-way import device, the stream media service relay module is independently deployed in the external network unit of the one-way import device or an Internet side, the analog terminal publishing module is independently deployed in the internal network unit of the one-way import device or a working internal network side, and the analog terminal publishing module is connected to an internal network RTMP stream media server. The RTMP subscription mode comprises: an analog terminal subscription module connected to a subscribed external network RTMP stream media server, a one-way sending program connected to the analog terminal subscription module, a one-way receiving program connected to the one-way sending program through a one-way isolated transmission channel, and an analog terminal publishing module connected to the one-way receiving program. The analog terminal subscription module is independently deployed in the external network unit of the one-way import device or the Internet side.
[0007] In an implementation manner of the application, the analog terminal publishing module publishing a video is connected to the internal network RTMP stream media server, and the internal network RTMP stream media server is connected to a play client subscribing to a video.
[0008] In an implementation manner of the application, the RTMP push streaming terminal device A comprises a camera and a recorder.
[0009] In an implementation manner of the application, the subscribed external network RTMP stream media server is connected to an external RTMP push streaming terminal device B.
[0010] In a second aspect, the application provides an RTMP one-way proxy method based on a one-way import device, applied to an RTMP one-way proxy system based on a one-way import device, the method comprising: In the RTMP publishing mode: receiving, by the stream media service relay module, original stream media data collected by the RTMP push streaming terminal device A, obtaining, by the stream media service relay module, stream media data stripped of an original protocol, encapsulating the stream media data according to a private communication protocol of the one-way import device, and sending the encapsulated stream media data to the one-way sending program. In the RTMP subscription mode: The analog terminal subscription module obtains the subscribed original streaming media data from the subscribed external network RTMP streaming media server; The analog terminal subscription module obtains the streaming media data stripped of the original protocol, encapsulates the streaming media data according to the private communication protocol of the one-way import device, and sends the encapsulated streaming media data to the one-way sending program; RTMP publishing mode or RTMP subscription mode, after sending the encapsulated streaming media data to the one-way sending program, The one-way sending program strips the private communication protocol of the encapsulated streaming media data, obtains the streaming media data, encapsulates the streaming media data, and sends the encapsulated streaming media data to the one-way receiving program; After the one-way receiving program receives the encapsulated streaming media data, it performs decryption and protocol recombination, and then forwards the recombined streaming media data to the analog terminal publishing module; the analog terminal publishing module sends the recombined streaming media data to the internal network RTMP streaming media server.
[0011] In an implementation manner of the present application, before the streaming media service relay module receives the original streaming media data collected by the RTMP push streaming end device A, the method further comprises: The RTMP push streaming end device A on the Internet side establishes a connection with the streaming media service relay module through handshaking, performs identity authentication, and interacts control signaling.
[0012] In an implementation manner of the present application, after the analog terminal publishing module sends the recombined streaming media data to the internal network RTMP streaming media server, the method further comprises: The internal network RTMP streaming media server sends the video to the subscribed playback client.
[0013] In an implementation manner of the present application, before the analog terminal subscription module obtains the subscribed original streaming media data from the subscribed external network RTMP streaming media server, the method further comprises: The RTMP push streaming end device B on the Internet side establishes a connection with the RTMP streaming media server on the Internet through handshaking, performs identity authentication, interacts control signaling, and publishes the video; The analog terminal subscription module establishes a connection with the RTMP streaming media server on the Internet through handshaking, performs identity authentication, interacts control signaling, and subscribes to the required on-demand video.
[0014] In a third aspect, the present application provides an RTMP one-way proxy device based on a one-way import device, comprising: a processor; and a memory having stored thereon executable code that, when executed, cause the processor to perform any one of the RTMP one-way proxy methods based on one-way import device as above.
[0015] In a fourth aspect, the present application provides a non-volatile computer storage medium having stored thereon computer instructions that, when executed, implement any one of the RTMP one-way proxy methods based on one-way import device as above.
[0016] From the above technical solutions, the present application has the following advantages: The present application realizes one-way encapsulation transmission of data stream in RTMP publishing mode through the cooperative design of the streaming media service relay module and the one-way sending program. After the streaming media service relay module receives the data of the RTMP push streaming end device, the one-way sending program encapsulates the data into a format supported by the one-way import device, and transmits the data to the one-way receiving program of the inner network unit through a physically isolated channel. This process completely avoids the two-way communication requirement in the handshake phase of the traditional RTMP protocol, so that the Internet camera data can enter the inner network in a one-way flow manner. In the RTMP subscription mode, the analog terminal subscription module actively pulls the data stream of the outer network streaming media server, and also encapsulates the data in a one-way manner through the one-way sending program, and finally the data is pushed to the inner network RTMP streaming media server by the analog terminal publishing module on the inner network side. This architecture design completely solves the one-way transmission bottleneck problem caused by the two-way communication in the handshake phase of the traditional scheme.
[0017] The present application has the beneficial effect of realizing seamless one-way proxy of the RTMP protocol through modular design. The dual-mode support of the streaming media service relay module and the analog terminal subscription module covers both the scenario of Internet camera actively publishing data and the scenario of inner network actively subscribing to the outer network streaming media server. The paired deployment of the one-way sending program and the one-way receiving program ensures the one-way transmission characteristics of the data in the physically isolated channel, and at the same time, through the protocol conversion function of the analog terminal publishing module, the inner network RTMP streaming media server can normally process the one-way imported data stream. This design not only retains the native functions of the RTMP protocol, but also meets the security requirements of the strict one-way data flow scenario through the physical isolation characteristics of the one-way channel.
[0018] Specifically, through the one-way import technology, only data import is realized, a more secure data transmission channel is provided, and the data security of the working inner network is ensured and will not be leaked to the devices on the Internet side.
[0019] By extracting the application layer streaming media data of the RTMP protocol, the RTMP and lower layer protocol data are stripped, and a private protocol and a one-way transmission channel are used to enter the working intranet, so that network attacks cannot be made from the RTMP and lower layer protocols, and the security of imported data is ensured.
[0020] The streaming media data is collected through the two modes of publishing and subscribing, and can be applied to all mainstream scenes at present, without the need to modify the existing deployed topology, and without the awareness of users of the video publishing end and the video playing end.
[0021] Through the RTMP publishing mode, the streaming media data of all legal video publishing terminals can be received, so as to realize the need of a large number of terminal access to the working intranet, and realize the real-time watching of all terminal published streaming media videos on the internet in the working intranet.
[0022] Through the RTMP subscription mode, the streaming media videos on the internet side can be subscribed on demand, and the working intranet users are strictly controlled, and the range of watchable streaming media videos of the working intranet users is limited.
[0023] The application composition modules are all independent software modules, which can be independently deployed on a server, or integrated and deployed on a one-way imported device, and have strong flexibility. BRIEF DESCRIPTION OF DRAWINGS
[0024] In order to more clearly illustrate the technical solutions of the present application, the drawings needed to be used in the description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.
[0025] Figure 1 is a kind of internal structure schematic diagram of RTMP one-way proxy system based on one-way imported device provided by the embodiment of the present application.
[0026] Figure 2 is a kind of integrated deployment RTMP publishing mode based on one-way imported device provided by the embodiment of the present application.
[0027] Figure 3 is a kind of independent deployment RTMP publishing mode based on one-way imported device provided by the embodiment of the present application.
[0028] Figure 4 is a kind of integrated deployment RTMP subscription mode based on one-way imported device provided by the embodiment of the present application.
[0029] Figure 5 is a kind of independent deployment RTMP subscription mode based on one-way imported device provided by the embodiment of the present application.
[0030] Figure 6 Figure 1 is a flow chart of a one-way proxy method of RTMP based on a one-way import device provided by an embodiment of the present application.
[0031] Figure 7 Figure 2 is a schematic diagram of an internal structure of a one-way proxy device of RTMP based on a one-way import device provided by an embodiment of the present application.
[0032] Main figure mark explanation 1, RTMP push stream end device A; 2, stream media service relay module; 3, one-way sending program; 4, one-way receiving program; 5, analog terminal publishing module; 6, intranet RTMP stream media server; 7, playing client; 8, RTMP push stream end device B; 9, extranet RTMP stream media server; 10, analog terminal subscribing module; 11, one-way import device. DETAILED DESCRIPTION
[0033] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts fall within the protection scope of the present application.
[0034] Those skilled in the art should understand that the embodiments described below are only preferred embodiments of the present disclosure, and do not mean that the present disclosure can only be implemented by the preferred embodiments. The preferred embodiments are only used to explain the technical principles of the present disclosure, and are not used to limit the protection scope of the present disclosure. Based on the preferred embodiments provided by the present disclosure, all other embodiments obtained by those skilled in the art without creative efforts still fall within the protection scope of the present disclosure.
[0035] It should also be noted that the terms "comprising", "including", or any other variant thereof are intended to cover non-exclusive inclusion, so that processes, methods, articles or devices including a series of elements not only include those elements, but also include other elements not explicitly listed, or further include elements inherent in such processes, methods, articles or devices. Without more limitations, the element defined by the statement "including a" does not exclude the presence of additional identical elements in the process, method, article or device including the element.
[0036] The technical solutions provided by the embodiments of the present application will be described in detail below with reference to the drawings.
[0037] As Figure 1As shown, the embodiment of the present application provides a one-way proxy system of RTMP based on one-way import equipment. The system provided by the embodiment of the present application mainly comprises: The stream media service relay module 2 is a service program which can be independently deployed in the outer network unit of the one-way import equipment 11 or the Internet side, is responsible for accessing the RTMP push streaming end device A1 such as a camera and a recorder, receiving the stream media data published by the RTMP push streaming end device A1, stripping the protocol of the stream media data, extracting the stream media data, and sending the stream media data to the one-way sending program 3 of the outer network unit of the one-way import equipment 11.
[0038] The analog terminal subscription module 10 is an analog terminal program which can be independently deployed in the outer network unit of the one-way import equipment 11 or the Internet side, is responsible for subscribing to live video from the outer network RTMP stream media server 9, receiving the stream media data sent by the RTMP push streaming end device B8 to the stream media server, and forwarding the stream media data to the one-way sending program 3 of the outer network unit.
[0039] The analog terminal publishing module 5 is an analog terminal program which can be independently deployed in the inner network unit of the one-way import equipment 11 or the working inner network side, is responsible for receiving the stream media data from the one-way receiving program 4, simulating the push streaming client to publish the stream media data to the inner network RTMP stream media server 6 of the working inner network.
[0040] Specifically, as shown in the figure, Figure 1 The system is divided into an RTMP publishing mode and an RTMP subscription mode; The RTMP publishing mode comprises: The stream media service relay module 2 connected with the RTMP push streaming end device A1 (as an example, the RTMP push streaming end device A1 comprises a camera and a recorder), the one-way sending program 3 connected with the stream media service relay module 2, the one-way receiving program 4 connected with the one-way sending program 3 through a one-way isolation transmission channel, and the analog terminal publishing module 5 connected with the one-way receiving program 4. The one-way sending program 3 is deployed in the outer network unit of the one-way import equipment 11, the one-way receiving program 4 is deployed in the inner network unit of the one-way import equipment 11, the stream media service relay module 2 is independently deployed in the outer network unit of the one-way import equipment 11 or the Internet side, the analog terminal publishing module 5 is independently deployed in the inner network unit of the one-way import equipment 11 or the working inner network side, the analog terminal publishing module 5 is connected with the inner network RTMP stream media server 6, the analog terminal publishing module 5 publishing video is connected with the inner network RTMP stream media server 6, and the inner network RTMP stream media server 6 is connected with the playback client 7 subscribing to video.
[0041] Further specifically, as shown in the figure, Figure 2As shown, the stream media service relay module 2 is independently deployed in the outer network unit of the one-way import device 11, and the simulation terminal publishing module 5 is independently deployed in the inner network unit of the one-way import device 11. Figure 2 As shown, the camera and the recorder correspond to the RTMP push stream end device A1, the one-way sending program 3 in the inner network unit is not shown, and the one-way receiving program 4 in the outer network unit is not shown. Figure 3 As shown, the stream media service relay module 2 is deployed on the Internet side, and the simulation terminal publishing module 5 is deployed on the working inner network side.
[0042] The RTMP subscription mode includes: The simulation terminal subscription module 10 connected with the subscribed outer network RTMP stream media server 9 (the subscribed outer network RTMP stream media server 9 is connected with the external RTMP push stream end device B8), the one-way sending program 3 connected with the simulation terminal subscription module 10, the one-way receiving program 4 connected with the one-way sending program 3 through the one-way isolation transmission channel, the simulation terminal publishing module 5 connected with the one-way receiving program 4; the simulation terminal publishing module 5 publishing the video is connected with the inner network RTMP stream media server 6, and the inner network RTMP stream media server 6 is connected with the video playing client 7 subscribing the video.
[0043] The simulation terminal subscription module 10 is independently deployed in the outer network unit of the one-way import device 11 or on the Internet side.
[0044] Further specifically, as shown, Figure 4 The simulation terminal subscription module 10 is independently deployed in the outer network unit of the one-way import device 11, and the simulation terminal publishing module 5 is independently deployed in the inner network unit of the one-way import device 11. Figure 4 As shown, the camera and the recorder correspond to the RTMP push stream end device B8, the one-way sending program 3 in the inner network unit is not shown, and the one-way receiving program 4 in the outer network unit is not shown. Figure 5 As shown, the simulation terminal subscription module 10 is deployed on the Internet side, and the simulation terminal publishing module 5 is deployed on the working inner network side.
[0045] Based on the above description, in the RTMP publishing mode, the original stream media data collected by the stream media service relay module 2 receives the stream media data collected by the stream media service relay module 2. The stream media data stripped of the original protocol is obtained by the stream media service relay module 2, and the stream media data is encapsulated according to the private communication protocol of the one-way import device 11. The encapsulated stream media data is sent to the one-way sending program 3. In the RTMP subscription mode: the analog terminal subscription module 10 obtains the subscribed original stream media data from the subscribed external network RTMP stream media server 9; the analog terminal subscription module 10 obtains the stream media data stripped of the original protocol, encapsulates the stream media data according to the private communication protocol of the one-way import device 11, and sends the encapsulated stream media data to the one-way sending program 3. In the RTMP publishing mode or the RTMP subscription mode, after the encapsulated stream media data is sent to the one-way sending program 3, the encapsulated stream media data is stripped of the private communication protocol by the one-way sending program 3, the stream media data is obtained, the stream media data is encapsulated, and the stream media data is sent to the one-way receiving program 4; after the one-way receiving program 4 receives the encapsulated stream media data, the stream media data is decrypted and protocol recombined, and then forwarded to the analog terminal publishing module 5; the analog terminal publishing module 5 sends the recombined stream media data to the internal network RTMP stream media server 6.
[0046] The application realizes one-way encapsulation transmission of data stream in the RTMP publishing mode through the cooperative design of the stream media service relay module 2 and the one-way sending program 3. After the stream media service relay module 2 receives the data of the RTMP stream pushing end device, the data is encapsulated into a format supported by the one-way import device 11 by the one-way sending program 3, and is transmitted to the one-way receiving program 4 of the internal network unit through a physically isolated channel. This process completely avoids the two-way communication requirement in the handshake phase of the traditional RTMP protocol, so that the Internet camera data can enter the internal network in a one-way flow manner. In the RTMP subscription mode, the analog terminal subscription module 10 actively pulls the data stream of the external network stream media server, and also performs one-way encapsulation through the one-way sending program 3, and finally the data is pushed to the internal network RTMP stream media server 6 by the analog terminal publishing module 5 on the internal network side. This architecture design completely solves the one-way transmission bottleneck problem caused by the two-way communication in the handshake phase of the traditional scheme.
[0047] The beneficial effects of the present application are that it realizes seamless one-way proxy of the RTMP protocol through modular design. The dual-mode support of the stream media service relay module 2 and the analog terminal subscription module 10 covers both the scene of the Internet camera actively publishing data and the scene of the intranet actively subscribing to the extranet stream media server. The paired deployment of the one-way sending program 3 and the one-way receiving program 4 ensures the one-way transmission characteristics of the data in the physically isolated channel, and at the same time, through the protocol conversion function of the analog terminal publishing module 5, the intranet RTMP stream media server 6 can normally process the one-way imported data stream. This design not only retains the native function of the RTMP protocol, but also meets the security requirements of the strictly one-way data flow scene through the physical isolation characteristics of the one-way channel.
[0048] In addition, the embodiment provides a one-way proxy method of RTMP based on a one-way import device, as shown in the figure, the method provided by the embodiment of the present application mainly includes the following steps: Figure 6 The method provided by the embodiment of the present application mainly includes the following steps: Step 110, in the RTMP publishing mode: receiving the original stream media data collected by the RTMP push terminal device A through the stream media service relay module; obtaining the stream media data stripped of the original protocol through the stream media service relay module, encapsulating the stream media data according to the private communication protocol of the one-way import device, and sending the encapsulated stream media data to the one-way sending program.
[0049] In some embodiments, before receiving the original stream media data collected by the RTMP push terminal device A through the stream media service relay module, the method further includes: The RTMP push terminal device A on the Internet side (camera, recorder and the like on the Internet side) establishes a connection with the stream media service relay module through handshaking, performs identity authentication and interacts with control signaling.
[0050] Before sending the encapsulated stream media data to the one-way sending program in step 110, it can be specifically: Step S11: the camera, recorder and the like on the Internet side establish a connection with the stream media service relay module through handshaking, perform identity authentication and interact with control signaling; Step S12: the RTMP stream media service relay module receives the stream media data pushed by the camera, recorder and the like and containing the original protocol, and strips the original protocol to extract only the stream media data; Step S13: the RTMP stream media service relay module encapsulates the stream media data according to the private communication protocol of the one-way import device, and sends it to the one-way sending program of the one-way import device on the extranet.
[0051] After sending the encapsulated stream media data to the one-way sending program, the present application can include: Step S14: After the unidirectional sending program of the unidirectional import device outer network unit receives the streaming media data sent by the RTMP streaming media service relay module, the data is protocol stripped tcp, data encapsulation, and sent to the unidirectional receiving program of the inner network unit through the unidirectional isolation transmission channel; Step S15: After the unidirectional receiving program of the unidirectional import device receives the data sent by the unidirectional sending program of the outer network unit, the data is unpacked and reorganized into a private protocol, and forwarded to the analog terminal publishing module; Step S16: The analog terminal publishing module registers and authenticates with the RTMP streaming media server of the working inner network, and completes the RTMP protocol handshake to establish a connection; Step S17: After the analog terminal publishing module receives the streaming media private protocol data sent by the unidirectional receiving program of the unidirectional import device, the streaming media data is extracted and reorganized into an RTMP protocol, and the streaming media data of the RTMP protocol is published to the inner network RTMP streaming media server of the working inner network.
[0052] Step S18: Users of the working inner network can use a playback client (RTMP player) to subscribe to the video content of the working inner network RTMP streaming media server, and realize playback of the video content on the Internet side.
[0053] Step 120, in the RTMP subscription mode: the analog terminal subscription module obtains the subscribed original streaming media data from the subscribed outer network RTMP streaming media server; the analog terminal subscription module obtains the streaming media data stripped of the original protocol, encapsulates the streaming media data according to the private communication protocol of the unidirectional import device, and sends the encapsulated streaming media data to the unidirectional sending program.
[0054] Before the analog terminal subscription module obtains the subscribed original streaming media data from the subscribed outer network RTMP streaming media server, the method further includes: The RTMP push stream end device B on the Internet side establishes a connection with the RTMP streaming media server on the Internet through a handshake, performs identity authentication, interacts with control signaling, and publishes a video. The analog terminal subscription module establishes a connection with the RTMP streaming media server on the Internet through a handshake, performs identity authentication, interacts with control signaling, and subscribes to the required on-demand video.
[0055] Before the encapsulated streaming media data is sent to the unidirectional sending program in step 120, it can be specifically: Step S21: The camera, recorder and other devices (RTMP push stream end device B) on the Internet side establish a connection with the RTMP streaming media server on the Internet through a handshake, perform identity authentication, interact with control signaling, and publish a video. Step S22: The analog terminal subscription module establishes a connection with the external network RTMP streaming media server on the Internet through handshaking, performs identity authentication and control signaling interaction, and subscribes to the required on-demand video. Step S22: The analog terminal subscription module receives the original streaming media data published by the camera, recorder and other devices (RTMP push stream device B) from the external network RTMP streaming media server on the Internet, and strips the original RTMP protocol to extract only the streaming media data. Step S23: The analog terminal subscription module encapsulates the streaming media data according to the private communication protocol of the one-way import device and sends it to the one-way sending program of the external network of the one-way import device.
[0056] In step 120, after the encapsulated streaming media data is sent to the one-way sending program, the application can include: Step S24: After the one-way sending program of the external network unit of the one-way import device receives the streaming media data sent by the analog terminal subscription module, it performs protocol stripping and data encapsulation on the data and sends it to the one-way receiving program of the internal network unit through the one-way isolated transmission channel. Step S25: After the one-way receiving program of the one-way import device receives the data sent by the one-way sending program of the external network unit, it performs decryption and private protocol reorganization on the data and forwards it to the analog terminal publishing module. Step S26: The analog terminal publishing module registers and authenticates with the RTMP streaming media server in the working internal network, and completes the RTMP protocol handshaking to establish a connection. Step S27: After the analog terminal publishing module receives the streaming media private protocol data sent by the one-way receiving program of the one-way import device, it extracts the streaming media data, performs RTMP protocol reorganization, and publishes the RTMP protocol streaming media data to the internal network RTMP streaming media server in the working internal network.
[0057] Step S28: The user in the working internal network can use a playback client (RTMP player) to subscribe to the video content of the RTMP streaming media server in the working internal network, and realize playing the video content on the Internet side.
[0058] Step 130, RTMP publishing mode or RTMP subscription mode, after sending the encapsulated streaming media data to the one-way sending program, the one-way sending program performs private communication protocol stripping on the encapsulated streaming media data to obtain the streaming media data, encapsulates the streaming media data, and sends it to the one-way receiving program; after the one-way receiving program receives the encapsulated streaming media data, it performs decryption and protocol reorganization, and then forwards it to the analog terminal publishing module; the analog terminal publishing module sends the reorganized streaming media data to the internal network RTMP streaming media server.
[0059] In some embodiments, after the simulated terminal publishing module sends the reconstructed streaming media data to the intranet RTMP streaming media server, the method further includes: The internal RTMP streaming media server sends the video to the subscribed playback clients.
[0060] Based on the above description, step 130 can be specifically described as follows: Step S31: After receiving the streaming media data sent by the analog terminal subscription module, the one-way sending program of the one-way import device external network unit performs protocol stripping and data encapsulation on the data, and sends it to the one-way receiving program of the internal network unit through the one-way isolated transmission channel. Step S32: After receiving the data sent by the one-way sending program of the external network unit, the one-way receiving program of the one-way import device decapsulates the data, reassembles the private protocol, and forwards it to the simulated terminal publishing module. Step S33: The simulated terminal publishing module registers and authenticates with the RTMP streaming media server on the intranet, and completes the RTMP protocol handshake to establish a connection.
[0061] Step S34: After receiving the private streaming media protocol data sent by the one-way receiving program of the one-way import device, the simulated terminal publishing module extracts the streaming media data, performs RTMP protocol reassembly, and publishes the RTMP protocol streaming media data to the intranet RTMP streaming media server on the work intranet.
[0062] Step S35: Intranet users can use a playback client (RTMP player) to subscribe to video content from the intranet RTMP streaming media server and play video content from the internet.
[0063] As described above, this embodiment achieves unidirectional encapsulation and transmission of data streams in RTMP publishing mode through the collaborative design of the streaming media service relay module and the one-way sending program. After receiving data from the RTMP push-end device, the streaming media service relay module encapsulates the data into a format supported by the one-way import device and transmits it to the one-way receiving program of the intranet unit through a physically isolated channel. This process completely avoids the bidirectional communication requirement of the traditional RTMP protocol handshake phase, enabling internet camera data to enter the intranet in a unidirectional flow. In RTMP subscription mode, the simulated terminal subscription module actively pulls the data stream from the external streaming media server, also performs unidirectional encapsulation through the one-way sending program, and finally pushes the data to the intranet RTMP streaming media server by the simulated terminal publishing module on the intranet side. This architecture design completely solves the unidirectional transmission bottleneck problem caused by the reliance on bidirectional communication for protocol handshake in traditional solutions.
[0064] A modular design enables seamless one-way proxying of the RTMP protocol. Dual-mode support for the streaming media service relay module and the analog terminal subscription module covers both scenarios where internet cameras actively publish data and scenarios where internal networks actively subscribe to external streaming media servers. The paired deployment of one-way sending and receiving programs ensures the one-way transmission characteristic of data in physically isolated channels. Simultaneously, the protocol conversion function of the analog terminal publishing module enables internal RTMP streaming media servers to properly handle one-way imported data streams. This design not only retains the native functionality of the RTMP protocol but also meets the security requirements of scenarios with strict one-way data flow through the physical isolation of the one-way channel.
[0065] The above are method embodiments of this application. Based on the same inventive concept, this application also provides an RTMP one-way proxy device based on a one-way import device. Figure 7 As shown, the device includes: a processor; and a memory storing executable code, which, when executed, causes the processor to perform an RTMP one-way proxy method based on a one-way import device as described in the above embodiment.
[0066] Specifically, on the server side, in RTMP publishing mode: the server receives raw streaming media data collected by RTMP push device A through the streaming media service relay module; the server obtains streaming media data stripped of the original protocol through the streaming media service relay module, encapsulates the streaming media data according to the private communication protocol of the one-way import device, and sends the encapsulated streaming media data to the one-way sending program; in RTMP subscription mode: the server obtains subscribed raw streaming media data from the subscribed external RTMP streaming media server through the simulated terminal subscription module; the server obtains streaming media data stripped of the original protocol through the simulated terminal subscription module, encapsulates the streaming media data according to the private communication protocol of the one-way import device, and sends the encapsulated streaming media data to the one-way sending program; in either RTMP publishing or RTMP subscription mode, after sending the encapsulated streaming media data to the one-way sending program, the one-way sending program strips the private communication protocol from the encapsulated streaming media data to obtain streaming media data, encapsulates the streaming media data, and sends it to the one-way receiving program; the one-way receiving program receives the encapsulated streaming media data, decapsulates and reassembles the protocol, and then forwards it to the simulated terminal publishing module; the simulated terminal publishing module sends the reassembled streaming media data to the internal RTMP streaming media server.
[0067] In addition, embodiments of this application also provide a non-volatile computer storage medium storing executable instructions, which, when executed, implement the RTMP one-way proxy method based on a one-way import device as described above.
[0068] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A one-way proxy system based on a one-way import device RTMP, characterized in that, The system comprises: RTMP publishing mode and RTMP subscription mode; The RTMP publishing mode comprises: A stream media service relay module connected with the RTMP push streaming terminal device A, a one-way sending program connected with the stream media service relay module, a one-way receiving program connected with the one-way sending program through a one-way isolation transmission channel, and an analog terminal publishing module connected with the one-way receiving program; The one-way sending program is deployed in an external network unit of the one-way import device, the one-way receiving program is deployed in an internal network unit of the one-way import device, the stream media service relay module is independently deployed in the external network unit of the one-way import device or an Internet side, the analog terminal publishing module is independently deployed in the internal network unit of the one-way import device or a working internal network side, and the analog terminal publishing module is connected with an internal network RTMP stream media server; The RTMP subscription mode comprises: An analog terminal subscription module connected with a subscribed external network RTMP stream media server, a one-way sending program connected with the analog terminal subscription module, a one-way receiving program connected with the one-way sending program through a one-way isolation transmission channel, and an analog terminal publishing module connected with the one-way receiving program; The analog terminal subscription module is independently deployed in the external network unit of the one-way import device or the Internet side.
2. The one-way import device-based RTMP one-way proxy system according to claim 1, wherein The analog terminal publishing module publishing a video is connected with the internal network RTMP stream media server, and the internal network RTMP stream media server is connected with a playing client subscribing a video.
3. The RTMP unidirectional proxy system based on unidirectional import device according to claim 1, wherein, The RTMP push streaming terminal device A comprises a camera and a recorder.
4. The one-way import device-based RTMP one-way proxy system according to claim 1, wherein The subscribed external network RTMP stream media server is connected with an external RTMP push streaming terminal device B.
5. A method for RTMP unidirectional proxy based on unidirectional propagation equipment, applied to the RTMP unidirectional proxy system based on unidirectional propagation equipment in claim 1, characterized in that, The method comprises: In the RTMP publishing mode: receiving original stream media data collected by the RTMP push streaming terminal device A through the stream media service relay module; obtaining stream media data stripped of an original protocol through the stream media service relay module, encapsulating the stream media data according to a private communication protocol of the one-way import device, and sending the encapsulated stream media data to the one-way sending program; In the RTMP subscription mode: obtaining subscribed original stream media data from the subscribed external network RTMP stream media server through the analog terminal subscription module; obtaining stream media data stripped of an original protocol through the analog terminal subscription module, encapsulating the stream media data according to a private communication protocol of the one-way import device, and sending the encapsulated stream media data to the one-way sending program; RTMP publishing mode or RTMP subscription mode, after sending the encapsulated stream media data to the one-way sending program, the encapsulated stream media data is stripped of the private communication protocol by the one-way sending program to obtain the stream media data, the stream media data is encapsulated and sent to the one-way receiving program; after the one-way receiving program receives the encapsulated stream media data, the stream media data is decrypted and protocol recombined, and then forwarded to the analog terminal publishing module; the analog terminal publishing module sends the recombined stream media data to the intranet RTMP stream media server.
6. The RTMP unidirectional proxy method based on unidirectional import device according to claim 5, characterized in that, Before receiving the original stream media data collected by the RTMP push streaming end device A through the stream media service relay module, the method further comprises: The RTMP push streaming end device A on the Internet side establishes a connection with the stream media service relay module through handshaking, performs identity authentication and control signaling interaction.
7. The RTMP unidirectional proxy method based on unidirectional import device according to claim 5, wherein, After the analog terminal publishing module sends the recombined stream media data to the intranet RTMP stream media server, the method further comprises: The intranet RTMP stream media server sends the video to the subscribed playback client.
8. The RTMP unidirectional proxy method based on unidirectional import device according to claim 5, characterized in that, Before obtaining the subscribed original stream media data from the subscribed extranet RTMP stream media server through the analog terminal subscription module, the method further comprises: The RTMP push streaming end device B on the Internet side establishes a connection with the RTMP stream media server on the Internet through handshaking, performs identity authentication, control signaling interaction and video publishing; The analog terminal subscription module establishes a connection with the RTMP stream media server on the Internet through handshaking, performs identity authentication, control signaling interaction and subscribes to the required on-demand video.
9. A unidirectional proxy device for RTMP based on a unidirectional import device, characterized in that, The device comprises: a processor; and a memory having executable code stored thereon, which, when executed, causes the processor to perform a one-way agent method for RTMP based on a one-way import device according to any one of claims 5-8.
10. A non-transitory computer storage medium, comprising, having computer instructions stored thereon, which, when executed, implement a one-way agent method for RTMP based on a one-way import device according to any one of claims 5-8.
Citation Information
Patent Citations
One-way data transmission method and system of intranet and extranet
CN107070907A
Video stream one-way import system and method based on multicast proxy technology
CN116033237A
Media data transmission method and device, electronic equipment, storage medium and system
CN116389106A
Internal and external network data one-way communication method and system based on physical isolation
CN118921202A
Double unidirectional optical gate system based data transmission methods and apparatuses, device and medium
WO2024113459A1
