CN112099942B - Port multiplexing method, system, terminal, server, equipment and storage medium - Google Patents
Port multiplexing method, system, terminal, server, equipment and storage medium Download PDFInfo
- Publication number
- CN112099942B CN112099942B CN202010774292.XA CN202010774292A CN112099942B CN 112099942 B CN112099942 B CN 112099942B CN 202010774292 A CN202010774292 A CN 202010774292A CN 112099942 B CN112099942 B CN 112099942B
- Authority
- CN
- China
- Prior art keywords
- virtual
- port
- data
- physical
- port number
- 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.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/505—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
- H04L69/164—Adaptation or special uses of UDP protocol
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/50—Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer And Data Communications (AREA)
Abstract
The invention provides a port multiplexing method, a system, a terminal, a server, equipment and a storage medium, which are applied to the technical field of communication, wherein the method comprises the following steps: the terminal selects a target virtual data link for the data transmission; determining a first virtual port number for identifying a first physical port according to the port corresponding relation of the target virtual data link; transmitting a data request carrying a first virtual port number to a second physical port of a server through the first physical port; when the server receives a data request, determining a second virtual port number corresponding to the first virtual port number according to the port corresponding relation; generating response data according to the data request; and sending response data carrying the second virtual port number to the first physical port through the second physical port. According to the scheme, the physical ports deploy a plurality of virtual data links among the virtual ports through the virtual port numbers to perform data transmission, multiplexing of the UDP ports is achieved, and data transmission capacity of the UDP ports is improved.
Description
Technical Field
The present invention belongs to the field of communication technologies, and in particular, to a method, a system, a terminal, a server, a device, and a storage medium for port multiplexing.
Background
UDP (User Datagram Protocol ) is a common transport layer protocol in a communication system, and because of the connectionless nature, the UDP has the characteristics of small transmission delay, high channel utilization rate and the like, and is widely applied to the fields of network telephone, video conference, video live broadcast and the like.
However, the connectionless nature of the UDP protocol makes it necessary to allocate an idle UDP port specifically each time data is transmitted between devices during data transmission, so that the same UDP port can only be used for carrying a single data transmission task, and when a firewall or other restrictions exist, the UDP port provided by the communication system is limited, a phenomenon that the transmission data cannot be allocated to the UDP port in time may occur, and the communication capability of the UDP protocol is limited.
Disclosure of Invention
In view of this, according to a first aspect of the present invention, there is provided a port multiplexing method applied to a port multiplexing system, the system comprising: the method comprises the steps of carrying at least one physical data link based on a user datagram protocol between a first physical port of the terminal and a second physical port of the server, wherein a plurality of virtual data links are deployed on at least one physical data link, and the method comprises the following steps:
The terminal selects a target virtual data link for the data transmission; determining a first virtual port number for identifying the first physical port according to the port corresponding relation of the target virtual data link; and sending a data request carrying the first virtual port number to a second physical port of a server through the first physical port, wherein the second physical port is further identified by a second virtual port number in the port corresponding relation;
when the server receives the data request, determining a second virtual port number corresponding to the first virtual port number according to the port corresponding relation; generating response data according to the data request; and sending response data carrying the second virtual port number to the first physical port through the second physical port.
According to a second aspect of the present invention, there is provided another port multiplexing method applied to a server in a port multiplexing system, the system further comprising: the terminal is used for bearing at least one physical data link based on a user datagram protocol between a first physical port of the terminal and a second physical port of the server, and a plurality of virtual data links are deployed on at least one physical data link;
The method comprises the following steps:
when a data request carrying a first virtual port number sent by the terminal is received, determining a second virtual port number corresponding to the first virtual port number according to the port corresponding relation, wherein the first physical port is identified by the first virtual port number in the port corresponding relation, and the second physical port is identified by the second virtual port number;
generating response data according to the data request;
and sending response data carrying the second virtual port number to the first physical port through the second physical port.
According to a third aspect of the present invention, there is provided a further port multiplexing method applied to a terminal in a port multiplexing system, the system further comprising: the system comprises a server, a first physical port of the terminal and a second physical port of the server, wherein the server is used for bearing at least one physical data link based on a user datagram protocol, and a plurality of virtual data links are deployed on at least one physical data link;
the method comprises the following steps:
selecting a target virtual data link for the data transmission;
determining a first virtual port number for identifying the first physical port according to the port corresponding relation of the target virtual data link;
Transmitting a data request carrying the first virtual port number to a second physical port of a server through the first physical port, wherein the second physical port is also identified by a second virtual port number in the port corresponding relation;
and receiving response data sent by the server according to the data request.
According to a fourth aspect of the present invention, there is provided a port multiplexing system, the system comprising: the system comprises a server and a terminal, wherein a first physical port of the terminal and a second physical port of the server are used for bearing at least one physical data link based on a user datagram protocol, and a plurality of virtual data links are deployed on at least one physical data link;
the terminal is used for selecting a target virtual data link for the data transmission; determining a first virtual port number for identifying the first physical port according to the port corresponding relation of the target virtual data link; transmitting a data request carrying the first virtual port number to a second physical port of a server through the first physical port, wherein the second physical port is also identified by a second virtual port number in the port corresponding relation;
The server is configured to determine, when receiving a data request carrying a first virtual port number sent by the terminal, a second virtual port number corresponding to the first virtual port number according to the port correspondence, where the first physical port is identified by the first virtual port number in the port correspondence, and the second physical port is identified by the second virtual port number; generating response data according to the data request; transmitting response data carrying the second virtual port number to the first physical port through the second physical port;
the terminal is also used for receiving response data sent by the server according to the data request.
According to a fifth aspect of the present invention, there is provided a server for use in a port multiplexing system, the system further comprising: the terminal is used for bearing at least one physical data link based on a user datagram protocol between a first physical port of the terminal and a second physical port of the server, and a plurality of virtual data links are deployed on at least one physical data link;
the server includes:
the first receiving module is used for determining a second virtual port number corresponding to the first virtual port number according to the port corresponding relation when receiving a data request carrying the first virtual port number sent by the terminal, wherein the first physical port is identified by the first virtual port number in the port corresponding relation, and the second physical port is identified by the second virtual port number;
The first generation module is used for generating response data according to the data request;
and the first sending module is used for sending response data carrying the second virtual port number to the first physical port through the second physical port.
According to a sixth aspect of the present invention, there is provided a terminal for use in a port multiplexing system, the system further comprising: the system comprises a server, a first physical port of the terminal and a second physical port of the server, wherein the server is used for bearing at least one physical data link based on a user datagram protocol, and a plurality of virtual data links are deployed on at least one physical data link;
the terminal comprises:
the selection module is used for selecting a target virtual data link for the data transmission;
a determining module, configured to determine a first virtual port number for identifying the first physical port according to a port correspondence of a target virtual data link;
the second sending module is used for sending a data request carrying the first virtual port number to a second physical port of the server through the first physical port, and the second physical port is further identified by a second virtual port number in the port corresponding relation;
And the second receiving module is used for receiving response data sent by the server according to the data request.
According to a seventh aspect of the present invention, there is provided an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processing implementing the port multiplexing method according to the second aspect when the computer program is executed.
According to an eighth aspect of the present invention, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the port multiplexing method according to any one of the first, second and third aspects.
Aiming at the prior art, the invention has the following advantages:
according to the port multiplexing method, the system, the terminal, the server, the equipment and the storage medium, the physical ports of the physical data links are identified by deploying the virtual data links on the physical data links based on the UDP protocol and utilizing the virtual port numbers of the virtual data links, so that when the terminal and the server perform data transmission through the virtual data links, the physical ports of the physical data links can be determined according to the port corresponding relation between the virtual port numbers at two ends and used for data transmission of the virtual data links, the physical ports of the physical data links can be deployed through the virtual port numbers through the virtual data links, data transmission is performed through the virtual data links, multiplexing of the UDP ports is achieved, and the data transmission capacity of the UDP ports is improved.
The foregoing description is only an overview of the present invention, and is intended to be implemented in accordance with the teachings of the present invention in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present invention more readily apparent.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to designate like parts throughout the figures. In the drawings:
fig. 1 is a flowchart of interaction steps of a port multiplexing method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a data transmission principle of a port multiplexing method according to an embodiment of the present invention;
fig. 3 is a flowchart of steps of another port multiplexing method according to an embodiment of the present invention;
fig. 4 is a flowchart of steps of a virtual link deployment method according to an embodiment of the present invention;
fig. 5 is a flowchart of steps of a method for generating a virtual port number according to an embodiment of the present invention;
FIG. 6 is a flowchart of steps in a method for acquiring response data according to an embodiment of the present invention;
fig. 7 is a flowchart of steps of still another method for port multiplexing according to an embodiment of the present invention;
fig. 8 is a flowchart of steps of another virtual link deployment method according to an embodiment of the present invention;
FIG. 9 is a flowchart illustrating steps of a method for acquiring data of an application according to an embodiment of the present invention;
fig. 10 is a block diagram of a port multiplexing system according to an embodiment of the present invention;
FIG. 11 is a block diagram of a server according to an embodiment of the present invention;
fig. 12 is a block diagram of a terminal according to an embodiment of the present invention;
fig. 13 is a block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
Fig. 1 is a flowchart of interaction steps of a port multiplexing method according to an embodiment of the present invention, where the method is applied to a port multiplexing system, and the system includes: the system comprises a server and a terminal, wherein a first physical port of the terminal and a second physical port of the server are used for bearing at least one physical data link based on a user datagram protocol, and a plurality of virtual data links are deployed on at least one physical data link.
The method comprises the following steps:
step 101, the terminal selects a target virtual data link for the current data transmission.
It should be noted that, the server in the embodiment of the present invention refers to an electronic device that provides service data for an application client in a terminal. The terminal refers to an electronic device having functions of data storage, data processing, data transmission, and the like, for example: personal computers, cell phones, tablet computers, etc., in which an application client can be installed, which can interact data with a server of an application. The user datagram (User Datagram Protocol, UDP) protocol is a connectionless transport layer protocol that is widely used for the transport of streaming media data. In practical applications, the client side of the streaming media application program may be installed on the terminal, and the streaming media application program has the requirements of low delay and high transmission efficiency, so that the UDP protocol is mostly adopted to perform data interaction with the server.
The first physical port and the second physical port are physical ports in the terminal and the server, respectively, for transmitting UDP packets. The physical data link between the first physical port of the terminal and the second physical port of the server is used for realizing communication connection between the terminal and the server. The virtual data link is a data transmission channel pre-deployed on a physical data link between the terminal and the server based on a UDP protocol, and typically, the terminal and the server interact through a signaling link to negotiate to deploy the virtual data link before data transmission.
In the embodiment of the invention, the terminal can automatically determine the response data which needs to be acquired by carrying out data transmission with the server according to the selection of the user or the system setting, so that the virtual data link deployed for the response data is used as the target virtual data link for carrying out data transmission at this time.
Step 102, the terminal determines a first virtual port number for identifying the first physical port according to the port correspondence of the target virtual data link.
In the embodiment of the present invention, the first virtual port number is an index for identifying a first physical port of the terminal, and similarly, the second virtual port number in the subsequent step is an index for identifying a second physical port of the server. The port corresponding relation comprises a corresponding relation of a first virtual port number and a second virtual port number, wherein the port corresponding relation is built and stored in advance through negotiation when a terminal and a server deploy virtual data links on physical data links, and different virtual data links correspond to different port corresponding relations. It can be understood that, since the common physical ports are all provided with unique physical port numbers, if multiple virtual data links are deployed on the same physical port, different virtual data links cannot be distinguished through the physical port numbers, so that the embodiment of the invention deploys corresponding virtual ports for each virtual data link on the physical port and uses the virtual port numbers to identify the virtual ports, thereby not only identifying the virtual data link according to the virtual port numbers, but also determining the physical port corresponding to the identified virtual port according to the virtual port numbers.
Step 103, the terminal sends a data request carrying the first virtual port number to a second physical port of the server through the first physical port, and the second physical port is further identified by a second virtual port number in the port corresponding relationship.
In the embodiment of the invention, the terminal equipment takes the first physical port identified by the first virtual port number as a source port, takes the second physical port identified by the second virtual port number as a destination port, encapsulates the data request carrying the first virtual port number according to the UDP protocol and then sends the encapsulated data request to the server. It can be understood that, because the terminal stores the port corresponding relationship when negotiating in advance to establish the virtual data link, when data transmission is required through the existing virtual data link, the first physical port required for sending the data request can be determined according to the first virtual port number in the port corresponding relationship, and it is not necessary to reallocate an idle UDP port for the data request. It can be understood that, in the prior art, since an idle UDP port is allocated for each data transmission based on the UDP protocol, the same UDP port can only be used for data transmission of one data, and in this scheme, multiple virtual ports are deployed on the UDP port and identified by using the virtual port numbers, so that when a terminal sends different data requests through multiple virtual data links, the same pair of first physical port and second physical port can be determined according to different first virtual port numbers and second virtual port numbers of the multiple virtual data links, so that the UDP port can be used for data transmission of multiple virtual data links at the same time.
Step 104, when the server receives the data request, determining a second virtual port number corresponding to the first virtual port number according to the port correspondence.
In the embodiment of the invention, the server extracts the first virtual port number carried by the data request sent by the terminal after decapsulating the data request based on the UDP protocol, and because the server stores the port corresponding relation of the target virtual data link when negotiating and deploying the target virtual data link in advance with the terminal, the server can determine the second virtual port number corresponding to the first virtual port number according to the port corresponding relation.
Step 105, the server generates response data according to the data request.
In the embodiment of the invention, the server determines the data required by the terminal according to the data identifier extracted from the data request, and then encapsulates the data and the second virtual port number based on the UDP protocol to obtain response data.
And step 106, the server sends response data carrying the second virtual port number to the first physical port through the second physical port.
In the embodiment of the invention, the server takes the second physical port identified by the second virtual port number as a source port and takes the first physical port identified by the first virtual port number as a destination port, so as to send response data carrying the second virtual port number to the terminal. It can be understood that, because the server stores the port corresponding relationship when the server negotiates and deploys the target virtual data link in advance, after receiving the data request carrying the first virtual port number, the server can send the response data along the second physical port identified by the second virtual port number in the port corresponding relationship, and there is no need to repeatedly allocate the physical port for sending the response data by adopting the UDP protocol in the data transmission process of the virtual data link, that is, when the server and the terminal use the virtual data link to perform data transmission, only the physical ports at two ends need to be allocated once by adopting the UDP protocol when deploying the virtual data link, so that the same physical port can be allocated to other virtual data links by the UDP protocol in the idle period after having been allocated to one virtual data link, and different virtual data links can be distinguished according to the virtual port numbers, so that the same physical port can be used for data transmission of multiple virtual data links at the same time.
Specifically, referring to fig. 2, a schematic diagram of a data transmission principle of a port multiplexing method of the present invention is shown, where a terminal includes a client a and a client B, a data link a11 and a data link a12 are a first data link of the client a, IPA2 is a first IP address of the client a, and vport a31 and vport a32 are first virtual port numbers of the client a; data link B11 and data link B12 are the first data link of client B. IPB2 is the first IP address of client B, vport B31 and vport B32 are the first virtual port numbers of client B. The server comprises a sub-server C and a sub-server D, wherein the sub-server C and the sub-server D are virtual servers deployed in the server. Data link C11 and data link C12 are the second data link of child server C, IPC2 is the second IP address of child server C, vport C31 and vport C32 are the second virtual port number of child server C; data link D11 and data link D12 are the second data link of sub-server D, IPD2 is the second IP address of sub-server D, vport D31 and vport D32 are the second virtual port number of sub-server D. There is a physical data link between the first physical port and the second physical port, the physical data link having disposed thereon a plurality of virtual data links between the terminal and the server. The first data link and the second data link are memory addresses of data in the device.
In particular, each virtual data link deployed on the physical data link is used for data transmission between the first data link and the second data link. As shown in fig. 2, there is a virtual data link between the data link a11 and the data link C11, between the data link a12 and the data link C12, between the data link B11 and the data link D11, and between the data link B12 and the data link D12. The terminal and the server store the corresponding port corresponding relation of each virtual data link, and the corresponding relation of the ports comprises the corresponding relation of the first virtual port and the second virtual port number. For example: the virtual data link between the data link a11 and the data link C11 stores the correspondence between the first virtual port number vport a3 and the second virtual port number vport C31 at the terminal and the server, and these virtual port numbers are used to identify the physical ports, for example: the vport a31, vport a32, vport b31, vport b32 of the terminal identify the first physical port of the terminal and the server is the same. Therefore, in the data transmission process, the terminal and the server identify the physical port through the virtual port number corresponding to the virtual data link, so that the physical data link on the same physical port can deploy a plurality of virtual data links and distinguish the virtual data link to which the transmission data belongs according to the port corresponding relation between the first virtual port number and the second virtual port number. Further, since the IP addresses of different clients in the terminal and different sub-servers in the server are different, a mapping table between the virtual port number and the IP address can be also established, so as to distinguish the virtual data links of different clients in the same terminal. Further, the mapping tables between the data link, the IP address and the virtual port number are stored in the terminal and the server, for example: data link a11 in fig. 2: IPA2: vport a31.
By way of example, the data transmission procedure of a virtual data link will be described below by taking as an example a virtual data link between the data link a11 of the client and the data link C11 of the sub-server C, and the virtual data link between the other data links can refer to this part of the content:
s1, a client A in a terminal determines a local data link A11 which needs to be subjected to data transmission, so that a virtual data link between the data link A11 and a data link C11 of a server is used as a target virtual data link of the data transmission;
s2, the client A acquires a data request carrying a first virtual port number A31 according to the data link A11, and queries a first IP address IPA2 of the client A according to a mapping table to package the data request according to a UDP protocol;
s3, the client A sends the packaged data request from a first physical port of the terminal to a second physical port of the server;
s4, the server extracts a first virtual port number A31 in the data request based on the UDP protocol, and determines a local second virtual port number C31 according to the port corresponding relation, so that the data request is sent to a sub-server C where the second virtual port number C31 is located;
S5, the sub-server C queries a data link C11 corresponding to the second virtual port number C31 according to the mapping table to acquire response data carrying the second virtual port number C31, and then queries a second IP address IPC2 of the sub-server C according to the mapping table to package the response data according to a UDP protocol;
s6, the sub-server C sends the packaged response data to a first physical port of the terminal through a local second physical port;
and S7, the terminal extracts a second virtual port number C31 through the unpacking response data, and determines a local first virtual port number A31 according to the port corresponding relation, so that the response data is sent to a client A where the first virtual port number A31 is located.
According to the port multiplexing method provided by the embodiment of the invention, the physical ports of the physical data links are identified by deploying the virtual data links on the physical data links based on the UDP protocol and utilizing the virtual port numbers of the virtual data links, so that when the terminal and the server perform data transmission through the virtual data links, the physical ports of the physical data links can be determined according to the port corresponding relation between the virtual port numbers at two ends and used for data transmission of the virtual data links, the physical ports of the physical data links can be deployed through the virtual port numbers through the virtual data links, and data transmission is performed through the virtual data links, thereby realizing multiplexing of the UDP ports and improving the data transmission capacity of the UDP ports.
Fig. 3 is a flowchart of steps of another port multiplexing method according to an embodiment of the present invention, which is applied to a server in a port multiplexing system, where the system further includes: the terminal is used for bearing at least one physical data link based on a user datagram protocol between a first physical port of the terminal and a second physical port of the server, and a plurality of virtual data links are deployed on at least one physical data link; the method comprises the following steps:
step 201, when a data request carrying a first virtual port number sent by the terminal is received, determining a second virtual port number corresponding to the first virtual port number according to the port correspondence, where the first physical port is identified by the first virtual port number in the port correspondence, and the second physical port is identified by the second virtual port number.
This step is described in detail with reference to step 104, and will not be described in detail here.
And 202, generating response data according to the data request.
This step may be described in detail with reference to step 105, and will not be described here again.
And step 203, sending response data carrying the second virtual port number to the first physical port through the second physical port.
This step is described in detail with reference to step 106 and will not be described here.
Optionally, referring to fig. 4, before the step 201, the method further includes:
and step 204, receiving a virtual link construction request sent by the terminal, wherein the virtual link construction request comprises a first virtual port number.
In an embodiment of the invention, the virtual link construction request is sent by the terminal to the server in a signalling format based on TCP (Transmission Control Protocol ). When the terminal needs to construct a virtual data link with the server, the first virtual port number of the terminal can be added into a virtual link construction request and sent to the server.
Step 205, generating a second virtual port number of the server according to the first virtual port number.
In the embodiment of the invention, the server allocates any local UDP port in an idle state for the first physical port identified by the first virtual port number as a second physical port, deploys the virtual port on the second physical port, and generates a second virtual port number for identifying the virtual port.
And 206, establishing the corresponding relation between the first virtual port and the second virtual port number as the port corresponding relation of the virtual data link deployed based on the physical data link.
In the embodiment of the invention, the server establishes the corresponding relation between the first virtual port and the second virtual port, and takes the corresponding relation as the port corresponding relation of the deployed virtual data link to be stored locally for subsequent inquiry.
And step 207, sending a virtual link construction response to the terminal, wherein the virtual link construction response comprises the second virtual port number.
In the embodiment of the invention, after the port corresponding relation of the deployed virtual data link is locally stored, the server also needs to send a virtual link construction response carrying the second virtual port number to the terminal, so that the terminal can also know the deployment condition of the virtual data link. The second virtual port number generated by the server is only carried in the virtual link construction response, and the port corresponding relation is not directly carried, so that the data volume of the virtual link construction response can be reduced, and the data transmission resources are saved.
According to the embodiment of the invention, the port corresponding relation is determined through interaction between the terminal and the server, the physical port bearing the virtual data link is recorded in a mode that the virtual port number identifies the physical port, and the physical port in data transmission is recorded without any intermediate equipment, so that the streaming media application layer protocol of the intermediate equipment is not supported in the data transmission process, such as SIP (Session Initiation Protocol ), RTSP (Real Time Streaming Protocol, real-time streaming protocol), webRTC (Web Real Time Communication, web instant messaging) and the like, can be compatible. It can be understood that, because some streaming media application layer protocols are provided with proxy server mechanisms, the proxy server is suitable for distributing the message, that is, directly sending the message to the opposite terminal device, while the intermediate device is not an actual opposite terminal device, the scheme of the invention can be exactly suitable for the streaming media application layer protocols, and the applicability of UDP port multiplexing is improved.
Optionally, the virtual link construction request further includes: identification of the first data link of the server, with reference to fig. 4, the step 205 includes:
sub-step 2051, determining at least one candidate data link corresponding to the first data link according to a preset link correspondence and an identification of the first data link.
In the embodiment of the invention, the identifier of the first data link is an index of the first data link, and the first data link is a storage address of the data request sent by the terminal. The preset link corresponding relation is pre-generated by the server and is sent to the terminal. For example: the developer can preset a preset link corresponding relation, and then add the first data link into an installation package of the application program client, so that when the client of the terminal requests the server to acquire data according to the first data link, the server can determine the corresponding candidate data link according to the preset link corresponding relation, wherein the candidate data link is a storage address of data provided by the server. It should be noted that, considering that providing data to multiple terminals by the same data link may cause abnormal data transmission due to excessive data transmission pressure, the server of the application program may set multiple candidate data links for the same data to reduce the data transmission pressure of the same data link.
Sub-step 2052, using any of the candidate data chains as a second data link corresponding to the first data link.
In the embodiment of the invention, the server can take the candidate data link with relatively good load condition as the second data link corresponding to the first data link according to the load condition of the candidate data link. Of course, other allocation rules may be used, and may be specifically determined according to actual requirements, which is not limited herein.
Sub-step 2053 assigns a second physical port to the second data link.
In the embodiment of the present invention, after the server determines the first data link, the server may allocate an idle UDP port as the second physical port according to the allocation rule of the UDP port in the UDP protocol, for data transmission of the second data link.
Sub-step 2054 generates a second virtual port number identifying the second physical port.
In the embodiment of the invention, the corresponding second data link is allocated and the second port number corresponding to the first virtual port number is generated according to the first data link in the virtual link construction request sent by the terminal, so that the terminal and the server can negotiate to construct the virtual data link according to the data link, and the efficiency of adopting the UDP protocol for data transmission is improved.
Optionally, the data request further includes: the step 202, referring to fig. 6, includes:
sub-step 2021, determining a first data link for said terminal from said first physical port number, a first IP address and said first virtual port.
In the embodiment of the invention, the first physical port number is a unique identifier of a first physical port on the terminal, and the first IP address is a network address of the terminal. The first physical port number may be obtained by extracting an identification of the source port in the data request, and the first IP address of the terminal may be obtained by extracting the source IP address in the data request. Because the first virtual terminal number is generated by the terminal, the first virtual terminal numbers on different terminals may be repeated, and in this way, the server may pre-establish a first association relationship between the first physical port number, the first IP address, the first virtual port number and the first data link in advance, so that after determining the first data link of the terminal, the first data link of the terminal may be determined according to the first association relationship, thereby ensuring the accuracy of the determined first data link.
Sub-step 2022, obtaining the first initial data from a second data link corresponding to the first data link.
In the embodiment of the invention, the server also stores a second association relationship between the first data link and the second data link, so that the second data link which needs to provide data for the terminal can be determined according to the second association relationship. The first initial data may be generated in advance, for example, a movie, music, etc., or may be generated in real time, for example, live webcast, etc., and may be specifically determined according to actual requirements, which is not limited herein.
Sub-step 2023 adds the second virtual port number to the header or trailer of the data field in the first initial data, resulting in response data.
In the embodiment of the present invention, when the second virtual port number is added to the first initial data, if any selected added location may have a problem that the peer cannot identify the second virtual port number. The first virtual port number may be added to the header or trailer of the data field, thereby making the second virtual port number in the resulting response data more easily identifiable.
According to the embodiment of the invention, the second data link for providing the data to the terminal is determined according to the first physical port number, the first IP address and the first virtual port number in the data request sent by the terminal, so that the problem of data transmission confusion caused by repetition of the first virtual port number is avoided, the accuracy of UDP port multiplexing is ensured, and the second virtual port number is added to the head or tail of the data field in the first initial data to obtain the response data, so that the second virtual port number in the response data is more convenient to identify.
According to the port multiplexing method provided by the embodiment of the invention, the physical ports of the physical data links are identified by deploying the virtual data links on the physical data links based on the UDP protocol and utilizing the virtual port numbers of the virtual data links, so that when the terminal and the server perform data transmission through the virtual data links, the physical ports of the physical data links can be determined according to the port corresponding relation between the virtual port numbers at two ends and used for data transmission of the virtual data links, the physical ports of the physical data links can be deployed through the virtual port numbers through the virtual data links, and data transmission is performed through the virtual data links, thereby realizing multiplexing of the UDP ports and improving the data transmission capacity of the UDP ports. And the virtual data link is identified based on the virtual port number, the IP address and the physical port number, so that the condition of data transmission confusion caused by virtual data number repetition is avoided. And the port corresponding relation is determined by interaction between the terminal and the server, the physical port bearing the virtual data link is recorded in a mode of marking the physical port by the virtual port number, and the physical port in data transmission is not required to be recorded by any intermediate equipment, so that the method can be compatible with a streaming media application layer protocol which does not support the intermediate equipment in the data transmission process, and the applicability of UDP port multiplexing is improved.
Fig. 7 is a flowchart of steps of still another method for port multiplexing according to an embodiment of the present invention, where the method is applied to a terminal in a port multiplexing system, and the system further includes: the system comprises a server, a first physical port of the terminal and a second physical port of the server, wherein the server is used for bearing at least one physical data link based on a user datagram protocol, and a plurality of virtual data links are deployed on at least one physical data link; the method comprises the following steps:
step 301, a target virtual data link for the present data transmission is selected.
This step is described in detail with reference to step 101, and will not be described here.
Step 302, determining a first virtual port number for identifying the first physical port according to the port correspondence of the target virtual data link.
This step may be described in detail with reference to step 102, and will not be described here again.
Step 303, sending, by the first physical port, a data request carrying the first virtual port number to a second physical port of the server, where the second physical port is further identified by a second virtual port number in the port correspondence.
This step is described in detail with reference to step 103, and will not be described here.
And step 304, receiving response data sent by the server according to the data request.
In the embodiment of the invention, the terminal can receive the response data of the server for the data request at the first physical port. The response data carries a second virtual port number of the server, and the terminal can determine that the response data is acquired from the target virtual data link according to the second virtual port number.
Optionally, referring to fig. 8, before the step 301, the method further includes:
step 305, a first physical port on which a virtual data link is to be deployed is determined.
In the embodiment of the invention, before the terminal performs data transmission with the server, a connection needs to be established between the data to be transmitted and the server, that is, a virtual data link for transmitting the data is deployed on a physical data link between the terminal and the server. Before negotiating with a server to deploy a virtual data link, a first physical port from among the local UDP ports is allocated for data transmission of the virtual data link.
Step 306 generates a first virtual port number identifying the first physical port.
In the embodiment of the invention, in order to facilitate the identification of the virtual data link used for data transmission by the first physical port, the virtual port may be deployed on the first physical port, and a first virtual port number for identifying the virtual port may be generated, where the first virtual port number corresponds to the virtual data link deployed this time, that is, the same first physical port may be deployed with multiple virtual ports at the same time, so that the same first physical port may correspond to multiple virtual port numbers, and the multiple virtual data links may determine the same first physical port according to the corresponding virtual port number to perform data transmission, so that multiple virtual data links may be deployed on the physical data link where the same physical port is located at the same time.
Step 307, sending a virtual link construction request to the server, wherein the data link construction request includes the first virtual port number.
In an embodiment of the invention, the terminal sends the first virtual port number carrying the first virtual port number to the server in a signalling format based on TCP (Transmission Control Protocol ). Therefore, the stability of the process of the mutual deployment of the virtual data link by the terminal and the server in the negotiation is ensured.
Step 308, receiving a data link construction response sent by the server according to the data link construction request, where the data link construction response includes a second virtual port number of the server.
In the embodiment of the invention, the server allocates a second physical port of the virtual data link to be deployed according to the first virtual port number in the data link construction request, and sends the second virtual port number for identifying the second physical port to the terminal in a signaling form.
Step 309, establishing a corresponding relationship between the first virtual port and the second virtual port number, as a port corresponding relationship of a virtual data link deployed based on the physical data link.
In the embodiment of the present invention, the scheme for establishing the port correspondence by the terminal in the step is similar to the scheme for establishing the port correspondence by the server in the step 206, and in order to avoid repetition, the description is omitted here.
According to the embodiment of the invention, the port corresponding relation is determined through interaction between the terminal and the server, the physical port bearing the virtual data link is recorded in a mode that the virtual port number identifies the physical port, and the physical port in data transmission is not required to be recorded by any intermediate equipment, so that the protocol of a streaming media application layer, such as SIP, RTSP, webRTC, which does not support the intermediate equipment in the data transmission process, can be compatible, and the applicability of UDP port multiplexing is improved.
Optionally, referring to fig. 8, before the step 303, the method further includes:
step 310, obtaining second initial data according to the first data link.
In an embodiment of the invention, the second initial data is a data request for obtaining data from the server, and the first data link is a storage address of the second initial data.
And 311, adding the first virtual port number to the head or tail of the data field in the second initial data to obtain a data request.
In the embodiment of the present invention, the scheme for acquiring the data request in this step is similar to that of acquiring the response data in step 2023, and in order to avoid repetition, a description thereof will be omitted.
In the embodiment of the invention, the first virtual port number is added to the head or tail of the data field of the first initial data, so that the first virtual port number in the obtained data request is more convenient to identify.
Optionally, referring to fig. 9, the step 305 includes:
sub-step 3051, receiving a selection input for a first data link in the target application.
In the embodiment of the present invention, the target application may be an application that needs to perform streaming media data transmission, such as a video application and a music application, and of course, may also be other application that has a data transmission requirement, and may specifically be determined according to an actual requirement, which is not described herein. The selection input may be a click, long press, swipe, voice, etc. type of input to the first data link.
In practical application, the terminal may trigger a virtual data link deployment procedure for a first data link of a target application according to a selection input of the first data link by a user.
Sub-step 3052, responsive to said selection input, allocates a physical port for said first data link as a first physical port for a desired deployment of a virtual data link.
In the embodiment of the invention, the terminal selects an idle port from the local UDP ports as a first physical port for bearing the virtual data link to be deployed.
After the step 304, the method further includes:
And step 312, transmitting the response data to the target application program.
In the embodiment of the invention, because the target virtual data link is deployed based on the first data link in the target application program, the terminal can transmit the response data to the target application program for the user to acquire, so that the target application can perform subsequent operations such as playing, processing and the like on the response data, and the user can acquire the required data from the server more efficiently.
According to the port multiplexing method provided by the embodiment of the invention, the physical ports of the physical data links are identified by deploying the virtual data links on the physical data links based on the UDP protocol and utilizing the virtual port numbers of the virtual data links, so that when the terminal and the server perform data transmission through the virtual data links, the physical ports of the physical data links can be determined according to the port corresponding relation between the virtual port numbers at two ends and used for data transmission of the virtual data links, the physical ports of the physical data links can be deployed through the virtual port numbers through the virtual data links, and data transmission is performed through the virtual data links, thereby realizing multiplexing of the UDP ports and improving the data transmission capacity of the UDP ports. And the port corresponding relation is determined by interaction between the terminal and the server, the physical port bearing the virtual data link is recorded in a mode of marking the physical port by the virtual port number, and the physical port in data transmission is not required to be recorded by any intermediate equipment, so that the method can be compatible with a streaming media application layer protocol which does not support the intermediate equipment in the data transmission process, and the applicability of UDP port multiplexing is improved.
Fig. 10 is a block diagram of a port multiplexing system 40 according to an embodiment of the invention, where the system includes: the system comprises a server 42 and a terminal 41, wherein a first physical port of the terminal 41 and a second physical port of the server 42 are used for bearing at least one physical data link based on a user datagram protocol, and a plurality of virtual data links are deployed on at least one physical data link;
the terminal 41 is configured to select a target virtual data link for the current data transmission; determining a first virtual port number for identifying the first physical port according to the port corresponding relation of the target virtual data link; and sending a data request carrying the first virtual port number to a second physical port of a server through the first physical port, wherein the second physical port is further identified by a second virtual port number in the port corresponding relation.
The server 42 is configured to determine, when receiving a data request carrying a first virtual port number sent by the terminal, a second virtual port number corresponding to the first virtual port number according to the port correspondence, where the first physical port is identified by the first virtual port number in the port correspondence, and the second physical port is identified by the second virtual port number; generating response data according to the data request; and sending response data carrying the second virtual port number to the first physical port through the second physical port.
The terminal 41 is further configured to receive response data sent by the server according to the data request.
According to the port multiplexing system provided by the invention, the physical ports of the physical data links are identified by deploying the virtual data links on the physical data links based on the UDP protocol and utilizing the virtual port numbers of the virtual data links, so that when the terminal and the server perform data transmission through the virtual data links, the physical ports of the physical data links can be determined according to the port corresponding relation between the virtual port numbers at two ends so as to be used for data transmission of the virtual data links, the physical ports of the physical data links can be deployed through the virtual port numbers through the virtual data links, and data transmission is performed through the virtual data links, thereby realizing multiplexing of the UDP ports and improving the data transmission capacity of the UDP ports.
Fig. 11 is a block diagram of a structure of a server 50 according to an embodiment of the present invention, where the server 50 is applied to a port multiplexing system, and the system further includes: the terminal is used for bearing at least one physical data link based on a user datagram protocol between a first physical port of the terminal and a second physical port of the server, and a plurality of virtual data links are deployed on at least one physical data link;
The server includes:
the first receiving module 501 is configured to determine, when receiving a data request carrying a first virtual port number sent by the terminal, a second virtual port number corresponding to the first virtual port number according to the port correspondence, where the first physical port is identified by the first virtual port number in the port correspondence, and the second physical port is identified by the second virtual port number.
A first generating module 502, configured to generate response data according to the data request.
A first sending module 503, configured to send, to the first physical port through the second physical port, response data carrying the second virtual port number.
Optionally, the server further includes:
a first deployment module 504 for:
receiving a virtual link construction request sent by the terminal, wherein the virtual link construction request comprises a first virtual port number;
generating a second virtual port number of the server according to the first virtual port number;
establishing a corresponding relation between the first virtual port and the second virtual port number as a port corresponding relation of a virtual data link deployed based on the physical data link;
And sending a link construction response to the terminal, wherein the virtual link construction response comprises the second virtual port number.
Optionally, the virtual data link construction request further includes: the identification of the first data link of the server, the first deployment module 504 is further configured to:
determining at least one candidate data link corresponding to the first data link according to a preset link corresponding relation and the identification of the first data link;
taking any one of the candidate data chains as a second data link corresponding to the first data link;
assigning a second physical port to the second data link;
a second virtual port number is generated for identifying the second physical port.
Optionally, the data request further includes: the first generating module 502 is further configured to:
determining a first data link of the terminal according to the first physical port number, a first IP address and the first virtual port;
acquiring first initial data according to a second data link corresponding to the first data link;
and adding the second virtual port number to the head or tail of the data field in the first initial data to obtain response data.
According to the server provided by the invention, the physical ports of the physical data links are identified by deploying the virtual data links on the physical data links based on the UDP protocol and utilizing the virtual port numbers of the virtual data links, so that when the terminal and the server perform data transmission through the virtual data links, the physical ports of the physical data links can be determined according to the port corresponding relation between the virtual port numbers at two ends so as to be used for data transmission of the virtual data links, the physical ports of the physical data links can be deployed through the virtual port numbers through the virtual data links, and the data transmission is performed through the virtual data links, thereby realizing multiplexing of the UDP ports and improving the data transmission capacity of the UDP ports.
Fig. 12 is a block diagram of a terminal 60 according to an embodiment of the present invention, which is applied to a port multiplexing system, and the system further includes: a server, wherein at least one physical data link based on user datagram protocol is carried between a first physical port of the terminal 60 and a second physical port of the server, and a plurality of virtual data links are deployed on at least one physical data link;
The terminal 60 includes:
a selection module 601, configured to select a target virtual data link for the current data transmission.
A determining module 602, configured to determine a first virtual port number for identifying the first physical port according to a port correspondence of the target virtual data link.
The second sending module 603 is configured to send, to a second physical port of the server through the first physical port, a data request carrying the first virtual port number, where the second physical port is further identified by a second virtual port number in the port corresponding relationship.
And a second receiving module 604, configured to receive response data sent by the server according to the data request.
Optionally, the terminal further includes:
a second deployment module 605:
determining a first physical port of a virtual data link to be deployed;
generating a first virtual port number identifying the first physical port;
transmitting a data link construction request to the server, wherein the data link construction request comprises the first virtual port number;
receiving a data link construction response sent by the server according to the data link construction request, wherein the data link construction response comprises a second virtual port number of the server;
And establishing the corresponding relation between the first virtual port and the second virtual port number as the port corresponding relation of the virtual data link deployed based on the physical data link.
Optionally, the second deployment module 605 is further configured to:
receiving a selection input for a first data link in the target application;
and responding to the selection input, and allocating a physical port for the first data link as a first physical port of the virtual data link required to be deployed.
After the step of receiving the response data sent by the server according to the data request, the method further comprises:
and sending the response data to the target application program.
Optionally, the second sending module 603 is further configured to:
acquiring second initial data according to the first data link;
and adding the first virtual port number to the head or tail of the data field in the second initial data to obtain a data request.
According to the terminal provided by the invention, the physical ports of the physical data links are identified by deploying the virtual data links on the physical data links based on the UDP protocol and utilizing the virtual port numbers of the virtual data links, so that when the terminal and the server perform data transmission through the virtual data links, the physical ports of the physical data links can be determined according to the port corresponding relation between the virtual port numbers at two ends and are used for data transmission of the virtual data links, the physical ports of the physical data links can be deployed through the virtual port numbers through the virtual data links, and data transmission is performed through the virtual data links, thereby realizing multiplexing of the UDP ports and improving the data transmission capacity of the UDP ports.
For the embodiments of the system, the server and the terminal, the description is relatively simple, and the relevant parts refer to part of the description of the method embodiments, since the embodiments are basically similar to the method embodiments.
The embodiment of the present invention further provides an electronic device, as shown in fig. 13, including a processor 701, a communication interface 702, a memory 703 and a communication bus 704, where the processor 701, the communication interface 702, and the memory 703 perform communication with each other through the communication bus 704,
a memory 703 for storing a computer program;
the processor 701 is configured to execute the program stored in the memory 703, and implement the following steps:
when a data request carrying a first virtual port number sent by the terminal is received, determining a second virtual port number corresponding to the first virtual port number according to the port corresponding relation, wherein the first physical port is identified by the first virtual port number in the port corresponding relation, and the second physical port is identified by the second virtual port number; generating response data according to the data request; and sending response data carrying the second virtual port number to the first physical port through the second physical port.
Selecting a target virtual data link for the data transmission; determining a first virtual port number for identifying the first physical port according to the port corresponding relation of the target virtual data link; transmitting a data request carrying the first virtual port number to a second physical port of a server through the first physical port, wherein the second physical port is also identified by a second virtual port number in the port corresponding relation; and receiving response data sent by the server according to the data request.
According to the embodiment of the invention, the physical ports of the physical data links are determined according to the port corresponding relation between the virtual port numbers at two ends when the terminal and the server perform data transmission through the virtual data links by deploying the virtual data links on the physical data links based on the UDP protocol and utilizing the virtual port numbers of the virtual data links to identify the physical ports of the physical data links, so that the physical ports of the physical data links can be used for data transmission of the virtual data links through the virtual port numbers, deployment of the virtual data links among the virtual ports is realized, and data transmission is performed through the virtual data links, thereby multiplexing the UDP ports is realized, and the data transmission capacity of the UDP ports is improved.
The communication bus mentioned by the above terminal may be a peripheral component interconnect standard (Peripheral Component Interconnect, abbreviated as PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, abbreviated as EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the terminal and other devices.
The memory may include random access memory (Random Access Memory, RAM) or non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; but also digital signal processors (Digital Signal Processing, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field-programmable gate arrays (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In yet another embodiment of the present invention, a computer readable storage medium is provided, in which instructions are stored, which when run on a computer, cause the computer to perform the port multiplexing method according to any of the above embodiments.
In yet another embodiment of the present invention, a computer program product containing instructions that, when run on a computer, cause the computer to perform the port multiplexing method of any of the above embodiments is also provided.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims (13)
1. A port multiplexing method, applied to a port multiplexing system, the system comprising: the method comprises the steps of carrying at least one physical data link based on a user datagram protocol between a first physical port of the terminal and a second physical port of the server, wherein a plurality of virtual data links are deployed on at least one physical data link, and the method comprises the following steps:
the terminal selects a target virtual data link for the data transmission; determining a first virtual port number for identifying the first physical port according to the port corresponding relation of the target virtual data link; and sending a data request carrying the first virtual port number to a second physical port of a server through the first physical port, wherein the second physical port is further identified by a second virtual port number in the port corresponding relation;
the server receives a virtual link construction request sent by the terminal, wherein the virtual link construction request comprises a first virtual port number; generating a second virtual port number of the server according to the first virtual port number; establishing a corresponding relation between the first virtual port and the second virtual port number as a port corresponding relation of a virtual data link deployed based on the physical data link; transmitting a link construction response to the terminal, wherein the link construction response comprises the second virtual port number; when the data request is received, determining a second virtual port number corresponding to the first virtual port number according to the port corresponding relation; generating response data according to the data request; and sending response data carrying the second virtual port number to the first physical port through the second physical port.
2. A method for port multiplexing, applied to a server in a port multiplexing system, the system further comprising: the terminal is used for bearing at least one physical data link based on a user datagram protocol between a first physical port of the terminal and a second physical port of the server, and a plurality of virtual data links are deployed on at least one physical data link;
the method comprises the following steps:
receiving a virtual link construction request sent by the terminal, wherein the virtual link construction request comprises a first virtual port number;
generating a second virtual port number of the server according to the first virtual port number;
establishing a corresponding relation between the first virtual port and the second virtual port number as a port corresponding relation of a virtual data link deployed based on the physical data link;
transmitting a link construction response to the terminal, wherein the link construction response comprises the second virtual port number;
when a data request carrying a first virtual port number sent by the terminal is received, determining a second virtual port number corresponding to the first virtual port number according to a port corresponding relation, wherein the first physical port is identified by the first virtual port number in the port corresponding relation, and the second physical port is identified by the second virtual port number;
Generating response data according to the data request;
and sending response data carrying the second virtual port number to the first physical port through the second physical port.
3. The method of claim 2, wherein the virtual data link construction request further comprises: the step of generating a second virtual port number of the server according to the first virtual port number includes:
determining at least one candidate data link corresponding to the first data link according to a preset link corresponding relation and the identification of the first data link;
taking any one of the candidate data chains as a second data link corresponding to the first data link;
assigning a second physical port to the second data link;
a second virtual port number is generated for identifying the second physical port.
4. A method according to claim 3, wherein the data request further comprises: the step of generating response data according to the data request includes:
determining a first data link of the terminal according to the first physical port number, a first IP address and the first virtual port;
Acquiring first initial data according to a second data link corresponding to the first data link;
and adding the second virtual port number to the head or tail of the data field in the first initial data to obtain response data.
5. A method for port multiplexing, applied to a terminal in a port multiplexing system, the system further comprising: the system comprises a server, a first physical port of the terminal and a second physical port of the server, wherein the server is used for bearing at least one physical data link based on a user datagram protocol, and a plurality of virtual data links are deployed on at least one physical data link;
the method comprises the following steps:
selecting a target virtual data link for the data transmission;
determining a first virtual port number for identifying the first physical port according to the port corresponding relation of the target virtual data link;
transmitting a data request carrying the first virtual port number to a second physical port of a server through the first physical port, wherein the second physical port is also identified by a second virtual port number in the port corresponding relation;
receiving response data sent by the server according to the data request;
The server is used for executing the following steps:
receiving a virtual link construction request sent by the terminal, wherein the virtual link construction request comprises a first virtual port number;
generating a second virtual port number of the server according to the first virtual port number;
establishing a corresponding relation between the first virtual port and the second virtual port number as a port corresponding relation of a virtual data link deployed based on the physical data link;
and sending a link construction response to the terminal, wherein the link construction response comprises the second virtual port number.
6. The method of claim 5, further comprising, prior to the step of selecting a target virtual data link for the current data transmission:
determining a first physical port of a virtual data link to be deployed;
generating a first virtual port number identifying the first physical port;
transmitting a data link construction request to the server, wherein the data link construction request comprises the first virtual port number;
receiving a data link construction response sent by the server according to the data link construction request, wherein the data link construction response comprises a second virtual port number of the server;
And establishing the corresponding relation between the first virtual port and the second virtual port number as the port corresponding relation of the virtual data link deployed based on the physical data link.
7. The method of claim 6, wherein the step of determining the first physical port required to deploy the virtual data link comprises:
receiving a selection input for a first data link in a target application;
responsive to the selection input, allocating a physical port for the first data link as a first physical port for a virtual data link to be deployed;
after the step of receiving the response data sent by the server according to the data request, the method further comprises:
and sending the response data to the target application program.
8. The method of claim 7, further comprising, prior to the step of sending the data request carrying the first virtual port number to a second physical port of a server via the first physical port:
acquiring second initial data according to the first data link;
and adding the first virtual port number to the head or tail of the data field in the second initial data to obtain a data request.
9. A port multiplexing system, the system comprising: the system comprises a server and a terminal, wherein a first physical port of the terminal and a second physical port of the server are used for bearing at least one physical data link based on a user datagram protocol, and a plurality of virtual data links are deployed on at least one physical data link;
the terminal is used for selecting a target virtual data link for the data transmission; determining a first virtual port number for identifying the first physical port according to the port corresponding relation of the target virtual data link; transmitting a data request carrying the first virtual port number to a second physical port of a server through the first physical port, wherein the second physical port is also identified by a second virtual port number in the port corresponding relation;
the server is used for receiving a virtual link construction request sent by the terminal, wherein the virtual link construction request comprises a first virtual port number; generating a second virtual port number of the server according to the first virtual port number; establishing a corresponding relation between the first virtual port and the second virtual port number as a port corresponding relation of a virtual data link deployed based on the physical data link; transmitting a link construction response to the terminal, wherein the link construction response comprises the second virtual port number; when a data request carrying a first virtual port number sent by the terminal is received, determining a second virtual port number corresponding to the first virtual port number according to the port corresponding relation, wherein the first physical port is identified by the first virtual port number in the port corresponding relation, and the second physical port is identified by the second virtual port number; generating response data according to the data request; transmitting response data carrying the second virtual port number to the first physical port through the second physical port;
The terminal is further configured to receive response data sent by the server according to the data request.
10. A server for use in a port multiplexing system, the system further comprising: the terminal is used for bearing at least one physical data link based on a user datagram protocol between a first physical port of the terminal and a second physical port of the server, and a plurality of virtual data links are deployed on at least one physical data link;
the server includes:
a first deployment module for: receiving a virtual link construction request sent by the terminal, wherein the virtual link construction request comprises a first virtual port number; generating a second virtual port number of the server according to the first virtual port number; establishing a corresponding relation between the first virtual port and the second virtual port number as a port corresponding relation of a virtual data link deployed based on the physical data link; transmitting a link construction response to the terminal, wherein the link construction response comprises the second virtual port number;
the first receiving module is used for determining a second virtual port number corresponding to the first virtual port number according to a port corresponding relation when receiving a data request carrying the first virtual port number sent by the terminal, wherein the first physical port is identified by the first virtual port number in the port corresponding relation, and the second physical port is identified by the second virtual port number;
The first generation module is used for generating response data according to the data request;
and the first sending module is used for sending response data carrying the second virtual port number to the first physical port through the second physical port.
11. A terminal for use in a port multiplexing system, the system further comprising: the system comprises a server, a first physical port of the terminal and a second physical port of the server, wherein the server is used for bearing at least one physical data link based on a user datagram protocol, and a plurality of virtual data links are deployed on at least one physical data link;
the terminal comprises:
the selection module is used for selecting a target virtual data link for the data transmission;
a determining module, configured to determine a first virtual port number for identifying the first physical port according to a port correspondence of a target virtual data link;
the second sending module is used for sending a data request carrying the first virtual port number to a second physical port of the server through the first physical port, and the second physical port is further identified by a second virtual port number in the port corresponding relation;
The second receiving module is used for receiving response data sent by the server according to the data request;
the server includes:
a first deployment module for: receiving a virtual link construction request sent by the terminal, wherein the virtual link construction request comprises a first virtual port number; generating a second virtual port number of the server according to the first virtual port number; establishing a corresponding relation between the first virtual port and the second virtual port number as a port corresponding relation of a virtual data link deployed based on the physical data link; and sending a link construction response to the terminal, wherein the link construction response comprises the second virtual port number.
12. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processing implementing the port multiplexing method of any of claims 2 to 4 when the computer program is executed.
13. A computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, which when executed by a processor implements the port multiplexing method of claim 1 or any of the ports of claims 2 to 4 or any of the port multiplexing methods of claims 5 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010774292.XA CN112099942B (en) | 2020-08-04 | 2020-08-04 | Port multiplexing method, system, terminal, server, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010774292.XA CN112099942B (en) | 2020-08-04 | 2020-08-04 | Port multiplexing method, system, terminal, server, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112099942A CN112099942A (en) | 2020-12-18 |
CN112099942B true CN112099942B (en) | 2023-08-25 |
Family
ID=73749626
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010774292.XA Active CN112099942B (en) | 2020-08-04 | 2020-08-04 | Port multiplexing method, system, terminal, server, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112099942B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116032998B (en) * | 2021-10-26 | 2024-10-01 | 广州视源电子科技股份有限公司 | Data transmission method, data transmission device, computer readable storage medium and electronic equipment |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101227437A (en) * | 2007-01-19 | 2008-07-23 | 华为技术有限公司 | Equipment, system and method for implementing media gateway resource share |
CN103491053A (en) * | 2012-06-08 | 2014-01-01 | 北京百度网讯科技有限公司 | UDP load balancing method, UDP load balancing system and UDP load balancing device |
CN111211878A (en) * | 2018-11-22 | 2020-05-29 | 杭州海康威视系统技术有限公司 | File transmission method, device and system and electronic equipment |
Family Cites Families (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6611872B1 (en) * | 1999-01-11 | 2003-08-26 | Fastforward Networks, Inc. | Performing multicast communication in computer networks by using overlay routing |
US7174390B2 (en) * | 2001-04-20 | 2007-02-06 | Egenera, Inc. | Address resolution protocol system and method in a virtual network |
FI20041104A0 (en) * | 2004-08-23 | 2004-08-23 | Nokia Corp | Continuity of a session |
CN101459602B (en) * | 2008-11-28 | 2012-02-29 | 烽火通信科技股份有限公司 | Apparatus and method for transmitting management and control information in packet transmission network |
WO2015081534A1 (en) * | 2013-12-05 | 2015-06-11 | 华为技术有限公司 | Data packet transmission system, transmission method and device thereof |
CN104539531B (en) * | 2014-12-25 | 2019-08-02 | 网宿科技股份有限公司 | Data transmission method and device |
CN105656747A (en) * | 2015-11-11 | 2016-06-08 | 乐卡汽车智能科技(北京)有限公司 | Multi-link data transmission method and apparatus |
CN105429797B (en) * | 2015-11-12 | 2019-06-11 | 北京航空航天大学 | Avionics system AFDX network simulation based on OPNET verifies system |
CN105978823B (en) * | 2016-07-11 | 2019-05-07 | 中体彩科技发展有限公司 | Data transmission method and device for game system |
US10554586B2 (en) * | 2017-02-22 | 2020-02-04 | International Business Machines Corporation | Physical port identification using software controlled LEDs |
-
2020
- 2020-08-04 CN CN202010774292.XA patent/CN112099942B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101227437A (en) * | 2007-01-19 | 2008-07-23 | 华为技术有限公司 | Equipment, system and method for implementing media gateway resource share |
CN103491053A (en) * | 2012-06-08 | 2014-01-01 | 北京百度网讯科技有限公司 | UDP load balancing method, UDP load balancing system and UDP load balancing device |
CN111211878A (en) * | 2018-11-22 | 2020-05-29 | 杭州海康威视系统技术有限公司 | File transmission method, device and system and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN112099942A (en) | 2020-12-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TWI245192B (en) | Method, system and storage medium for passing through network address translation device | |
US20070180079A1 (en) | Method and system for peer-to-peer stream | |
CN112583618B (en) | Method, device and computing equipment for providing network service for business | |
US20150088995A1 (en) | Method and apparatus for sharing contents using information of group change in content oriented network environment | |
CN105743958A (en) | Terminal-to-terminal communication method and device | |
CN111885733B (en) | Resource allocation method, device, storage medium and network equipment | |
CN112398845B (en) | Data transmission method, data transmission device, data transmission system and electronic equipment | |
JP2012083891A (en) | Failover system, storage processor, and failover control method | |
CN112099942B (en) | Port multiplexing method, system, terminal, server, equipment and storage medium | |
CN113973136A (en) | Traffic scheduling method, device and system | |
CN106027354B (en) | The reflow method and device of VPN client | |
CN107222365B (en) | Data processing method and device and server | |
CN104683312A (en) | Method and device for negotiating media multiplexing | |
CN110708293B (en) | Method and device for distributing multimedia service | |
CN116233481A (en) | Media stream transmission method, media server and communication system | |
CN105656994A (en) | Business acceleration method and device | |
CN109040199A (en) | A kind of method, system and storage medium for distributing resource data | |
CN111669610B (en) | Live video transmission method, system, device, server, electronic equipment and storage medium | |
CN113873301A (en) | Video stream acquisition method and device, server and storage medium | |
US11671515B2 (en) | Methods, network node and client device for acquisition and delivery of resources in a communications network | |
US20110276669A1 (en) | Method and System for Peer-to-Peer Stream | |
KR20220116201A (en) | Methods for delivering audio and/or video content to a player | |
CN113472907A (en) | Network access method, router, electronic device and computer readable medium | |
JP5289345B2 (en) | Address translation device, communication system, message communication method, and program | |
CN111835822B (en) | Service processing method, system, domain name server, electronic equipment and medium |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |