CN117938870A - Network communication method, device, electronic equipment and medium - Google Patents

Network communication method, device, electronic equipment and medium Download PDF

Info

Publication number
CN117938870A
CN117938870A CN202311770828.0A CN202311770828A CN117938870A CN 117938870 A CN117938870 A CN 117938870A CN 202311770828 A CN202311770828 A CN 202311770828A CN 117938870 A CN117938870 A CN 117938870A
Authority
CN
China
Prior art keywords
network
network data
inter
data packet
data processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311770828.0A
Other languages
Chinese (zh)
Inventor
韩波
赵海亮
袁占涛
任晓壮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hainan Qiantang Shilian Information Technology Co ltd
Original Assignee
Hainan Qiantang Shilian Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hainan Qiantang Shilian Information Technology Co ltd filed Critical Hainan Qiantang Shilian Information Technology Co ltd
Priority to CN202311770828.0A priority Critical patent/CN117938870A/en
Publication of CN117938870A publication Critical patent/CN117938870A/en
Pending legal-status Critical Current

Links

Abstract

The embodiment of the invention provides a method, a device, electronic equipment and a medium for network communication, wherein the method comprises the following steps: based on a first IP network connection, receiving an IP network data packet sent by a first end positioned in a first network area, and converting the IP network data packet into a non-IP network data packet; and sending the non-IP network data packet to a second inter-network data processing service of a second network area in the non-IP network, so that the second inter-network data processing service converts the non-IP network data packet into an IP network data packet, and sending the IP network data packet to a second end of the second network area based on second IP network connection. By the embodiment of the invention, the transmission of the IP network data packet among different network areas of the non-IP network is realized, the code of the application program based on the IP network protocol is not required to be modified, and the compatibility and the communication convenience of the non-IP network are improved.

Description

