Connection establishment method, program product and storage medium

By establishing suitable transport stream connections based on data type in the communication between the UAV and the ground station, the problems of traditional connection switching delay and head-of-line blocking are solved, achieving efficient and stable data transmission.

CN121968370APending Publication Date: 2026-05-01ZHEJIANG HUAFEI INTELLIGENT TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG HUAFEI INTELLIGENT TECH CO LTD
Filing Date
2026-04-02
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

In communication between UAVs and ground stations, traditional connection switching mechanisms result in long communication delays, affecting the immediacy and reliability of control. Furthermore, traditional connections may suffer from head-of-line congestion, reducing communication efficiency and system stability.

Method used

By establishing a first connection between the first device and the sending end based on the target data type, and determining the target transmission stream from multiple pre-established transmission streams, a control message carrying the identifier of the target transmission stream is sent to the second device to instruct the second device to establish a second connection that supports the target data type. This ensures that data packets are transmitted along the connection that best suits their characteristics, avoiding blocking caused by unnecessary conversions and retransmissions.

Benefits of technology

It enables efficient connection establishment, improves communication efficiency, ensures real-time data packet transmission and system stability, and avoids head-of-line congestion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121968370A_ABST
    Figure CN121968370A_ABST
Patent Text Reader

Abstract

The invention discloses a connection establishment method, a program product and a storage medium, and the method comprises the steps: building a first connection between a first device and a sending end based on a target data type of a target data packet under the condition that the sending end is determined to send the target data packet to a receiving end; determining a target transport stream from a plurality of transport streams pre-established between the first device and the second device based on the target data type, the target transport stream supporting a forwarding data type including a data packet of the target data type; and sending a control message carrying the identifier of the target transport stream to a second device to instruct the second device to establish a second connection supporting a data packet of which the transmission data type comprises the target data type based on the identifier of the target transport stream, the second connection being a connection between the second device and the receiving end. Through application of the method and the device, the problem of low communication efficiency of the established connection in the related technology is solved, and the effect of establishing the connection with high communication efficiency is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Connection establishment methods and procedures, products, and storage media Technical Field

[0001] This application relates to the field of transmission technology, and more specifically, to a connection establishment method and program product, and a storage medium. Background Technology

[0002] In current industrial-grade drone applications, such as power line inspection, emergency communication, and logistics delivery, communication between the drone and the ground station primarily relies on a combination of a private image transmission network and a 4G / 5G public network. The private image transmission network provides low-latency image transmission, while the 4G / 5G public network ensures control signaling transmission over longer distances. However, during link switching between the private and public networks, traditional switching mechanisms rely on application-layer state detection and manual connection reconstruction, resulting in long switching delays that severely impact the immediacy and reliability of drone control. Furthermore, once the main link (such as the private image transmission network) is interrupted, a new connection needs to be established. This process involves a three-way handshake using the Transmission Control Protocol (TCP), increasing communication latency. Moreover, traditional connections may suffer from head-of-line congestion, hindering timely command execution and reducing overall communication efficiency and drone system stability.

[0003] In summary, the connections established in the relevant technologies suffer from low communication efficiency. Summary of the Invention

[0004] This application provides a connection establishment method, program product, and storage medium to at least solve the technical problem of low communication efficiency in connections established in related technologies.

[0005] According to one aspect of the embodiments of this application, a connection establishment method is provided, comprising: when it is determined that a sending end is to send a target data packet to a receiving end, establishing a first connection between a first device and the sending end based on the target data packet's target data type; determining a target transport stream from a plurality of transport streams pre-established between the first device and a second device based on the target data type, wherein the target transport stream supports forwarding data packets whose data type includes the target data type; sending a control message carrying an identifier of the target transport stream to the second device to instruct the second device to establish a second connection based on the identifier of the target transport stream that supports transmitting data packets whose data type includes the target data type, wherein the second connection is a connection between the second device and the receiving end.

[0006] In one exemplary embodiment, when it is determined that the sending end is to send a target data packet to the receiving end, establishing a first connection between the first device and the sending end based on the target data type of the target data packet includes: acquiring the target data packet received through a first interface of the first device; determining the receiving address of the receiving end based on the target data packet; determining the target data type based on a first interface type of the first interface, wherein the interface of the first interface type is used to receive data packets whose data type includes the target data type; and establishing the first connection based on the receiving address and the target data type.

[0007] In one exemplary embodiment, determining a target transmission stream from a plurality of transmission streams pre-established between the first device and the second device based on the target data type includes: determining a plurality of target idle transmission streams in an idle state from the plurality of transmission streams included in the plurality of connections pre-established between the first device and the second device based on the target data type, wherein the target idle transmission streams support forwarding data packets whose data type includes the target data type; and determining one of the transmission streams in the target idle transmission streams as the target transmission stream.

[0008] In one exemplary embodiment, sending a control message carrying an identifier of the target transport stream to the second device to instruct the second device to establish a second connection supporting the transmission of data packets of the target data type based on the identifier of the target transport stream includes: determining the receiving address of the receiving end based on the received target data packets; generating the control message based on the identifier of the target transport stream and the receiving address; and sending the control message to the second device through a first idle transport stream among the plurality of transport streams to instruct the second device to establish the second connection based on the identifier of the target transport stream and the receiving address, wherein the first idle transport stream is a transport stream included among the plurality of transport streams for transmitting messages between the first device and the second device.

[0009] In one exemplary embodiment, the method further includes: forwarding the target data packet to the second device via the target transport stream, so as to instruct the second device to determine the second connection based on the identifier of the target transport stream, and forwarding the target data to the receiving end via the second connection.

[0010] In one exemplary embodiment, forwarding the target data packet to the second device via the target transport stream to instruct the second device to determine the second connection based on the identifier of the target transport stream, and forwarding the target data to the receiving end via the second connection, includes: determining the identifier of the target transport stream corresponding to the first connection based on a first correspondence, wherein the first correspondence is used to indicate the correspondence between the identifier of the target transport stream and the first connection; and forwarding the target data packet to the second device via the target transport stream based on the identifier of the target transport stream when it is determined that the third connection where the target transport stream is located meets a preset rule within a preset time period, instructing the second device to determine the second connection corresponding to the target transport stream based on a second correspondence, and forwarding the target data to the receiving end via the second connection, wherein the third connection is one of a plurality of connections pre-established between the first device and the second device, and the second correspondence is used to indicate the correspondence between the identifier of the target transport stream and the second connection.

[0011] In an exemplary embodiment, the method further includes: determining a target connection when it is determined that the third connection does not meet the preset rule within the preset time period, wherein the target connection is a connection that meets the preset rule within the preset time period among a plurality of connections pre-established between the first device and the second device; forwarding the target data packet to the second device through a backup transport stream in the target connection, wherein the backup transport stream supports forwarding data packets whose data type includes the target data type.

[0012] According to another aspect of the embodiments of this application, a connection establishment apparatus is also provided, applied to a first device, comprising: a first establishment module, configured to establish a first connection between the first device and the sending end based on a target data type of the target data packet when it is determined that the sending end is to send a target data packet to the receiving end; a first determination module, configured to determine a target transmission stream from a plurality of transmission streams pre-established between the first device and the second device based on the target data type, wherein the target transmission stream supports forwarding data packets whose data type includes the target data type; and a first sending module, configured to send a control message carrying an identifier of the target transmission stream to the second device to instruct the second device to establish a second connection based on the identifier of the target transmission stream that supports transmitting data packets whose data type includes the target data type, wherein the second connection is a connection between the second device and the receiving end.

[0013] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program is configured to perform the steps in any of the above method embodiments when executed by a processor.

[0014] According to another aspect of the embodiments of this application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the computer device to perform the steps in any of the method embodiments described above.

[0015] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to perform the steps of any of the above method embodiments through the computer program.

[0016] This application establishes a first connection between a first device and a sending end to forward the target data packet based on the target data packet's target data type. This ensures that different connections are mapped to data packets of different data types, achieving independent scheduling. Simultaneously, based on the target data type corresponding to the first connection, a target transport stream supporting the forwarding of the target data packet is determined from multiple pre-established transport streams between the first and second devices. A control message carrying the identifier of the target transport stream is then sent to the second device, instructing it to establish a second connection supporting the transmission of data packets including the target data type. This ensures that different connections are mapped to different transport streams, enabling data packets to be transmitted along connections best suited to their characteristics, avoiding unnecessary conversions and congestion caused by retransmissions. Therefore, it solves the problem of low communication efficiency in connections established in related technologies, achieving the effect of establishing connections with high communication efficiency. Attached Figure Description

[0017] Figure 1 is a schematic diagram of an application scenario of a connection establishment method according to an embodiment of this application;

[0018] Figure 2 is a flowchart illustrating an optional connection establishment method according to an embodiment of this application;

[0019] Figure 3 is a schematic diagram of another optional connection establishment method according to an embodiment of this application;

[0020] Figure 4 is a structural block diagram of an optional connection establishment device according to an embodiment of this application. Detailed Implementation

[0021] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0022] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0023] According to one aspect of the embodiments of this application, a method for establishing a connection is provided. Optionally, in this embodiment, the above-described method for establishing a connection can be applied, but is not limited to, to a hardware environment including a terminal device 102 and a server 104 as shown in FIG. 1. The server 104 can be connected to the terminal device 102 via a network and can be used to provide services (e.g., application services, etc.) to the terminal device 102 or clients installed on the terminal device 102. A database can be set up on or independently of the server 104 to provide data storage services to the server 104.

[0024] The aforementioned network may include, but is not limited to, at least one of the following: wired network and wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network (WAN), metropolitan area network (MAN), and local area network (LAN). The aforementioned wireless network may include, but is not limited to, at least one of the following: Wireless Fidelity (WIFI) and Bluetooth. Terminal device 102 may be, but is not limited to, a personal computer (PC), mobile phone, tablet computer, etc. Server 104 may be, but is not limited to, a cloud server, server cluster, or other server types.

[0025] The connection establishment method of this application embodiment can be executed by server 104, terminal device 102, or jointly by server 104 and terminal device 102. Alternatively, the connection establishment method of this application embodiment can be executed by a client installed on the terminal device 102.

[0026] Taking the connection establishment method in this embodiment executed by terminal device 102 as an example, wherein terminal device 102 is a first device, Figure 2 is a schematic flowchart of an optional connection establishment method according to an embodiment of this application. As shown in Figure 2, the process of the method may include the following steps:

[0027] Step S202: If it is determined that the sending end is to send a target data packet to the receiving end, a first connection is established between the first device and the sending end based on the target data type of the target data packet.

[0028] Optionally, in drone application scenarios, the transmitting end can be a device in the drone, such as an aircraft (including all onboard computers in the aircraft, including the flight control system), an image transmission module, or a 5G module, while the receiving end can be a device in a ground station, such as a monitoring center or any device or system that needs to process the data transmitted by the drone.

[0029] Alternatively, in another drone application scenario, the transmitting end can be a device in a ground station, such as a monitoring center or any device or system that needs to process the data transmitted by the drone, and the receiving end can be a device in the drone, such as the aircraft (including all onboard computers in the aircraft, including the flight control system), image transmission module, or 5G module.

[0030] Optionally, the target data packet is the specific data packet to be transmitted, and different data types require different transmission protocols or strategies. Target data types include, but are not limited to, TCP and User Datagram Protocol (UDP).

[0031] Optionally, the first device is a proxy server client with Stream Control Transmission Protocol (SCTP) multi-destination and multi-stream capabilities, capable of routing, forwarding, processing, or protocol conversion of data packets. In scenarios where the sending end is a device on a drone, the first device can be an SCTP transparent proxy deployed on the drone; in scenarios where the sending end is a device on a ground station, the first device can be an SCTP transparent proxy deployed on the ground station.

[0032] Optionally, the first connection is a transport connection established between the first device (transparent agent) and the sender based on the target data type. This connection leverages SCTP's multi-destination and multi-stream capabilities to provide high reliability and optimized transmission strategies.

[0033] Step S204: Based on the target data type, determine the target transmission stream from the multiple transmission streams pre-established between the first device and the second device, wherein the target transmission stream supports forwarding data packets whose data type includes the target data type.

[0034] Optionally, the second device is a proxy server with SCTP multi-destination and multi-stream capabilities, capable of routing, forwarding, processing, or protocol conversion of data packets. In scenarios where the sending end is a device on a drone, the first device can be an SCTP transparent proxy deployed on the drone, and the second device can be an SCTP transparent proxy deployed on a ground station; conversely, in scenarios where the sending end is a device on a ground station, the first device can be an SCTP transparent proxy deployed on the ground station, and the second device can be an SCTP transparent proxy deployed on the drone.

[0035] Optionally, a transport stream can independently transmit different types of data packets, unaffected by other streams. Through the connection between the first and second devices, a mapping relationship between each transport stream and its data type can be pre-defined. Specifically, a correspondence can be established between the transport stream's identifier and its data type. For example, in communication between a UAV and a ground station, multiple SCTP transport streams may be pre-established, including: stream ID 0 for transmitting control signaling; stream ID 1 for transmitting UDP data packets; and stream ID 2 and above for transmitting TCP data packets. Stream IDs 2 through 30002 are used for uplink data (from the UAV to the ground station), and stream IDs 30002 through 60002 are used for downlink data (from the ground station to the UAV). It should be noted that the transport stream allocation in this application is merely an example; the specific allocation method can be adjusted based on the actual application scenario.

[0036] Step S206: Send a control message carrying the identifier of the target transmission stream to the second device to instruct the second device to establish a second connection that supports the transmission of data packets including the target data type based on the identifier of the target transmission stream, wherein the second connection is a connection between the second device and the receiving end.

[0037] Optionally, the identifier of the target transport stream is used to uniquely identify a specific stream selected from a plurality of pre-established SCTP transport streams, and may specifically be a stream ID. For example, an SCTP connection includes multiple streams (stream IDs from 0 to 60000), where stream ID 0 is used for control signaling, stream ID 1 is used for UDP pass-through, stream IDs 2 to 30000 are used for uplink TCP data transmission, and stream IDs 30002 to 60000 are used for downlink TCP data transmission.

[0038] Optionally, a control message is a message used to communicate control commands or status between a first device and a second device.

[0039] The embodiments provided in this application establish a first connection between the first device and the sending end to forward the target data packet based on the target data packet's target data type. This ensures that different connections are mapped to data packets of different data types, achieving independent scheduling. Simultaneously, based on the target data type corresponding to the first connection, a target transport stream supporting the forwarding of the target data packet is determined from multiple transport streams pre-established between the first and second devices. A control message carrying the identifier of the target transport stream is then sent to the second device, instructing it to establish a second connection supporting the transmission of data packets including the target data type. This ensures that different connections are mapped to different transport streams, enabling data packets to be transmitted along connections best suited to their characteristics, avoiding unnecessary conversions and congestion caused by retransmissions. Therefore, the problem of low communication efficiency in connections established in related technologies can be solved, achieving the effect of establishing connections with high communication efficiency.

[0040] In one exemplary embodiment, when it is determined that the sending end is to send a target data packet to the receiving end, establishing a first connection between the first device and the sending end based on the target data type of the target data packet includes: acquiring the target data packet received through a first interface of the first device; determining the receiving address of the receiving end based on the target data packet; determining the target data type based on a first interface type of the first interface, wherein the interface of the first interface type is used to receive data packets whose data type includes the target data type; and establishing the first connection based on the receiving address and the target data type.

[0041] Optionally, the first interface is a network interface on the first device used to receive specific types of data. It can be a physical interface or a logical interface, such as an Ethernet interface, a wireless interface (Wi-Fi, 5G, etc.), or other specially designed data receiving channels. Specifically, when the data type includes TCP and UDP types, the first interface can be two ports: IP_B:PORT_TCP_B and IP_B:PORT_UDP_B, where IP_B is the Internet Protocol (IP) address of the first device.

[0042] Optionally, the first interface type refers to the communication protocol or data transmission characteristics supported by the first interface, used to identify and process different types of data packets. For example, the agent program in the first device listens on two ports, IP_B:PORT_TCP_B and IP_B:PORT_UDP_B. The target data type of the target data packet forwarded to IP_B:PORT_TCP_B (i.e., the first interface type) is UDP, while the target data type of the target data packet forwarded to IP_B:PORT_UDP_B (i.e., the first interface type) is TCP.

[0043] Optionally, the receiving address is the network address of the destination of the target data packet, which can be an IP address, MAC address or other network identifier.

[0044] Optionally, in a drone application scenario, firstly, a bidirectional transparent proxy is deployed on both the drone and the ground station. Secondly, an SCTP connection is established between the SCTP proxy server client and the SCTP proxy server. After the IPTABLES and TPROXY functions are configured, TCP packets from the ground station's local IP_A:PORT_A to the drone's target IP_D:PORT_D are forwarded to the SCTP proxy server client of IP_B:PORT_TCP_B, establishing a connection X between the ground station's local IP_A:PORT_A and the SCTP proxy server client.

[0045] In one exemplary embodiment, determining a target transmission stream from a plurality of transmission streams pre-established between the first device and the second device based on the target data type includes: determining a plurality of target idle transmission streams in an idle state from the plurality of transmission streams included in the plurality of connections pre-established between the first device and the second device based on the target data type, wherein the target idle transmission streams support forwarding data packets whose data type includes the target data type; and determining one of the transmission streams in the target idle transmission streams as the target transmission stream.

[0046] Optionally, the target data type is determined based on the first connection, and multiple target idle transmission streams in an idle state are determined from the multiple transmission streams included in the multiple connections pre-established between the first device and the second device based on the target data type, wherein the target idle transmission streams support forwarding data packets whose data type includes the target data type; and one of the transmission streams in the target idle transmission streams is determined as the target transmission stream.

[0047] Optionally, the multiple connections pre-established between the first device and the second device can be multiple connections established between the first device and the second device before communication begins, via the SCTP protocol or other compatible multi-stream transmission protocols. Each connection can include one or more transport streams, providing different transmission channels for different data types. These multiple connections include, but are not limited to, private network connections for image transmission and 5G public network connections. For example, the first device (drone) and the second device (ground station) may pre-establish an image transmission connection and a 5G connection via the SCTP protocol. The image transmission connection may include transport streams with flow IDs 2 to 302, and the 5G connection may include transport streams with flow IDs 302 to 602.

[0048] Optionally, the target idle transport stream is one of multiple transport streams that currently has no or only a small amount of data being transmitted.

[0049] Optionally, after determining one of the target idle transport streams as the target transport stream, the identifier of the target transport stream and the identifier of the first connection are saved to the local list of the first device.

[0050] Optionally, based on the aforementioned target data type, determining multiple target idle transmission streams in an idle state from the multiple transmission streams included in the multiple connections pre-established between the first device and the second device includes: obtaining a first list, wherein the first list includes multiple transmission streams in an idle state, specifically an idle STREAMMAP; and determining target idle transmission streams from the first list based on the target data type, wherein the multiple transmission streams in an idle state include target idle transmission streams.

[0051] Optionally, in a drone application scenario, the agent program client obtains the target address IP_D:PORT_D of connection X, allocates an idle stream number STREAM_ID from the idle STREAM MAP, and determines the SCTP stream corresponding to STREAM_ID as the target transport stream.

[0052] This embodiment effectively avoids head-of-line blocking by matching different types of data packets to different transport streams. That is, when the transmission of a data packet of one type is blocked, it will not affect the transmission of other types of data.

[0053] In one exemplary embodiment, sending a control message carrying an identifier of the target transport stream to the second device to instruct the second device to establish a second connection supporting the transmission of data packets of the target data type based on the identifier of the target transport stream includes: determining the receiving address of the receiving end based on the received target data packets; generating the control message based on the identifier of the target transport stream and the receiving address; and sending the control message to the second device through a first idle transport stream among the plurality of transport streams to instruct the second device to establish the second connection based on the identifier of the target transport stream and the receiving address, wherein the first idle transport stream is a transport stream included among the plurality of transport streams for transmitting messages between the first device and the second device.

[0054] Optionally, the target data packet includes the receiver's address. The control message includes the identifier of the target transport stream and the receiver's address.

[0055] Optionally, the first idle transport stream is a transport stream used for transmitting control signaling, wherein the control signaling includes control messages. For example, in a pre-established SCTP connection, stream ID 1 may be predefined as the first idle transport stream for transmitting control signaling.

[0056] In one exemplary embodiment, the method further includes: forwarding the target data packet to the second device via the target transport stream, so as to instruct the second device to determine the second connection based on the identifier of the target transport stream, and forwarding the target data to the receiving end via the second connection.

[0057] Optionally, when the second device receives a control message carrying the target transport stream identifier, it determines or establishes a second connection based on the stream ID to prepare for receiving specific types of data packets.

[0058] Optionally, after the second device establishes a second connection with the receiving end, the identifier of the target transmission stream and the identifier of the second connection are saved to the local list of the second device.

[0059] In one exemplary embodiment, forwarding the target data packet to the second device via the target transport stream to instruct the second device to determine the second connection based on the identifier of the target transport stream, and forwarding the target data to the receiving end via the second connection, includes: determining the identifier of the target transport stream corresponding to the first connection based on a first correspondence, wherein the first correspondence is used to indicate the correspondence between the identifier of the target transport stream and the first connection; and forwarding the target data packet to the second device via the target transport stream based on the identifier of the target transport stream when it is determined that the third connection where the target transport stream is located meets a preset rule within a preset time period, instructing the second device to determine the second connection corresponding to the target transport stream based on a second correspondence, and forwarding the target data to the receiving end via the second connection, wherein the third connection is one of a plurality of connections pre-established between the first device and the second device, and the second correspondence is used to indicate the correspondence between the identifier of the target transport stream and the second connection.

[0060] Optionally, the first correspondence is stored locally by the first device and is used to indicate the association between the target transport stream identifier and the first connection. For example, after determining one of the transport streams in the target idle transport stream as the target transport stream, the first device saves the identifier of the target transport stream and the identifier of the first connection to the local list of the first device. The one-to-one correspondence between the identifier of the target transport stream and the identifier of the first connection is the first correspondence.

[0061] Optionally, the third connection is one of the pre-established SCTP connections between the first device and the second device, including but not limited to private network connections for image transmission and 5G public network connections.

[0062] Optionally, a preset time period is a pre-defined period of time used to monitor or evaluate the performance of the pre-established connection between the first device and the second device, such as the real-time round-trip time (RTT) and packet loss rate.

[0063] Optionally, the preset rules are rules used to evaluate whether the connection meets the data transmission requirements, and are used to indicate whether the performance of the connection meets the requirements of data transmission, including but not limited to the maximum allowed RTT and packet loss rate threshold.

[0064] Optionally, the second correspondence is stored locally by the second device and is used to indicate the association between the target transport stream identifier and the second connection. For example, after the second device establishes a second connection with the receiving end, the identifier of the target transport stream and the identifier of the second connection are saved in the local list of the second device. The one-to-one correspondence between the identifier of the target transport stream and the identifier of the second connection is the second correspondence.

[0065] This embodiment selects the optimal third connection for data transmission, ensuring that data packets are transmitted through the best connection within a preset time period, thereby reducing transmission latency and improving data transmission quality. Simultaneously, through the first and second correspondences, the transport stream identifier of the target data packet can be accurately determined and matched with the corresponding connection, ensuring that different types of data packets can be transmitted through a specially preset SCTP stream. This achieves logical isolation of data transmission and avoids head-of-line blocking problems.

[0066] In an exemplary embodiment, the method further includes: determining a target connection when it is determined that the third connection does not meet the preset rule within the preset time period, wherein the target connection is a connection that meets the preset rule within the preset time period among a plurality of connections pre-established between the first device and the second device; forwarding the target data packet to the second device through a backup transport stream in the target connection, wherein the backup transport stream supports forwarding data packets whose data type includes the target data type.

[0067] Optionally, the target connection is a connection selected from multiple pre-established connections that meets preset rules within a preset time period to ensure efficient and stable transmission of data packets. For example, when a performance degradation of a third connection is detected, it will select the currently best-performing connection from among the pre-established connections as the target connection, such as the SCTP connection with the lowest RTT and the lowest packet loss rate.

