KCP reliable transmission proxy method and system based on digital networking

By introducing the KCP protocol into the Digital Networking system, using local proxy and remote proxy for data encapsulation and parsing, the unreliable transmission problem of the Digital Networking application protocol is solved, and efficient and reliable data proxy transmission is achieved.

CN120281832AActive Publication Date: 2025-07-08BEIJING BIG DATA ADVANCED TECH RES INST

Patent Information

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

AI Technical Summary

Technical Problem

The existing network proxy system fails to effectively support the proxy functions of the digital network application protocol DOIP and DO-IRP, resulting in unreliable and inefficient data transmission.

Method used

The KCP protocol is used as the application layer fast and reliable protocol, and data encapsulation and parsing are carried out through local agents and remote agents, target server connections are established, and data transmission is realized under the transport layer protocol, overcoming the shortcomings of the traditional transport layer protocol.

Benefits of technology

It realizes efficient and reliable transmission of data of digital network application protocols, solves the packet loss and unreliability problems of traditional transport layer protocols, and improves the efficiency and reliability of data proxy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120281832A_ABST
    Figure CN120281832A_ABST
Patent Text Reader

Abstract

The invention provides a KCP reliable transmission proxy method and system based on the Internet of Things, and relates to the technical field of Internet of Things communication, and the method comprises the steps: transmitting Internet of Things application protocol data to a local proxy through a client; packaging the received data networking application protocol data based on an application layer rapid and reliable protocol; forwarding the packaged request data packet to a remote agent of the target device based on a transport layer protocol; analyzing the request data packet to obtain data networking application protocol data and address data in a session message header; establishing connection with a target server according to server address information and a server port number in the address data; in response to the forwarded data networking application protocol data, the target server returns response data to the remote agent; the response data are packaged and transmitted back to the local agent to be analyzed, and the response data are forwarded to the client; and closing the connection between the client and the local agent based on the received response data. The invention aims to carry out efficient and reliable data networking data proxy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of Internet of Data communication, and in particular, to a reliable transmission proxy method and system for the KCP protocol based on the Internet of Data. Background Art

[0002] The Internet of Data (IoD) is a virtual data network based on the Internet. Through an open software architecture and standardized protocols, it efficiently connects various data platforms and systems. The Internet of Data constructed based on the digital object architecture abstracts data resources as digital objects according to basic elements such as identifiers, metadata, and data entities, making data an entity independent of machines and no longer relying on specific business systems and business scenarios. It provides services for different business scenarios in an independent form, solving problems such as data assetization, data circulation, transaction, and privacy protection.

[0003] However, most existing network proxies are implemented based on Nginx. Except for the HTTP and HTTPS proxies supported by native Nginx, and the proxy functions of other protocols implemented by integrating third-party modules or plugins into Nginx, for the Internet of Data application protocols, 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). Summary of the Invention

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

[0005] In the first aspect of this application, this application provides a reliable transmission proxy method for the KCP protocol based on the Internet of Data. The method includes: Sending Internet of Data application protocol data to a local proxy through a client of a terminal device; Encapsulating the Internet of Data application protocol data based on the application layer fast reliable protocol by 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 by the local proxy; Parsing the request data packet by the remote proxy to obtain the Internet of Data application protocol data and address data in a session message header; Establishing a connection between the remote proxy and a target server of the target device according to the server address information and server port number in the address data; In response to the data networking application protocol data forwarded by the remote proxy, the target server returns response data to the remote proxy; The remote proxy encapsulates the response data and sends it back to the local proxy; The local proxy parses the encapsulated response data and forwards it to the client; Based on the response data received by the client, the connection between the client and the local proxy is closed.

[0006] Optionally, encapsulating the response data by the remote proxy and sending it back to the local proxy includes: The remote proxy encapsulates the response data based on the Application Layer Fast and Reliable Protocol 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 sent back to the local proxy through the transport layer protocol.

[0007] Optionally, before the local proxy encapsulates the data networking application protocol data based on the Application Layer Fast and Reliable Protocol to obtain a corresponding request data packet, the method further includes: According to the received data networking application protocol data, the local proxy creates a corresponding first session and stores it in the local session pool for session management; Encapsulating the data networking application protocol data by the local proxy based on the Application Layer Fast and Reliable Protocol to obtain a corresponding request data packet includes: The local proxy encapsulates the data networking application protocol data and the session identifier of the first session based on the Application Layer Fast and Reliable Protocol to obtain a corresponding request data packet; Parsing the request data packet by the remote proxy to obtain the data networking application protocol data and the address data in the session message header includes: The remote proxy parses the request data packet to obtain the data networking 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, the remote proxy creates a corresponding second session and stores it in the remote session pool for session management; Closing the connection between the client and the local proxy based on the response data received by the client includes: 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 recycled.

[0008] Optionally, according to the session identifier of the first session, a corresponding second session is created by the remote proxy and stored in the remote session pool for session management, including: According to the session identifier of the first session, query whether the session identifier of the first session exists in the remote session pool through the remote proxy; In the case of non-existence, create a second session with the same session identifier as the first session and store it in the remote session pool; Register the second session to the session management event through the remote proxy for abnormal request handling; In the case of existence, end the creation of the second session corresponding to the request data packet.

[0009] Optionally, based on the response data received by the client, close the connection between the client and the local proxy, and recycle the first session and the second session, including: Based on the response data received by the client, close the connection between itself and the local proxy through the client; Based on the closed state of the connection, release the first session through the local proxy and remove the first session from the local session pool; Send a connection close data packet to the remote proxy through the local proxy; Based on the received connection close data packet, release the second session through the remote proxy and remove the second session from the remote session pool.

[0010] Optionally, the method further includes: Monitor the request process through the session management event to obtain the corresponding monitoring result; In the case where the monitoring result is request timeout or response timeout, release and remove the corresponding session.

[0011] Optionally, before sending the digital networking application protocol data from the client of the terminal device to the local proxy, the method further includes: Configure the service address, the first request data port, and the first network data port of the local proxy of the terminal device. The first request data port is used to receive the digital networking 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 proxy; Configure the service address, the second request data port, and the second network data port of the remote proxy of the target device. The second request data port is used to receive the digital networking application protocol data sent by the server of the target device when it acts as a request end, and the second network data port is used to receive the request data packet sent by the local proxy.

[0012] 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; Based on the session identifier of the first session, the local agent creates a corresponding first session.

[0013] Optionally, generating a session identifier of the first session according to the timestamp of the received data network application protocol data includes: Generate a session identifier of 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 networking application protocol data, and creating the first session; If it exists, regenerate a new session identifier of 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 digital networking application protocol data, and the first session is created.

[0014] In a second aspect of the present application, the present application provides a KCP protocol reliable transmission proxy system based on a data network, the system comprising: a terminal device initiating a request and a target device responding to the request, the terminal device comprising a local proxy and a client initiating the request, the target device comprising a remote proxy and a server responding to the request; The client is used to send the data network application protocol data to the local proxy through the client of the terminal device; The local proxy 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 proxy of the target device based on the transport layer protocol; The remote proxy 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 to establish 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; The target server is used to return response data to the remote proxy in response to the data networking application protocol data forwarded by the remote proxy; The remote proxy is also used 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 itself and the local proxy based on the received response data.

[0015] Compared with the prior art, the present application has the following advantages: A reliable transmission proxy method for the KCP protocol based on the digital networking provided by an embodiment of the present application includes: sending digital networking application protocol data from the client of the terminal device to the local proxy; encapsulating the digital networking application protocol data by the local proxy based on the application layer fast reliable protocol to obtain a corresponding request data packet; forwarding the request data packet to the remote proxy of the target device by the local proxy based on the transport layer protocol; parsing the request data packet by the remote proxy to obtain the digital networking 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 according to the server address information and the server port number in the address data; in response to the digital networking application protocol data forwarded by the remote proxy, the target server returns response data to the remote proxy; encapsulating and sending back the response data to the local proxy by the remote proxy; parsing and forwarding the encapsulated response data to the client by the local proxy; closing the connection between the client and the local proxy based on the response data received by the client. Thus, the present application re - encapsulates the request data of the digital networking application protocol type (DOIP, DO - IRP protocol) through the application layer fast reliable protocol, forms a request data packet, and realizes the transmission of the network data packet (i.e., the request data packet) between the local proxy of the terminal device on the user side and the remote proxy of the target device on the service side based on the transport layer protocol. While realizing the service proxy for the DOIP protocol, it overcomes the defects of packet loss, disorder, and unreliability of the traditional transport layer protocol (such as the UDP protocol), and realizes the efficient and reliable proxy transmission of data at the application layer.

[0016] The above description is only an overview of the technical solution of the present application. In order to be able to understand the technical means of the present application more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features, and advantages of the present application more obvious and understandable, the following specifically describes the embodiments of the present application. Description of the Drawings

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

[0018] Figure 1 It is a flowchart of a reliable transmission proxy method for the KCP protocol based on the digital networking provided by an embodiment of the present application; Figure 2It is a flowchart of session creation and recycling in a reliable transmission proxy method of the KCP protocol based on the Internet of Data provided by an embodiment of the present application; Figure 3 It is another flowchart of session creation in a reliable transmission proxy method of the KCP protocol based on the Internet of Data provided by an embodiment of the present application; Figure 4 It is a schematic diagram of a reliable transmission proxy method of the KCP protocol based on the Internet of Data provided by an embodiment of the present application; Figure 5 It is a schematic diagram of a reliable transmission proxy system of the KCP protocol based on the Internet of Data provided by an embodiment of the present application. Detailed implementation manners

[0019] Hereinafter, exemplary embodiments of the present application will be described in more detail with reference to the accompanying drawings.

[0020] For ease of understanding, relevant professional terms mentioned hereinafter are explained: Internet of Data (IoD for short): The Internet of Data is a virtual data network based on the Internet. Through an open software architecture and standardized protocols, it efficiently connects various data platforms and systems, supports the interconnection, interoperability, and mutual operation of heterogeneous, remote, and different-owner data, and forms a data space of "data interconnection, on-demand scheduling, intra-domain autonomy, and inter-domain collaboration".

[0021] Digital Object (DO for short): It is a data structure for abstractly describing data resources, which organizes and records the data in a computer system according to basic elements such as identifiers, metadata, and data entities.

[0022] Digital Object Architecture (DOA for short): An open software architecture centered on data.

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

[0024] Network proxy: Also known as a proxy server, it is an intermediate server located between the client and the target server. It can receive the client's request, then communicate with the target server on behalf of the client, and finally return the response of the target server to the client.

[0025] Figure 1 It is a flowchart of a reliable transmission proxy method of the KCP protocol based on the Internet of Data provided by an embodiment of the present application. As Figure 1 shown, the method includes: Step S1: Sending Internet application protocol data to a local proxy via a client of a terminal device.

[0026] In this embodiment, the KCP protocol reliable transmission agent method based on the digital network provided by this application is applied to a digital network built based on the digital object architecture. The composition of the digital network built based on the digital object architecture includes: 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 (Digital Object Interface Protocol, referred to as DOIP) and the Digital Object Identifier / Resolution protocol (Digital Object Identifier / Resolution protocol, referred to as 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.

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

[0028] 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.

[0029] In this embodiment, after the local proxy receives the data networking application protocol data sent by the client of the terminal device, it performs secondary encapsulation on the received data networking application protocol data through the application layer fast and reliable protocol to obtain a request data packet after secondary encapsulation. The application layer fast and reliable protocol is preferably the KCP protocol, and it can also be other types of fast and reliable protocols in the application layer. When encapsulating the data networking application protocol data, a session message header will be added, and the session message header will at least include the 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 data networking application protocol data. The target server refers to the server that returns the requested data in response to the request corresponding to the data networking application protocol data; while the local address information and local transport layer protocol port number are used by the remote proxy to determine the local proxy of the terminal device to which the response data points when returning the response data.

[0030] Step S3: Forward the request data packet to the remote proxy of the target device through the local proxy based on the transport layer protocol.

[0031] In this embodiment, after the local proxy performs secondary encapsulation on the data networking 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. It should be understood that the transport layer protocol can also be other types of transport layer protocols.

[0032] Step S4: Parse the request data packet through the remote proxy to obtain the data networking application protocol data and the address data in the session message header.

[0033] In this embodiment, after the remote proxy receives the request data packet, it performs unpacking processing on the request data packet to obtain the data networking application protocol data and the session message header therein, and further parses the session message header to obtain the recorded address data therein.

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

[0035] 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 data networking application protocol data obtained by unpacking the request data packet to the target server.

[0036] Step S6: In response to the Internet of Data Application Protocol data forwarded by the remote proxy, the target server returns response data to the remote proxy.

[0037] In this embodiment, after the target server receives the Internet of Data Application Protocol data forwarded by the remote proxy, in response to the Internet of Data Application Protocol data, the target server determines the content requested by the Internet of Data Application Protocol data, and returns the requested content as response data to the remote proxy.

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

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

[0040] Step S8: The local proxy parses the encapsulated response data and forwards it to the client.

[0041] In this embodiment, after the local proxy of the terminal device receives the encapsulated response data forwarded back by the remote proxy, it 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 initially sent the Internet of Data Application Protocol data.

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

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

[0044] A reliable transmission proxy method for the KCP protocol based on the digital networking provided by the embodiments of the present application includes: sending digital networking application protocol data to the local proxy through the client of the terminal device; encapsulating the digital networking application protocol data based on the application layer fast reliable protocol by the local proxy to obtain the corresponding request data packet; forwarding the request data packet to the remote proxy of the target device based on the transport layer protocol by the local proxy; parsing the request data packet by the remote proxy to obtain the digital networking 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 according to the server address information and the server port number in the address data; in response to the digital networking application protocol data forwarded by the remote proxy, the target server returns response data to the remote proxy; encapsulating the response data by the remote proxy and sending it back to the local proxy; parsing and forwarding the encapsulated response data to the client by the local proxy; closing the connection between the client and the local proxy based on the response data received by the client. Thus, the present application performs secondary encapsulation on the request data of the digital networking application protocol type through the application layer fast reliable protocol, forms a request data packet, and realizes the transmission of the network data packet (i.e., the request data packet) based on the transport layer protocol between the local proxy of the terminal device on the user side and the remote proxy of the target device on the service side. While realizing the service proxy for the DOIP protocol, it overcomes the defects of packet loss, disorder, and unreliability of the traditional transport layer protocol (such as the UDP protocol), and realizes the efficient and reliable proxy transmission of data at the application layer.

[0045] Combined with the above embodiments, in an implementation manner, the embodiments of the present application further provide a reliable transmission proxy method for the KCP protocol based on the digital networking. In this reliable transmission proxy method for the KCP protocol based on the digital networking, step S7 may include: Step S71: Encapsulating the response data based on the application layer fast reliable protocol by the remote proxy to obtain a response data packet.

[0046] In this embodiment, after the remote proxy receives the response data returned by the target server, it performs secondary encapsulation on the response data through the application layer fast reliable protocol to obtain the corresponding response data packet.

[0047] Step S72: Returning the response data packet to the local proxy through the transport layer protocol according to the local address information and the local transport layer protocol port number in the address data.

[0048] In this embodiment, based on the local address information and the local transport layer protocol port number in the address data obtained by parsing the session message header in the request data packet corresponding to the response data packet before, a local proxy corresponding to the local address information and the local transport layer protocol port number is determined, and the response data packet is sent back to the local proxy through the transport layer protocol. When the transport layer protocol is the UDP protocol, 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.

[0049] Combined with the above embodiments, in one implementation, the embodiments of the present application further provide a reliable transmission proxy method for the KCP protocol based on the digital networking. In this reliable transmission proxy method for the KCP protocol based on the digital networking, before step S2, the method further includes step S02: According to the received digital networking application protocol data, the local proxy creates a corresponding first session and stores it in the local session pool for session management.

[0050] In this embodiment, to facilitate the management of the request and response processes during the entire proxy process, the present application creates sessions (i.e., sessions) both in the local proxy and the remote proxy during the process of initiating a request and responding to a request.

[0051] Specifically: As Figure 2 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 corresponding to the digital networking application protocol data based on the received digital networking application protocol data, assigns a unique session identifier sessionID to the first session, stores the first session in the local session pool of the map structure, and registers a session management event for the first session for use and management in subsequent processes.

[0052] In the present application, when the method further includes step S02, step S2 may include: The local proxy encapsulates the digital networking application protocol data and the session identifier of the first session based on the application layer fast reliable protocol to obtain a corresponding request data packet.

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

[0054] In this application, when the method further includes step S02, step S4 may include: parsing the request data packet by the remote proxy to obtain the data networking 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, creating a corresponding second session through the remote proxy and storing it in the remote session pool for session management.

[0055] In this embodiment, after receiving the request data packet, the remote proxy unpacks the request data packet to obtain the data networking application protocol data, the session message header, and the session identifier of the first session therein, and further parses the session message header to obtain the recorded address data therein. As Figure 2 shown, the remote proxy will create a second session 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 a session management event for the second session for use and management of the second session in subsequent processes.

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

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

[0058] Combined with the above embodiments, in one implementation manner, the embodiments of this application further provide a reliable transmission proxy method for the KCP protocol based on the data networking. In this reliable transmission proxy method for the KCP protocol based on the data networking, according to the session identifier of the first session, creating a corresponding second session through the remote proxy and storing it in the remote session pool for session management includes: querying by the remote proxy whether the session identifier of the first session exists in the remote session pool according to the session identifier of the first session; if not, 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 by the remote proxy for abnormal request handling; if it exists, ending the creation of the second session corresponding to the request data packet.

[0059] In this embodiment, the remote proxy queries whether the session identifier of the first session obtained based on the parsed request data packet exists in the remote session pool. If it does not exist, the remote proxy creates a second session with the same session identifier as that 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 handling, such as monitoring whether the session times out. If it exists, it indicates that the request data packet currently parsed by the remote proxy is a sub-packet of a complete request data packet, and sub-packets of this complete request data packet have been sent to the remote proxy before. Therefore, it can be determined that the remote proxy has created a corresponding second session based on other sub-packets of this complete request data packet before. At this time, the creation of the corresponding second session for the currently parsed request data packet ends. That is, when a complete request data packet is sent to the remote proxy in sub-packets, the remote proxy only creates a second session corresponding to the complete request data packet based on the first sub-packet of the complete request data packet.

[0060] Combined with the above embodiments, in one implementation, the embodiment of the present application further provides a reliable transmission proxy method for the KCP protocol based on the data networking. In this reliable transmission proxy method for the KCP protocol based on the data networking, 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 recycled, including: based on the response data received by the client, the client closes its own connection with the local proxy; based on the closed state of the connection, the local proxy releases the first session and removes the first session from the local session pool; the local proxy sends a connection close data packet to the remote proxy; based on the received connection close data packet, the remote proxy releases the second session and removes the second session from the remote session pool.

[0061] In this embodiment, after the client receives the corresponding response data based on the data networking 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 networking application protocol data, remove the first session from the local session pool of the local proxy, and 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 that has the same session identifier as the first session currently released by the local proxy. After both the local proxy and the remote proxy have completed the release and removal of the first session and the second session corresponding to the data networking application protocol data initiated by the client from their respective session pools, the request and response process corresponding to the data networking application protocol data is completely ended.

[0062] Combined with the above embodiments, in one implementation, the embodiments of the present application further provide a reliable transmission proxy method for the KCP protocol based on the data network. In this reliable transmission proxy method for the KCP protocol based on the data network, the method further includes: monitoring the request process through session management events to obtain corresponding monitoring results; releasing and removing the corresponding sessions when the monitoring results are request timeout or response timeout.

[0063] In this embodiment, as Figure 2 shown, both the local proxy and the remote proxy have respectively created sessions and registered session management events for the same request and response process. Throughout the process, both the local proxy and the remote proxy will monitor the request and response process based on the session management events registered by themselves to obtain corresponding monitoring results. When the monitoring results are request timeout or response timeout, release and remove the corresponding sessions in the corresponding session pools to end the abnormal timeout requests and timeout responses in this way. During the request process of a request session, if the client accesses the session, update the time of the session to prevent the request session from being recognized as timed out and ended by the session management event during the process where the client is continuously accessing the session.

[0064] Combined with the above embodiments, in one implementation, the embodiments of the present application further provide a reliable transmission proxy method for the KCP protocol based on the digital networking. In this reliable transmission proxy method for the KCP protocol based on the digital networking, before step S1, the method further includes: configuring the service address, the first request data port, and the first network data port of the local proxy of the terminal device, where the first request data port is used to receive the digital networking 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 proxy; configuring the service address, the second request data port, and the second network data port of the remote proxy of the target device, where the second request data port is used to receive the digital networking application protocol data sent by the server of the target device when the target device acts as a requestor, and the second network data port is used to receive the request data packet sent by the local proxy.

[0065] In this embodiment, certain preparatory work is carried out before the transmission proxy, including configuring the local proxy of the terminal device and the remote proxy of the target device.

[0066] Specifically: Configure the service address, the first request data port, and the first network data port of the local proxy of the terminal device. The first request data port is the DOIP / DO-IRP port. When the transport layer protocol is UDP, the first network data port is the UDP port. The first request data port is used to receive the digital networking application protocol data sent by each client of the terminal device, and the first network data port is used to receive the encapsulated response data returned by the remote proxy. At the same time, configure the service address, the second request data port, and the second network data port of the remote proxy of the target device. The second request data port is the DOIP / DO-IRP port. When the transport layer protocol is UDP, the second network data port is the UDP port. The second network data port is used to receive the request data packet sent by the local proxy. When the server of the target device provides services to other devices, it is the server. At the same time, the server of the target device can also actively initiate requests to other devices. At this time, the server of the target device is embodied as a client, and the second request data port is used to receive the digital networking application protocol data (that is, the request data for initiating the request) sent by the server of the target device acting as a requestor (that is, when the server of the target device is embodied as the client initiating the request). The remote proxy waits for the response data on the connection for forwarding the digital networking application protocol data to the target server, which is the same as the way the client of the terminal device receives the response data returned by the local proxy.

[0067] Combined with the above embodiments, in one implementation, the embodiments of the present application further provide a reliable transmission proxy method for the KCP protocol based on the digital networking. In this reliable transmission proxy method for the KCP protocol based on the digital networking, according to the received digital networking application protocol data, the local proxy creates a corresponding first session, including: generating a session identifier of the first session according to the timestamp of the received digital networking application protocol data; based on the session identifier of the first session, the local proxy creates a corresponding first session.

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

[0069] Combined with the above embodiments, in one implementation, the embodiments of the present application further provide a reliable transmission proxy method for the KCP protocol based on the digital networking. In this reliable transmission proxy method for the KCP protocol based on the digital networking, generating a session identifier of the first session according to the timestamp of the received digital networking application protocol data includes: generating a session identifier of the session according to the timestamp of the received digital networking application protocol data; determining whether the session identifier exists in the local session pool; in the case of non-existence, determining the generated session identifier as the session identifier of the first session corresponding to the digital networking application protocol data, and creating the first session; in the case of existence, regenerating a new session identifier of the session until the generated new session identifier does not exist in the local session pool; determining the new session identifier that does not exist in the corresponding session pool as the session identifier of the first session corresponding to the digital networking application protocol data, and creating the first session.

[0070] In this embodiment, as Figure 3As shown, in order to further ensure the uniqueness of the generated session identifier, after receiving the digital networking application protocol data, the local proxy generates a session identifier for the session based on the timestamp of the digital networking application protocol data. Then, it is determined 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 digital networking application protocol data, and the first session is created. If the session identifier exists in the local session pool, it means that the session identifier has been generated based on other digital networking application protocol data before. In order to ensure that each digital networking application protocol data in the local session pool has a uniquely determined session identifier, a new session identifier will be randomly generated for the digital networking application protocol data at this time, and then it is determined whether the new session identifier exists in the local session pool. If the new session identifier still exists in the local session pool, a new session identifier will continue to be randomly generated for the digital networking application protocol data until the randomly generated new session identifier no longer exists in the local session pool. At this time, the last new session identifier is determined as the session identifier of the first session corresponding to the received digital networking application protocol data, and the first session is created.

[0071] In this embodiment, if Figure 4 As shown, Figure 4 A schematic diagram of a KCP protocol reliable transmission proxy method based on a digital networking provided in an embodiment of the present application. The present application provides a KCP protocol reliable transmission proxy method based on a digital networking, firstly, 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 networking 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, and the remote proxy transmits data with each server based on the digital networking application protocol, thereby realizing a transmission proxy for digital networking data under the digital object architecture.

[0072] Based on the same inventive concept, the present application provides a KCP protocol reliable transmission proxy system based on a data network, 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 a request, and the target device 502 includes a remote proxy 5021 and a server 5022 that responds to the request; The client 5012 is used to send the data networking application protocol data to the local proxy through the client of the terminal device; The local proxy 5011 is used to encapsulate the data networking application protocol data based on the application layer fast and reliable protocol to obtain a corresponding request data packet, and is also used to forward the request data packet to the remote proxy of the target device based on the transport layer protocol; The remote proxy 5021 is used to parse the request data packet to obtain the data networking application protocol data and the address data in the session message header, and is also used to establish 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; The target server is used to return response data to the remote proxy in response to the data networking application protocol data forwarded by the remote proxy; The remote proxy 5021 is also used to encapsulate the response data and send it back to the local proxy; The local proxy 5011 is also used to parse the encapsulated response data and forward it to the client; The client 5012 is used to close the connection between itself and the local proxy based on the received response data.

[0073] Optionally, the remote proxy 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 also used to send the response data packet back to the local proxy through the transport layer protocol according to the local address information and the local transport layer protocol port number in the address data.

[0074] Optionally, the system 500 further includes: The local proxy 5011 is used to create a corresponding first session according to the received data networking application protocol data and store it in the local session pool for session management; and is also used to encapsulate the data networking application protocol data and the session identifier of the first session based on the application layer fast and reliable protocol to obtain a corresponding request data packet; The remote proxy 5021 is used to parse the request data packet to obtain the data networking application protocol data, the address data in the session message header, and the session identifier of the first session; and is also used to create a corresponding second session according to the session identifier of the first session and store it in the remote session pool for session management; The client 5012 is used to close the connection between the client and the local proxy based on the received response data, and recycle the first session and the second session.

[0075] The remote agent 5021 is used to query whether the session identifier of the first session exists in the remote session pool according to the session identifier of the first session; and, in the case of non-existence, create a second session with the same session identifier as the first session and store it in the remote session pool; and, register the second session to the session management event for abnormal request processing; and, in the case of existence, end the creation of the second session corresponding to the request data packet.

[0076] The client 5012 is used to close the connection between itself and the local agent based on the received response data; The local agent 5011 is used to release the first session based on the closed state of the connection and remove the first session from the local session pool; and, send a connection close data packet to the remote agent; The remote agent 5021 is used to release the second session based on the received connection close data packet and remove the second session from the remote session pool.

[0077] Optionally, the local agent 5011 and the remote agent 5021 include: An event monitoring module is used to monitor the request process through session management events to obtain corresponding monitoring results; and, in the case where the monitoring result is request timeout or response timeout, release and remove the corresponding session.

[0078] Optionally, the system 500 further includes: A first configuration module is used to configure 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 data networking 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; A second configuration module is used to configure 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 data networking application protocol data sent by the server of the target device when it acts as a request end, and the second network data port is used to receive the request data packet sent by the local agent.

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

[0080] Optionally, the local agent 5011 is configured to generate a session identifier for a session according to the timestamp of the received data networking application protocol data; determine whether the session identifier exists in the local session pool; and, in the case of non-existence, determine the generated session identifier as the session identifier of the first session corresponding to the data networking application protocol data, and create the first session; and, in the case of existence, regenerate a new session identifier for the session until the generated new session identifier does not exist in the local session pool; and 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 data networking application protocol data, and create the first session.

[0081] For the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple. For the relevant parts, refer to the partial description of the method embodiment.

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

[0083] Each embodiment in this specification is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. The same or similar parts among the embodiments can be referred to each other.

[0084] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the embodiments of the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

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

[0086] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including an instruction means that implements the functions specified in the process Figure 1 one process or multiple processes and / or blocks Figure 1 a block or multiple blocks.

[0087] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device, such that a series of operation steps are executed on the computer or other programmable terminal device to generate a computer-implemented process, so that the instructions executed on the computer or other programmable terminal device provide steps for implementing the functions specified in the process Figure 1 one process or multiple processes and / or blocks Figure 1 a block or multiple blocks.

[0088] Although the preferred embodiments of the embodiments of the present application have been described, those skilled in the art can make additional changes and modifications to these embodiments once they learn the basic creative concept. Therefore, the appended claims are intended to be construed as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

[0089] Finally, it should also be noted that in this text, relational terms such as first and second are only used 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 term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or terminal device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or terminal device. Without more limitations, an element defined by the statement "comprising an..." does not exclude the existence of additional identical elements in the process, method, article or terminal device comprising the said element.

[0090] The above provides a detailed introduction to a method and system for managing digital networking nodes of the present application. Specific examples are used in this text to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation on the present application.

Claims

1. A reliable transmission proxy method for the KCP protocol based on the digital internet of things, characterized in that, The method includes: Sending the data networking application protocol data through the client of the terminal device to the local proxy; Encapsulating the data networking application protocol data by the local proxy based on the application layer fast and reliable protocol to obtain a corresponding request data packet; Forwarding the request data packet by the local proxy to the remote proxy of the target device based on the transport layer protocol; Parsing the request data packet by the remote proxy to obtain the data networking 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 according to the server address information and the server port number in the address data; In response to the data networking application protocol data forwarded by the remote proxy, the target server returns response data to the remote proxy; Encapsulating the response data by the remote proxy and sending it back to the local proxy; Parsing the encapsulated response data by the local proxy and forwarding it to the client; Based on the response data received by the client, closing the connection between the client and the local proxy.

2. A reliable transmission proxy method for the KCP protocol based on the digital networking as claimed in claim 1, characterized in that Encapsulating the response data by the remote proxy and sending it back to the local proxy includes: Encapsulating the response data by the remote proxy based on the application layer fast and reliable protocol to obtain a response data packet; Sending back the response data packet to the local proxy through the transport layer protocol according to the local address information and the local transport layer protocol port number in the address data.

3. A reliable transmission proxy method for the KCP protocol based on the digital networking as claimed in claim 1, wherein, Before encapsulating the data networking application protocol data by the local proxy based on the application layer fast and reliable protocol to obtain a corresponding request data packet, the method further includes: According to the received data networking application protocol data, the local proxy creates a corresponding first session and stores it in the local session pool for session management; Encapsulating the data networking application protocol data by the local proxy based on the application layer fast and reliable protocol to obtain a corresponding request data packet includes: Encapsulating the data networking application protocol data and the session identifier of the first session by the local proxy based on the application layer fast and reliable protocol to obtain a corresponding request data packet; Parsing the request data packet by the remote proxy to obtain the data networking application protocol data and the address data in the session message header includes: Parsing the request data packet by the remote proxy to obtain the data networking application protocol data, the address data in the session message header, and the session identifier of the first session; Creating a corresponding second session by the remote proxy according to the session identifier of the first session and storing it in the remote session pool for session management; Based on the response data received by the client, closing the connection between the client and the local proxy includes: Based on the response data received by the client, closing the connection between the client and the local proxy and recycling the first session and the second session.

4. The reliable transmission proxy method of the KCP protocol based on the digital networking according to claim 3, characterized in that Creating a corresponding second session by the remote proxy according to the session identifier of the first session and storing it in the remote session pool for session management includes: Query whether the session identifier of the first session exists in the remote session pool through the remote proxy according to the session identifier of the first session; In the case of non-existence, create a second session with the same session identifier as the first session and store it in the remote session pool; Register the second session to the session management event through the remote proxy for abnormal request handling; In the case of existence, end the creation of the second session corresponding to the request data packet.

5. The reliable transmission proxy method of the KCP protocol based on the digital networking according to claim 3, characterized in that, Based on the response data received by the client, close the connection between the client and the local proxy, and recycle the first session and the second session, including: Based on the response data received by the client, close the connection between itself and the local proxy through the client; Based on the closed state of the connection, release the first session through the local proxy and remove the first session from the local session pool; Send a connection close data packet to the remote proxy through the local proxy; Based on the received connection close data packet, release the second session through the remote proxy and remove the second session from the remote session pool.

6. A reliable transmission proxy method for the KCP protocol based on the digital networking according to claim 4, wherein The method further includes: Monitor the request process through the session management event to obtain the corresponding monitoring result; In the case where the monitoring result is a request timeout or a response timeout, release and remove the corresponding session.

7. A reliable transmission proxy method for the KCP protocol based on the digital networking according to claim 1, characterized in that Before sending the data networking application protocol data from the client of the terminal device to the local proxy, the method further includes: Configure the service address, the first request data port, and the first network data port of the local proxy of the terminal device. The first request data port is used to receive the data networking 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 proxy; Configure the service address, the second request data port, and the second network data port of the remote proxy of the target device. The second request data port is used to receive the data networking application protocol data sent by the server of the target device when it acts as a request end, and the second network data port is used to receive the request data packet sent by the local proxy.

8. A reliable transmission proxy method for the KCP protocol based on the digital internet according to claim 3, characterized in that, According to the received data networking application protocol data, the local proxy creates a corresponding first session, including: Generate the session identifier of the first session according to the timestamp of the received data networking application protocol data; Based on the session identifier of the first session, the local proxy creates a corresponding first session.

9. A reliable transmission proxy method for the KCP protocol based on the digital networking according to claim 8, characterized in that Generate the session identifier of the first session according to the timestamp of the received data networking application protocol data, including: Generate the session identifier of the session according to the timestamp of the received data networking application protocol data; Determine whether the session identifier exists in the local session pool; In the case of non-existence, determine the generated session identifier as the session identifier of the first session corresponding to the data networking application protocol data, and create the first session; In the case of existence, regenerate a new session identifier of 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 digital networking application protocol data, and the first session is created.

10. A reliable transmission proxy system for the KCP protocol based on the digital networking, characterized in that The system comprises: a terminal device initiating a request and a target device responding to the request, the terminal device comprises a local agent and a client initiating the request, the target device comprises a remote agent and a server responding to the request; The client is used to send the data network application protocol data to the local proxy through the client of the terminal device; The local proxy 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 proxy of the target device based on the transport layer protocol; The remote proxy 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 to establish 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; The target server is used to return response data to the remote proxy in response to the data networking application protocol data forwarded by the remote proxy; The remote proxy is also used to encapsulate the response data and transmit it back to the local proxy; The local proxy is further used to parse the encapsulated response data and forward it to the client; The client is used to close the connection between itself and the local proxy based on the received response data.

Citation Information

Patent Citations

  • Communication method and device

    CN111726384A

  • Data transmission method and device, equipment and storage medium

    CN115580667A

  • Quic protocol-based network agent method and network agent system

    CN116962509A

  • Data transmission method and device

    WO2012075885A1

Cited By

  • Gateway agent system and method based on Internet of Things, electronic equipment and storage medium

    CN120729944A

  • Session management method and system based on KCP protocol

    CN120856756A

  • A session management method and system based on KCP protocol

    CN120856756B