Transmission method and device based on network environment self-adaption and storage medium
By adopting the network environment-based adaptive transmission method in cloud desktop/cloud PC technology, dynamically selecting the optimal transmission path is solved, and the problem of poor media streaming quality in complex network environments is achieved, and efficient and stable media streaming is achieved.
Patent Information
- Application Number
- CN202510095252.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-21
- Publication Date
- 2025-02-28
AI Technical Summary
Existing cloud desktop/cloud PC technologies are difficult to ensure the quality of media streaming in complex and diverse network environments, especially in 5G, WiFi, wired network hybrid environments or multi-level NAT connections, which have problems such as large latency, lag in picture, low connection stability and degraded system performance.
A transmission method based on network environment is proposed. Through the combination of cloud PC server, switching equipment, virtual private gateway (VPN) and user terminals, a variety of transmission strategies such as direct link, point-to-point transmission hole-punch service component (P2P), media transit service component (Trans) and VPN tunnel are adopted to dynamically select the optimal link according to the network environment to achieve efficient transmission of media streams.
By adaptively selecting the transmission path, high-quality and efficient transmission of media streams in complex network environments is achieved, transmission delay is reduced, connection success rate and system performance are improved, and rapid connection under different network conditions is supported.
Smart Images

Figure CN119544686A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of streaming media transmission, and in particular to a transmission method, device and storage medium based on network environment adaptation. Background Art
[0002] Currently, cloud desktop / cloud PC technology is widely used for high-fidelity, low-latency operations using remote desktops, especially for scenarios that require high-definition video conferencing, remote design, and other real-time interactive scenarios such as remote office and virtual desktop environments, where media stream (such as audio and video) transmission is an important part of the user experience. However, the complex and diverse network environment leads to the following problems when the network fluctuates: large delay in media stream transmission, severe screen freezes, low connection success rate in cross-network scenarios, easy disconnection when switching networks; system performance decreases significantly when multiple users are concurrent. The adaptive ability of traditional technologies is limited, and it is difficult to ensure the transmission quality in multiple network scenarios, especially in a mixed environment of 5G, WiFi, and wired networks or in a multi-level NAT series connection, the stability is further reduced. The media transmission technology of typical cloud desktops relies on protocols such as RDP, HDX or PCoIP, and usually uses fixed network paths for transmission, which has the following limitations: fixed transmission paths lack flexibility, a single protocol is difficult to adapt to complex network environments, centralized deployment leads to high bandwidth costs, lack of intelligent path selection mechanism, and security and reliability are difficult to guarantee. Summary of the invention
[0003] The present invention provides a transmission method, device and storage medium based on network environment adaptation, aiming to solve at least one of the technical problems existing in the prior art.
[0004] The technical solution of the present invention is a transmission method based on network environment adaptation. The transmission method based on network environment adaptation is applied to a transmission device based on network environment adaptation. The transmission device based on network environment adaptation includes: a cloud PC server, wherein a computing blade for providing computing services is arranged in the cloud PC server; a switching device, wherein the switching device includes a combination of one or more of a switch, a router and a bridge, wherein the cloud PC server is electrically connected to the switching device; a virtual private gateway (VPN), wherein the virtual private gateway (VPN) includes at least an intranet network card (PrivateItf) and a public network card (PublicItf) connected in sequence, wherein the switching device is connected to the intranet network card (PrivateItf); and a user terminal (Terminal), wherein the user terminal (Terminal) is connected to the public network card (PublicItf). The transmission method based on network environment adaptation includes the following steps: S100: If the user terminal (Terminal) is in the intranet and is in the same network level as the cloud PC server, the user terminal (Terminal) attempts to establish a direct connection with the cloud PC server; S200, if the user terminal (Terminal) is in the intranet, but is not in the same level network as the cloud PC server, the user terminal (Terminal) attempts to establish a connection with the cloud PC server through the point-to-point transmission hole punching service component (P2P), and if unsuccessful, establishes a connection with the cloud PC server through the media transfer service component (Trans); S300, if the user terminal (Terminal) is in the external network, the virtual private gateway (VPN) connected to the user terminal (Terminal) and the cloud PC server are in the same level network, the user terminal (Terminal) directly connects to the IP address of the cloud PC server through dial-up connection to the corresponding virtual private gateway (VPN), thereby realizing direct connection of media streams; S400, if the user terminal (Terminal) is in the external network, but the virtual private gateway (VPN) connected to the user terminal (Terminal) and the cloud PC server are not in the same level network, the user terminal (Terminal) connects to the virtual private gateway (VPN) through dial-up, and the virtual private gateway (VPN) attempts to establish a connection with the cloud PC server through the point-to-point transmission hole punching service component (P2P). If it fails, it establishes a connection with the cloud PC server through the media transfer service component (Trans).
[0005] Further, the step S100 includes the following steps: S110, the user terminal (Terminal) obtains the IP address of the cloud PC server by broadcasting or querying the local area network; S120, detecting whether the network delay and bandwidth of the local area network meet the preset maximum first response time condition and the preset minimum bandwidth condition; S130: If the longest first response time condition and the lowest bandwidth condition are met, select and record the direct link connection mode; S140, connection establishment: The user terminal (Terminal) negotiates the direct link path with the cloud PC server by sending signaling. After the negotiation is completed, the cloud PC server returns a confirmation signaling to establish a UDP / TCP direct link; S150. Continuously detect and record the health status of the UDP / TCP direct link at a preset time interval.
[0006] Further, the step S120 includes: S121, based on the Ping command of the ICMP protocol, obtain the first response time required for the data packet in the local area network to go from the user terminal (Terminal) to the cloud PC server and return to the user terminal (Terminal), and determine whether the first response time is less than the preset maximum first response time (Round-Trip Time, RTT) condition; S122. Testing whether the bandwidth of the local area network is greater than a preset minimum bandwidth condition by transmitting a test file.
[0007] Further, the step S200 includes: S210, confirming the network location of the user terminal (Terminal), the user terminal (Terminal) attempts to establish a direct connection with the cloud PC server through the Address Resolution Protocol (ARP) and the Ping command based on the ICMP protocol. If the IP address of the target cloud server cannot be connected, it is determined that the user terminal (Terminal) and the target cloud server are in different subnets; S220, the user terminal (Terminal) attempts to establish a connection with the cloud PC server through a peer-to-peer transmission hole punching service component (P2P); S230, if the point-to-point transmission hole punching service component (P2P) is unsuccessful, test the connection performance between the user terminal (Terminal) and the transit server providing the media transit service component (Trans), and establish a connection with the transit server; S240: Continuously detect and record the health status of the transit link at a preset time interval, including at least the traffic, delay, and packet loss rate of the transit link.
[0008] Further, the step S230 includes: S231, based on the Ping command of the ICMP protocol, obtain the second response time required for the data packet in the local area network to travel from the user terminal (Terminal) to the transit server providing the media transit service component (Trans) and return to the user terminal (Terminal), and determine whether the second response time is less than a preset maximum second response time (Round-Trip Time, RTT) condition; S232, testing whether the transfer bandwidth of the local area network is greater than a preset minimum transfer bandwidth condition by transmitting a test file; S233, the user terminal (Terminal) sends a signaling to the STUN server to request to connect to the cloud PC server; S234. The STUN server sends a signal to the cloud PC server to establish a media path between the user terminal (Terminal) and the cloud PC server.
[0009] Further, the step S300 includes: S310, based on the OpenVPN or IPsec protocol, the user terminal (Terminal) attempts to establish a connection with the virtual private gateway (VPN), and monitors the connection status in real time; S320, after the user terminal (Terminal) accesses the intranet through a virtual private gateway (VPN), an intranet IP address is allocated; S330, the user terminal (Terminal) uses the Ping command based on the ICMP protocol to test whether it is in the same network level as the cloud PC server and test the accessibility of the intranet; S340, the user terminal (Terminal) obtains the third response time required for the data packet in the local area network to go from the user terminal (Terminal) to the cloud PC server and return to the user terminal (Terminal) based on the Ping command of the ICMP protocol, and determines whether the third response time is less than a preset maximum third response time (Round-Trip Time, RTT) condition; S350, testing the network uplink rate and downlink rate, delay and bandwidth by transmitting test files; S360: If the third response time is less than the preset maximum third response time (Round-Trip Time, RTT) and the preset uplink bandwidth condition is met, the user terminal (Terminal) directly connects to the IP address of the cloud PC server, the user terminal (Terminal) sends a signal to the cloud PC server to negotiate a direct path, the cloud PC server returns a confirmation signal, and a UDP / TCP direct channel is established to realize direct connection of media streams; S370: Detect link status at preset time intervals. If link performance degradation is detected, record a log and notify the user.
[0010] Further, the step S400 includes: S410, confirm whether a connection is established with a virtual private gateway (VPN), obtain the IP address and gateway address of the user terminal (Terminal) based on ipconfig of Windows system or ifconfig of Linux system, and confirm that the connected cloud PC server is not in the same level network; S420, the user terminal (Terminal) sends a detection request to the STUN server, obtains the public network IP address and port, determines the NAT type, and the NAT type includes at least Full Cone and Symmetric NAT. According to the NAT type, it is confirmed whether the user terminal (Terminal) can establish a connection through the point-to-point transmission hole punching service component (P2P); S430, intranet route check, try to check whether the user terminal (Terminal) and the cloud PC server can relay data through the internal gateway of the virtual private gateway (VPN) through the routing table. If there is no valid route between the virtual private gateway (VPN) and the cloud PC server, it is marked as a cross-network environment that requires relay; S440, prioritizes attempts to establish a direct penetration connection through the peer-to-peer transmission hole punching service component (P2P). If the direct penetration connection fails to be established or the user terminal (Terminal) and the cloud PC server are in a symmetric (Symmetric NAT) environment, automatically selects a relay server (Relay Server) for data transmission; S450, if a relay server is selected for data transmission, a relay server node with the lowest delay is selected from multiple relay nodes through Ping test or GeoIP positioning; S460, detect the performance of the relay path, measure the fourth response time (Round-Trip Time, RTT) through ICMP packets, detect the average delay of the relay path, detect the packet loss rate of the relay node, and detect the bandwidth through upload and download speed tests to ensure that the transmission requirements are met; S470, monitor the current link status in real time through the RTP control protocol, at least the delay, packet loss and jitter, and when the link performance deteriorates, try to renegotiate a better link.
[0011] Furthermore, the present invention also proposes a transmission device based on network environment adaptation, which is used to execute the transmission method based on network environment adaptation. The transmission device based on network environment adaptation includes: A cloud PC server, wherein a computing blade for providing computing services is disposed in the cloud PC server; A switching device, wherein the switching device includes a combination of one or more of a switch, a router, and a bridge, and the cloud PC server is electrically connected to the switching device; The switching device is provided with at least a point-to-point transmission hole punching service component (P2P) and a media transfer service component (Trans), wherein the point-to-point transmission hole punching service component (P2P) is used to directly connect two devices to realize media signal transmission, and the media transfer service component (Trans) realizes media signal transmission by forwarding through an intermediate server, and the media transfer service component (Trans) can be optionally configured in a transfer server; A virtual private gateway (VPN), wherein the virtual private gateway (VPN) comprises at least an intranet network card (PrivateItf) and a public network card (PublicItf) connected in sequence, and the switching device is connected to the intranet network card (PrivateItf); A user terminal (Terminal), wherein the user terminal (Terminal) is connected to the public network card (PublicItf).
[0012] Furthermore, the transmission device based on network environment adaptation also includes: One or more level network address translation modules (Network Address Translation, NAT), the network address translation modules include an intranet network address translation module set in the intranet and an extranet network address translation module set in the extranet; The switching device is connected to a user terminal arranged in the intranet through an intranet network address translation module, and the public network card (PublicItf) is connected to a user terminal arranged in the extranet through an extranet network address translation module.
[0013] Furthermore, the present invention also proposes a computer-readable storage medium on which program instructions are stored. When the program instructions are executed by a processor, the transmission method based on network environment adaptation is implemented.
[0014] The beneficial effects of the present invention are: The transmission method, device and storage medium based on network environment adaptation can autonomously select the link connection mode according to the network connection environment, and monitor and switch in real time, so as to achieve the technical effect of ensuring high-quality and efficient transmission of streaming media. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 The figure is an overall flow chart of the transmission method based on network environment adaptation.
[0016] Figure 2 It is a schematic diagram of the structure of a transmission device based on network environment adaptation.
[0017] Figure 3 The figure is a schematic diagram of a link in a transmission device based on network environment adaptation when the user terminal and the cloud PC are in an intranet.
[0018] Figure 4 A schematic diagram of a link for VPN cross-network access based on a transmission device that adapts to the network environment.
[0019] Figure 5 The figure is a schematic diagram of the link when the transmission device is self-adaptive based on the network environment and penetrates the cross-network access. DETAILED DESCRIPTION
[0020] The following will be combined with the embodiments and drawings to clearly and completely describe the concept, specific structure and technical effects of the present invention, so as to fully understand the purpose, scheme and effect of the present invention. It should be noted that the embodiments and features in the embodiments of this application can be combined with each other without conflict.
[0021] It should be noted that, unless otherwise specified, when a feature is referred to as being "fixed" or "connected" to another feature, it may be directly fixed or connected to the other feature, or it may be indirectly fixed or connected to the other feature. In addition, the descriptions of up, down, left, right, top, bottom, etc. used in the present invention are only relative to the relative positional relationship of the components of the present invention in the drawings.
[0022] In addition, unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by those skilled in the art. The terms used in this specification are only for describing specific embodiments, not for limiting the present invention. The term "and / or" used herein includes any combination of one or more related listed items.
[0023] It should be understood that, although the terms first, second, third, etc. may be used to describe various elements in the present disclosure, these elements should not be limited to these terms. These terms are only used to distinguish elements of the same type from each other. For example, without departing from the scope of the present disclosure, the first element may also be referred to as the second element, and similarly, the second element may also be referred to as the first element.
[0024] Reference Figures 1 to 5In some embodiments, the technical solution of the present invention is a transmission method, device and storage medium based on network environment adaptation. The transmission method based on network environment adaptation is applied to a transmission device based on network environment adaptation. The transmission device based on network environment adaptation includes: a cloud PC server, wherein a computing blade for providing computing services is provided in the cloud PC server; a switching device, wherein the switching device includes a combination of one or more of a switch, a router and a bridge, wherein the cloud PC server is electrically connected to the switching device; a virtual private gateway (VPN), wherein the virtual private gateway (VPN) includes at least an intranet network card (PrivateItf) and a public network card (PublicItf) connected in sequence, wherein the switching device is connected to the intranet network card (PrivateItf); a user terminal (Terminal), wherein the user terminal (Terminal) is connected to the public network card (PublicItf). The transmission method based on network environment adaptation includes the following steps: S100: If the user terminal (Terminal) is in the intranet and is in the same network level as the cloud PC server, the user terminal (Terminal) attempts to establish a direct connection with the cloud PC server; S200, if the user terminal (Terminal) is in the intranet, but is not in the same level network as the cloud PC server, the user terminal (Terminal) attempts to establish a connection with the cloud PC server through the point-to-point transmission hole punching service component (P2P), and if unsuccessful, establishes a connection with the cloud PC server through the media transfer service component (Trans); S300, if the user terminal (Terminal) is in the external network, the virtual private gateway (VPN) connected to the user terminal (Terminal) and the cloud PC server are in the same level network, the user terminal (Terminal) directly connects to the IP address of the cloud PC server through dial-up connection to the corresponding virtual private gateway (VPN), thereby realizing direct connection of media streams; S400, if the user terminal (Terminal) is in the external network, but the virtual private gateway (VPN) connected to the user terminal (Terminal) and the cloud PC server are not in the same level network, the user terminal (Terminal) connects to the virtual private gateway (VPN) through dial-up, and the virtual private gateway (VPN) attempts to establish a connection with the cloud PC server through the point-to-point transmission hole punching service component (P2P). If it fails, it establishes a connection with the cloud PC server through the media transfer service component (Trans).
[0025] The beneficial effect of the present invention is that the transmission method, device and storage medium based on network environment adaptation can independently select the link connection mode according to the network connection environment, and monitor and switch in real time, so as to achieve the technical effect of ensuring high-quality and efficient transmission of streaming media.
[0026] The present invention relates to the field of cloud desktop / cloud PC media stream transmission processing, and in particular to a technical solution for realizing intelligent transmission strategy by dual deployment of VPN and media transfer in a multi-network environment. The present invention solves the problems of connectivity, transmission efficiency and user experience in a complex network environment by flexibly combining transmission strategies.
[0027] Specifically, the transmission method based on network environment adaptation proposes an intelligent media transmission system for cloud PC server scenarios, which adaptively selects the best transmission path based on the network environment. Specifically, the user end adaptively selects the most appropriate transmission method according to the current network environment, such as: (1) Within the enterprise network: If the user terminal and the cloud PC server are on the same network level, the media stream can be directly transmitted without P2P hole punching; (2) Within the enterprise network: If the user terminal (Terminal) and the cloud PC server are not in the same network level, P2P hole punching is required. If successful, the P2P channel will be used. If unsuccessful, the channel will be transferred through the Trans media. (3) If the user terminal is in the external network, the cloud PC server and VPN are in the same network level: the user terminal connects to the VPN via dial-up, directly connects to the IP address of the cloud PC server, and the media stream is directly connected; (4) If the user terminal is in the external network, the cloud PC server and VPN are not in the same network level: the user terminal connects to the VPN via dial-up, and the user terminal creates a media channel through P2P hole punching. If successful, the media flow goes through the P2P channel. If unsuccessful, the media flow goes through the media transit channel. The cloud PC intelligent transmission system proposed in the present invention can flexibly adapt to multiple network environments and has the following technical features: (1) Low operating costs: Media transfer, P2P, and VPN are all deployed in the enterprise's internal physical network, without cloud deployment and no bandwidth costs; (2) The system is more secure: All service components (such as media services, signaling services, operation and maintenance servers, etc.) are deployed in the physical network within the enterprise to avoid network attacks to the greatest extent possible and ensure system security; (3) Strong network adaptability: A deployment method that is suitable for different enterprise network environments and can adapt to different network conditions (such as wired, WiFi, 5G), or through multiple cascades of switches / routers, to ensure successful media link connection and support users' fast connection under different network conditions. For example: the cloud PC and the user terminal are in the same LAN, or are not in the same LAN through one or more NATs, and the user terminal can access the cloud PC on the intranet / extranet; This solution realizes intelligent media streaming transmission in the enterprise intranet and extranet by combining system deployment with software. When accessing the extranet, there is no need for cloud deployment, which effectively saves bandwidth costs; when accessing the intranet, P2P or media transfer is dynamically selected according to the network environment. This solution not only significantly improves the success rate of media streaming connection and quickly establishes a connection, but also ensures the stability and smoothness of audio and video transmission. At the same time, it supports large-scale concurrent access and can effectively cope with diverse network environments and network fluctuations.
[0028] Based on the local deployment of the transmission method that is adaptive to the network environment, all service components (such as media services, signaling services, operation and maintenance servers, etc.) are deployed in the physical network within the enterprise, which can avoid network attacks to the greatest extent, ensure system security, and have no bandwidth costs; The transmission method based on network environment adaptation can flexibly establish transmission channels and select the fastest connection method according to the network and usage scenarios. The user terminal and the cloud PC are in the same intranet and the same level network, saving the time of punching holes, directly establishing a connection, and quickly establishing a media stream channel, so that users can see the picture at the fastest speed; the user terminal and the cloud PC are in the same intranet but different levels of the network, and you can choose to establish a connection through transfer, quickly establish a media stream channel, or P2P punch holes to reduce the pressure on the media transfer server; the user terminal is in the external network, the VPN intranet and the cloud PC are in the same level of network, the user terminal directly connects to the IP address of the cloud PC, and the media stream is directly connected; the user terminal is in the external network, the VPN intranet and the cloud PC are not in the same level of network, and the user finally creates a media channel through P2P punching holes. If successful, the media stream goes through the p2p channel. If unsuccessful, it goes through the media transfer channel.
[0029] The transmission method based on network environment adaptation can reduce transmission delay. According to the network environment, the optimal transmission path is selected based on the preset strategy (minimum delay / maximum bandwidth) to ensure that users use the best media stream transmission path. This transmission system provides multiple media flow paths such as intranet direct connection, VPN tunnel, p2p hole punching, media transfer, VPN tunnel and direct connection combination, VPN tunnel and media transfer combination, etc., to ensure that users use the best media stream transmission path. Use the most efficient transmission path while ensuring connectivity.
[0030] The transmission method based on network environment adaptation has high concurrent processing capabilities. Intranet point-to-point transmission, cross-VPN transmission, and media transit transmission do not affect each other and do not require cluster deployment. The concurrent capacity of the bearer is the sum of the concurrent capacities of different transmission channels, which can significantly improve the concurrent capacity of a single transmission channel.
[0031] The transmission method based on network environment adaptation has a dynamic load balancing mechanism and does not require cluster deployment. The media stream meets multiple transmission channels and can be dynamically allocated to the most appropriate transmission path based on the concurrent capacity of the channel.
[0032] The transmission method based on network environment adaptation has a backup path switching function. When the media stream meets multiple transmission paths, if the current transmission path fails, it can switch to an available backup path to ensure that the media stream is not interrupted.
[0033] Further, refer to Figure 1 and Figure 3 , the step S100 includes the following steps; S110, the user terminal (Terminal) obtains the IP address of the cloud PC server by broadcasting or querying the local area network; S120, detecting whether the network delay and bandwidth of the local area network meet the preset maximum first response time condition and the preset minimum bandwidth condition; S130: If the longest first response time condition and the lowest bandwidth condition are met, select and record the direct link connection mode; S140, connection establishment: The user terminal (Terminal) negotiates the direct link path with the cloud PC server by sending signaling. After the negotiation is completed, the cloud PC server returns a confirmation signaling to establish a UDP / TCP direct link; S150. Continuously detect and record the health status of the UDP / TCP direct link at a preset time interval.
[0034] Further, refer to Figure 1 and Figure 3 , the step S120 comprises: S121, based on the Ping command of the ICMP protocol, obtain the first response time required for the data packet in the local area network to go from the user terminal (Terminal) to the cloud PC server and return to the user terminal (Terminal), and determine whether the first response time is less than the preset maximum first response time (Round-Trip Time, RTT) condition; S122. Testing whether the bandwidth of the local area network is greater than a preset minimum bandwidth condition by transmitting a test file.
[0035] Specifically, refer to Figure 3In step S100, if the user terminal and the cloud PC are in the same level network, the media stream does not need P2P hole punching and can pass directly.
[0036] In a specific embodiment, two devices in a company communicate directly, wherein: Network environment: The user terminal and the cloud PC are located in the same LAN (e.g. 192.168.0.x), the network quality is high, and no transfer is required.
[0037] Implementation steps: (1) Network environment detection, including: A. The user terminal obtains the IP address of the cloud PC through LAN broadcast or query server.
[0038] B. Detect network latency and bandwidth: Use ICMP Ping to determine the RTT within the LAN (such as less than 10ms), and use simple file transfer (such as 10MB data packet) to test the bandwidth (such as above 100Mbps).
[0039] (2) Link selection and feedback, including: A. The system determines whether it can directly connect to the cloud PC through the intranet IP: If the target IP can be pinged and the latency and bandwidth meet the requirements, the direct link is selected first and the direct link optimization result is recorded.
[0040] B. If the link is stable, the system sends health status reports regularly (such as sending Ping every 10 seconds to monitor the connection status).
[0041] (3) Signaling transmission and feedback: A. Connection establishment: The user terminal sends signaling to the cloud PC to negotiate a direct path.
[0042] B. Link verification: The cloud PC returns a confirmation signal and establishes a UDP / TCP direct channel.
[0043] Further, refer to Figure 1 and Figure 3 , the step S200 comprises: S210, confirming the network location of the user terminal (Terminal), the user terminal (Terminal) attempts to establish a direct connection with the cloud PC server through the Address Resolution Protocol (ARP) and the Ping command based on the ICMP protocol. If the IP address of the target cloud server cannot be connected, it is determined that the user terminal (Terminal) and the target cloud server are in different subnets; S220, the user terminal (Terminal) attempts to establish a connection with the cloud PC server through a peer-to-peer transmission hole punching service component (P2P); S230, if the point-to-point transmission hole punching service component (P2P) is unsuccessful, test the connection performance between the user terminal (Terminal) and the transit server providing the media transit service component (Trans), and establish a connection with the transit server; S240: Continuously detect and record the health status of the transit link at a preset time interval, including at least the traffic, delay, and packet loss rate of the transit link.
[0044] Further, refer to Figure 1 and Figure 3 , the step S230 comprises: S231, based on the Ping command of the ICMP protocol, obtain the second response time required for the data packet in the local area network to travel from the user terminal (Terminal) to the transit server providing the media transit service component (Trans) and return to the user terminal (Terminal), and determine whether the second response time is less than a preset maximum second response time (Round-Trip Time, RTT) condition; S232, testing whether the transfer bandwidth of the local area network is greater than a preset minimum transfer bandwidth condition by transmitting a test file; S233, the user terminal (Terminal) sends a signaling to the STUN server to request to connect to the cloud PC server; S234. The STUN server sends a signal to the cloud PC server to establish a media path between the user terminal (Terminal) and the cloud PC server.
[0045] Specifically, refer to Figure 3 If the user terminal and the cloud PC server are not in the same network level, P2P hole punching is required. If successful, the p2p channel is used. If unsuccessful, the media is transferred through Trans. In a specific embodiment, the user terminal and the cloud PC cross VLANs and need to be transferred. Network environment: User terminal IP address: 192.168.1.x Cloud PC server IP address: 192.168.2.x There is no direct link between the terminal and the cloud PC, and a transit server is required.
[0046] Implementation steps (1) Network environment detection: The user terminal attempts to establish a direct connection with the cloud PC through ARP and ICMP Ping detection. If the target IP cannot be pinged, it is judged to be in a different subnet.
[0047] (2) Test the connection performance with the transit server, including: A. Ping the transit server to obtain the RTT and packet loss rate.
[0048] B. Transmit test data (e.g., a 1MB file) to evaluate the transit bandwidth.
[0049] (3) Link selection and feedback: A. The system determines that a transfer connection is required: if it detects that there is no direct path between the terminal and the cloud PC, it will automatically switch to P2P hole punching. If it succeeds, it will go through the p2p channel. If it fails, it will be transferred through the Trans media.
[0050] B. Link status feedback: Regularly send transit link status reports, including current traffic, latency, packet loss rate, etc.
[0051] (4) Signaling transmission and feedback: A. Connection establishment: The user terminal sends a signal to the STUN server, requesting to connect to the cloud PC: B. Link verification: The STUN server sends signaling to the cloud PC to establish a media path between the user terminal and the cloud PC.
[0052] Further, refer to Figure 1 and Figure 4 , the step S300 comprises: S310, based on the OpenVPN or IPsec protocol, the user terminal (Terminal) attempts to establish a connection with the virtual private gateway (VPN), and monitors the connection status in real time; S320, after the user terminal (Terminal) accesses the intranet through a virtual private gateway (VPN), an intranet IP address is allocated; S330, the user terminal (Terminal) uses the Ping command based on the ICMP protocol to test whether it is in the same network level as the cloud PC server and test the accessibility of the intranet; S340, the user terminal (Terminal) obtains the third response time required for the data packet in the local area network to go from the user terminal (Terminal) to the cloud PC server and return to the user terminal (Terminal) based on the Ping command of the ICMP protocol, and determines whether the third response time is less than a preset maximum third response time (Round-Trip Time, RTT) condition; S350, testing the network uplink rate and downlink rate, delay and bandwidth by transmitting test files; S360: If the third response time is less than the preset maximum third response time (Round-Trip Time, RTT) and the preset uplink bandwidth condition is met, the user terminal (Terminal) directly connects to the IP address of the cloud PC server, the user terminal (Terminal) sends a signal to the cloud PC server to negotiate a direct path, the cloud PC server returns a confirmation signal, and a UDP / TCP direct channel is established to realize direct connection of media streams; S370: Detect link status at preset time intervals. If link performance degradation is detected, record a log and notify the user.
[0053] Specifically, refer to Figure 4 , VPN cross-network direct access, VPN intranet ( Figure 4 The privateItf address in the middle) and the cloud PC server are in the same network level, and the user terminal is directly connected to the IP address of the cloud PC, and the media stream is directly connected; In a specific embodiment, a remote user terminal (Terminal) accesses a cloud PC server through a VPN, wherein: Network environment: The user terminal connects to the company's intranet through VPN dial-up and is assigned an intranet IP (such as 192.168.0.x). The cloud PC server is located in the same intranet (such as 192.168.0.y). VPN users can communicate directly with the cloud PC server.
[0054] Implementation steps: Network environment detection, including: A. Detect VPN connection status: When the user terminal attempts to establish a VPN connection (based on protocols such as OpenVPN, IPsec, etc.), the system monitors in real time whether the VPN connection is successful. Detect whether the intranet IP address (such as 192.168.0.x) is obtained.
[0055] B. Intranet accessibility test: The user terminal pings the intranet IP address of the cloud PC (such as 192.168.0.y). If the response is successful, it is confirmed that the cloud PC and the VPN terminal are in the same intranet. Test latency and bandwidth: Send ICMP packets, measure RTT latency (such as less than 50ms), and test the network uplink and downlink rates and bandwidth through simple file transfers (such as 100MB).
[0056] (2) Link selection and feedback: A. Prefer VPN direct links: The system gives priority to direct paths within VPN channels.
[0057] Check the following conditions: Whether the VPN intranet IP and cloud PC IP are in the same subnet range (such as 192.168.0.x / 24). Whether the latency is below the threshold (such as 50ms). Whether the bandwidth is sufficient (such as at least 10Mbps upstream bandwidth to meet application requirements).
[0058] B. Link status feedback mechanism: The system sends link status reports regularly (such as RTT measurement every 10 seconds) to ensure link health. If link performance degradation is detected (such as latency increases to more than 100ms or packet loss rate exceeds 5%), the system immediately notifies the user and records the log for subsequent optimization.
[0059] (3) Signaling transmission and feedback: Connection establishment: The user terminal sends a signal to the cloud PC to negotiate a direct path. Link verification: The cloud PC returns a confirmation signal to establish a UDP / TCP direct channel.
[0060] Further, refer to Figure 1 and Figure 5 , the step S400 includes: S410, confirm whether a connection is established with a virtual private gateway (VPN), obtain the IP address and gateway address of the user terminal (Terminal) based on ipconfig of Windows system or ifconfig of Linux system, and confirm that the connected cloud PC server is not in the same level network; S420, the user terminal (Terminal) sends a detection request to the STUN server, obtains the public network IP address and port, determines the NAT type, and the NAT type includes at least Full Cone and Symmetric NAT. According to the NAT type, it is confirmed whether the user terminal (Terminal) can establish a connection through the point-to-point transmission hole punching service component (P2P); S430, intranet route check, try to check whether the user terminal (Terminal) and the cloud PC server can relay data through the internal gateway of the virtual private gateway (VPN) through the routing table. If there is no valid route between the virtual private gateway (VPN) and the cloud PC server, it is marked as a cross-network environment that requires relay; S440, prioritizes attempts to establish a direct penetration connection through the peer-to-peer transmission hole punching service component (P2P). If the direct penetration connection fails to be established or the user terminal (Terminal) and the cloud PC server are in a symmetric (Symmetric NAT) environment, automatically selects a relay server (Relay Server) for data transmission; S450, if a relay server is selected for data transmission, a relay server node with the lowest delay is selected from multiple relay nodes through Ping test or GeoIP positioning; S460, detect the performance of the relay path, measure the fourth response time (Round-Trip Time, RTT) through ICMP packets, detect the average delay of the relay path, detect the packet loss rate of the relay node, and detect the bandwidth through upload and download speed tests to ensure that the transmission requirements are met; S470, monitor the current link status in real time through the RTP control protocol, at least the delay, packet loss and jitter, and when the link performance deteriorates, try to renegotiate a better link.
[0061] Specifically, refer to Figure 5 In order to penetrate cross-network access, the VPN intranet and cloud PC are not on the same level of network. The user finally creates a media channel through P2P hole punching. If successful, the media flow goes through the p2p channel. If unsuccessful, it goes through the media transit channel.
[0062] In a specific embodiment, a remote user terminal accesses a cloud PC server via a VPN, wherein: Network environment: The user terminal uses VPN dial-up to connect to the company's intranet and is assigned an IP address in network A (such as 192.168.0.x). The cloud PC server is located in network B (such as 192.168.1.y) of the intranet. There is no direct route between it and network A, so VPN users cannot communicate directly with the cloud PC. The system needs to use NAT penetration or a relay server to achieve data communication between the user terminal and the cloud PC server.
[0063] Implementation steps: (1) Network environment detection, including: A. VPN connection and intranet status detection: User terminal detects VPN connection: Confirm whether VPN connection is established successfully and whether the assigned IP address range belongs to network A (such as 192.168.0.x). Use ipconfig (Windows) or ifconfig (Linux) to obtain the assigned IP and gateway address. Cloud PC intranet accessibility test: User terminal pings the B network IP (such as 192.168.1.x) of the cloud PC to confirm whether direct communication is possible. Usually, the Ping test will fail due to no routing or NAT blocking.
[0064] B. STUN protocol detection penetration capability: The user terminal sends a probe request to the STUN server to obtain its public IP and port, and determine the NAT type (such as Full Cone, Symmetric NAT). According to the STUN result, it is confirmed whether the user terminal can establish a P2P connection.
[0065] C. Intranet route check: The system attempts to check whether the user terminal and cloud PC can relay data through the VPN internal gateway through the routing table. If there is no valid route between network A and network B, the system marks the current network as a cross-network environment that "requires relay".
[0066] (2) Link selection and feedback, including: A. Link optimization strategy: Direct penetration priority: The system will try P2P penetration first, using the public IP and port of both parties for direct connection. If the NAT type is Full Cone or Restricted Cone, the success rate of P2P direct connection is higher. Relay path alternative: If P2P penetration fails or the user terminal and cloud PC are in a Symmetric NAT environment, the system will automatically select a relay server for data transmission.
[0067] B. Relay server selection: The system selects the node with the lowest latency from multiple relay nodes (such as through Ping test or GeoIP positioning). Relay path performance monitoring: Latency: Measure RTT through ICMP packets and record the average latency of the relay path. Packet loss rate: Monitor the packet loss of relay nodes. Bandwidth: Ensure that the transmission requirements are met through upload and download speed tests.
[0068] C. Link status feedback: The system uses the RTCP protocol to monitor the current link status (such as delay, packet loss, and jitter) in real time. When the link performance degrades (such as delay > 150ms, packet loss rate > 5%), the system attempts to renegotiate a better link.
[0069] (3) Signaling transmission and feedback: A. Initial connection signaling: The user terminal and the cloud PC negotiate the connection through the relay server: The system uses the ICE (Interactive Connectivity Establishment) protocol to exchange candidate addresses: The user terminal sends a signaling request to the cloud PC, obtains the public network address and port through the STUN server, and generates a candidate path. The cloud PC returns its own candidate address set (including the intranet address and relay address).
[0070] B. Path negotiation and confirmation: The system selects the optimal path based on the candidate address (P2P first, then relay) and completes the connection handshake.
[0071] Further, refer to Figure 2 The present invention further proposes a transmission device based on network environment adaptation, which is used to execute the transmission method based on network environment adaptation. The transmission device based on network environment adaptation includes: A cloud PC server, wherein a computing blade for providing computing services is disposed in the cloud PC server; A switching device, wherein the switching device includes a combination of one or more of a switch, a router, and a bridge, and the cloud PC server is electrically connected to the switching device; The switching device is provided with at least a point-to-point transmission hole punching service component (P2P) and a media transfer service component (Trans), wherein the point-to-point transmission hole punching service component (P2P) is used to directly connect two devices to realize media signal transmission, and the media transfer service component (Trans) realizes media signal transmission by forwarding through an intermediate server, and the media transfer service component (Trans) can be optionally configured in a transfer server; A virtual private gateway (VPN), wherein the virtual private gateway (VPN) comprises at least an intranet network card (PrivateItf) and a public network card (PublicItf) connected in sequence, and the switching device is connected to the intranet network card (PrivateItf); A user terminal (Terminal), wherein the user terminal (Terminal) is connected to the public network card (PublicItf).
[0072] Specifically, P2P refers to the point-to-point transmission hole punching service component, that is, a connection is established directly between two devices without relying on an intermediate server, and the transmission speed is faster. trans refers to the media transit service component. When P2P hole punching fails, media transmission is achieved by forwarding through an intermediate server. Switch refers to a switch. There may be multiple devices under the switch, such as switches, routers, bridges, etc. privateItf refers to an intranet network card; publicItf refers to a public network network card; NAT refers to a single or multiple levels of NAT formed by devices such as switches / routers / bridges. In the implementation of this technology, there may be no NAT. Terminal refers to PC, thin terminal, notebook, tablet / mobile phone. PC refers to a cloud PC server, a PC centrally deployed by an enterprise, which supports remote access by user terminals.
[0073] Deployment Instructions: (1) Media transfer, P2P, VPN, or other service components (such as cloud PC management platform) are all deployed in the enterprise's internal physical network; (2) The VPN gateway is deployed at the enterprise public network egress and realizes internal and external IP address mapping through dual network cards or IP address mapping, acting as an intermediary between external users and internal devices. (3) External users do not know the actual IP address or location of internal devices. After receiving the external request, the VPN processes the request and forwards it to the target device on the internal network according to the configuration. The returned response is also forwarded back to the external user through the proxy server.
[0074] Furthermore, the transmission device based on network environment adaptation also includes: One or more level network address translation modules (Network Address Translation, NAT), the network address translation modules include an intranet network address translation module set in the intranet and an extranet network address translation module set in the extranet; The switching device is connected to a user terminal arranged in the intranet through an intranet network address translation module, and the public network card (PublicItf) is connected to a user terminal arranged in the extranet through an extranet network address translation module.
[0075] Furthermore, the present invention also proposes a computer-readable storage medium on which program instructions are stored. When the program instructions are executed by a processor, the transmission method based on network environment adaptation is implemented.
[0076] The above is only a preferred embodiment of the present invention. The present invention is not limited to the above implementation. As long as the technical effect of the present invention is achieved by the same means, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the scope of protection of the present disclosure. All should belong to the protection scope of the present invention. Within the protection scope of the present invention, its technical scheme and / or implementation method can have various modifications and changes.
Claims
1. A transmission method based on network environment adaptation, wherein the transmission method based on network environment adaptation is applied to a transmission device based on network environment adaptation, wherein the transmission device based on network environment adaptation comprises: A cloud PC server, wherein a computing blade for providing computing services is disposed in the cloud PC server; A switching device, wherein the switching device includes a combination of one or more of a switch, a router, and a bridge, and the cloud PC server is electrically connected to the switching device; a virtual private gateway, wherein the virtual private gateway includes at least an intranet network card and a public network card connected in sequence, and the switching device is connected to the intranet network card; a user terminal, wherein the user terminal is connected to the public network card, wherein the transmission method based on network environment adaptation includes the following steps: S100: If the user terminal is in the intranet and is in the same network level as the cloud PC server, the user terminal attempts to establish a direct connection with the cloud PC server; S200: If the user terminal is in the intranet but not in the same network level as the cloud PC server, the user terminal attempts to establish a connection with the cloud PC server through the point-to-point transmission hole punching service component. If unsuccessful, the user terminal attempts to establish a connection with the cloud PC server through the media transfer service component. S300: If the user terminal is in the external network, and the virtual private gateway connected to the user terminal is in the same network level as the cloud PC server, the user terminal directly connects to the IP address of the cloud PC server by dialing up the corresponding virtual private gateway to achieve direct media stream connection; S400. If the user terminal is in the external network, but the virtual private gateway connected to the user terminal and the cloud PC server are not in the same level network, the user terminal connects to the virtual private gateway through dial-up, and the virtual private gateway attempts to establish a connection with the cloud PC server through the point-to-point transmission hole punching service component. If it fails, it establishes a connection with the cloud PC server through the media transfer service component.
2. The transmission method based on network environment adaptation according to claim 1, characterized in that: The step S100 includes the following steps: S110, the user terminal obtains the IP address of the cloud PC server by broadcasting or querying the local area network; S120, detecting whether the network delay and bandwidth of the local area network meet the preset maximum first response time condition and the preset minimum bandwidth condition; S130: If the longest first response time condition and the lowest bandwidth condition are met, select and record the direct link connection mode; S140, connection establishment The user terminal negotiates the direct link path with the cloud PC server by sending signaling. After the negotiation is completed, the cloud PC server returns a confirmation signaling to establish a UDP / TCP direct link; S150. Continuously detect and record the health status of the UDP / TCP direct link at a preset time interval.
3. The transmission method based on network environment adaptation according to claim 2, characterized in that: The step S120 includes: S121, using a Ping command based on the ICMP protocol, obtaining the first response time required for a data packet in the local area network to travel from the user terminal to the cloud PC server and back to the user terminal, and determining whether the first response time is less than a preset maximum first response time condition; S122. Testing whether the bandwidth of the local area network is greater than a preset minimum bandwidth condition by transmitting a test file.
4. The transmission method based on network environment adaptation according to claim 1, characterized in that: The step S200 includes: S210, confirming the network location of the user terminal, the user terminal attempts to establish a direct connection with the cloud PC server through the address resolution protocol and the Ping command based on the ICMP protocol. If the IP address of the target cloud server cannot be connected, it is determined that the user terminal and the target cloud server are in different subnets; S220, the user terminal attempts to establish a connection with the cloud PC server through a point-to-point transmission hole punching service component; S230, if the point-to-point transmission hole punching service component is unsuccessful, testing the connection performance between the user terminal and the transit server providing the media transit service component, and establishing a connection with the transit server; S240: Continuously detect and record the health status of the transit link at a preset time interval, including at least the traffic, delay, and packet loss rate of the transit link.
5. The transmission method based on network environment adaptation according to claim 4, characterized in that: The step S230 includes: S231, based on the Ping command of the ICMP protocol, obtain the second response time required for the data packet in the local area network to travel from the user terminal to the transit server providing the media transit service component and return to the user terminal, and determine whether the second response time is less than a preset maximum second response time condition; S232, testing whether the transfer bandwidth of the local area network is greater than a preset minimum transfer bandwidth condition by transmitting a test file; S233, the user terminal sends a signal to the STUN server to request to connect to the cloud PC server; S234. The STUN server sends a signaling to the cloud PC server to establish a media path between the user terminal and the cloud PC server.
6. The transmission method based on network environment adaptation according to claim 1, characterized in that: The step S300 includes: S310, based on the OpenVPN or IPsec protocol, the user terminal attempts to establish a connection with the virtual private gateway and monitors the connection status in real time; S320, after the user terminal accesses the intranet through the virtual private gateway, an intranet IP address is allocated; S330, the user terminal uses the Ping command based on the ICMP protocol to test whether it is in the same network level as the cloud PC server and to test the accessibility of the intranet; S340, the user terminal obtains the third response time required for a data packet in the local area network to travel from the user terminal to the cloud PC server and back to the user terminal based on the Ping command of the ICMP protocol, and determines whether the third response time is less than a preset maximum third response time condition; S350, testing the network uplink rate and downlink rate, delay and bandwidth by transmitting test files; S360: If the third response time is less than the preset maximum third response time and the preset uplink bandwidth condition is met, the user terminal directly connects to the IP address of the cloud PC server, the user terminal sends a signal to the cloud PC server, negotiates a direct path, the cloud PC server returns a confirmation signal, and establishes a UDP / TCP direct channel to realize direct connection of media streams; S370: Detect link status at preset time intervals. If link performance degradation is detected, record a log and notify the user.
7. The transmission method based on network environment adaptation according to claim 1, characterized in that: The step S400 includes: S410, confirm whether a connection is established with the virtual private gateway, obtain the IP address and gateway address of the user terminal based on ipconfig of the Windows system or ifconfig of the Linux system, and confirm that the connected cloud PC server is not in the same level network; S420, the user terminal sends a detection request to the STUN server, obtains the public network IP address and port, determines the NAT type, and the NAT type includes at least full cone and symmetric type, and confirms whether the user terminal can establish a connection through the point-to-point transmission hole punching service component according to the NAT type; S430, intranet route check, try to check whether the user terminal and the cloud PC server can relay data through the internal gateway of the virtual private gateway through the routing table. If there is no valid route between the virtual private gateway and the cloud PC server, it is marked as a cross-network environment that requires relay; S440, preferentially try to establish a direct penetration connection through the point-to-point transmission hole punching service component, if the direct penetration connection fails to be established or the user terminal and the cloud PC server are in a symmetric environment, automatically select a relay server for data transmission; S450, if a relay server is selected for data transmission, a relay server node with the lowest delay is selected from multiple relay nodes through Ping test or GeoIP positioning; S460, detecting the performance of the relay path, measuring the fourth response time through the ICMP packet, detecting the average delay of the relay path, detecting the packet loss rate of the relay node, and detecting the bandwidth through the upload and download speed test to ensure that the transmission requirements are met; S470, monitor the current link status in real time through the RTP control protocol, at least the delay, packet loss and jitter, and when the link performance deteriorates, try to renegotiate a better link.
8. A transmission device based on network environment adaptation, used to execute the transmission method based on network environment adaptation according to any one of claims 1 to 7, characterized in that: The transmission device based on network environment adaptation includes: A cloud PC server, wherein a computing blade for providing computing services is disposed in the cloud PC server; A switching device, wherein the switching device includes a combination of one or more of a switch, a router, and a bridge, and the cloud PC server is electrically connected to the switching device; At least a point-to-point transmission hole punching service component and a media transfer service component are provided in the switching device. The point-to-point transmission hole punching service component is used to directly connect two devices to realize media signal transmission. The media transfer service component realizes media signal transmission by forwarding through an intermediate server. The media transfer service component can be optionally configured in the transfer server. A virtual private gateway, the virtual private gateway at least comprising an intranet network card and a public network card connected in sequence, the switching device being connected to the intranet network card; A user terminal is connected to the public network card.
9. The transmission device based on network environment adaptation according to claim 8, characterized in that: The transmission device based on network environment adaptation also includes: One or more network address translation modules, wherein the network address translation modules include an intranet network address translation module arranged in the intranet and an extranet network address translation module arranged in the extranet; The switching device is connected to a user terminal arranged in the intranet through an intranet network address translation module, and the public network card is connected to a user terminal arranged in the extranet through an extranet network address translation module.
10. A computer-readable storage medium having program instructions stored thereon, wherein the program instructions, when executed by a processor, implement the method as claimed in any one of claims 1 to 7.
Citation Information
Patent Citations
Method, terminal and system for transmitting file between SIP (Session Initiation Protocol) terminals in NAT (Network Address Translation) network
CN101964785A
Private data cloud storage system and private data cloud storage method
CN107071039A
Low-delay audio and video transmission method
CN113315823A
Method for node networking intercommunication and computing device
CN118573715A
Cross-regional equipment networking system and method
CN119155229A
Cited By
Image processing method, intelligent glasses, intelligent equipment, system and medium
CN120635498A
Communication apparatus, method, system, electronic device, storage medium, and program product
CN121644558A