[0068] Optionally, the backup transport stream is an unoccupied or currently idle transport stream in the target connection, used to temporarily or alternatively transmit target data packets when the performance of the third connection where the target transport stream resides degrades.

[0069] This embodiment establishes multiple connections between the first and second devices in advance. If the performance of the currently used connection is detected to be inconsistent with preset rules, it can quickly switch to a backup connection and seamlessly continue data transmission. Even if the main path is interrupted, it can ensure communication continuity and task execution efficiency. Meanwhile, upper-layer applications do not need to concern themselves with the underlying communication details, including the management of transport stream identifiers, the selection and switching of third connections, etc. The transparent proxy handles these processes, maintaining the transparency of data transmission, reducing the design complexity of upper-layer applications, and improving the overall usability and maintainability of the system.

[0070] The connection establishment method in the embodiments of this application will be explained below with reference to optional examples.

[0071] Figure 3 is a schematic diagram of another optional connection establishment method according to an embodiment of this application, using a ground station as the sending end and an aircraft as the receiving end as an example:

[0072] First, deploy a two-way transparent agent on both the drone and ground station sides.

[0073] Secondly, an SCTP connection is established, binding the private network IP and the 5G public network IP as a multi-homed address pair. Specifically, an SCTP connection is first established from SCTP proxy server client B to SCTP proxy server server C. After the IPTABLES and TPROXY functions of local device A in the ground station are configured, local device A sends TCP packets to device D in the aircraft with address IP_D:PORT_D via IP_A:PORT_A. The sent TCP packets are forwarded to the proxy program client with IP_B:PORT_TCP_B, establishing connection X between local device A and proxy server client B. Proxy program client B obtains the address IP_D:PORT_D of connection X, allocates an idle stream number STREAM_ID (such as ID 2) from the idle STREAM MAP, packages (ID_D:PORTD, STREAM_ID) into a control message block and sends it to proxy server server C via SCTP STREAM 0, while simultaneously recording (STREAM_ID, X) in the local list of proxy server client B. Proxy server server C receives the STREAM... The control message block sent by 0 is parsed, IP_D:PORT_D is established, a connection Y from the proxy server C to IP_D:PORT_D is established, and (STREAM_ID,Y) is recorded in the local list of the proxy server C.

[0074] Finally, the proxy server client B enters the TCP packet based on connection X, finds the STREAM_ID corresponding to connection X through B's list, and forwards the TCP packet to the proxy server C through the SCTP stream corresponding to STREAM_ID. After receiving the TCP packet through the SCTP stream corresponding to STREAM_ID, the proxy server C finds connection Y through STREAM_ID and forwards the TCP packet to device D in the aircraft through connection Y, completing the uplink proxy process. Here, it is agreed that data sent from the ground station to the UAV is uplink, and data sent from the UAV to the ground station is downlink.

[0075] Optionally, the explanation will take an example where the transmitter is an aircraft and the receiver is a ground station:

[0076] First, deploy a two-way transparent agent on both the drone and ground station sides.

[0077] Secondly, an SCTP connection is established, binding the private network IP and the 5G public network IP as a multi-homed address pair. Specifically, an SCTP connection is first established from SCTP proxy server client B to SCTP proxy server server C. After the IPTABLES and TPROXY functions of device D in the aircraft are configured, device D sends TCP packets to local device A at address IP_A:PORT_A via IP_D:PORT_D. The sent TCP packets are forwarded to the proxy program client at IP_B:PORT_TCP_B, establishing connection X between device D and proxy server client B. Proxy program client B obtains the address IP_A:PORT_A of connection X, allocates an idle stream number STREAM_ID (e.g., ID 60000) from the idle STREAM MAP, packages (IP_A:PORT_A, STREAM_ID) into a control message block, and sends it to proxy server server C via SCTP STREAM 0. At the same time, (STREAM_ID, X) is recorded in the local list of proxy server client B. Proxy server server C receives the STREAM... The control message block sent by 0 is parsed, IP_A:PORT_A is established, a connection Y is established from the proxy server C to IP_A:PORT_A, and (STREAM_ID,Y) is recorded in the local list of the proxy server C.

[0078] Finally, the proxy server client B enters the TCP packet based on connection X, finds the STREAM_ID corresponding to connection X through B's list, and forwards the TCP packet to the proxy server C through the SCTP stream corresponding to STREAM_ID. After receiving the TCP packet through the SCTP stream corresponding to STREAM_ID, the proxy server C finds connection Y through STREAM_ID and forwards the TCP packet to local device A through connection Y, completing the downlink proxy process. Here, it is agreed that the data sent from the UAV to the ground station is the downlink.

[0079] In one embodiment, the RTT, packet loss rate, and SACK feedback of each connection between proxy server client B and proxy server server C are monitored in real time. If the current connection between proxy server client B and proxy server server C is determined to be degraded based on the RTT, packet loss rate, and SACK feedback, for example, if HEARTBEAT is sent multiple times (e.g., 3 times) without receiving HEARTBEAT ACK, the current connection is considered degraded and unreachable. The SCTP stack will automatically switch to the backup connection. After the original connection is restored, it can selectively switch back or maintain the current optimal path. During this process, the upper layer application is unaware of the connection switching.

[0080] In one embodiment, proxy server client B and proxy server server C negotiate and statically allocate flow IDs during the SCTP INIT phase, as shown in Table 1:

[0081] Table 1:

[0082]

[0083] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0084] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory (ROM) / random access memory (RAM), magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0085] According to another aspect of the embodiments of this application, a connection establishment apparatus is also provided. This apparatus is applied to a first device, and the module execution duration determination apparatus can be used to implement the connection establishment method provided in the above embodiments, and will not be repeated hereafter. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0086] Figure 4 is a structural block diagram of an optional connection establishment device according to an embodiment of this application. As shown in Figure 4, the device includes:

[0087] The first connection establishment module 402 is used to establish a first connection between the first device and the sending end based on the target data type of the target data packet when it is determined that the sending end is to send a target data packet to the receiving end.

[0088] The first determining module 404 is used to determine a target transmission stream from multiple transmission streams pre-established between the first device and the second device based on the target data type, wherein the target transmission stream supports forwarding data packets whose data type includes the target data type.

[0089] The first sending module 406 is configured to send a control message carrying the identifier of the target transmission stream to the second device, so as to instruct the second device to establish a second connection based on the identifier of the target transmission stream to support the transmission of data packets including the target data type, wherein the second connection is a connection between the second device and the receiving end.

[0090] It should be noted that the first establishing module 402 in this embodiment can be used to execute the above step S202, the first determining module 404 in this embodiment can be used to execute the above step S204, and the first sending module 406 in this embodiment can be used to execute the above step S206.

[0091] In an exemplary embodiment, the first establishment module 402 includes: a first acquisition submodule, configured to acquire the target data packet received through the first interface of the first device; a first determination submodule, configured to determine the receiving address of the receiving end based on the target data packet; a second determination submodule, configured to determine the target data type based on the first interface type of the first interface, wherein the interface of the first interface type is used to receive data packets whose data type includes the target data type; and a first establishment submodule, configured to establish the first connection based on the receiving address and the target data type.

[0092] In an exemplary embodiment, the first determining module 404 includes: a third determining submodule, configured to determine, based on the target data type, a plurality of target idle transmission streams in an idle state from the plurality of transmission streams included in the plurality of connections pre-established between the first device and the second device, wherein the target idle transmission streams support forwarding data packets whose data type includes the target data type; and a fourth determining submodule, configured to determine one of the transmission streams in the target idle transmission streams as the target transmission stream.

[0093] In one exemplary embodiment, the first sending module 406 includes: a fifth determining submodule, configured to determine the receiving address of the receiving end based on the received target data packet; a first generating submodule, configured to generate the control message based on the identifier of the target transport stream and the receiving address; and a first sending submodule, configured to send the control message to the second device through a first idle transport stream among the plurality of transport streams, to instruct the second device to establish the second connection based on the identifier of the target transport stream and the receiving address, wherein the first idle transport stream is a transport stream among the plurality of transport streams used for transmitting messages between the first device and the second device.

[0094] In one exemplary embodiment, the apparatus further includes: a first forwarding module, configured to forward the target data packet to the second device via the target transport stream, thereby instructing the second device to determine the second connection based on the identifier of the target transport stream, and to forward the target data packet to the receiving end via the second connection.

[0095] In an exemplary embodiment, the first forwarding module includes: a sixth determining submodule, configured to determine the identifier of the target transmission stream corresponding to the first connection based on a first correspondence, wherein the first correspondence is used to indicate the correspondence between the identifier of the target transmission stream and the first connection; and a first forwarding submodule, configured to, when determining that the third connection where the target transmission stream is located meets a preset rule within a preset time period, forward the target data packet to the second device based on the identifier of the target transmission stream, so as to instruct the second device to determine the second connection corresponding to the target transmission stream based on a second correspondence, and forward the target data to the receiving end through the second connection, wherein the third connection is one of a plurality of connections pre-established between the first device and the second device, and the second correspondence is used to indicate the correspondence between the identifier of the target transmission stream and the second connection.

[0096] In one exemplary embodiment, the apparatus further includes: a second determining module, configured to determine a target connection when it is determined that the third connection does not satisfy the preset rule within the preset time period, wherein the target connection is a connection that satisfies the preset rule within the preset time period among a plurality of pre-established connections between the first device and the second device; and a second forwarding module, configured to forward the target data packet to the second device through a backup transport stream in the target connection, wherein the backup transport stream supports forwarding data packets whose data type includes the target data type.

[0097] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.

[0098] According to another aspect of the embodiments of this application, a computer-readable storage medium is provided, the computer-readable storage medium including a stored program, wherein the program executes the steps in any of the above method embodiments when it is run.

[0099] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, ROMs, RAMs, portable hard drives, magnetic disks, or optical disks.

[0100] According to another aspect of the embodiments of this application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor is configured to perform the steps of any of the method embodiments described above via the computer program. In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0101] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.

[0102] According to another aspect of the embodiments of this application, a computer program product is also provided, the computer program product including a computer program / instructions containing program code for performing the method shown in the flowchart.

[0103] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.

[0104] The above are merely preferred embodiments of this application and are not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.

Claims

1. A method for establishing a connection, characterized in that, The method, applied to a first device, includes: upon determining that a sender intends to send a target data packet to a receiver, establishing a first connection between the first device and the sender based on the target data type of the target data packet; determining a target transport stream from a plurality of transport streams pre-established between the first device and a second device based on the target data type, wherein the target transport stream supports forwarding data packets whose data type includes the target data type; and sending a control message carrying an identifier of the target transport stream to the second device to instruct the second device to establish a second connection based on the identifier of the target transport stream that supports transmitting data packets whose data type includes the target data type, wherein the second connection is a connection between the second device and the receiver.

2. The method according to claim 1, characterized in that, When it is determined that the sending end is to send a target data packet to the receiving end, establishing a first connection between the first device and the sending end based on the target data packet's target data type includes: acquiring the target data packet received through a first interface of the first device; determining the receiving address of the receiving end based on the target data packet; determining the target data type based on a first interface type of the first interface, wherein the interface of the first interface type is used to receive data packets whose data type includes the target data type; and establishing the first connection based on the receiving address and the target data type.

3. The method according to claim 1, characterized in that, Determining a target transport stream from multiple transport streams pre-established between the first device and the second device based on the target data type includes: determining multiple target idle transport streams in an idle state from the multiple transport streams included in the multiple connections pre-established between the first device and the second device based on the target data type, wherein the target idle transport streams support forwarding data packets whose data type includes the target data type; and determining one of the transport streams in the target idle transport streams as the target transport stream.

4. The method according to claim 1, characterized in that, Sending a control message carrying the identifier of the target transport stream to the second device to instruct the second device to establish a second connection supporting the transmission of data packets of the target data type based on the identifier of the target transport stream includes: determining the receiving address of the receiving end based on the received target data packet; generating the control message based on the identifier of the target transport stream and the receiving address; sending the control message to the second device through a first idle transport stream among the plurality of transport streams to instruct the second device to establish the second connection based on the identifier of the target transport stream and the receiving address, wherein the first idle transport stream is a transport stream included among the plurality of transport streams for transmitting messages between the first device and the second device.

5. The method according to any one of claims 1 to 4, characterized in that, The method further includes: forwarding the target data packet to the second device through the target transport stream, so as to instruct the second device to determine the second connection based on the identifier of the target transport stream, and forwarding the target data packet to the receiving end through the second connection.

6. The method according to claim 5, characterized in that, Forwarding the target data packet to the second device via the target transport stream, to instruct the second device to determine the second connection based on the identifier of the target transport stream, and forwarding the target data to the receiving end via the second connection, includes: determining the identifier of the target transport stream corresponding to the first connection based on a first correspondence, wherein the first correspondence is used to indicate the correspondence between the identifier of the target transport stream and the first connection; if it is determined that the third connection where the target transport stream is located meets a preset rule within a preset time period, forwarding the target data packet to the second device via the target transport stream based on the identifier of the target transport stream, to instruct the second device to determine the second connection corresponding to the target transport stream based on a second correspondence, and forwarding the target data to the receiving end via the second connection, wherein the third connection is one of a plurality of connections pre-established between the first device and the second device, and the second correspondence is used to indicate the correspondence between the identifier of the target transport stream and the second connection.

7. The method according to claim 6, characterized in that, The method further includes: determining a target connection when it is determined that the third connection does not meet the preset rule within the preset time period, wherein the target connection is a connection that meets the preset rule within the preset time period among a plurality of connections pre-established between the first device and the second device; forwarding the target data packet to the second device through a backup transport stream in the target connection, wherein the backup transport stream supports forwarding data packets whose data type includes the target data type.

8. A connection establishment device, characterized in that, The device is applied to a first device and includes: a first establishment module, configured to establish a first connection between the first device and the sending end based on the target data type of the target data packet when it is determined that the sending end is to send a target data packet to the receiving end; a first determination module, configured to determine a target transport stream from a plurality of transport streams pre-established between the first device and the second device based on the target data type, wherein the target transport stream supports forwarding data packets whose data type includes the target data type; and a first sending module, configured to send a control message carrying an identifier of the target transport stream to the second device to instruct the second device to establish a second connection based on the identifier of the target transport stream that supports transmitting data packets whose data type includes the target data type, wherein the second connection is a connection between the second device and the receiving end.

9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Two-way transparent proxy method and two-way transparent proxy system

    CN107483593A

  • Method and apparatus for establishing wireless connection

    CN109076624A

  • Data transmission method and device

    CN111294399A

  • IP transparent transmission method and system based on UDP and QUIC protocols

    CN115604339A

  • Audio and video data transmission method and system

    CN116233563A