A network data transmission method and device and a storage medium
By establishing a mapping relationship between session identifiers and connection source information between terminal devices and servers, the problem of connection interruption caused by network switching is solved, and the continuity of network data transmission and communication reliability are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- QINGDAO SCO AEROSPACE TECH CO LTD
- Filing Date
- 2022-05-13
- Publication Date
- 2026-05-08
AI Technical Summary
When a terminal device switches networks, the network address changes, causing the network connection to be interrupted, which cannot guarantee the continuity of data transmission and the reliability of communication.
By receiving data packets from the server and utilizing the mapping relationship between session identifiers and connection source information, the target session identifier and connection source information are determined. Data packets are then sent to the terminal device via the target access device, ensuring the continuity and reliability of multiple link communication connections.
It enables seamless switching between multiple links during network switching, ensuring the continuity of network data transmission and the reliability of communication between terminal devices and servers.
Smart Images

Figure CN115087058B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, and in particular to a network data transmission method, apparatus, and storage medium. Background Technology
[0002] Satellite networks refer to networks that use satellite transponders to relay signals and complete data transmission between their nodes. They offer advantages such as long service distances, wide service coverage, no geographical limitations, high system reliability, and strong resilience. Ground-based networks, on the other hand, rely on terrestrial access equipment to relay signals and complete data transmission between their nodes. Satellite networks can supplement ground-based networks, providing network services to terminal devices.
[0003] In existing technologies, when a terminal device switches networks—such as from a terrestrial network to a satellite network, or from one network access device to another within the same network—its network address changes. This means the terminal device uses a different network address before and after the switch. This necessitates disconnecting the previous network connection and then establishing a new network connection based on the new network address, using the new network for data transmission. This makes the network switching process overly complex, compromises data transmission continuity, and results in low communication reliability. Summary of the Invention
[0004] This invention provides a network data transmission method, apparatus, and storage medium that can ensure the continuity of network data transmission and improve the reliability of communication between terminal devices and servers.
[0005] To achieve the above objectives, the present invention adopts the following technical solution:
[0006] In a first aspect, the present invention provides a network data transmission method, the method comprising:
[0007] Receive a first data packet sent by the server. The first data packet includes destination information, which includes information used by the server to communicate with the target terminal device.
[0008] Based on the first mapping relationship between the stored session identifier and the destination information, the target session identifier corresponding to the destination information is determined. The target session identifier is used to identify the session between the target terminal device and the server.
[0009] Based on the second mapping relationship between the stored session identifier and the connection source information, at least one connection source information corresponding to the target session identifier is determined. The connection source information includes information used by the target terminal device to communicate with the server through the access device.
[0010] The target connection source information is determined based on at least one connection source information, and the target access device and the target terminal device corresponding to the target connection source information are in a connected state.
[0011] A second data packet is sent to the target terminal device via the target access device. The second data packet includes the first data packet and the target connection source information.
[0012] In one possible implementation, when at least one connection source information includes multiple connection source information, determining the target connection source information based on at least one connection source information includes: obtaining status information corresponding to each connection source information among the multiple connection source information, the status information including first information and second information, the first information indicating whether the target terminal device and the access device corresponding to the connection source information are in a connected state, and the second information indicating communication parameter information between the target terminal device and the access device corresponding to the connection source information; determining the priority of the multiple access devices based on the multiple second information and the device type of each access device among the multiple access devices corresponding to the multiple connection source information; and determining the connection source information corresponding to the access device with the highest priority among the status information indicating that the connection is in a connected state as the target connection source information.
[0013] In one possible implementation, determining the priority of multiple access devices based on multiple pieces of second information and the device type of each access device in the access devices corresponding to multiple connection source information includes: grouping access devices with the same device type into one category to obtain at least one device set; determining the priority of at least one device set based on the device type corresponding to each device set; determining the priority of access devices in each device set based on the second information corresponding to each access device in each device set; and determining the priority of multiple access devices based on the priority of at least one device set and the priority of access devices in each device set.
[0014] In one possible implementation, the second information includes at least one of the following: last active time and network delay information; the last active time is the time when the link corresponding to the connection source information last transmitted data, and the network delay information is the network delay of the link corresponding to the connection source information.
[0015] In one possible implementation, the network data transmission method further includes: receiving a third data packet sent by a target access device, the third data packet including target connection source information, the target connection source information including source address, source port and identifier of the target access device; determining the target session identifier corresponding to the target connection source information according to a second mapping relationship; determining the destination information corresponding to the target session identifier according to a first mapping relationship; and sending the third data packet to the server according to the destination information.
[0016] In one possible implementation, the target connection source information includes a source address, a source port, and an identifier of the target access device. Before receiving the first data packet sent by the server, the network data transmission method further includes: receiving a network connection request sent by the target access device; when the network connection request includes a source address, a source port, and destination information, establishing a session between the target terminal device and the server, and assigning a target session identifier to the session; sending the target session identifier to the target terminal device via the target access device; establishing a first mapping relationship between the target session identifier and the destination information, and establishing a second mapping relationship between the target session identifier and the target connection source information; and storing the status information corresponding to the target connection source information.
[0017] In one possible implementation, the network data transmission method further includes: when the network connection request includes a source address, a source port, and a target session identifier, establishing a second mapping relationship between the target session identifier and the target connection source information, and storing the status information corresponding to the target connection source information.
[0018] In one possible implementation, sending a target session identifier to a target terminal device via a target access device includes: encrypting the target session identifier using a preset algorithm; and sending the encrypted target session identifier to the target terminal device via the target access device.
[0019] In a second aspect, the present invention provides a network data transmission device, comprising:
[0020] The receiving module is used to receive a first data packet sent by the server. The first data packet includes destination information, which includes information used by the server to communicate with the target terminal device.
[0021] The first determining module is used to determine the target session identifier corresponding to the target information based on the first mapping relationship between the stored session identifier and the target information. The target session identifier is used to identify the session between the target terminal device and the server.
[0022] The second determining module is used to determine at least one connection source information corresponding to the target session identifier based on the second mapping relationship between the stored session identifier and the connection source information. The connection source information includes information used by the target terminal device to communicate with the server through the access device.
[0023] The third determining module is used to determine the target connection source information based on at least one connection source information, wherein the target access device and the target terminal device corresponding to the target connection source information are in a connected state.
[0024] The sending module is used to send a second data packet to a target terminal device via the target access device. The second data packet includes the first data packet and target connection source information.
[0025] In one possible implementation, when at least one connection source information includes multiple connection source information, the third determining module is specifically used to: obtain status information corresponding to each connection source information among the multiple connection source information, the status information including first information and second information, the first information being used to indicate whether the target terminal device and the access device corresponding to the connection source information are in a connected state, and the second information being used to indicate the communication parameter information between the target terminal device and the access device corresponding to the connection source information; determine the priority of the multiple access devices based on the multiple second information and the device type of each access device among the multiple access devices corresponding to the multiple connection source information; and determine the connection source information corresponding to the access device with the highest priority among the status information indicating that the connection is in a connected state as the target connection source information.
[0026] In one possible implementation, the third determining module is specifically used to: classify access devices of the same device type among multiple access devices into one category to obtain at least one device set; determine the priority of at least one device set according to the device type corresponding to each device set; determine the priority of access devices in each device set according to the second information corresponding to each access device in each device set; and determine the priority of multiple access devices according to the priority of at least one device set and the priority of access devices in each device set.
[0027] In one possible implementation, the second information includes at least one of the following: last active time and network delay information; the last active time is the time when the access device corresponding to the connection source information last transmitted data, and the network delay information is the network delay of the access device corresponding to the connection source information.
[0028] In one possible implementation, the receiving module is further configured to receive a third data packet sent by the target access device, the third data packet including target connection source information, the target connection source information including source address, source port and identifier of the target access device; the second determining module is further configured to determine the target session identifier corresponding to the target connection source information according to the second mapping relationship; the first determining module is further configured to determine the destination information corresponding to the target session identifier according to the first mapping relationship; and the sending module is further configured to send the third data packet to the server according to the destination information.
[0029] In one possible implementation, the target connection source information includes a source address, a source port, and an identifier of the target access device. The network data transmission device further includes an establishment module and a storage module. The receiving module is also used to receive a network connection request sent by the target access device. The establishment module is used to establish a session between the target terminal device and the server when the network connection request includes a source address, a source port, and destination information, and to assign a target session identifier to the session. The sending module is also used to send the target session identifier to the target terminal device via the target access device. The establishment module is also used to establish a first mapping relationship between the target session identifier and the destination information, and to establish a second mapping relationship between the target session identifier and the target connection source information. The storage module is used to store the status information corresponding to the target connection source information.
[0030] In one possible implementation, the establishment module is further used to establish a second mapping relationship between the target session identifier and the target connection source information when the network connection request includes the source address, source port and target session identifier; the storage module is used to store the status information corresponding to the target connection source information.
[0031] In one possible implementation, the sending module is specifically used to: encrypt the target session identifier using a preset algorithm; and send the encrypted target session identifier to the target terminal device via the target access device.
[0032] Thirdly, the present invention provides a computer device comprising a processor and a memory. The memory stores computer program code, which includes computer instructions. When the processor executes the computer instructions, the computer device performs a network data transmission method as described in the first aspect and any possible implementation thereof.
[0033] Fourthly, the present invention provides a computer-readable storage medium having computer instructions stored thereon, which, when executed on a computer device, cause the computer device to perform a network data transmission method as described in the first aspect and any possible implementation thereof.
[0034] Fifthly, the present invention provides a computer program product comprising computer instructions that, when executed on a computer device, cause the computer device to perform a network data transmission method as described in the first aspect and any possible implementation thereof.
[0035] The network data transmission method provided in this invention receives a first data packet sent by a server. The first data packet includes destination information, which includes information used by the server to communicate with a target terminal device. Based on a stored first mapping relationship between session identifiers and destination information, a target session identifier corresponding to the destination information is determined. Based on a stored second mapping relationship between session identifiers and connection source information, at least one connection source information corresponding to the target session identifier is determined. Target connection source information is determined based on the at least one connection source information. Finally, a second data packet is sent to the target terminal device via a target access device. The target session identifier identifies the session between the target terminal device and the server. The target access device corresponding to the target connection source information is in a connected state with the target terminal device. The connection source information includes information used by the target terminal device to communicate with the server through the access device. The second data packet includes the first data packet and the target connection source information. In this way, the server can maintain communication with the target terminal device simultaneously through multiple links corresponding to multiple connection source information in a connected state, and can seamlessly switch between multiple links, thereby ensuring the continuity of network data transmission and improving the reliability of communication between the terminal device and the server. Attached Figure Description
[0036] Figure 1 This is a schematic diagram illustrating an application scenario of a network data transmission method provided in an embodiment of the present invention;
[0037] Figure 2 A schematic diagram illustrating the mapping relationship of session identifiers provided in an embodiment of the present invention;
[0038] Figure 3 This is one of the flowcharts illustrating a network data transmission method provided in an embodiment of the present invention;
[0039] Figure 4 This is a second schematic flowchart of a network data transmission method provided in an embodiment of the present invention;
[0040] Figure 5 This is a third flowchart illustrating a network data transmission method provided in an embodiment of the present invention.
[0041] Figure 6 The fourth flowchart illustrates a network data transmission method provided in this embodiment of the invention.
[0042] Figure 7 The fifth schematic flowchart of a network data transmission method provided in this embodiment of the invention;
[0043] Figure 8 This is one of the structural schematic diagrams of a network data transmission device provided in an embodiment of the present invention;
[0044] Figure 9This is a second schematic diagram of a network data transmission device provided in an embodiment of the present invention. Detailed Implementation
[0045] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0046] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of embodiments of this disclosure, unless otherwise stated, "a plurality of" means two or more. Furthermore, the use of "based on" or "according to" implies openness and inclusiveness, because processes, steps, calculations, or other actions "based on" or "according to" one or more of the stated conditions or values may in practice be based on additional conditions or beyond the stated values.
[0047] To ensure the continuity of network data transmission and improve the reliability of communication between terminal devices and servers, this invention provides a network data transmission method, apparatus, and storage medium. The method involves receiving a first data packet sent by a server. The first data packet includes destination information, which includes information used by the server to communicate with a target terminal device. Based on a stored first mapping relationship between session identifiers and destination information, a target session identifier corresponding to the destination information is determined. Based on a stored second mapping relationship between session identifiers and connection source information, at least one connection source information corresponding to the target session identifier is determined. Target connection source information is determined based on the at least one connection source information. Finally, a second data packet is sent to the target terminal device via a target access device. The target session identifier identifies the session between the target terminal device and the server. The target access device corresponding to the target connection source information is in a connected state with the target terminal device. The connection source information includes information used by the target terminal device to communicate with the server through the access device. The second data packet includes the first data packet and the target connection source information. In this way, the server can maintain communication with the target terminal device simultaneously through multiple links corresponding to multiple connection source information in a connected state, and can seamlessly switch between multiple links, thereby ensuring the continuity of network data transmission and improving the reliability of communication between the terminal device and the server.
[0048] The network data transmission method provided in this embodiment of the invention is executed by a computer device capable of network interconnection, such as a gateway. This embodiment of the invention uses a gateway as an example to describe the network data transmission method.
[0049] Figure 1 This is a schematic diagram illustrating an application scenario of a network data transmission method provided in an embodiment of the present invention. For example... Figure 1 As shown, the target terminal device 01 can be a multi-mode communication device that supports both space-based and ground-based networks, such as a mobile phone, and the server 02 can be a computer device capable of providing Internet services.
[0050] Target terminal device 01 can be accessed via satellites in a space-based network. Figure 1 Taking only satellite access devices E1 and E2 as examples, or ground base stations in a ground-based network (… Figure 1 Taking only one access device, ground base station E3, as an example, it communicates with server 02 via gateway 03.
[0051] Specifically, when establishing a network connection between the target terminal device 01 and the server 02, the gateway 03 can obtain the source address and source port of the target terminal device 01, the identifier of the access device, the communication protocol, and the destination address and destination port of the server 02. After establishing the connection, the gateway 03 can generate a session identifier and establish a first mapping relationship between the session identifier and the destination information, and a second mapping relationship between the session identifier and the connection source information. The destination information includes the destination address and destination port of the server 02, and the connection source information can include the source address and source port of the target terminal device 01 and the identifier of the access device. The connection source information is used to indicate the communication link between the target terminal device 01 and the access device. Furthermore, the gateway 03 can return the session identifier to the target terminal device 01. When the source address of the target terminal device 01 changes due to a change in the access device, the target terminal device 01 can initiate a change request. The change request includes the session identifier and the new connection source information corresponding to when the target terminal device 01 initiated the change request. After receiving the change request, the gateway 03 can modify the second mapping relationship according to the session identifier and the new connection source information. The modification methods include adding and modifying.
[0052] Figure 2 This is a diagram illustrating the mapping relationship of session identifiers. For example... Figure 2As shown, the first mapping relationship indicates a one-to-one mapping between the session identifier and the destination information corresponding to the server, while the second mapping relationship indicates a many-to-one mapping between the multiple connection source information included in the target terminal device 01 and the session identifier. In other words, the gateway 03 can map the multiple connection source information included in the target terminal device 01 to the same session and communicate with the server 02 through this session.
[0053] For example, when the target terminal device 01 loses its ground-based network signal, it can transmit network data to the server 02 via satellite E1 in the space-based network, through paths S1 and S2. Subsequently, due to satellite movement, the access device changes to satellite E2. When the server 02 transmits network data to the target terminal device 01, the network data can reach the target terminal device 01 via paths S3 and S4 because of the change in the access device. After a period of time, due to a change in the location of the target terminal device 01, it regains its ground-based network signal and can transmit network data to the server 02 via ground base station E3 in the ground-based network, through paths S5 and S6.
[0054] based on Figure 1 and Figure 2 , Figure 3 This illustrates one of the flowcharts for a network data transmission method. (For example...) Figure 3 As shown, the method may include the following steps S301-S305.
[0055] S301. The server sends a first data packet to the gateway, and the gateway receives the first data packet sent by the server. The first data packet includes destination information, which includes information used by the server to communicate with the target terminal device.
[0056] The destination information may include the server's destination address and destination port. The destination address is the Internet Protocol address (IP address) when the server sends the first data packet, and the destination port is the port used by the server when sending the first data packet.
[0057] Specifically, the gateway can receive the first data packet sent by the server. The first data packet includes destination information, which includes information used by the server to communicate with the target terminal device.
[0058] S302. The gateway determines the target session identifier corresponding to the target information based on the first mapping relationship between the stored session identifier and the target information. The target session identifier is used to identify the session between the target terminal device and the server.
[0059] Understandably, a gateway can support multiple sessions simultaneously. The first mapping relationship is used to indicate that each session has a globally unique session identifier. Furthermore, each session identifier uniquely identifies not only a destination message but also a terminal device.
[0060] Specifically, the gateway can determine the target session identifier corresponding to the destination information based on the stored first mapping relationship between session identifiers and destination information. The target session identifier is used to identify the session between the target terminal device and the server. In this way, the gateway can determine the target terminal device receiving the first data packet from multiple terminal devices using the destination information when the server sends the first data packet.
[0061] S303. The gateway determines at least one connection source information corresponding to the target session identifier based on the second mapping relationship between the stored session identifier and the connection source information. The connection source information includes information used by the target terminal device to communicate with the server through the access device.
[0062] Understandably, connection source information can include the source address, source port, and access device identifier used by the target terminal device when connecting to the gateway. The source address is the IP address used by the target terminal device to communicate with the server, the source port is the port used by the target terminal device to communicate with the server, and the access device can be a satellite in a space-based network or a ground base station in a ground-based network. The source address of the target terminal device differs in different types of networks, resulting in different connection source information. Similarly, the connection source information differs even within the same type of network. The second mapping relationship indicates that different connection source information for the same terminal device is associated with the same session identifier.
[0063] Specifically, the gateway can determine at least one connection source information corresponding to the target session identifier based on the second mapping relationship between the stored session identifier and the connection source information. The connection source information includes information used by the target terminal device to communicate with the server through the access device.
[0064] S304. The gateway determines the target connection source information based on at least one connection source information, and the target access device and the target terminal device corresponding to the target connection source information are in a connected state.
[0065] It is understandable that the communication links between the target terminal device and different access devices are not always in a connected state. Taking low-orbit satellites as an example, their flight speed is fast and their transit time is short, so the time they are in a connected state is limited.
[0066] Specifically, the gateway can determine the target connection source information based on at least one connection source information, and the target access device and the target terminal device corresponding to the target connection source information are in a connected state.
[0067] S305. The gateway sends a second data packet to the target terminal device via the target access device. The target terminal device receives the second data packet, which includes the first data packet and the target connection source information.
[0068] It is understandable that determining the target connection source information means determining the path information when the gateway forwards the first data. This path information includes the target source address, the target source port, and the identifier of the target access device used when the target terminal device receives the first data.
[0069] Specifically, the gateway can send a second data packet to the target terminal device via the target access device. The second data packet includes the first data packet and the target connection source information.
[0070] In one possible implementation, the gateway can use a preset algorithm to encrypt the target session identifier and send the encrypted target session identifier to the target terminal device via the target access device, thereby ensuring that the network connection between the target terminal device and the server is not maliciously relayed.
[0071] In this embodiment, the gateway receives a first data packet sent by the server. The first data packet includes destination information, which includes information used by the server to communicate with the target terminal device. Based on a stored first mapping relationship between session identifiers and destination information, the gateway determines the target session identifier corresponding to the destination information. Based on a stored second mapping relationship between session identifiers and connection source information, the gateway determines at least one connection source information corresponding to the target session identifier. Based on the at least one connection source information, the gateway determines the target connection source information. Finally, the gateway sends a second data packet to the target terminal device via the target access device. The target session identifier identifies the session between the target terminal device and the server. The target access device corresponding to the target connection source information is in a connected state with the target terminal device. The connection source information includes information used by the target terminal device to communicate with the server through the access device. The second data packet includes the first data packet and the target connection source information. In this way, the server can maintain communication with the target terminal device simultaneously through multiple links corresponding to multiple connection source information in a connected state, and can seamlessly switch between multiple links, thereby ensuring the continuity of network data transmission and improving the reliability of communication between the terminal device and the server.
[0072] Optional, based on Figure 3 , Figure 4 This is the second flowchart illustrating a network data transmission method. (For example...) Figure 4 As shown, when at least one connection source information includes multiple connection source information, the above step S304 includes:
[0073] S401. The gateway obtains the status information corresponding to each connection source information in multiple connection source information. The status information includes first information and second information. The first information is used to indicate whether the target terminal device and the access device corresponding to the connection source information are in a connection state. The second information is used to indicate the communication parameter information between the target terminal device and the access device corresponding to the connection source information.
[0074] The second piece of information can be either the last active time or network latency information. The last active time is the moment when the target terminal device and the access device corresponding to the connection source information last transmitted data, and the network latency information is the network latency between the target terminal device and the access device corresponding to the connection source information.
[0075] Specifically, the gateway can obtain the status information corresponding to each of the multiple connection source information. The status information may include first information and second information. The first information indicates whether the access device corresponding to the connection source information is in a connected state, and the second information indicates the communication parameter information of the access device corresponding to the connection source information.
[0076] S402. The gateway determines the priority of multiple access devices based on multiple second pieces of information and the device type of each access device in the access devices corresponding to multiple connection source information.
[0077] Specifically, the gateway can determine the priority of multiple access devices based on multiple second pieces of information and the device type of each access device in the access devices corresponding to multiple connection source information.
[0078] In one possible implementation, the network management system can group access devices of the same type into one category to obtain at least one device set. Then, based on the device type corresponding to each device set, the priority of the at least one device set is determined. Based on the second information corresponding to each access device in each device set, the priority of the access devices in each device set is determined. Finally, based on the priority of the at least one device set and the priority of the access devices in each device set, the priority of the multiple access devices is determined.
[0079] For example, if the access devices are of different types, the ground base station devices in the ground-based network have a higher priority than the satellites in the space-based network; if the access devices are of the same type, the access devices with lower network latency have a higher priority.
[0080] S403. The gateway uses the first information to indicate the status information of the access device with the highest priority in the connection state as the target connection source information.
[0081] Specifically, the gateway can use the first information to indicate the connection source information of the highest priority access device in the connection state to determine the target connection source information.
[0082] In this embodiment, the gateway filters out the highest priority target connection source information by checking whether the access device corresponding to the connection source information is in a connected state and by using the communication parameter information of the access device corresponding to the connection source information. This not only ensures the continuity and reliability of communication between the terminal device and the server, but also further improves the communication quality between the two.
[0083] It is understood that the above embodiments describe the process of the gateway executing the network data transmission method by taking the example of the server sending a first data packet to the target terminal device through the gateway. Based on this, this embodiment describes the process of the gateway executing the network data transmission method by taking the example of the target terminal device sending a third data packet to the server through the gateway.
[0084] Figure 5 The third flowchart illustrates a network data transmission method. (For example...) Figure 5 As shown, network data transmission methods include:
[0085] S501. The terminal sends a third data packet to the gateway via the target access device. The gateway receives the third data packet sent by the target access device. The third data packet includes target connection source information, which includes the source address, source port, and identifier of the target access device.
[0086] S502. The gateway determines the target session identifier corresponding to the target connection source information based on the second mapping relationship.
[0087] S503. The gateway determines the destination information corresponding to the target session identifier based on the first mapping relationship.
[0088] S504. The gateway sends a third data packet to the server based on the destination information, and the server receives the third data packet.
[0089] In this embodiment, the gateway receives a third data packet sent by the target access device. The third data packet includes target connection source information, which includes source address, source port and identifier of the target access device. Based on the second mapping relationship, the gateway determines the target session identifier corresponding to the target connection source information. Based on the first mapping relationship, the gateway determines the destination information corresponding to the target session identifier. Finally, based on the destination information, the gateway sends the third data packet to the server, thereby realizing communication between the terminal and the server.
[0090] Optionally, the target connection source information includes the source address, source port, and identifier of the target access device, based on... Figure 4 , Figure 6The fourth flowchart illustrates a network data transmission method. Figure 4 As shown, before step S301, the network data transmission method further includes:
[0091] S601. The target terminal device sends a network connection request to the gateway via the target access device, and the gateway receives the network connection request sent by the target access device.
[0092] It is understandable that the network request can be a request made by the target terminal when it first establishes a communication connection with the server through the target access device, or it can be a change request initiated by the target terminal through the target access device to the gateway to re-establish a communication connection with the server after the network address has changed.
[0093] Specifically, the gateway can receive network connection requests sent by the target access device.
[0094] S602. When the network connection request includes the source address, source port and destination information, the gateway establishes a session between the target terminal device and the server, and assigns a target session identifier to the session.
[0095] It is understandable that when a network connection request includes source address, source port, and destination information, the network connection request is the request made by the target terminal when it first establishes a communication connection with the server through the target access device.
[0096] Specifically, when a network connection request includes source address, source port, and destination information, the gateway establishes a session between the target terminal device and the server, and assigns a target session identifier to the session. This target session identifier is used to uniquely identify the session between the target terminal device and the server.
[0097] S603. The gateway sends the target session identifier to the target terminal device through the target access device, and the target terminal device receives and stores the target session identifier.
[0098] Specifically, the gateway can send the target session identifier to the target terminal device via the target access device. Furthermore, the target terminal device can store the target session identifier.
[0099] S604. The gateway establishes a first mapping relationship between the target session identifier and the destination information, and establishes a second mapping relationship between the target session identifier and the target connection source information.
[0100] Specifically, the gateway can establish a first mapping relationship between the target session identifier and the destination information, and a second mapping relationship between the target session identifier and the target connection source information. Furthermore, the gateway can store both the first and second mapping relationships.
[0101] S605. The gateway stores the status information corresponding to the target connection source information.
[0102] Specifically, the gateway can determine and store the status information corresponding to the target connection source information. Furthermore, the gateway can update the status information in real time when it changes.
[0103] In this embodiment, the gateway receives a network connection request sent by the target access device. When the network connection request includes a source address, source port, and destination information, it establishes a session between the target terminal device and the server, assigns a target session identifier to the session, and sends the target session identifier to the target terminal device via the target access device. A first mapping relationship is established between the target session identifier and the destination information, and a second mapping relationship is established between the target session identifier and the target connection source information. The gateway also stores the status information corresponding to the target connection source information. This establishes a mapping relationship between the connection source information corresponding to the target terminal device and the target session identifier corresponding to the destination information. Based on this, the gateway can maintain this mapping relationship to ensure the continuity and reliability of communication between the target terminal device and the server when the connection source information corresponding to the target terminal device changes or is added.
[0104] Optional, based on Figure 6 , Figure 7 The fifth step in illustrating a network data transmission method is shown. Figure 7 As shown, network data transmission methods also include:
[0105] S701. When the network connection request includes the source address, source port and target session identifier, the gateway establishes a second mapping relationship between the target session identifier and the target connection source information, and stores the status information corresponding to the target connection source information.
[0106] It is understandable that when a network connection request includes a source address, source port, and target session identifier, the network connection request is a change request initiated by the target terminal through the target access device to the gateway to re-establish a communication connection with the server after the network address has changed.
[0107] Specifically, when a network connection request includes a source address, a source port, and a target session identifier, the gateway can maintain the existing second mapping relationship, re-establish the second mapping relationship between the target session identifier and the target connection source information, and store the status information corresponding to the target connection source information.
[0108] In one possible implementation, if the network connection request is initiated due to a change in the access device, the gateway can add new connection source information to the existing second mapping relationship.
[0109] In another possible implementation, if the network connection request is initiated due to a change in the source address of the target terminal device while the access device remains unchanged, the gateway can modify the original connection source information in the original second mapping relationship.
[0110] In this embodiment, when the network connection request includes a source address, source port, and target session identifier, the gateway establishes a second mapping relationship between the target session identifier and the target connection source information, and stores the status information corresponding to the target connection source information. By maintaining this second mapping relationship, the continuity and reliability of communication between the target terminal device and the server can be guaranteed.
[0111] The foregoing primarily describes the solutions provided by the embodiments of the present invention from the perspective of the device. It is understood that, in order to achieve the above functions, the device includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, in conjunction with the algorithmic steps of the various examples described in the embodiments disclosed herein, the present invention can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
[0112] Figure 8 A schematic diagram of one possible network data transmission device is shown, such as... Figure 8 As shown, the network data transmission device may include: a receiving module 81, a first determining module 82, a second determining module 83, a third determining module 84, and a sending module 85.
[0113] The receiving module 81 is used to receive a first data packet sent by the server. The first data packet includes destination information, which includes information used by the server to communicate with the target terminal device.
[0114] The first determining module 82 is used to determine the target session identifier corresponding to the target information based on the first mapping relationship between the stored session identifier and the target information. The target session identifier is used to identify the session between the target terminal device and the server.
[0115] The second determining module 83 is used to determine at least one connection source information corresponding to the target session identifier based on the second mapping relationship between the stored session identifier and the connection source information. The connection source information includes information used by the target terminal device to communicate with the server through the access device.
[0116] The third determining module 84 is used to determine the target connection source information based on at least one connection source information, wherein the target access device and the target terminal device corresponding to the target connection source information are in a connected state.
[0117] The sending module 85 is used to send a second data packet to the target terminal device via the target access device. The second data packet includes the first data packet and the target connection source information.
[0118] Optionally, when at least one connection source information includes multiple connection source information, the third determining module 84 is specifically used to: obtain status information corresponding to each connection source information among the multiple connection source information, the status information including first information and second information, the first information being used to indicate whether the target terminal device and the access device corresponding to the connection source information are in a connected state, and the second information being used to indicate the communication parameter information between the target terminal device and the access device corresponding to the connection source information; determine the priority of the multiple access devices based on the multiple second information and the device type of each access device among the multiple access devices corresponding to the multiple connection source information; and determine the connection source information corresponding to the access device with the highest priority among the status information indicating that the connection is in a connected state as the target connection source information.
[0119] Optionally, the third determining module 84 is specifically used to: classify access devices of the same device type among multiple access devices into one category to obtain at least one device set; determine the priority of at least one device set according to the device type corresponding to each device set; determine the priority of access devices in each device set according to the second information corresponding to each access device in each device set; and determine the priority of multiple access devices according to the priority of at least one device set and the priority of access devices in each device set.
[0120] Optionally, the second information includes at least one of the following: last active time and network latency information; the last active time is the moment when the target terminal device and the access device corresponding to the connection source information last transmitted data, and the network latency information is the network latency between the target terminal device and the access device corresponding to the connection source information.
[0121] Optionally, the receiving module 81 is further configured to receive a third data packet sent by the target access device, the third data packet including target connection source information, the target connection source information including source address, source port and identifier of the target access device; the second determining module 83 is further configured to determine the target session identifier corresponding to the target connection source information according to the second mapping relationship; the first determining module 82 is further configured to determine the destination information corresponding to the target session identifier according to the first mapping relationship; and the sending module 85 is further configured to send the third data packet to the server according to the destination information.
[0122] Optionally, the target connection source information includes the source address, source port, and identifier of the target access device. Based on Figure 8 , Figure 9 A second schematic diagram of a possible network data transmission device is shown, such as... Figure 9 As shown, the network data transmission device further includes an establishment module 86 and a storage module 87; the receiving module 81 is further configured to receive a network connection request sent by the target access device; the establishment module 86 is configured to establish a session between the target terminal device and the server when the network connection request includes a source address, a source port, and destination information, and to assign a target session identifier to the session; the sending module 85 is further configured to send the target session identifier to the target terminal device via the target access device; the establishment module 86 is further configured to establish a first mapping relationship between the target session identifier and the destination information, and to establish a second mapping relationship between the target session identifier and the target connection source information; the storage module 87 is configured to store the status information corresponding to the target connection source information.
[0123] Optionally, the establishment module 86 is further configured to establish a second mapping relationship between the target session identifier and the target connection source information when the network connection request includes the source address, source port and target session identifier; the storage module 87 is configured to store the status information corresponding to the target connection source information.
[0124] Optionally, the sending module 85 is specifically used to: encrypt the target session identifier using a preset algorithm; and send the encrypted target session identifier to the target terminal device via the target access device.
[0125] Of course, the network data transmission device provided in this embodiment of the invention includes, but is not limited to, the modules described above.
[0126] The network data transmission apparatus provided in this embodiment of the invention is used to execute the above-described network data transmission method, and thus can achieve the same effect as the above-described network data transmission method.
[0127] Another embodiment of the present invention provides a computer device, which includes a processor and a memory. The memory stores computer program code, including computer instructions. When the processor executes the computer instructions, the computer device performs the network data transmission method shown in the above-described method embodiment.
[0128] Another embodiment of the present invention provides a computer-readable storage medium storing computer instructions that, when executed on a computer device, cause the computer device to perform the network data transmission method shown in the above-described method embodiment.
[0129] Another embodiment of the present invention provides a computer program product, which includes computer instructions that, when executed on a computer device, cause the computer device to perform the network data transmission method shown in the above method embodiment.
[0130] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions within the technical scope disclosed in the present invention should be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A network data transmission method, characterized in that, include: The server receives a first data packet, which includes destination information, including information used by the server to communicate with the target terminal device. Based on the first mapping relationship between the stored session identifier and the destination information, the target session identifier corresponding to the destination information is determined, and the target session identifier is used to identify the session between the target terminal device and the server; Based on the second mapping relationship between the stored session identifier and connection source information, at least one connection source information corresponding to the target session identifier is determined, wherein the connection source information includes information used by the target terminal device to communicate with the server through the access device; Target connection source information is determined based on the at least one connection source information, wherein the target access device corresponding to the target connection source information is in a connected state with the target terminal device; When the at least one connection source information includes multiple connection source information, determining the target connection source information based on the at least one connection source information includes: obtaining status information corresponding to each connection source information among the multiple connection source information, the status information including first information and second information, the first information being used to indicate whether the target terminal device and the access device corresponding to the connection source information are in a connection state, and the second information being used to indicate communication parameter information between the target terminal device and the access device corresponding to the connection source information; determining the priority of multiple access devices based on multiple second information and the device type of each access device among the multiple access devices corresponding to the multiple connection source information; and determining the connection source information corresponding to the access device with the highest priority among the status information indicating a connection state as the target connection source information; A second data packet is sent to the target terminal device via the target access device. The second data packet includes the first data packet and the target connection source information.
2. The network data transmission method according to claim 1, characterized in that, The step of determining the priority of multiple access devices based on multiple pieces of second information and the device type of each access device in the access devices corresponding to the multiple connection source information includes: Among the multiple access devices, access devices of the same type are grouped into one category to obtain at least one set of devices; The priority of the at least one device set is determined based on the device type corresponding to each device set; The priority of the access devices in each device set is determined based on the second information corresponding to each access device in each device set; The priorities of the plurality of access devices are determined based on the priority of the at least one set of devices and the priority of the access devices in each set of devices.
3. The network data transmission method according to claim 2, characterized in that, The second information includes at least one of the following: last active time, network latency information; The last active time is the moment when the target terminal device and the access device corresponding to the connection source information last transmitted data, and the network latency information is the network latency between the target terminal device and the access device corresponding to the connection source information.
4. The network data transmission method according to claim 1 or 2, characterized in that, The network data transmission method further includes: Receive a third data packet sent by the target access device, the third data packet including the target connection source information, the target connection source information including the source address, the source port and the identifier of the target access device; Based on the second mapping relationship, the target session identifier corresponding to the target connection source information is determined; Based on the first mapping relationship, determine the destination information corresponding to the target session identifier; Based on the stated purpose information, the third data packet is sent to the server.
5. The network data transmission method according to claim 2, characterized in that, The target connection source information includes a source address, a source port, and an identifier of the target access device. Before receiving the first data packet sent by the server, the network data transmission method further includes: Receive the network connection request sent by the target access device; When the network connection request includes the source address, the source port, and the destination information, a session is established between the target terminal device and the server, and the target session identifier is assigned to the session; The target session identifier is sent to the target terminal device via the target access device; Establish a first mapping relationship between the target session identifier and the destination information, and establish a second mapping relationship between the target session identifier and the target connection source information; Store the status information corresponding to the target connection source information.
6. The network data transmission method according to claim 5, characterized in that, The network data transmission method further includes: When the network connection request includes the source address, the source port, and the target session identifier, a second mapping relationship is established between the target session identifier and the target connection source information, and the status information corresponding to the target connection source information is stored.
7. The network data transmission method according to claim 5, characterized in that, Sending the target session identifier to the target terminal device via the target access device includes: The target session identifier is encrypted using a preset algorithm; The encrypted target session identifier is sent to the target terminal device via the target access device.
8. A network data transmission device, characterized in that, include: A receiving module is configured to receive a first data packet sent by a server, the first data packet including destination information, the destination information including information used by the server to communicate with the target terminal device; The first determining module is used to determine the target session identifier corresponding to the target information based on the first mapping relationship between the stored session identifier and the target information. The target session identifier is used to identify the session between the target terminal device and the server. The second determining module is used to determine at least one connection source information corresponding to the target session identifier based on the second mapping relationship between the stored session identifier and connection source information. The connection source information includes information used by the target terminal device to communicate with the server through the access device. The third determining module is used to determine target connection source information based on the at least one connection source information, wherein the target access device corresponding to the target connection source information is in a connected state with the target terminal device. When the at least one connection source information includes multiple connection source information, determining the target connection source information based on the at least one connection source information includes: obtaining status information corresponding to each connection source information among the multiple connection source information, the status information including first information and second information, the first information being used to indicate whether the target terminal device and the access device corresponding to the connection source information are in a connection state, and the second information being used to indicate communication parameter information between the target terminal device and the access device corresponding to the connection source information; determining the priority of multiple access devices based on multiple second information and the device type of each access device among the multiple access devices corresponding to the multiple connection source information; and determining the connection source information corresponding to the access device with the highest priority among the status information indicating a connection state as the target connection source information; The sending module is used to send a second data packet to the target terminal device via the target access device, the second data packet including the first data packet and the target connection source information.
9. A computer device, characterized in that, The computer device includes a processor and a memory; the memory is used to store computer program code, the computer program code including computer instructions; when the processor executes the computer instructions, the computer device performs the network data transmission method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, It includes computer instructions that, when executed on a computer device, cause the computer device to perform the network data transmission method as described in any one of claims 1-7.
Citation Information
Patent Citations
Method and terminal for sending data through gateway and gateway
CN104717759A
System and method for transporting information to services in a network environment
US20150334027A1