Network communication method, device, electronic equipment and medium
Technical Field
The present invention relates to the field of network technologies, and in particular, to a method, an apparatus, an electronic device, and a medium for network communication.
Background
In some non-IP networks, an application based on an IP network protocol may be used, where the data packet generated by the application based on the IP network protocol is an IP network data packet, and the IP network data packet cannot be transmitted in the non-IP network due to the heterogeneity of the network.
When an application program based on an IP network protocol needs to perform data transmission in the same network area of a non-IP network, only the IP network data packet can be limited to the internal transmission of the same server, or an IP local area network is established in the same network area so as to perform the transmission of the IP network data packet.
When an application program based on an IP network protocol needs to be transmitted in different network areas of a non-IP network, only the code of the application program can be modified, so that a data packet generated by the application program is adapted to the non-IP network, and the method is complex and inconvenient to operate.
Disclosure of Invention
In view of the foregoing, a method, apparatus, electronic device and medium for providing a network communication that overcomes or at least partially solves the foregoing problems are presented, comprising:
A method of network communication for a first inter-network data processing service located in a first network area in a non-IP network, the method comprising:
Based on a first IP network connection, receiving an IP network data packet sent by a first end positioned in a first network area, and converting the IP network data packet into a non-IP network data packet;
and sending the non-IP network data packet to a second inter-network data processing service of a second network area in the non-IP network, so that the second inter-network data processing service converts the non-IP network data packet into an IP network data packet, and sending the IP network data packet to a second end of the second network area based on second IP network connection.
Optionally, before the receiving, based on the first IP network connection, an IP network packet sent by the first end located in the first network area, the method further includes:
Receiving an IP network connection request sent by the first end;
and responding to the IP network connection request, establishing a first IP network connection with the first end, and sending a request to the second inter-network data processing service so as to enable the second inter-network data processing service to establish a second IP network connection with the second end.
Optionally, the IP network connection request is a request sent by the first end to a destination local service port of the first inter-network data processing service, and before the sending a request to the second inter-network data processing service to enable the second inter-network data processing service to establish a second IP network connection with the second end, the method further includes:
configuring a data forwarding rule; the data forwarding rule comprises a mapping relation between a target local service port and the second inter-network data processing service and the second end;
The sending a request to the second inter-network data processing service to enable the second inter-network data processing service to establish a second IP network connection with the second end includes:
And determining a second inter-network data processing service and a second end which receive the target local service port mapping of the IP network connection request based on the data forwarding rule, and sending a request to the second inter-network data processing service so as to enable the second inter-network data processing service to establish a second IP network connection with the second end.
Optionally, the mapping relationship between the target local service port and the second inter-network data processing service, the second end includes:
and the mapping relation between the port number of the target local service port and the non-IP network address of the second inter-network data processing service, the IP address of the second end and the port number.
Optionally, the first network area has a first area service, the second network area has a second area service, and communication is performed between the first inter-network data processing service and the second inter-network data processing service through the first area service and the second area service;
The first regional service and the second regional service are communicated based on a non-IP network protocol;
The first inter-network data processing service communicates with the first regional service based on an IP network connection or the first inter-network data processing service communicates with the first regional service based on a non-IP network protocol;
the second inter-network data processing service communicates with the second regional service based on an IP network connection or the second inter-network data processing service communicates with the second regional service based on a non-IP network protocol.
A method of network communication for a second inter-network data processing service located in a second network area in a non-IP network, the method comprising:
Receiving a non-IP network data packet sent by a first inter-network data processing service located in a first network area in a non-IP network; the non-IP network data packet is obtained by converting the first inter-network data processing service into an IP network data packet, and the IP network data packet is obtained by converting the first inter-network data processing service into an IP network data packet based on a first IP network connection and is received by a first end of the first network area;
And converting the non-IP network data packet into an IP network data packet, and transmitting the IP network data packet to a second end of the second network area based on a second IP network connection.
An apparatus for network communication for use with a first inter-network data processing service located in a first network area in a non-IP network, the apparatus comprising:
The first data packet conversion module is used for receiving an IP network data packet sent by a first end of the first network area based on a first IP network connection and converting the IP network data packet into a non-IP network data packet;
And the non-IP network data packet sending module is used for sending the non-IP network data packet to a second inter-network data processing service positioned in a second network area in a non-IP network so that the second inter-network data processing service converts the non-IP network data packet into an IP network data packet and sends the IP network data packet to a second end of the second network area based on second IP network connection.
An apparatus for network communication for use with a second inter-network data processing service located in a second network area in a non-IP network, the apparatus comprising:
a non-IP network data packet receiving module, configured to receive a non-IP network data packet sent by a first inter-network data processing service located in a first network area in a non-IP network; the non-IP network data packet is obtained by converting the first inter-network data processing service into an IP network data packet, and the IP network data packet is obtained by converting the first inter-network data processing service into an IP network data packet based on a first IP network connection and is received by a first end of the first network area;
And the second data packet conversion module is used for converting the non-IP network data packet into an IP network data packet and transmitting the IP network data packet to a second end of the second network area based on a second IP network connection.
An electronic device comprising a processor, a memory and a computer program stored on the memory and capable of running on the processor, which when executed by the processor implements a method of network communication as described above.
A computer readable storage medium having stored thereon a computer program which when executed by a processor implements a method of network communication as described above.
The embodiment of the invention has the following advantages:
in the embodiment of the invention, the IP network data packet sent by the first end of the first network area is received based on the first IP network connection, the IP network data packet is converted into the non-IP network data packet, the non-IP network data packet is sent to the second inter-network data processing service of the second network area in the non-IP network, so that the second inter-network data processing service converts the non-IP network data packet into the IP network data packet, and the IP network data packet is sent to the second end of the second network area based on the second IP network connection, thereby realizing the transmission of the IP network data packet between different network areas of the non-IP network without modifying codes of application programs based on IP network protocols, and improving the compatibility and communication convenience of the non-IP network.
Drawings
In order to more clearly illustrate the technical solutions of the present invention, the drawings that are needed in the description of the present invention will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort to a person skilled in the art.
FIG. 1 is a flow chart of steps of a method for network communication according to an embodiment of the present invention;
FIG. 2 is a flow chart of steps of another method for network communication according to an embodiment of the present invention;
FIG. 3a is a schematic diagram illustrating a TCP packet communication process according to an embodiment of the present invention;
FIG. 3b is a schematic diagram illustrating another TCP packet communication process according to an embodiment of the present invention;
FIG. 3c is a schematic diagram illustrating an HTTP packet communication process according to an embodiment of the present invention;
FIG. 3d is a schematic diagram illustrating another HTTP packet communication process according to an embodiment of the present invention;
FIG. 4 is a block diagram of an apparatus for network communication according to an embodiment of the present invention;
fig. 5 is a block diagram of a network communication device according to an embodiment of the present invention.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will become more readily apparent, a more particular description of the invention will be rendered by reference to the appended drawings and appended detailed description. It will be apparent that the described embodiments are some, but not all, embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, a flowchart illustrating steps of a method for network communication according to an embodiment of the present invention is applied to a first inter-network data processing service located in a first network area in a non-IP network.
In an example, the non-IP network may be a heterogeneous network with the IP network, in which a plurality of independent network areas (the network areas may also be referred to as autonomous domains) may be disposed, for example, the non-IP network may be a video network, which is a real-time high-speed transmission network based on ethernet hardware, and a private network for transmitting high-definition video and a private protocol.
In one example, an inter-network data processing service may be used to handle protocol conversion between IP network data packets and non-IP network data packets, such as an inter-network data processing service being a protocol conversion service.
Specifically, the method comprises the following steps:
step 101, based on the first IP network connection, receiving an IP network packet sent by a first end located in the first network area, and converting the IP network packet into a non-IP network packet.
The first end and the second end may be communication ends where application programs based on the IP network protocol are located, that is, the operation of the first end and the second end depends on the IP network protocol, and the first end and the second end can only generate and process IP network data packets.
In an example, the communication end may be a client (e.g., a client deployed in an internet of view terminal), a server (e.g., a server deployed in an internet of view server), for example, the first end is a client and the second end is a server, or the first end is a server and the second end is a client, or the first end is a client and the second end is a client, or the first end is a server and the second end is a server.
It should be noted that, although the first end and the second end are communication ends where the application program based on the IP network protocol is located, the first end and the second end are located in a non-IP network, not in an IP network, and the first end and the second end cannot use the IP network for communication.
In an example, the IP network protocol may be TCP (Transmission Control Protocol ), HTTP (Hypertext Transfer Protocol, hypertext transfer protocol), the IP network connection may be a TCP connection, an HTTP connection, the IP network packet may be a TCP packet, an HTTP packet, or any other IP network-based protocol.
When the IP network protocol is HTTP, one of the first and second ends is a browser, and the other end is a WEB site, which may be a browser at the first end and a WEB site at the second end, or may be a WEB site at the first end and a browser at the second end.
The first end may be located in a first network area of the non-IP network, the second end may be located in a second network area of the non-IP network, and the first network area and the second network area may be independent network areas.
When a first end in a first network area is to communicate with a second end in a second network area, that is, a cross-domain communication service is to be performed between different network areas, the first end can generate an IP network data packet based on an IP network protocol, the IP network data packet adopts an IP network protocol packet header, and a destination address of the IP network data packet is an IP address and a port of the second end.
Because the first end and the second end cannot communicate through the IP network, and the non-IP network cannot be compatible with the IP network data packet generated by the first end, the first end may send the generated IP network data packet to the first inter-network data processing service in the first network area where the first end is located.
In an example, since the first inter-network data processing service and the first end are located in the same network area, the first inter-network data processing service and the first end may use an IP local area network for communication, and of course, if the first inter-network data processing service and the first end are located in the same server, the first inter-network data processing service and the first end may also directly perform data transmission inside the server.
In a specific implementation, the first end may establish a first IP network connection with the first inter-network data processing service, and then may send an IP network packet to the first inter-network data processing service through the established first IP network connection. After receiving the IP network data packet, the first inter-network data processing service may convert the IP network data packet into a non-IP network data packet based on a non-IP network protocol. Specifically, the first inter-network data processing service may generate a non-IP network protocol packet header, and then use the IP network data packet as a packet body, so as to generate a non-IP network data packet.
In an example, where the non-IP network is a video network, the non-IP network protocol may be a full-network transparent protocol of the video network, in which a full-network address is used in the video network, and a message may be sent to any terminal or server accessing the video network.
Step 102, the non-IP network data packet is sent to a second inter-network data processing service located in a second network area in the non-IP network, so that the second inter-network data processing service converts the non-IP network data packet into an IP network data packet, and sends the IP network data packet to a second end of the second network area based on a second IP network connection.
After generating the non-IP network data packet, the non-IP network data packet may be transmitted in the non-IP network, and the first inter-network data processing service may send the non-IP network data packet to a second inter-network data processing service located in a second network area in the non-IP network.
After receiving the non-IP network data packet, the second inter-network data processing service may convert the non-IP network data into an IP network data packet because the data is to be transmitted to the second end, which is a communication end where the application program based on the IP network protocol is located, and only the IP network data packet can be processed.
In an example, since the second inter-network data processing service and the second end are located in the same network area, the second inter-network data processing service and the second end may use an IP local area network to perform communication, and of course, if the second inter-network data processing service and the second end are located in the same server, the second inter-network data processing service and the second end may also directly perform data transmission inside the server.
After generating the IP network data packet, the second inter-network data processing service may send the IP network data packet to the second end through the established second IP network connection, and the second end may obtain the IP network data packet, and further may process the IP network data packet, to complete the cross-domain service.
In an example, the second end may also send a feedback message to the first end, where the feedback message generated by the second end may also be an IP network packet, and the transmission process may be the same as or similar to the process that the first end sends the IP network packet to the second end, and may refer to the process that the first end sends the IP network packet to the second end.
In an embodiment of the present invention, before the receiving, based on the first IP network connection, an IP network packet sent by a first end located in the first network area, the method further includes:
Receiving an IP network connection request sent by the first end; and responding to the IP network connection request, establishing a first IP network connection with the first end, and sending a request to the second inter-network data processing service so as to enable the second inter-network data processing service to establish a second IP network connection with the second end.
Before transmitting the IP network data packet, the first end may send an IP network connection request to the first inter-network data processing service, where the first inter-network data processing service establishes a first IP network connection with the first end after receiving the IP network connection request, e.g. establishes an IP network connection through a handshake interaction procedure.
Since the destination address of the IP network packet is the second end in the second network area, the first inter-network data processing service may send a request to the second inter-network data processing service located in the second network area.
After receiving the request sent by the first inter-network data processing service, the second inter-network data processing service may establish a second IP network connection with the second end, e.g., through a handshake interaction procedure.
In one embodiment of the present invention, before sending a request to a second inter-network data processing service to enable the second inter-network data processing service to establish a second IP network connection with the second end, the method further includes:
Configuring a data forwarding rule; the data forwarding rule comprises a mapping relation between a target local service port and the second inter-network data processing service and the second end.
In practical application, the first inter-network data processing service has a plurality of local service ports, and different local service ports may correspond to different communication opposite ends, so that a data forwarding rule may be preconfigured, where the data forwarding rule may include a mapping relationship between the local service ports and the communication opposite ends, that is, indicates to which communication opposite end the data received through which local service port is to be forwarded.
In an example, the mapping relationship between the destination local service port and the second inter-network data processing service, the second end includes: and mapping relation between the port number of the destination local service port and the non-IP network address of the second inter-network data processing service, the IP address of the second end and the port number.
In an embodiment of the present invention, the sending a request to the second inter-network data processing service to enable the second inter-network data processing service to establish a second IP network connection with the second end includes:
And determining a second inter-network data processing service and a second end which are mapped by the target local service port and receive the IP network connection request based on the data forwarding rule, and sending a request to the second inter-network data processing service so as to enable the second inter-network data processing service to establish a second IP network connection with the second end.
In a specific implementation, the IP network connection request sent by the first end to the first inter-network data processing service may be a request sent by the first end to a destination local service port of the first inter-network data processing service, where the first inter-network data processing service may search, in a data forwarding rule, a communication opposite end mapped by the destination local service port as a second end, where the second end is located, and the inter-network data processing service of the second network area is a second inter-network data processing service.
After determining that the opposite communication end is the second end, the first inter-network data processing service may send a request to a second inter-network data processing service of a second network area where the second end is located, where the second inter-network data processing service may establish a second IP network connection with the second end, for example, establish an IP network connection through a handshake interaction procedure.
In an example, the request may be a request based on a non-IP network protocol, where the request may carry information about the second end, such as an IP address and a port of the second end.
In one embodiment of the present invention, the first network area has a first area service and the second network area has a second area service, which may be used to communicate with other network areas, also referred to as autonomous services.
Because the first inter-network data processing service and the second inter-network data processing service are located in different network areas, the first inter-network data processing service and the second inter-network data processing service can communicate through the first area service and the second area service, specifically, the first inter-network data processing service sends a data packet to the first area service, the first area service sends the data packet to the second area service, and the second area service sends the data packet to the second inter-network data processing service.
In an example, the first area service and the second area service communicate based on a non-IP network protocol, such as a full network transparent transmission protocol of the internet of view in a case that the non-IP network is the internet of view.
In an embodiment of the present invention, because of different network access modes, different connection modes may be adopted between the inter-network data processing service and the regional service in the same network region, and the inter-network data processing service and the regional service may be connected through an IP network or a non-IP network.
For the first inter-network data processing service, the first inter-network data processing service may communicate with the first area service based on the IP network connection, that is, the first inter-network data processing service may directly send the IP network data packet to the first area service, and send the non-IP network data packet by the first area service. The communication with the first regional service may also be based on a non-IP network protocol, that is, the first inter-network data processing service may send the non-IP network data packet to the first regional service, and directly forward by the first regional service.
For the second inter-network data processing service, the second inter-network data processing service may communicate with the second area service based on the IP network connection, that is, the second inter-network data processing service may directly send the IP network data packet to the second area service, and send the non-IP network data packet out by the second area service. The second inter-network data processing service may also communicate with the second regional service based on a non-IP network protocol, that is, the second inter-network data processing service may send non-IP network data packets to the second regional service for direct forwarding by the second regional service.
For example, in the internet of view, an autonomous network provides two ways of network access:
1. The inter-network data processing service logs on a core server through a virtual terminal number (ensuring that the core server is connected to the network), and is further connected to the regional service through the core server, and the protocol conversion service, the core server and the regional service are communicated through a full-network transparent transmission protocol;
2. The inter-network data processing service is directly connected to the regional service through the autonomous user number by using TCP, communication is carried out between the protocol conversion service and the regional service through TCP, and a TCP data packet carries a data packet of a full-network transparent transmission protocol (the data packet is obtained by converting the inter-network data processing service).
In the embodiment of the invention, the IP network data packet sent by the first end of the first network area is received based on the first IP network connection, the IP network data packet is converted into the non-IP network data packet, the non-IP network data packet is sent to the second inter-network data processing service of the second network area in the non-IP network, so that the second inter-network data processing service converts the non-IP network data packet into the IP network data packet, and the IP network data packet is sent to the second end of the second network area based on the second IP network connection, thereby realizing the transmission of the IP network data packet between different network areas of the non-IP network without modifying codes of application programs based on IP network protocols, and improving the compatibility and communication convenience of the non-IP network.
Referring to fig. 2, a flowchart of steps of another method for network communication according to an embodiment of the present invention is shown, applied to a second inter-network data processing service located in a second network area in a non-IP network.
Specifically, the method comprises the following steps:
Step 201, receiving a non-IP network data packet sent by a first inter-network data processing service located in a first network area in a non-IP network; the non-IP network data packet is obtained by converting the first inter-network data processing service into an IP network data packet, and the IP network data packet is obtained by converting the first inter-network data processing service into the IP network data packet based on a first IP network connection and is received by a first end of the first network area.
When a first end in a first network area is to communicate with a second end in a second network area, that is, a cross-domain communication service is to be performed between different network areas, the first end can generate an IP network data packet based on an IP network protocol, the IP network data packet adopts an IP network protocol packet header, and a destination address of the IP network data packet is an IP address and a port of the second end.
Because the first end and the second end cannot communicate through the IP network, and the non-IP network cannot be compatible with the IP network data packet generated by the first end, the first end may send the generated IP network data packet to the first inter-network data processing service in the first network area where the first end is located.
In a specific implementation, the first end may establish a first IP network connection with the first inter-network data processing service, and then may send an IP network packet to the first inter-network data processing service through the established first IP network connection. After receiving the IP network data packet, the first inter-network data processing service may convert the IP network data packet into a non-IP network data packet based on a non-IP network protocol. Specifically, the first inter-network data processing service may generate a non-IP network protocol packet header, and then use the IP network data packet as a packet body, so as to generate a non-IP network data packet.
After generating the non-IP network data packet, the non-IP network data packet may be transmitted in the non-IP network, and the first inter-network data processing service may send the non-IP network data packet to a second inter-network data processing service located in a second network area in the non-IP network.
Step 202, converting the non-IP network data packet into an IP network data packet, and transmitting the IP network data packet to the second end of the second network area based on the second IP network connection.
After receiving the non-IP network data packet, the second inter-network data processing service may convert the non-IP network data into an IP network data packet because the data is to be transmitted to the second end, which is a communication end where the application program based on the IP network protocol is located, and only the IP network data packet can be processed.
After generating the IP network data packet, the second inter-network data processing service may send the IP network data packet to the second end through the established second IP network connection, and the second end may obtain the IP network data packet, and further may process the IP network data packet, to complete the cross-domain service.
In an embodiment of the present invention, before the sending the IP network packet to the second end of the second network area based on the second IP network connection, the method further includes:
and receiving a request sent by the first inter-network data processing service, and establishing a second IP network connection with the second end in response to the request of the first inter-network data processing service.
Before transmitting the IP network data packet, the first end may send an IP network connection request to the first inter-network data processing service, where the first inter-network data processing service establishes a first IP network connection with the first end after receiving the IP network connection request, e.g. establishes an IP network connection through a handshake interaction procedure.
Since the destination address of the IP network packet is the second end in the second network area, the first inter-network data processing service may send a request to the second inter-network data processing service located in the second network area.
After receiving the request sent by the first inter-network data processing service, the second inter-network data processing service may establish a second IP network connection with the second end, e.g., through a handshake interaction procedure.
In a specific implementation, the IP network connection request sent by the first end to the first inter-network data processing service may be a request sent by the first end to a destination local service port of the first inter-network data processing service, where the first inter-network data processing service may search, in a data forwarding rule, a communication opposite end mapped by the destination local service port as a second end, where the second end is located, and the inter-network data processing service of the second network area is a second inter-network data processing service.
After determining that the opposite communication end is the second end, the first inter-network data processing service may send a request to a second inter-network data processing service of a second network area where the second end is located, where the second inter-network data processing service may establish a second IP network connection with the second end, for example, establish an IP network connection through a handshake interaction procedure.
In the embodiment of the invention, the non-IP network data packet is obtained by converting the non-IP network data packet sent by the first inter-network data processing service in the first network area in the non-IP network into the IP network data packet, the IP network data packet is obtained by converting the first inter-network data processing service into the IP network data packet based on the first IP network connection, the IP network data packet sent by the first end in the first network area is received, then the non-IP network data packet is converted into the IP network data packet, and the IP network data packet is sent to the second end in the second network area based on the second IP network connection, so that the transmission of the IP network data packet between different network areas of the non-IP network is realized, the code of an application program based on an IP network protocol is not required to be modified, and the compatibility and the communication convenience of the non-IP network are improved.
The invention is illustrated below with reference to fig. 3a to 3 d:
In the video networking, an autonomous network provides two networking modes:
1. The protocol conversion service logs on to the core server through the virtual terminal number (ensuring that the core server is already in the network), and is further connected to the autonomous service through the core server, as shown in fig. 3a and 3c, the protocol conversion service, the core server and the autonomous service are communicated through the whole network transparent transmission protocol;
2. The protocol conversion service is directly connected to the autonomous service through the autonomous user number by using TCP, as shown in fig. 3b and fig. 3d, the protocol conversion service and the autonomous service communicate through TCP, and the TCP data packet carries a data packet of the full network transparent transmission protocol.
In the case that the IP network protocol is TCP and the non-IP network protocol is the all-network transparent transmission protocol of the internet of view, the network communication process is as shown in fig. 3a and 3b, and specifically as follows:
1. The TCP/IP application program of the autonomous domain A establishes TCP connection to a local service port of the protocol conversion service;
2. After receiving the TCP connection, the protocol conversion service of the autonomous domain A sends a TCP connection request to the protocol conversion service of the autonomous domain B through the full-network transparent transmission protocol of the autonomous service;
3. After receiving the TCP connection request, the protocol conversion service of the autonomous domain B establishes TCP connection to the service address of the TCP/IP application program of the autonomous domain B;
4. And after the connection is established successfully, realizing a bidirectional data transmission channel. Specifically, the protocol conversion service receives a TCP data packet sent by the local TCP/IP application program and then sends the TCP data packet to the opposite terminal through the whole-network transmission protocol, and the protocol conversion service receives a data packet transmitted by the opposite terminal through the whole-network transmission protocol and then sends the data packet to the local TCP/IP application program through the TCP protocol.
In the case that the IP network protocol is HTTP and the non-IP network protocol is the internet-of-view transparent transmission protocol, the network communication process is as shown in fig. 3c and 3d, and specifically as follows:
1. The browser of the autonomous domain A establishes HTTP connection to a protocol conversion service local service port;
2. After the protocol conversion service of the autonomous domain A receives the HTTP connection, an HTTP connection request is sent to the protocol conversion service of the autonomous domain B through the full-network transparent transmission protocol of the autonomous service;
3. after the protocol conversion service of the autonomous domain B receives the HTTP connection request, establishing HTTP connection to the WEB site address of the autonomous domain B;
4. And after the connection is established successfully, realizing a bidirectional data transmission channel. Specifically, after receiving HTTP data sent by a local browser, the protocol conversion service sends the HTTP data to a WEB site of an opposite end through a full-network transparent transmission protocol, and after receiving the full-network transparent transmission protocol data of the WEB site, the protocol conversion service sends the HTTP data to the local browser through HTTP connection.
It should be noted that, for simplicity of description, the method embodiments are shown as a series of acts, but it should be understood by those skilled in the art that the embodiments are not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred embodiments, and that the acts are not necessarily required by the embodiments of the invention.
Referring to fig. 4, a schematic structural diagram of an apparatus for network communication according to an embodiment of the present invention is applied to a first inter-network data processing service located in a first network area in a non-IP network.
Specifically, the method can comprise the following modules:
The first packet conversion module 401 is configured to receive an IP network packet sent at a first end of the first network area based on a first IP network connection, and convert the IP network packet into a non-IP network packet.
A non-IP network data packet sending module 402, configured to send the non-IP network data packet to a second inter-network data processing service located in a second network area in the non-IP network, so that the second inter-network data processing service converts the non-IP network data packet into an IP network data packet, and sends the IP network data packet to a second end of the second network area based on a second IP network connection.
In an embodiment of the present invention, further includes:
an IP network connection request receiving module, configured to receive an IP network connection request sent by the first end;
And the first IP network connection establishment module is used for responding to the IP network connection request, establishing a first IP network connection with the first end, and sending a request to the second inter-network data processing service so as to enable the second inter-network data processing service to establish a second IP network connection with the second end.
In an embodiment of the present invention, the IP network connection request is a request sent by the first end to a destination local service port of the first inter-network data processing service, and further includes:
The data forwarding rule configuration module is used for configuring data forwarding rules; the data forwarding rule comprises a mapping relation between a target local service port and the second inter-network data processing service and the second end;
In an embodiment of the present invention, the sending a request to the second inter-network data processing service to enable the second inter-network data processing service to establish a second IP network connection with the second end includes:
And determining a second inter-network data processing service and a second end which receive the target local service port mapping of the IP network connection request based on the data forwarding rule, and sending a request to the second inter-network data processing service so as to enable the second inter-network data processing service to establish a second IP network connection with the second end.
In an embodiment of the present invention, the mapping relationship between the target local service port and the second inter-network data processing service, the second end includes:
and the mapping relation between the port number of the target local service port and the non-IP network address of the second inter-network data processing service, the IP address of the second end and the port number.
In an embodiment of the present invention, the first network area has a first area service, the second network area has a second area service, and the first inter-network data processing service and the second inter-network data processing service communicate with each other through the first area service and the second area service;
The first regional service and the second regional service are communicated based on a non-IP network protocol;
The first inter-network data processing service communicates with the first regional service based on an IP network connection or the first inter-network data processing service communicates with the first regional service based on a non-IP network protocol;
the second inter-network data processing service communicates with the second regional service based on an IP network connection or the second inter-network data processing service communicates with the second regional service based on a non-IP network protocol.
In the embodiment of the invention, the IP network data packet sent by the first end of the first network area is received based on the first IP network connection, the IP network data packet is converted into the non-IP network data packet, the non-IP network data packet is sent to the second inter-network data processing service of the second network area in the non-IP network, so that the second inter-network data processing service converts the non-IP network data packet into the IP network data packet, and the IP network data packet is sent to the second end of the second network area based on the second IP network connection, thereby realizing the transmission of the IP network data packet between different network areas of the non-IP network without modifying codes of application programs based on IP network protocols, and improving the compatibility and communication convenience of the non-IP network.
Referring to fig. 5, a schematic structural diagram of an apparatus for network communication according to an embodiment of the present invention is applied to a second inter-network data processing service located in a second network area in a non-IP network.
Specifically, the method can comprise the following modules:
A non-IP network data packet receiving module 501, configured to receive a non-IP network data packet sent by a first inter-network data processing service located in a first network area in a non-IP network; the non-IP network data packet is obtained by converting the first inter-network data processing service into an IP network data packet, and the IP network data packet is obtained by converting the first inter-network data processing service into the IP network data packet based on a first IP network connection and is received by a first end of the first network area.
A second data packet conversion module 502, configured to convert the non-IP network data packet into an IP network data packet, and send the IP network data packet to a second end of the second network area based on a second IP network connection.
In an embodiment of the present invention, further includes:
and the second IP network connection establishment module is used for receiving the request sent by the first inter-network data processing service and responding to the request of the first inter-network data processing service to establish a second IP network connection with the second end.
In an embodiment of the present invention, the first network area has a first area service, the second network area has a second area service, and the first inter-network data processing service and the second inter-network data processing service communicate with each other through the first area service and the second area service;
The first regional service and the second regional service are communicated based on a non-IP network protocol;
The first inter-network data processing service communicates with the first regional service based on an IP network connection or the first inter-network data processing service communicates with the first regional service based on a non-IP network protocol;
the second inter-network data processing service communicates with the second regional service based on an IP network connection or the second inter-network data processing service communicates with the second regional service based on a non-IP network protocol.
In the embodiment of the invention, the non-IP network data packet is obtained by converting the non-IP network data packet sent by the first inter-network data processing service in the first network area in the non-IP network into the IP network data packet, the IP network data packet is obtained by converting the first inter-network data processing service into the IP network data packet based on the first IP network connection, the IP network data packet sent by the first end in the first network area is received, then the non-IP network data packet is converted into the IP network data packet, and the IP network data packet is sent to the second end in the second network area based on the second IP network connection, so that the transmission of the IP network data packet between different network areas of the non-IP network is realized, the code of an application program based on an IP network protocol is not required to be modified, and the compatibility and the communication convenience of the non-IP network are improved.
An embodiment of the present invention also provides an electronic device that may include a processor, a memory, and a computer program stored on the memory and capable of running on the processor, the computer program implementing a method of network communication as above when executed by the processor.
An embodiment of the present invention also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method of network communication as above.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are information and data authorized by the user or fully authorized by each party, and the collection, use and processing of the related data need to comply with the related laws and regulations and standards of the related country and region, and provide corresponding operation entries for the user to select authorization or rejection.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described by differences from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other.
It will be apparent to those skilled in the art that embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the invention may take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiment and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it is further 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 terminal 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 terminal. 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 terminal device that comprises the element.
The foregoing has described in detail the method, apparatus, electronic device and medium for network communication, and specific examples have been presented herein to illustrate the principles and embodiments of the present invention, and the above examples are only for the purpose of aiding in the understanding of the method and core concept of the present invention; meanwhile, as those skilled in the art will vary in the specific embodiments and application scope according to the idea of the present invention, the present disclosure should not be construed as limiting the present invention in summary.

Claims (10)

1. A method of network communication for a first inter-network data processing service located in a first network area in a non-IP network, the method comprising:
Based on a first IP network connection, receiving an IP network data packet sent by a first end positioned in a first network area, and converting the IP network data packet into a non-IP network data packet;
and sending the non-IP network data packet to a second inter-network data processing service of a second network area in the non-IP network, so that the second inter-network data processing service converts the non-IP network data packet into an IP network data packet, and sending the IP network data packet to a second end of the second network area based on second IP network connection.
2. The method of claim 1, further comprising, prior to receiving the IP network packet sent at the first end of the first network region based on the first IP network connection:
Receiving an IP network connection request sent by the first end;
and responding to the IP network connection request, establishing a first IP network connection with the first end, and sending a request to the second inter-network data processing service so as to enable the second inter-network data processing service to establish a second IP network connection with the second end.
3. The method of claim 2, wherein the IP network connection request is a request sent by the first end to a destination local service port of the first inter-network data processing service, and wherein prior to the sending a request to the second inter-network data processing service to establish a second IP network connection between the second inter-network data processing service and the second end, further comprising:
configuring a data forwarding rule; the data forwarding rule comprises a mapping relation between a target local service port and the second inter-network data processing service and the second end;
The sending a request to the second inter-network data processing service to enable the second inter-network data processing service to establish a second IP network connection with the second end includes:
And determining a second inter-network data processing service and a second end which receive the target local service port mapping of the IP network connection request based on the data forwarding rule, and sending a request to the second inter-network data processing service so as to enable the second inter-network data processing service to establish a second IP network connection with the second end.
4. The method of claim 3, wherein the mapping between the target local service port and the second inter-network data processing service, the second end comprises:
and the mapping relation between the port number of the target local service port and the non-IP network address of the second inter-network data processing service, the IP address of the second end and the port number.
5. The method according to any one of claim 1 to 4, wherein,
The first network area is provided with a first area service, the second network area is provided with a second area service, and the first inter-network data processing service and the second inter-network data processing service are communicated through the first area service and the second area service;
The first regional service and the second regional service are communicated based on a non-IP network protocol;
The first inter-network data processing service communicates with the first regional service based on an IP network connection or the first inter-network data processing service communicates with the first regional service based on a non-IP network protocol;
the second inter-network data processing service communicates with the second regional service based on an IP network connection or the second inter-network data processing service communicates with the second regional service based on a non-IP network protocol.
6. A method of network communication for a second inter-network data processing service located in a second network area in a non-IP network, the method comprising:
Receiving a non-IP network data packet sent by a first inter-network data processing service located in a first network area in a non-IP network; the non-IP network data packet is obtained by converting the first inter-network data processing service into an IP network data packet, and the IP network data packet is obtained by converting the first inter-network data processing service into an IP network data packet based on a first IP network connection and is received by a first end of the first network area;
And converting the non-IP network data packet into an IP network data packet, and transmitting the IP network data packet to a second end of the second network area based on a second IP network connection.
7. An apparatus for network communication for a first inter-network data processing service located in a first network area in a non-IP network, the apparatus comprising:
The first data packet conversion module is used for receiving an IP network data packet sent by a first end of the first network area based on a first IP network connection and converting the IP network data packet into a non-IP network data packet;
And the non-IP network data packet sending module is used for sending the non-IP network data packet to a second inter-network data processing service positioned in a second network area in a non-IP network so that the second inter-network data processing service converts the non-IP network data packet into an IP network data packet and sends the IP network data packet to a second end of the second network area based on second IP network connection.
8. An apparatus for network communication for use with a second inter-network data processing service located in a second network area in a non-IP network, the apparatus comprising:
a non-IP network data packet receiving module, configured to receive a non-IP network data packet sent by a first inter-network data processing service located in a first network area in a non-IP network; the non-IP network data packet is obtained by converting the first inter-network data processing service into an IP network data packet, and the IP network data packet is obtained by converting the first inter-network data processing service into an IP network data packet based on a first IP network connection and is received by a first end of the first network area;
And the second data packet conversion module is used for converting the non-IP network data packet into an IP network data packet and transmitting the IP network data packet to a second end of the second network area based on a second IP network connection.
9. An electronic device comprising a processor, a memory and a computer program stored on the memory and capable of running on the processor, which when executed by the processor implements a method of network communication according to any one of claims 1 to 6.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements a method of network communication according to any of claims 1 to 6.
CN202311770828.0A 2023-12-21 2023-12-21 Network communication method, device, electronic equipment and medium Pending CN117938870A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311770828.0A CN117938870A (en) 2023-12-21 2023-12-21 Network communication method, device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311770828.0A CN117938870A (en) 2023-12-21 2023-12-21 Network communication method, device, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN117938870A true CN117938870A (en) 2024-04-26

