CN115643646A - Data transmission method and device and electronic equipment - Google Patents

Data transmission method and device and electronic equipment Download PDF

Info

Publication number
CN115643646A
CN115643646A CN202211266021.9A CN202211266021A CN115643646A CN 115643646 A CN115643646 A CN 115643646A CN 202211266021 A CN202211266021 A CN 202211266021A CN 115643646 A CN115643646 A CN 115643646A
Authority
CN
China
Prior art keywords
connection
sub
identifier
target server
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211266021.9A
Other languages
Chinese (zh)
Inventor
许炳昆
张利洪
李智慧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN202211266021.9A priority Critical patent/CN115643646A/en
Publication of CN115643646A publication Critical patent/CN115643646A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The embodiment of the application discloses a data transmission method, a data transmission device and electronic equipment, wherein after a first sub-stream between a terminal and a target server is established based on a first path and first session information corresponding to the first sub-stream, first connection information is established based on the first session information, the first connection information comprises an identifier of the target server in the first session information, the target server is selected from a plurality of servers according to a load balancing algorithm, and the first connection information is respectively associated with each connection identifier in the first session information, so that when a second sub-stream creation message sent by the terminal is obtained through a second path, the first connection information can be found according to the target connection identifier in the message created by the second sub-stream, and the second sub-stream creation message is sent to the target server according to the identifier of the target server in the first connection information to create the second sub-stream.

Description

Data transmission method and device and electronic equipment
Technical Field
The present application relates to the field of communications technologies, and in particular, to a data transmission method and apparatus, an electronic device, and a storage medium.
Background
With the diversification of the access network forms of the terminal devices, the 4G/5G, the WIFI, the ethernet and the like become the common network access technologies, and the terminals often have the capability of accessing multiple networks simultaneously, such as the WIFI, the 4G and the like, but most terminals often cannot support the simultaneous use of multiple access networks, that is, cannot support the multipath transmission. In order to improve support for multipath, many protocols are designed or functionally expanded based on multipath, so that some scenarios can support multipath transmission, but some scenarios cannot achieve multipath transmission, for example, a load balancing service scenario of multi-instance deployment, and the like.
Disclosure of Invention
The application aims to provide a data transmission method, a data transmission device and electronic equipment, and the data transmission method, the device and the electronic equipment comprise the following technical scheme:
a method of data transmission, the method comprising:
establishing a first sub-stream between a terminal and a target server and first session information corresponding to the first sub-stream based on a first path; the target server is selected from a plurality of servers according to a load balancing algorithm; the first session information comprises an identifier of the target server and at least one connection identifier negotiated by the terminal and the target server;
establishing first connection information based on the first session information, wherein the first connection information is associated with each connection identifier in the at least one connection identifier, and the first connection information comprises an identifier of the target server;
obtaining a second sub-flow establishing message sent by the terminal through a second path, and searching the first connection information according to a target connection identifier carried in the second sub-flow establishing message; the target connection identifier is any one of the at least one connection identifier;
and forwarding the second sub-flow creation packet to the target server according to the identifier of the target server in the first connection information so as to establish the second sub-flow.
The above method, optionally, further includes: and establishing second session information corresponding to the second sub-stream according to the first connection information, wherein the second session information comprises the identifier of the target server.
The above method, optionally, further includes:
obtaining a target message sent by the terminal through the second path; the target message belongs to the second sub-stream;
searching second session information corresponding to the second sub-stream;
and forwarding the target message to the target server according to the target server identifier in the second session information.
In the above method, optionally, the first session information at least includes a first connection identifier and at least one non-first connection identifier; wherein the content of the first and second substances,
the first connection identifier is obtained by the terminal and the target server through negotiation in the process of establishing the first sub-flow through negotiation;
the at least one non-first connection identifier is obtained by the terminal and the target server based on the first sub-flow negotiation.
The method, optionally, a process of negotiating the at least one non-first connection identifier includes:
obtaining a connection application message sent by the terminal through the first path, wherein the connection application message belongs to the first sub-stream;
forwarding the connection application packet to the target server according to the identifier of the target server in the first session information corresponding to the first sub-stream;
obtaining a response message sent by the target server corresponding to the connection application message, wherein the response message carries at least one distributed non-first connection identifier;
adding the at least one non-first connection identification to the first session message.
The above method, optionally, further includes:
associating the at least one non-first connection identification with the first connection information, respectively.
In the above method, optionally, the target connection identifier is: the first connection identifier; or, the target connection identifier is: any one of the at least one non-first connection identifier is a non-first connection identifier.
The above method, optionally, further includes:
acquiring a connection deletion message sent by a terminal; the deletion connection packet belongs to a target sub-stream, and the target sub-stream is the first sub-stream or the second sub-stream;
and deleting the connection identifier indicated by the connection deletion message from the first session information and the first connection information, and removing the association relationship between the connection identifier indicated by the connection deletion message and the first connection information.
A data transmission apparatus, the apparatus comprising:
the system comprises a first establishing module, a second establishing module and a third establishing module, wherein the first establishing module is used for establishing a first sub-flow between a terminal and a target server and first session information corresponding to the first sub-flow based on a first path; the target server is selected from a plurality of servers according to a load balancing algorithm; the first session information comprises an identifier of the target server and at least one connection identifier negotiated by the terminal and the target server;
a second establishing module, configured to establish first connection information based on the first session information, where the first connection information is associated with each connection identifier in the at least one connection identifier, and the first connection information includes an identifier of the target server;
the searching module is used for obtaining a second sub-flow establishing message sent by the terminal through a second path and searching the first connection information according to a target connection identifier carried in the second sub-flow establishing message; the target connection identifier is any one of the at least one connection identifier;
and the forwarding module is used for forwarding the second sub-flow creation packet to the target server according to the identifier of the target server in the first connection information so as to establish the second sub-flow.
An electronic device, comprising:
a memory for storing a program;
a processor, configured to call and execute the program in the memory, and implement the steps of the data transmission method according to any one of the above items by executing the program.
A readable storage medium, having stored thereon a computer program which, when executed by a processor, carries out the steps of the data transmission method as claimed in any one of the preceding claims.
According to the scheme, after the first sub-stream between the terminal and the target server and the first session information corresponding to the first sub-stream are established based on the first path, the first connection information is established based on the first session information, the first connection information includes an identifier of the target server in the first session information, the target server is selected from the multiple servers according to a load balancing algorithm, and the first connection information is respectively associated with each connection identifier in the first session information.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the embodiments will be briefly described below, and obviously, the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1a is an exemplary diagram of multipath transmission provided by an embodiment of the present application;
fig. 1b is an exemplary diagram of a single-path transmission-based access load balancing service according to an embodiment of the present application;
fig. 1c is a diagram illustrating an example of a multipath-based transmission access load balancing service according to an embodiment of the present disclosure;
fig. 2 is a flowchart of an implementation of a data transmission method according to an embodiment of the present application;
fig. 3 is a flowchart of an implementation of negotiating at least one non-first connection identifier according to an embodiment of the present application;
fig. 4 is an exemplary diagram of an association relationship between session information and connection information provided in an embodiment of the present application;
fig. 5 is a schematic structural diagram of a data transmission device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in other sequences than described or illustrated herein.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without inventive step, are within the scope of the present disclosure.
The multi-path transmission means that two communication parties use a plurality of paths to carry out data communication, so that the network utilization rate can be improved. As shown in fig. 1a, an exemplary diagram of multipath transmission provided in the embodiment of the present application is shown, in which a mobile terminal and a server perform data communication simultaneously through two paths, namely, wiFi and a 4G network.
The multi-instance deployed load balancing service means that a business service is no longer provided by a single server, but a plurality of servers which are backed up with each other and have independent business service capabilities are deployed to provide the business service, that is, different servers have the same business service capabilities, but each server independently provides the business service. In practical application, a plurality of deployed servers provide actual service for a terminal side, and a load balancer determines which server is specifically selected to provide the service according to a preset load balancing algorithm. As shown in fig. 1b, for an example of a single-path transmission access load balancing service provided by the embodiment of the present application, in this example, a mobile terminal performs data communication with a load balancer through one path of a 4G network, when the mobile terminal needs to invoke a service, an initialization handshake message is sent to the load balancer through the 4G network, the load balancer creates new session information (denoted as first session information) in a session table, associates a five-tuple of the initialization handshake message (i.e., a source IP address, a source port number, a protocol number, a destination IP address, and a destination port number) with the first session information, selects one server (denoted as a target server) from multiple servers according to a load balancing algorithm, in the example shown in fig. 1b, the load balancer selects server 1 as the target server according to the load balancing algorithm, forwards the initialization handshake message to the target server, and adds an identifier of the target server to the first session information. After receiving the initialization handshake message, the target server creates a connection identifier (marked as a first connection identifier) and other related parameters, and replies the message, where the replied message carries the first connection identifier and other related parameters. And after receiving the message replied by the target server, the load balancer forwards the message replied by the target server to the mobile terminal. And after receiving the message replied by the target server, the mobile terminal sends a handshake completion message to the load balancer, wherein the handshake completion message carries the first connection identifier. The load balancer finds the first session information according to the quintuple carried in the handshake completing message, forwards the handshake completing message to the target server according to the identification of the target server in the first session information, and adds the first connection identification to the first session information. And then, data interaction can be carried out between the mobile terminal and the target server, specifically, the mobile terminal can send a data message to the load balancer, the load balancer finds out the first session information according to the quintuple in the data message, and forwards the data message to the target server according to the identifier of the target server in the first session information, so that data transmission between the mobile terminal and the target server is realized.
In the example shown in fig. 1b, the mobile terminal and the load balancer are connected by a single path, and if the mobile terminal and the load balancer perform multi-path transmission, a load balancing service cannot be implemented based on the current data transmission method. As shown in fig. 1c, an exemplary diagram of a multi-path transmission-based access load balancing service provided in the embodiment of the present application is shown, in which a mobile terminal and a load balancer are connected through two paths, namely, a WiFi network and a 4G network, at the same time, and data transmission is performed between the load balancer and each server through the same path. Assuming that a mobile terminal establishes connection and a first substream with a target server (i.e., the server 1) through a 4G network, a subsequent mobile terminal sends a second substream creation message to a load balancer through a WIFI network, after receiving the second substream creation message, the load balancer searches for a session message according to a five-tuple carried in the second substream creation message, because the second substream creation message belongs to a first message of the second substream, the session message cannot be found, at this time, the load balancer selects one server from a plurality of servers again according to a load balancing algorithm and forwards the second substream creation message to the selected server, and the server selected based on the load balancing policy is not necessarily the server 1 (for example, the server 2 or the server 3 may be), so that the second substream between the mobile terminal and the server 1 cannot be successfully established, and transmission cannot be realized, and network resources cannot be fully utilized.
The application is provided for realizing multi-path data transmission in a multi-instance deployed load balancing service scene. The data transmission method and the data transmission device provided by the embodiment of the application can be used for a load balancer. The responsible equalizer may be implemented by a single server, or may be implemented by a server cluster, or may be implemented by a cloud server.
As shown in fig. 2, a flowchart for implementing a data transmission method provided in this embodiment may include:
step S201: establishing a first sub-stream between the terminal and the target server and first session information corresponding to the first sub-stream based on the first path; the target server is selected from a plurality of servers according to a load balancing algorithm; the first session information includes an identifier of the target server and at least one connection identifier negotiated by the terminal and the target server.
The terminal may be a mobile terminal, such as a mobile phone, a notebook computer, a tablet computer, or a desktop device, such as a conventional computer (a computer with a server and a display independent of each other), an all-in-one computer, or other terminal devices.
In the application, only one connection identifier may be negotiated between the terminal and the target server, or multiple connection identifiers may be negotiated. The process of negotiating one connection identifier may refer to the foregoing process of negotiating a first connection identifier, and the process of negotiating multiple connection identifiers may refer to the following embodiments.
Step S202: and establishing first connection information based on the first session information, wherein the first connection information is associated with each connection identifier in at least one connection identifier, and the first connection information comprises the identifier of the target server.
One piece of connection information (denoted as first connection information) may be established in the connection table based on the first session information, that is, all connection information is recorded in the table (denoted as connection table). And associating each connection identifier in the at least one connection identifier with the first connection information, so that the first connection information can be found based on each connection identifier in the at least one connection identifier.
Step S203: acquiring a second sub-flow establishing message sent by the terminal through a second path, and searching first connection information according to a target connection identifier carried in the second sub-flow establishing message; the target connection identifier is any one of the at least one connection identifier.
Each sub-stream may be characterized by a five-tuple of packets in the sub-stream, i.e., the five-tuple of packets in the same sub-stream is the same.
The target connection identifier may be the first connection identifier, or may be any non-first connection identifier in the at least one connection identifier.
In the application, although the second sub-stream creation packet belongs to the first packet of the second sub-stream and cannot find the corresponding session information, the second sub-stream creation packet carries the target connection identifier, and the target connection identifier is associated with the first connection information, so that the first connection information can be found, and further the identifier of the target server can be obtained.
Step S204: and forwarding the second sub-flow establishing message to the target server according to the identification of the target server in the first connection information so as to establish a second sub-flow.
The second sub-flow creating message is forwarded to the target server, so that the second sub-flow between the terminal and the target server can be successfully created.
According to the data transmission method, after a first sub-stream between a terminal and a target server and first session information corresponding to the first sub-stream are established based on a first path, first connection information is established based on the first session information, the first connection information comprises an identifier of a target server in the first session information, the target server is obtained by selection from a plurality of servers according to a load balancing algorithm, and the first connection information is respectively associated with each connection identifier in the first session information.
In an optional embodiment, the data transmission method provided in the present application may further include:
and after the second sub-flow establishing message is forwarded to the target server, establishing second session information corresponding to the second sub-flow according to the first connection information, wherein the second session information comprises the identifier of the target server.
After the second session information is created, the second session information may be associated with the second sub-stream, and in particular, the second session information may be associated with a five-tuple of the second sub-stream creation packet.
Optionally, the first connection information may include, in addition to the identifier of the target server, the at least one connection identifier and identifiers of each piece of target session information; the target session information is session information having the same connection identifier as the first connection information. Of course, the target session information and the first connection information both have the identifier of the target server.
Further, the data transmission method provided by the present application may further include:
obtaining a target message sent by the terminal through a second path; the target packet belongs to the second sub-stream, i.e. the five-tuple of the target packet represents the second sub-stream. The target message may be a data message, a negotiation message, or another type of message. The target packet is a non-first packet of the second sub-stream.
And searching second session information corresponding to the second sub-stream. And searching the second session information according to the quintuple of the target message.
And forwarding the target message to the target server according to the identifier of the target server carried in the second session information.
That is, in the present application, the session information belongs to a fast lookup table, which is suitable for fast forwarding of traffic, and the connection information belongs to a general lookup table, which is suitable for new sub-flow establishment in a load balancing service scenario.
In an optional embodiment, the first session information includes at least two connection identifiers, which may specifically include: a first connection identifier and at least one non-first connection identifier; wherein the content of the first and second substances,
the first connection identifier is obtained by the terminal and the target server through negotiation in the process of negotiating and establishing the first sub-stream, and the specific negotiation process refers to the foregoing embodiments, which are not described herein again.
The at least one non-first connection identifier is obtained by the terminal and the target server based on the first sub-flow negotiation.
Optionally, an implementation flowchart for negotiating the at least one non-first connection identifier provided in the embodiment of the present application is shown in fig. 3, and may include:
step S301: and obtaining a connection application message sent by the terminal through the first path, wherein the connection application message belongs to the first sub-flow.
The connection application message is used for applying for a new connection identifier. The terminal may apply for a new connection identifier immediately after the first sub-stream is created, or may apply for a new connection identifier after the first sub-stream is created for a period of time (i.e., data is transmitted to the target server through the first sub-stream for a period of time). The terminal may send the connection application packet when detecting the existence of the second path, and the terminal may detect the existence of the second path before establishing the first sub-flow, or may detect the existence of the second path after establishing the first sub-flow for a period of time. Under the condition that the second path is detected before the first sub-flow is established, the terminal can apply for a new connection identifier immediately after the first sub-flow is established, or can apply for a new connection identifier after data of a period of time is transmitted between the first sub-flow and the target server. Under the condition that the second path is detected after the first substream is established for a period of time, the terminal can only send the connection application message after the first substream is established for a period of time. Of course, the terminal may also send the connection application message to apply for a new connection identifier without detecting the second path, so that when the second path is detected, the terminal does not need to apply for a new connection identifier, but directly uses the applied connection identifier, thereby improving the data transmission efficiency.
Step S302: and forwarding the connection application message to the target server according to the identifier of the target server in the first session information corresponding to the first sub-stream.
The session information corresponding to the quintuple can be searched according to the quintuple carried in the connection application message, and the searched session information is the first session information because the connection application message belongs to the first sub-stream.
Step S303: and acquiring a response message sent by the target server corresponding to the connection application message, wherein the response message carries at least one distributed non-first connection identifier.
The connection application message may carry the number of connections to be applied, and if M is assumed, the target server may create M non-first connection identifiers, that is, create M connections between the terminal and the target server, where the identifiers of the M connections are the M non-first connection identifiers.
Step S304: at least one non-first connection identity is added to the first session message.
The method and the device add at least one non-first connection identifier negotiated based on the first sub-flow into a first session message corresponding to the first sub-flow, so that the first session message has a plurality of connection identifiers.
Optionally, the target connection identifier carried in the second sub-flow creation packet may be the first connection identifier, or may be any one of the at least one non-first connection identifier.
In summary, in the present application, one piece of session information is established corresponding to each sub-stream, different sub-streams correspond to different pieces of session information, and the session information corresponding to different sub-streams has the same server identifier and connection identifier. Each connection identifier in the corresponding session message corresponding to different sub-streams is associated with the same connection information, and the connection information has the server identifier in the session message, and further can include the connection identifier in the session message, and further can include the identifiers of each session message.
Fig. 4 is a diagram illustrating an example of association between session information and connection information according to an embodiment of the present application. In this example, two sub-streams and two connection identifiers are exemplified. Wherein, each line in the session table represents a session information, the session identifier session _ idk is used to uniquely identify the kth (k =1,2,3, \8230;, n) session information, the source information original _ info represents the source information of the kth sub-stream, the target _ info represents the destination information of the kth sub-stream, the server _ idk is the identifier of the server to which the kth sub-stream flows, the connection _ id _ veck represents a group of session identifiers negotiated based on the kth sub-stream, one line in the connection table represents a connection information, and cidj is used to uniquely identify the jth (j =1,2,3, \8230;, m) connection information.
In the example shown in fig. 4, a first sub-stream between the terminal and the target server is established based on the first path, and first session information (session _ id2 session information in fig. 4) corresponding to the first sub-stream, where a group of connection identifiers (denoted by connection _ id _ vec2 in fig. 4) in the first session information at least includes a first connection identifier and a second connection identifier, where the first connection identifier is determined by negotiation in a process of negotiating the first sub-stream between the terminal and the target server, and the second connection identifier is obtained by the terminal and the target server based on the negotiation of the first sub-stream. After the first session information is established, establishing first connection information (connection information identified by connection identifier cid2 in fig. 4) in the connection table, associating the first connection information with each connection identifier connection _ id in connection _ id _ vec2 (specifically, connection identifier cid2 may be associated with each connection identifier connection _ id in connection _ id _ vec2, and connection identifier cid2 is used as an index of the first connection information, so that after connection identifier cid2 is found, connection information identified by cid2 may be found, and thus, connection information identified by connection identifier cid2 can be found based on each connection identifier _ id in connection _ id _ vec 2. Then, when the second sub-stream creation packet is obtained through the second path, the second sub-stream creation packet carries the second connection identifier, and since the session table cannot be found, the first connection information may be found through the second connection identifier, and further, the second sub-stream creation packet is forwarded to the target server identified by the server _ id2 through the server identifier (server _ id2 in fig. 4) in the first connection information, so as to create the second sub-stream. Then, a second session message (session information identified by session _ id3 in fig. 4) corresponding to the second sub-stream may be established based on the first connection information, both server _ id2 and connection _ id _ vec2 in the second session message are determined based on the first connection information, and source information _ info3 and destination information target _ info3 may be determined based on the second sub-stream creation packet. When the message belonging to the second sub-stream is received again, the second session information can be directly searched, and the message is forwarded to the target server according to the server _ id2 in the second session information.
Similarly, if the third sub-stream creation packet is obtained through the third path, the third sub-stream creation packet may be processed with reference to the processing flow of the second sub-stream creation packet, and then the third sub-stream creation packet may be forwarded to the target server based on the first connection information, and third session information corresponding to the third sub-stream may also be created based on the first connection information, both server _ id2 and connection _ id _ vec2 in the third session information are determined based on the first connection information, and source information _ info4 and destination information target _ info4 may be determined based on the third sub-stream creation packet. When the packet belonging to the third sub-stream is received again, the third session information can be directly searched, and the packet is forwarded to the target server according to the server _ id2 in the third session information.
Further, after the second sub-stream or the third sub-stream is established, a new connection may also be applied through the second sub-stream or the third sub-stream, and for the specific application process, reference may be made to the foregoing process of applying for a new connection based on the first sub-stream, and details are not described here.
In an actual application scenario, there may be a situation of connection update, and based on this, in an optional embodiment, the data transmission method provided in this embodiment may further include:
and acquiring a connection updating message sent by the terminal, wherein the connection updating message belongs to a target sub-stream, the target sub-stream can be a first sub-stream or a second sub-stream, and the connection updating message indicates that a third connection identifier is used for data transmission. The third connection identity is an unused connection identity of the at least one connection identity comprised in the first session information.
Since the third connection identifier is already recorded in the first session information and the first connection information, the load balancer directly forwards the connection update message to the target server.
Further, the load balancer may also obtain a deletion connection packet sent by the terminal, where the deletion connection packet belongs to a target substream, and the target substream may be the first substream or the second substream.
And the load balancer deletes the connection identifier indicated by the connection deleting message from the first session information and the first connection information, and removes the association relation between the connection identifier indicated by the connection deleting message and the first connection information. And under the condition that the second session information is established, deleting the connection identifier indicated by the deletion connection message from the second session information.
Based on the method and the device, the establishment, the updating and the deletion of the multi-connection can be realized, and the stability of the multi-path data transmission is ensured.
Corresponding to the method embodiment, an embodiment of the present application further provides a data transmission device, and a schematic structural diagram of the data transmission device provided in the embodiment of the present application is shown in fig. 5, and the data transmission device may include:
a first establishing module 501, a second establishing module 502, a searching module 503 and a forwarding module 504; wherein, the first and the second end of the pipe are connected with each other,
the first establishing module 501 is configured to establish a first sub-stream between a terminal and a target server and first session information corresponding to the first sub-stream based on a first path; the target server is selected from a plurality of servers according to a load balancing algorithm; the first session information comprises an identifier of the target server and at least one connection identifier negotiated by the terminal and the target server;
the second establishing module 502 is configured to establish first connection information based on the first session information, where the first connection information is associated with each connection identifier of the at least one connection identifier, and the first connection information includes an identifier of the target server;
the searching module 503 is configured to obtain a second sub-stream creation packet sent by the terminal through a second path, and search for the first connection information according to a target connection identifier carried in the second sub-stream creation packet; the target connection identifier is any one of the at least one connection identifier;
the forwarding module 504 is configured to forward the second sub-flow creation packet to the target server according to the identifier of the target server in the first connection information, so as to establish the second sub-flow.
According to the data transmission device provided by the embodiment of the application, after a first sub-stream between a terminal and a target server and first session information corresponding to the first sub-stream are established based on a first path, first connection information is established based on the first session information, the first connection information comprises an identifier of a target server in the first session information, the target server is obtained by selecting from a plurality of servers according to a load balancing algorithm, the first connection information is respectively associated with each connection identifier in the first session information, so that when a second sub-stream creation message sent by the terminal is obtained through a second path, the first connection information can be searched according to the target connection identifier in the message created by the second sub-stream, and the second sub-stream creation message is sent to the target server according to the identifier of the target server in the first connection information to establish the second sub-stream, so that the second sub-stream and the first sub-stream can both reach the same target server, and multi-path data transmission under a multi-instance deployed load balancing service scene is realized.
In an optional embodiment, the data transmission apparatus may further include a third establishing module, configured to: and establishing second session information corresponding to the second sub-stream according to the first connection information, wherein the second session information comprises the identifier of the target server.
In an optional embodiment, the lookup module 503 may be further configured to:
obtaining a target message sent by the terminal through the second path; the target message belongs to the second sub-stream;
searching second session information corresponding to the second sub-flow;
the forwarding module 504 may be further configured to: and forwarding the target message to the target server according to the target server identifier in the second session information.
In an optional embodiment, the first session information at least includes a first connection identifier and at least one non-first connection identifier; wherein the content of the first and second substances,
the first connection identifier is obtained by the terminal and the target server through negotiation in the process of establishing the first sub-flow through negotiation;
the at least one non-first connection identifier is obtained by the terminal and the target server based on the first sub-flow negotiation.
In an optional embodiment, the forwarding module 504 is further configured to obtain, through the first path, a connection application packet sent by the terminal, where the connection application packet belongs to the first sub-flow; forwarding the connection application packet to the target server according to the identifier of the target server in the first session information corresponding to the first sub-stream;
the data transmission device further comprises an adding module, configured to obtain a response message sent by the target server corresponding to the connection application packet, where the response message carries at least one non-first connection identifier that is allocated; adding the at least one non-first connection identification to the first session message.
In an optional embodiment, the data transmission apparatus further includes an association module, configured to associate the at least one non-first connection identifier with the first connection information respectively.
In an optional embodiment, the target connection identifier is: the first connection identifier; or, the target connection identifier is: any one of the at least one non-first connection identifier is a non-first connection identifier.
In an optional embodiment, the data transmission apparatus further includes an association module, configured to:
obtaining a connection updating message sent by a terminal; the connection update message belongs to a target sub-stream, and the target sub-stream is the first sub-stream or the second sub-stream; the connection updating message indicates to update the third connection identifier to a fourth connection identifier; associating the fourth connection identification with the first connection information.
Corresponding to the method embodiment, the present application further provides an electronic device, a schematic structural diagram of which is shown in fig. 6, and the electronic device may include: at least one processor 1, at least one communication interface 2, at least one memory 3 and at least one communication bus 4.
In the embodiment of the present application, the number of the processor 1, the communication interface 2, the memory 3, and the communication bus 4 is at least one, and the processor 1, the communication interface 2, and the memory 3 complete mutual communication through the communication bus 4.
The processor 1 may be a central processing unit CPU, or an Application Specific Integrated Circuit ASIC (Application Specific Integrated Circuit), or one or more Integrated circuits configured to implement the embodiments of the present Application, etc.
The memory 3 may comprise a high-speed RAM memory, and may further comprise a non-volatile memory (non-volatile memory) or the like, such as at least one disk memory.
Wherein the memory 3 stores a program, and the processor 1 may call the program stored in the memory 3, the program being configured to:
establishing a first sub-stream between a terminal and a target server and first session information corresponding to the first sub-stream based on a first path; the target server is selected from a plurality of servers according to a load balancing algorithm; the first session information comprises an identifier of the target server and at least one connection identifier negotiated by the terminal and the target server;
establishing first connection information based on the first session information, wherein the first connection information is associated with each connection identifier in the at least one connection identifier, and the first connection information comprises an identifier of the target server;
acquiring a second sub-flow establishing message sent by the terminal through a second path, and searching the first connection information according to a target connection identifier carried in the second sub-flow establishing message; the target connection identifier is any one of the at least one connection identifier;
and forwarding the second sub-flow establishing message to the target server according to the identifier of the target server in the first connection information so as to establish the second sub-flow.
Alternatively, the detailed function and the extended function of the program may be as described above.
Embodiments of the present application further provide a storage medium, where a program suitable for execution by a processor may be stored, where the program is configured to:
establishing a first sub-stream between a terminal and a target server and first session information corresponding to the first sub-stream based on a first path; the target server is selected from a plurality of servers according to a load balancing algorithm; the first session information comprises an identifier of the target server and at least one connection identifier negotiated by the terminal and the target server;
establishing first connection information based on the first session information, wherein the first connection information is associated with each connection identifier in the at least one connection identifier, and the first connection information comprises an identifier of the target server;
obtaining a second sub-flow establishing message sent by the terminal through a second path, and searching the first connection information according to a target connection identifier carried in the second sub-flow establishing message; the target connection identifier is any one of the at least one connection identifier;
and forwarding the second sub-flow creation packet to the target server according to the identifier of the target server in the first connection information so as to establish the second sub-flow.
Alternatively, the detailed function and the extended function of the program may be as described above.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
It should be understood that the technical problems can be solved by combining and combining the features of the embodiments from the claims.
The functions may be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, and various media capable of storing program codes.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method of data transmission, the method comprising:
establishing a first sub-stream between a terminal and a target server and first session information corresponding to the first sub-stream based on a first path; the target server is selected from a plurality of servers according to a load balancing algorithm; the first session information comprises an identifier of the target server and at least one connection identifier negotiated by the terminal and the target server;
establishing first connection information based on the first session information, wherein the first connection information is associated with each connection identifier in the at least one connection identifier, and the first connection information comprises an identifier of the target server;
obtaining a second sub-flow establishing message sent by the terminal through a second path, and searching the first connection information according to a target connection identifier carried in the second sub-flow establishing message; the target connection identifier is any one of the at least one connection identifier;
and forwarding the second sub-flow creation packet to the target server according to the identifier of the target server in the first connection information so as to establish the second sub-flow.
2. The method of claim 1, further comprising: and establishing second session information corresponding to the second sub-stream according to the first connection information, wherein the second session information comprises the identifier of the target server.
3. The method of claim 2, further comprising:
obtaining a target message sent by the terminal through the second path; the target message belongs to the second sub-stream;
searching second session information corresponding to the second sub-flow;
and forwarding the target message to the target server according to the target server identifier in the second session information.
4. The method of claim 1, the first session information comprising at least a first connection identifier and at least one non-first connection identifier; wherein the content of the first and second substances,
the first connection identifier is obtained by the terminal and the target server through negotiation in the process of establishing the first sub-flow through negotiation;
the at least one non-first connection identifier is obtained by the terminal and the target server based on the first sub-flow negotiation.
5. The method of claim 4, the process of negotiating the at least one non-first connection identity, comprising:
obtaining a connection application message sent by the terminal through the first path, wherein the connection application message belongs to the first sub-stream;
forwarding the connection application packet to the target server according to the identifier of the target server in the first session information corresponding to the first sub-stream;
obtaining a response message sent by the target server corresponding to the connection application message, wherein the response message carries at least one distributed non-first connection identifier;
adding the at least one non-first connection identification to the first session message.
6. The method of claim 5, further comprising:
associating the at least one non-first connection identification with the first connection information, respectively.
7. The method of claim 5, the target connection identification being: the first connection identifier; or, the target connection identifier is: any one of the at least one non-first connection identifier is a non-first connection identifier.
8. The method of any of claims 1-7, further comprising:
acquiring a connection deletion message sent by a terminal; the deletion connection packet belongs to a target sub-stream, and the target sub-stream is the first sub-stream or the second sub-stream;
and deleting the connection identifier indicated by the connection deletion message from the first session information and the first connection information, and removing the association relationship between the connection identifier indicated by the connection deletion message and the first connection information.
9. A data transmission apparatus, the apparatus comprising:
the system comprises a first establishing module, a second establishing module and a third establishing module, wherein the first establishing module is used for establishing a first sub-flow between a terminal and a target server and first session information corresponding to the first sub-flow based on a first path; the target server is selected from a plurality of servers according to a load balancing algorithm; the first session information comprises an identifier of the target server and at least one connection identifier negotiated by the terminal and the target server;
a second establishing module, configured to establish first connection information based on the first session information, where the first connection information is associated with each connection identifier in the at least one connection identifier, and the first connection information includes an identifier of the target server;
the searching module is used for obtaining a second sub-flow establishing message sent by the terminal through a second path and searching the first connection information according to a target connection identifier carried in the second sub-flow establishing message; the target connection identifier is any one of the at least one connection identifier;
and the forwarding module is used for forwarding the second sub-flow creation packet to the target server according to the identifier of the target server in the first connection information so as to establish the second sub-flow.
10. An electronic device, comprising:
a memory for storing a program;
a processor for calling and executing the program in the memory, and implementing the steps of the data transmission method according to any one of claims 1 to 8 by executing the program.
CN202211266021.9A 2022-10-17 2022-10-17 Data transmission method and device and electronic equipment Pending CN115643646A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211266021.9A CN115643646A (en) 2022-10-17 2022-10-17 Data transmission method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211266021.9A CN115643646A (en) 2022-10-17 2022-10-17 Data transmission method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN115643646A true CN115643646A (en) 2023-01-24

Family

ID=84945018

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211266021.9A Pending CN115643646A (en) 2022-10-17 2022-10-17 Data transmission method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN115643646A (en)

Similar Documents

Publication Publication Date Title
US10079803B2 (en) Peer-to-peer connection establishment using TURN
EP3125476B1 (en) Service function chaining processing method and device
US11277313B2 (en) Data transmission method and corresponding device
CN107948076B (en) Method and device for forwarding message
CN106789526B (en) method and device for connecting multiple system networks
CN109361606B (en) Message processing system and network equipment
RU2464722C2 (en) Method, device and system for distribution of messages
CN108964940B (en) Message sending method and device and storage medium
CN111600797B (en) Data transmission method, node and system
CN111107672B (en) Method, device and system for establishing sub-streams of multi-path connection
WO2021008591A1 (en) Data transmission method, device, and system
CN110290044B (en) Method, device and storage medium for shunting VPN (virtual private network) and backbone network
CN113794609A (en) Home gateway and method for forwarding service thereof
CN105959188B (en) Method and device for controlling user terminal to be on-line
WO2014040279A1 (en) Information processing method and load balancing device
WO2016173269A1 (en) Message processing method and related device during pppoe authentication
JP2015061229A (en) Method and system for switching edge router, edge router, and redundant management device
CN107547618B (en) Session dismantling method and device
US10104018B2 (en) Method, apparatus, and system for controlling forwarding of service data in virtual network
CN115643646A (en) Data transmission method and device and electronic equipment
CN106936718B (en) PPPoE message transmission method and PPPoE server
CN112822088B (en) Network connection method and device, electronic equipment, processor and storage medium
CN110830477B (en) Service identification method, device, gateway, system and storage medium
JP2005277653A (en) Communication terminal
CN108418709B (en) Port aggregation method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination