A KCP protocol reliable transmission agent method and system based on digital network

By adopting the KCP protocol for application layer data encapsulation and transmission in the digital networking system, the problem of unreliable data transmission of the digital networking application protocol is solved, efficient and reliable proxy transmission is achieved, and the stability and efficiency of data transmission are improved.

CN120281832BActive Publication Date: 2025-09-30BEIJING BIG DATA ADVANCED TECH RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510772217.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-11
Publication Date
2025-09-30
Estimated Expiration
2045-06-11

AI Technical Summary

Technical Problem

The existing network proxy system lacks proxy function support for the logarithmic networking application protocols DOIP and DO-IRP, resulting in unreliable and inefficient data transmission.

Method used

The KCP protocol is used to encapsulate and transmit data at the application layer. Through the collaborative work between the local agent and the remote agent, reliable transmission of Internet application protocol data is achieved, including session management and data packet encapsulation and analysis.

Benefits of technology

It achieves efficient and reliable transmission of Internet application protocol data, overcomes the packet loss and unreliability problems of traditional transport layer protocols, and improves the stability and efficiency of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120281832B_ABST
    Figure CN120281832B_ABST
Patent Text Reader

Abstract

The present application provides a KCP protocol reliable transmission proxy method and system based on the digital network, which relates to the field of digital network communication technology. The method includes: sending digital network application protocol data to a local proxy through a client; encapsulating the received digital network application protocol data based on an application layer fast and reliable protocol; forwarding the encapsulated request data packet to a remote proxy of a target device based on a transport layer protocol; parsing the request data packet to obtain the digital network application protocol data and the address data in the session message header; establishing a connection with the target server based on the server address information and server port number in the address data; in response to the forwarded digital network application protocol data, the target server returns response data to the remote proxy; encapsulating the response data and returning it to the local proxy for parsing and forwarding it to the client; and closing the connection between the client and the local proxy based on the received response data. The purpose is to perform efficient and reliable digital network data proxying.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of digital network communication technology, and in particular to a KCP protocol reliable transmission agent method and system based on the digital network. Background Art

[0002] The Internet of Data (IoD) is an internet-based virtual data network that efficiently connects various data platforms and systems through an open software architecture and standardized protocols. Built on a digital object architecture, the IoD abstracts data resources into digital objects based on basic elements such as identifiers, metadata, and data entities. This makes data a machine-independent entity, no longer dependent on specific business systems and scenarios. It provides services for different business scenarios in an independent form, solving challenges such as data assetization, data circulation, transactions, and privacy protection.

[0003] However, most existing network proxies are implemented based on Nginx. In addition to the HTTP and HTTPS proxies supported by native Nginx, and the proxy functions of other protocols implemented by integrating third-party modules or plug-ins into Nginx, there are currently no relevant proxy methods or systems that support the proxy functions of DOIP (Digital Object Interface Protocol) and DO-IRP (Digital Object Identifier / Resolution Protocol) for digital network application protocols. Summary of the Invention

[0004] In view of this, the present application provides a KCP protocol reliable transmission proxy method and system based on the Internet of Things, aiming to provide an efficient and reliable Internet of Things data proxy method.

[0005] In a first aspect of the present application, the present application provides a KCP protocol reliable transmission agent method based on a data network, the method comprising:

[0006] Sending Internet application protocol data to the local proxy through the client of the terminal device;

[0007] Encapsulating the data network application protocol data based on the application layer fast and reliable protocol through the local proxy to obtain a corresponding request data packet;

[0008] Forwarding the request data packet to a remote agent of the target device through the local agent based on the transport layer protocol;

[0009] Parsing the request data packet through the remote proxy to obtain the data network application protocol data and the address data in the session message header;

[0010] The remote proxy establishes a connection with the target server of the target device according to the server address information and the server port number in the address data;

[0011] In response to the data network application protocol data forwarded by the remote proxy, the target server returns response data to the remote proxy;

[0012] Encapsulating the response data through the remote proxy and transmitting it back to the local proxy;

[0013] Parsing the encapsulated response data through the local proxy and forwarding it to the client;

[0014] Based on the response data received by the client, the connection between the client and the local proxy is closed.

[0015] Optionally, encapsulating the response data through the remote proxy and transmitting it back to the local proxy includes:

[0016] Encapsulating the response data based on the application layer fast and reliable protocol through the remote proxy to obtain a response data packet;

[0017] According to the local address information and the local transport layer protocol port number in the address data, the response data packet is returned to the local proxy via the transport layer protocol.

[0018] Optionally, before encapsulating the data network application protocol data based on the application layer fast and reliable protocol by the local proxy to obtain the corresponding request data packet, the method further includes:

[0019] According to the received data network application protocol data, the local agent creates a corresponding first session and stores it in a local session pool for session management;

[0020] The encapsulating the data network application protocol data based on the application layer fast and reliable protocol by the local proxy to obtain the corresponding request data packet includes:

[0021] Encapsulating the data network application protocol data and the session identifier of the first session through the local proxy based on the application layer fast and reliable protocol to obtain a corresponding request data packet;

[0022] The step of parsing the request data packet through the remote proxy to obtain the data network application protocol data and the address data in the session message header includes:

[0023] Parsing the request data packet through the remote proxy to obtain the data network application protocol data, the address data in the session message header, and the session identifier of the first session;

[0024] According to the session identifier of the first session, a corresponding second session is created by the remote proxy and stored in a remote session pool for session management;

[0025] Closing the connection between the client and the local proxy based on the response data received by the client includes:

[0026] Based on the response data received by the client, the connection between the client and the local proxy is closed, and the first session and the second session are reclaimed.

[0027] Optionally, according to the session identifier of the first session, creating a corresponding second session through the remote proxy and storing the second session in a remote session pool for session management includes:

[0028] querying, through a remote proxy, whether the session identifier of the first session exists in a remote session pool according to the session identifier of the first session;

[0029] If the session identifier of the first session does not exist, creating a second session with the same session identifier as the first session and storing it in the remote session pool;

[0030] registering the second session to a session management event through the remote proxy to process an abnormal request;

[0031] If the second session exists, the creation of the second session corresponding to the request data packet is terminated.

[0032] Optionally, closing the connection between the client and the local proxy based on the response data received by the client, and reclaiming the first session and the second session includes:

[0033] Based on the response data received by the client, closing the connection between the client and the local proxy;

[0034] Based on the closed state of the connection, releasing the first session through the local proxy and removing the first session from the local session pool;

[0035] Sending a connection close data packet to the remote agent through the local agent;

[0036] Based on the received connection close data packet, the second session is released through the remote proxy, and the second session is removed from the remote session pool.

[0037] Optionally, the method further includes:

[0038] Monitor the request process through session management events and obtain corresponding monitoring results;

[0039] If the monitoring result is a request timeout or a response timeout, the corresponding session is released and removed.

[0040] Optionally, before sending the Internet application protocol data to the local proxy through the client of the terminal device, the method further includes:

[0041] Configuring a service address, a first request data port, and a first network data port of a local proxy of a terminal device, wherein the first request data port is used to receive Internet application protocol data sent by the client, and the first network data port is used to receive encapsulated response data returned by the remote proxy;

[0042] The service address, second request data port and second network data port of the remote agent of the target device are configured. The second request data port is used to receive the network application protocol data sent by the server of the target device when it acts as the requesting end, and the second network data port is used to receive the request data packet sent by the local agent.

[0043] Optionally, the local agent creates a corresponding first session according to the received data networking application protocol data, including: generating a session identifier of the first session according to a timestamp of the received data networking application protocol data;

[0044] Based on the session identifier of the first session, the local agent creates a corresponding first session.

[0045] Optionally, generating a session identifier for the first session according to the timestamp of the received data network application protocol data includes:

[0046] generating a session identifier for the session according to the timestamp of the received data network application protocol data;

[0047] Determine whether the session identifier exists in the local session pool;

[0048] If the session identifier does not exist, determining the generated session identifier as the session identifier of the first session corresponding to the data network application protocol data, and creating the first session;

[0049] If it exists, regenerate a new session identifier for the session until the generated new session identifier does not exist in the local session pool;

[0050] The generated new session identifier that does not exist in the corresponding session pool is determined as the session identifier of the first session corresponding to the network application protocol data, and the first session is created.

[0051] In a second aspect of the present application, the present application provides a KCP protocol reliable transmission agent system based on the Internet of Things, the system comprising: a terminal device initiating a request and a target device responding to the request, the terminal device comprising a local agent and a client initiating the request, the target device comprising a remote agent and a server responding to the request;

[0052] The client is used to send Internet application protocol data to the local proxy through the client of the terminal device;

[0053] The local agent is used to encapsulate the data of the Internet application protocol based on the application layer fast and reliable protocol to obtain the corresponding request data packet, and is used to forward the request data packet to the remote agent of the target device based on the transport layer protocol;

[0054] The remote proxy is used to parse the request data packet to obtain the address data in the data network application protocol data and the session message header, and to establish a connection with the target server of the target device based on the server address information and server port number in the address data;

[0055] The target server is configured to return response data to the remote proxy in response to the data network application protocol data forwarded by the remote proxy;

[0056] The remote proxy is further configured to encapsulate the response data and transmit it back to the local proxy;

[0057] The local proxy is further configured to parse the encapsulated response data and forward it to the client;

[0058] The client is configured to close the connection between itself and the local proxy based on the received response data.

[0059] Compared with the prior art, this application has the following advantages:

[0060] An embodiment of the present application provides a KCP protocol reliable transmission proxy method based on the digital network, including: sending digital network application protocol data to a local proxy through a client of a terminal device; encapsulating the digital network application protocol data based on an application layer fast and reliable protocol through the local proxy to obtain a corresponding request data packet; forwarding the request data packet to a remote proxy of a target device based on a transport layer protocol through the local proxy; parsing the request data packet through the remote proxy to obtain the digital network application protocol data and the address data in the session message header; establishing a connection between the remote proxy and the target server of the target device based on the server address information and the server port number in the address data; in response to the digital network application protocol data forwarded by the remote proxy, the target server returns response data to the remote proxy; encapsulating the response data through the remote proxy and transmitting it back to the local proxy; parsing the encapsulated response data through the local proxy and forwarding it to the client; closing the connection between the client and the local proxy based on the response data received by the client. Therefore, this application uses a fast and reliable protocol at the application layer to re-encapsulate the request data of the Internet application protocol type (DOIP, DO-IRP protocol), forming a request data packet between the local agent of the terminal device on the user side and the remote agent of the target device on the service side based on the transport layer protocol to realize the transmission of the network data packet (that is, the request data packet). While realizing the service proxy for the DOIP protocol, it overcomes the defects of traditional transport layer protocols (such as UDP protocol) such as packet loss, disorder, and unreliability, and realizes efficient and reliable proxy transmission of data at the application layer.

[0061] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art.

[0063] Figure 1 A flowchart of a KCP protocol reliable transmission agent method based on the Internet of Things provided in an embodiment of the present application;

[0064] Figure 2 A flowchart of session creation and recovery in a KCP protocol reliable transmission proxy method based on a data network provided in an embodiment of the present application;

[0065] Figure 3 Another flow chart of session creation in a KCP protocol reliable transmission proxy method based on a data network provided in an embodiment of the present application;

[0066] Figure 4 A schematic diagram of a KCP protocol reliable transmission proxy method based on a data network provided in an embodiment of the present application;

[0067] Figure 5 A schematic diagram of a KCP protocol reliable transmission proxy system based on the Internet of Things provided in an embodiment of the present application. DETAILED DESCRIPTION

[0068] Exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings.

[0069] For ease of understanding, the following related professional terms are explained:

[0070] Internet of Data (IoD): The IoD is a virtual data network based on the Internet. Through open software architecture and standardized protocols, it efficiently connects various data platforms and systems, supports the interconnection, interoperability and multi-domain data of heterogeneous structures and masters, and forms a data space with "data interconnection, on-demand scheduling, intra-domain autonomy and inter-domain collaboration".

[0071] Digital Object (DO): A data structure that abstractly describes data resources. It organizes and records data in a computer system according to basic elements such as identification, metadata, and data entities.

[0072] Digital Object Architecture (DOA): a data-centric open software architecture.

[0073] KCP (KCP - A Fast and Reliable ARQ Protocol): an open source application layer fast and reliable protocol.

[0074] A network proxy, also known as a proxy server, is an intermediary server that sits between a client and a target server. It receives requests from clients, communicates with the target server on their behalf, and returns the target server's response to the client.

[0075] Figure 1 A flowchart of a KCP protocol reliable transmission agent method based on a data network is provided in an embodiment of the present application, such as Figure 1 As shown, the method includes:

[0076] Step S1: Sending Internet application protocol data to a local proxy via a client of a terminal device.

[0077] In this embodiment, the digital network to which the KCP protocol reliable transmission agent method based on the digital network provided by this application is applied is a digital network built based on the digital object architecture. The digital network built based on the digital object architecture is composed of: a basic model, two basic protocols, and three core systems. The basic model is used to define the three elements of the data object; the core system is used to manage digital objects; the two basic protocols include the Digital Object Interface Protocol (DOIP) and the Digital Object Identifier / Resolution Protocol (DO-IRP), which are used to access, parse, search, and use digital objects. For the convenience of description, the digital networks mentioned later are all digital networks built based on the digital object architecture.

[0078] In this embodiment, when initiating a request in a digital network, the client of a terminal device first sends digital network application protocol data to the local proxy of the terminal device. The sent digital network application protocol data is request data sent using the digital network application protocol, which is the Digital Object Interface Protocol (DOIP) and the Digital Object Identifier / Resolution Protocol (DO-IRP).

[0079] Step S2: Encapsulating the data network application protocol data based on the application layer fast and reliable protocol through the local proxy to obtain a corresponding request data packet.

[0080] In this embodiment, after the local proxy receives the digital networking application protocol data sent by the client of the terminal device, the received digital networking application protocol data is re-encapsulated through the application layer fast and reliable protocol to obtain the re-encapsulated request data packet. The application layer fast and reliable protocol is preferably the KCP protocol, and it can also be other types of application layer fast and reliable protocols. The digital networking application protocol data will add a session message header when encapsulating, and the session message header includes at least server address information, server port number, local address information and local transport layer protocol port number. The server address information and server port number will be used by the remote proxy to establish a connection with the target server pointed to by the digital networking application protocol data. The target server refers to the server that returns the requested data in response to the request corresponding to the digital networking application protocol data; and the local address information and local transport layer protocol port number are used to determine the local proxy of the terminal device to which the response data points when the remote proxy returns the response data.

[0081] Step S3: forwarding the request data packet to the remote agent of the target device through the local agent based on the transport layer protocol.

[0082] In this embodiment, after the local proxy re-encapsulates the network application protocol data based on the application layer fast and reliable protocol to obtain the corresponding request data packet, it forwards the request data packet to the remote proxy of the target device based on the transport layer protocol. The transport layer protocol is preferably the UDP protocol, but it should be understood that the transport layer protocol can also be other types of transport layer protocols.

[0083] Step S4: parsing the request data packet through the remote proxy to obtain the data network application protocol data and the address data in the session message header.

[0084] In this embodiment, after receiving the request data packet, the remote proxy unpacks the request data packet to obtain the network application protocol data and session message header therein, and further parses the session message header to obtain the address data recorded therein.

[0085] Step S5: The remote proxy establishes a connection with the target server of the target device according to the server address information and the server port number in the address data.

[0086] In this embodiment, based on the server address information and server port number in the address data obtained by parsing the session header message in the request data packet, the remote proxy establishes a connection with the target server pointed to by the server address information and server port number, and forwards the digital network application protocol data obtained by unpacking the request data packet to the target server.

[0087] Step S6: In response to the Internet application protocol data forwarded by the remote proxy, the target server returns response data to the remote proxy.

[0088] In this embodiment, after the target server receives the data of the Internet application protocol forwarded by the remote agent, the target server determines the content requested by the data of the Internet application protocol data in response to the data of the Internet application protocol data, and returns the requested content as response data to the remote agent.

[0089] Step S7: The remote proxy encapsulates the response data and transmits it back to the local proxy.

[0090] In this embodiment, after the remote proxy receives the response data returned by the target server, it encapsulates the response data and transmits it back to the local proxy of the terminal device.

[0091] Step S8: The encapsulated response data is parsed by the local proxy and forwarded to the client.

[0092] In this embodiment, after receiving the encapsulated response data returned by the remote agent, the local agent of the terminal device parses the encapsulated response data to obtain the parsed response data, and forwards the parsed response data to the client of the terminal device that originally sent the digital network application protocol data.

[0093] Step S9: based on the response data received by the client, close the connection between the client and the local proxy.

[0094] In this embodiment, after receiving the parsed response data, the client closes the connection between itself and the local proxy.

[0095] An embodiment of the present application provides a KCP protocol reliable transmission proxy method based on the digital network, including: sending digital network application protocol data to a local proxy through a client of a terminal device; encapsulating the digital network application protocol data based on an application layer fast and reliable protocol through the local proxy to obtain a corresponding request data packet; forwarding the request data packet to a remote proxy of a target device based on a transport layer protocol through the local proxy; parsing the request data packet through the remote proxy to obtain the digital network application protocol data and the address data in the session message header; establishing a connection between the remote proxy and the target server of the target device based on the server address information and the server port number in the address data; in response to the digital network application protocol data forwarded by the remote proxy, the target server returns response data to the remote proxy; encapsulating the response data through the remote proxy and transmitting it back to the local proxy; parsing the encapsulated response data through the local proxy and forwarding it to the client; closing the connection between the client and the local proxy based on the response data received by the client. Therefore, this application uses a fast and reliable protocol at the application layer to re-encapsulate the request data of the Internet application protocol type, forming a request data packet between the local agent of the terminal device on the user side and the remote agent of the target device on the service side, and realizes the transmission of network data packets (that is, the request data packets) based on the transport layer protocol. While realizing the service proxy for the DOIP protocol, it overcomes the defects of traditional transport layer protocols (such as UDP protocol) such as packet loss, disorder, and unreliability, and realizes efficient and reliable proxy transmission of data at the application layer.

[0096] In combination with the above embodiments, in one embodiment, the present application embodiment further provides a KCP protocol reliable transmission agent method based on the data network. In the KCP protocol reliable transmission agent method based on the data network, step S7 may include:

[0097] Step S71: The remote proxy encapsulates the response data based on the application layer fast and reliable protocol to obtain a response data packet.

[0098] In this embodiment, after the remote proxy receives the response data returned by the target server, it re-encapsulates the response data through the application layer fast and reliable protocol to obtain a corresponding response data packet.

[0099] Step S72: Based on the local address information and the local transport layer protocol port number in the address data, the response data packet is transmitted back to the local proxy via the transport layer protocol.

[0100] In this embodiment, based on the local address information and local transport layer protocol port number obtained from the address data previously parsed in the session message header of the request packet corresponding to the response packet, a local proxy corresponding to the local address information and local transport layer protocol port number is determined, and the response packet is transmitted back to the local proxy via the transport layer protocol. If the transport layer protocol is UDP, the local transport layer protocol port number is the UDP port of the local proxy, and the local address information is the service address information of the local proxy.

[0101] In conjunction with the above embodiments, in one embodiment, the present application also provides a KCP protocol reliable transmission proxy method based on the Internet of Things. In this KCP protocol reliable transmission proxy method based on the Internet of Things, before step S2, the method further includes step S02: based on the received Internet of Things application protocol data, the local proxy creates a corresponding first session and stores it in the local session pool for session management.

[0102] In this embodiment, in order to facilitate the management of the request and response process in the entire proxy process, the present application creates a session (ie, session) in both the local proxy and the remote proxy during the process of initiating and responding to requests.

[0103] Specifically: Figure 2 As shown, after the local proxy receives the digital networking application protocol data sent by the client of the terminal device, before re-encapsulating the digital networking application protocol data, the local proxy creates a first session session corresponding to the digital networking application protocol data based on the received digital networking application protocol data, and assigns a unique session identifier sessionID to the first session, stores the first session in a local session pool of a map structure, and registers session management events for the first session so that the first session can be used and managed in subsequent processes.

[0104] In the present application, when the method further includes step S02, step S2 may include: encapsulating the network application protocol data and the session identifier of the first session based on the application layer fast and reliable protocol through the local agent to obtain a corresponding request data packet.

[0105] In this embodiment, when the method also includes step S02, step S2 encapsulates the digital networking application protocol data together with the session identifier of the corresponding first session created for the digital networking application protocol data through the local agent based on the application layer fast and reliable protocol, and obtains the corresponding request data packet. The session identifier of the first session encapsulated in the request data packet is used by the remote agent to create a second session with the same session identifier based on the session identifier.

[0106] In the present application, when the method also includes step S02, step S4 may include: parsing the request data packet through the remote agent to obtain the digital network application protocol data, the address data in the session message header and the session identifier of the first session; based on the session identifier of the first session, creating a corresponding second session through the remote agent and storing it in the remote session pool for session management.

[0107] In this embodiment, after receiving the request data packet, the remote proxy unpacks the request data packet to obtain the network application protocol data, the session message header and the session identifier of the first session, and further parses the session message header to obtain the address data recorded therein. Figure 2 As shown, the remote proxy will create a second session corresponding to the session identifier of the first session based on the obtained session identifier of the first session, store the created second session in the remote session pool, and register the session management event for the second session so that the second session can be used and managed in subsequent processes.

[0108] In the present application, when the method further includes step S02, step S9 may include: closing the connection between the client and the local proxy based on the response data received by the client, and reclaiming the first session and the second session.

[0109] In this embodiment, when the method also includes step S02, the implementation method of step S9 is: after the client receives the parsed response data, it closes the connection between itself and the local proxy, and at the same time the local proxy reclaims the first session in the local session pool and the remote proxy reclaims the second session in the remote session pool to end the request and response process.

[0110] In combination with the above embodiments, in one embodiment, the embodiment of the present application also provides a KCP protocol reliable transmission agent method based on the digital network. In the KCP protocol reliable transmission agent method based on the digital network, according to the session identifier of the first session, a corresponding second session is created through the remote agent and stored in the remote session pool for session management, including: according to the session identifier of the first session, querying through the remote agent whether the session identifier of the first session exists in the remote session pool; if it does not exist, creating a second session with the same session identifier as the first session and storing it in the remote session pool; registering the second session to the session management event through the remote agent for abnormal request processing; if it exists, ending the creation of the second session corresponding to the request data packet.

[0111] In this embodiment, the remote proxy, based on the session identifier of the first session obtained by parsing the request data packet, queries the remote session pool to see if the session identifier of the first session exists. If not, the remote proxy creates a second session whose session identifier is the same as the session identifier of the first session, stores the second session in the remote session pool, and registers the second session with the session management event for abnormal request processing, such as monitoring whether the session has timed out. If the second session exists, it indicates that the request data packet currently being parsed by the remote proxy is a subpacket of a complete request data packet, and a subpacket of the complete request data packet has previously been sent to the remote proxy. Therefore, it can be determined that the remote proxy has previously created a corresponding second session based on other subpackets of the complete request data packet. At this point, the creation of the corresponding second session for the currently parsed request data packet ends. That is, when a complete request data packet is subpacketed and sent to the remote proxy, the remote proxy will only create a second session corresponding to the complete request data packet based on the first subpacket of the complete request data packet.

[0112] In combination with the above embodiments, in one embodiment, the embodiment of the present application also provides a KCP protocol reliable transmission agent method based on the digital network. In the KCP protocol reliable transmission agent method based on the digital network, based on the response data received by the client, the connection between the client and the local agent is closed, and the first session and the second session are recovered, including: based on the response data received by the client, the connection between itself and the local agent is closed by the client; based on the closed state of the connection, the first session is released by the local agent, and the first session is removed from the local session pool; a connection closing data packet is sent to the remote agent by the local agent; based on the received connection closing data packet, the second session is released by the remote agent, and the second session is removed from the remote session pool.

[0113] In this embodiment, after the client receives the corresponding response data based on the data network application protocol data sent by itself, the client will close the connection between itself and the local proxy. Based on the closed state of the connection between itself and the client, the local proxy will release the first session corresponding to the data network application protocol data and remove the first session from the local proxy's local session pool. At the same time, the local proxy will send a connection close data packet to the remote proxy for the currently released first session. The remote proxy receives and parses the connection close data packet to determine the specific session that the local proxy wants to release. Based on the determined specific session, the remote proxy will release the specific session in the remote session pool and remove the specific session from the remote session pool. The specific session is a second session in the remote session pool with the same session identifier as the first session currently released by the local proxy. After the local proxy and the remote proxy have completed the release and removal of the first and second sessions corresponding to the data network application protocol data initiated by the client in their own session pools, the request and response process corresponding to the data network application protocol data is completely completed.

[0114] In conjunction with the above embodiments, in one embodiment, the present application also provides a KCP protocol reliable transmission proxy method based on the data network. In the KCP protocol reliable transmission proxy method based on the data network, the method further includes: monitoring the request process through session management events to obtain corresponding monitoring results; if the monitoring result is a request timeout or a response timeout, releasing and removing the corresponding session.

[0115] In this embodiment, if Figure 2 As shown, the local proxy and the remote proxy both create sessions and register session management events for the same request and response process. During the entire process, the local proxy and the remote proxy will monitor the request and response process based on their own registered session management events to obtain corresponding monitoring results. In the case where the monitoring result is a request timeout or a response timeout, the corresponding session in the corresponding session pool is released and removed, thereby ending the abnormal timeout request and timeout response. During the request process of a request session, if the client accesses the session, the session time is updated to prevent the request session from being identified as timeout and ended by the session management event while the client is still accessing the session.

[0116] In combination with the above embodiments, in one embodiment, the embodiment of the present application also provides a KCP protocol reliable transmission agent method based on the digital network. In the KCP protocol reliable transmission agent method based on the digital network, before step S1, the method also includes: configuring the service address, the first request data port and the first network data port of the local agent of the terminal device, the first request data port is used to receive the digital network application protocol data sent by the client, and the first network data port is used to receive the encapsulated response data returned by the remote agent; configuring the service address, the second request data port and the second network data port of the remote agent of the target device, the second request data port is used to receive the digital network application protocol data sent by the server of the target device when it acts as the requesting end, and the second network data port is used to receive the request data packet sent by the local agent.

[0117] In this embodiment, certain preparations are performed before performing the transmission proxy, including configuring the local proxy of the terminal device and configuring the remote proxy of the target device.

[0118] Specifically: the service address, first request data port and first network data port of the local agent of the terminal device are configured. The first request data port is a DOIP / DO-IRP port. When the transport layer protocol is UDP, the first network data port is a UDP port. The first request data port is used to receive the Internet application protocol data sent by each client of the terminal device. The first network data port is used to receive the encapsulated response data sent back by the remote agent. At the same time, the service address, second request data port and second network data port of the remote agent of the target device are configured. The second request data port is a DOIP / DO-IRP port. When the transport layer protocol is UDP, the second network data port is a UDP port. The second network data port is used to receive the request data packet sent by the local agent. The target device's server acts as a server when providing services to other devices. It can also proactively initiate requests to other devices, in which case it acts as a client. The second request data port is used to receive Internet application protocol data (i.e., request data) sent by the target device's server when it acts as a requester (i.e., when it acts as a client initiating a request). The remote proxy waits for response data on the connection that forwards Internet application protocol data to the target server, similar to how the client on a terminal device receives response data returned by the local proxy.

[0119] In combination with the above embodiments, in one embodiment, the embodiment of the present application further provides a KCP protocol reliable transmission agent method based on the digital network. In the KCP protocol reliable transmission agent method based on the digital network, the local agent creates a corresponding first session based on the received digital network application protocol data, including: generating a session identifier of the first session based on the timestamp of the received digital network application protocol data; based on the session identifier of the first session, the local agent creates a corresponding first session.

[0120] In this embodiment, to ensure the uniqueness of the generated session identifier, after receiving the digital network application protocol data, the local agent generates a session identifier for the first session based on the timestamp of the digital network application protocol data, and then creates a first session based on the generated session identifier for the first session.

[0121] In combination with the above embodiments, in one embodiment, the embodiment of the present application also provides a KCP protocol reliable transmission agent method based on the digital network. In the KCP protocol reliable transmission agent method based on the digital network, a session identifier of the first session is generated according to the timestamp of the received digital network application protocol data, including: generating a session identifier of the session according to the timestamp of the received digital network application protocol data; determining whether the session identifier exists in the local session pool; if it does not exist, determining the generated session identifier as the session identifier of the first session corresponding to the digital network application protocol data, and creating the first session; if it exists, regenerating a new session identifier of the session until the generated new session identifier does not exist in the local session pool; determining the generated new session identifier that does not exist in the corresponding session pool as the session identifier of the first session corresponding to the digital network application protocol data, and creating the first session.

[0122] In this embodiment, if Figure 3As shown, to further ensure the uniqueness of the generated session identifier, after receiving the data network application protocol data, the local agent generates a session identifier for the session based on the timestamp of the data network application protocol data. It then determines whether the session identifier exists in the local session pool. If the session identifier does not exist in the local session pool, the session identifier is determined as the session identifier of the first session corresponding to the received data network application protocol data, and the first session is created. If the session identifier exists in the local session pool, it indicates that the session identifier has been previously generated based on other data network application protocol data. To ensure that each data network application protocol data in the local session pool has a unique session identifier, a new session identifier is randomly generated for the data network application protocol data. It then determines whether the new session identifier exists in the local session pool. If the new session identifier still exists in the local session pool, new session identifiers are continuously randomly generated for the data network application protocol data until the randomly generated new session identifier no longer exists in the local session pool. At this point, the last new session identifier is determined as the session identifier of the first session corresponding to the received data network application protocol data, and the first session is created.

[0123] In this embodiment, if Figure 4 As shown, Figure 4 A schematic diagram of a KCP protocol reliable transmission proxy method based on the digital network provided in an embodiment of the present application. The present application provides a KCP protocol reliable transmission proxy method based on the digital network. First, a local proxy is deployed on the terminal device side that makes a data request and a remote proxy is deployed on the target device side that responds to the data request. Each client of the terminal device transmits data with the local proxy based on the digital network application protocol, and the local proxy transmits data with the remote proxy of the target device through the application layer fast and reliable protocol and the transport layer protocol. The remote proxy transmits data with each server based on the digital network application protocol, thereby realizing a transmission proxy for digital network data under the digital object architecture.

[0124] Based on the same inventive concept, this application provides a KCP protocol reliable transmission agent system based on the Internet of Things, such as Figure 5 As shown, the system 500 includes: a terminal device 501 that initiates a request and a target device 502 that responds to the request, the terminal device 501 includes a local proxy 5011 and a client 5012 that initiates the request, and the target device 502 includes a remote proxy 5021 and a server 5022 that responds to the request;

[0125] The client 5012 is used to send Internet application protocol data to the local proxy through the client of the terminal device;

[0126] The local agent 5011 is used to encapsulate the data network application protocol data based on the application layer fast and reliable protocol to obtain the corresponding request data packet, and is used to forward the request data packet to the remote agent of the target device based on the transport layer protocol;

[0127] The remote proxy 5021 is used to parse the request data packet, obtain the address data in the data network application protocol data and the session message header, and establish a connection with the target server of the target device based on the server address information and server port number in the address data;

[0128] The target server is configured to return response data to the remote proxy in response to the data network application protocol data forwarded by the remote proxy;

[0129] The remote proxy 5021 is further configured to encapsulate the response data and transmit it back to the local proxy;

[0130] The local proxy 5011 is further configured to parse the encapsulated response data and forward it to the client;

[0131] The client 5012 is configured to close the connection between itself and the local proxy based on the received response data.

[0132] Optionally, the remote agent 5021 is used to encapsulate the response data based on the application layer fast and reliable protocol to obtain a response data packet; and is used to return the response data packet to the local agent through the transport layer protocol based on the local address information and local transport layer protocol port number in the address data.

[0133] Optionally, the system 500 further includes:

[0134] The local proxy 5011 is configured to create a corresponding first session based on the received data network application protocol data and store it in a local session pool for session management; and to encapsulate the data network application protocol data and the session identifier of the first session based on an application layer fast and reliable protocol to obtain a corresponding request data packet;

[0135] The remote proxy 5021 is configured to parse the request data packet to obtain the data network application protocol data, the address data in the session message header, and the session identifier of the first session; and to create a corresponding second session based on the session identifier of the first session and store it in the remote session pool for session management;

[0136] The client 5012 is configured to close the connection between the client and the local proxy based on the received response data, and reclaim the first session and the second session.

[0137] The remote proxy 5021 is used to query whether the session identifier of the first session exists in the remote session pool based on the session identifier of the first session; and, if the session identifier does not exist, to create a second session with the same session identifier as the first session and store it in the remote session pool; and, to register the second session with the session management event for abnormal request processing; and, if the session identifier exists, to terminate the creation of the second session corresponding to the request data packet.

[0138] The client 5012 is configured to close the connection between itself and the local proxy based on the received response data;

[0139] The local proxy 5011 is configured to release the first session and remove the first session from the local session pool based on the closed state of the connection; and to send a connection close data packet to the remote proxy;

[0140] The remote proxy 5021 is configured to release the second session and remove the second session from the remote session pool based on the received connection close data packet.

[0141] Optionally, the local agent 5011 and the remote agent 5021 include:

[0142] The event monitoring module is used to monitor the request process through session management events and obtain corresponding monitoring results; and to release and remove the corresponding session when the monitoring result is request timeout or response timeout.

[0143] Optionally, the system 500 further includes:

[0144] a first configuration module, configured to configure a service address, a first request data port, and a first network data port of a local proxy of a terminal device, wherein the first request data port is used to receive Internet application protocol data sent by the client, and the first network data port is used to receive encapsulated response data transmitted back by the remote proxy;

[0145] The second configuration module is used to configure the service address, second request data port and second network data port of the remote agent of the target device. The second request data port is used to receive the network application protocol data sent by the server of the target device when it acts as the requesting end. The second network data port is used to receive the request data packet sent by the local agent.

[0146] Optionally, the local agent 5011 is used to generate a session identifier of the first session according to the timestamp of the received Internet application protocol data; and to create a corresponding first session based on the session identifier of the first session.

[0147] Optionally, the local agent 5011 is used to generate a session identifier for the session based on the timestamp of the received digital network application protocol data; and to determine whether the session identifier exists in the local session pool; and, if it does not exist, to determine the generated session identifier as the session identifier of the first session corresponding to the digital network application protocol data, and to create the first session; and, if it exists, to regenerate a new session identifier for the session until the generated new session identifier does not exist in the local session pool; and, to determine the generated new session identifier that does not exist in the corresponding session pool as the session identifier of the first session corresponding to the digital network application protocol data, and to create the first session.

[0148] As for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0149] It should be noted that for the method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited by the order of the actions described, because according to the embodiments of the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.

[0150] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0151] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the embodiments of the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the embodiments of the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0152] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0153] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0154] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0155] Although preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they become aware of the basic inventive concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0156] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or terminal device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or terminal device that includes the element.

[0157] The above is a detailed introduction to a data network node management method and system provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, based on the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A KCP protocol reliable transmission agent method based on the data network, characterized in that: The method comprises: Sending Internet application protocol data to the local proxy through the client of the terminal device; According to the received data network application protocol data, the local agent creates a corresponding first session and stores it in a local session pool for session management; Encapsulating the data network application protocol data and the session identifier of the first session through the local proxy based on the application layer fast and reliable protocol to obtain a corresponding request data packet; Forwarding the request data packet to a remote agent of the target device through the local agent based on the transport layer protocol; Parsing the request data packet through the remote proxy to obtain the data network application protocol data, the address data in the session message header, and the session identifier of the first session; According to the session identifier of the first session, a corresponding second session is created by the remote proxy and stored in a remote session pool for session management; The remote proxy establishes a connection with the target server of the target device according to the server address information and the server port number in the address data; In response to the data network application protocol data forwarded by the remote proxy, the target server returns response data to the remote proxy; Encapsulating the response data through the remote proxy and transmitting it back to the local proxy; Parsing the encapsulated response data through the local proxy and forwarding it to the client; Based on the response data received by the client, the connection between the client and the local proxy is closed, and the first session and the second session are reclaimed.

2. A KCP protocol reliable transmission agent method based on the data network according to claim 1, characterized in that: Encapsulating the response data through the remote proxy and returning it to the local proxy includes: Encapsulating the response data based on the application layer fast and reliable protocol through the remote proxy to obtain a response data packet; According to the local address information and the local transport layer protocol port number in the address data, the response data packet is returned to the local proxy via the transport layer protocol.

3. A KCP protocol reliable transmission agent method based on the data network according to claim 2, characterized in that: Creating, according to the session identifier of the first session, a corresponding second session by the remote proxy and storing the session in a remote session pool for session management, including: querying, through a remote proxy, whether the session identifier of the first session exists in a remote session pool according to the session identifier of the first session; If the session identifier of the first session does not exist, creating a second session with the same session identifier as the first session and storing it in the remote session pool; registering the second session to a session management event through the remote proxy to process an abnormal request; If the second session exists, the creation of the second session corresponding to the request data packet is terminated.

4. A KCP protocol reliable transmission agent method based on the data network according to claim 2, characterized in that: Closing the connection between the client and the local proxy based on the response data received by the client, and reclaiming the first session and the second session, including: Based on the response data received by the client, closing the connection between the client and the local proxy; Based on the closed state of the connection, releasing the first session through the local proxy and removing the first session from the local session pool; Sending a connection close data packet to the remote agent through the local agent; Based on the received connection close data packet, the second session is released through the remote proxy, and the second session is removed from the remote session pool.

5. A KCP protocol reliable transmission agent method based on digital network according to claim 3, characterized in that: The method further comprises: Monitor the request process through session management events and obtain corresponding monitoring results; If the monitoring result is a request timeout or a response timeout, the corresponding session is released and removed.

6. A KCP protocol reliable transmission agent method based on the data network according to claim 1, characterized in that: Before sending the Internet application protocol data to the local proxy through the client of the terminal device, the method further includes: Configuring a service address, a first request data port, and a first network data port of a local proxy of a terminal device, wherein the first request data port is used to receive Internet application protocol data sent by the client, and the first network data port is used to receive encapsulated response data returned by the remote proxy; The service address, second request data port and second network data port of the remote agent of the target device are configured. The second request data port is used to receive the network application protocol data sent by the server of the target device when it acts as the requesting end, and the second network data port is used to receive the request data packet sent by the local agent.

7. A KCP protocol reliable transmission agent method based on the data network according to claim 1, characterized in that: The local agent creates a corresponding first session according to the received data network application protocol data, including: generating a session identifier for the first session according to the timestamp of the received data network application protocol data; Based on the session identifier of the first session, the local agent creates a corresponding first session.

8. A KCP protocol reliable transmission agent method based on digital network according to claim 7, characterized in that: Generating a session identifier of the first session according to the timestamp of the received data network application protocol data includes: generating a session identifier for the session according to the timestamp of the received data network application protocol data; Determine whether the session identifier exists in the local session pool; If the session identifier does not exist, determining the generated session identifier as the session identifier of the first session corresponding to the data network application protocol data, and creating the first session; If it exists, regenerate a new session identifier for the session until the generated new session identifier does not exist in the local session pool; The generated new session identifier that does not exist in the corresponding session pool is determined as the session identifier of the first session corresponding to the network application protocol data, and the first session is created.

9. A KCP protocol reliable transmission agent system based on the Internet of Things, characterized in that: The system includes: a terminal device that initiates a request and a target device that responds to the request, the terminal device includes a local agent and a client that initiates the request, and the target device includes a remote agent and a server that responds to the request; The client is used to send Internet application protocol data to the local proxy through the client of the terminal device; The local proxy is configured to create a corresponding first session based on the received data network application protocol data and store it in a local session pool for session management, and to encapsulate the data network application protocol data and the session identifier of the first session based on an application layer fast and reliable protocol to obtain a corresponding request data packet, and to forward the request data packet to a remote proxy of a target device based on a transport layer protocol; The remote proxy is configured to parse the request data packet to obtain the data network application protocol data, the address data in the session message header, and the session identifier of the first session; and to create a corresponding second session based on the session identifier of the first session and store it in the remote session pool for session management; and to establish a connection with the target server of the target device based on the server address information and server port number in the address data; The target server is configured to return response data to the remote proxy in response to the data network application protocol data forwarded by the remote proxy; The remote proxy is further configured to encapsulate the response data and transmit it back to the local proxy; The local proxy is further configured to parse the encapsulated response data and forward it to the client; The client is configured to close the connection between the client and the local proxy based on the received response data, and reclaim the first session and the second session.