Family

ID=90754775

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311770828.0A Pending CN117938870A (en) 2023-12-21 2023-12-21 Network communication method, device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN117938870A (en)

Similar Documents

Publication Publication Date Title
EP2220852B1 (en) Communicating a selection of a potential configuration
CN104270379B (en) HTTPS agency retransmission methods and device based on transmission control protocol
CN112954001B (en) Method and device for HTTP-to-HTTPS bidirectional transparent proxy
US20100088427A1 (en) Selective Routing of Data Transmission Between Clients
EP3125502A1 (en) Method for providing access to a web server
CN106604119B (en) Network penetration method and system for private cloud equipment of smart television
KR20130135953A (en) System and method using a web proxy-server to access a device having an assigned network address
US8724630B2 (en) Method and system for implementing network intercommunication
CN105357212A (en) DNS end-to-end analysis method capable of ensuring safety and privacy
CN103107983A (en) Data management method of network system and related system thereof
CN107124483A (en) Domain name analytic method and server
CN106657035B (en) A kind of network message transmission method and device
KR20020040872A (en) Resource request forwarding in HAVi and other internetworking devices
CN103581361A (en) Domain name resolution proxy method, device and system
JP2002141954A (en) Communication relay device, communication relay method, and program storage medium
CN106331195B (en) Data receiving and sending method and device
CN104219257A (en) Web real-time communication method, system, server and client
CN113132218B (en) Home gateway access method, device, system processor and storage medium
JP2004096726A (en) Method for performing internet connectivity of point-to-point and point-to-multipoint
JP2017010388A (en) Http server and control method for the same, image forming apparatus, and program
CN103841139A (en) Data transmission method, device and system
CN117938870A (en) Network communication method, device, electronic equipment and medium
CN105376096A (en) Method and system for analyzing domain name, evaluating and feeding back data quality and optimizing data
CN117896390A (en) Network communication method, device, electronic equipment and medium
US7194521B1 (en) HTTP call Recognition on a PSTN device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication